Hermes2D  2.0
Hermes::Hermes2D::Views::StreamView Class Reference

Visualizes streamlines of a vector PDE solution. More...

#include <stream_view.h>

+ Inheritance diagram for Hermes::Hermes2D::Views::StreamView:

Classes

struct  Node
 

Public Member Functions

 StreamView (const char *title="StreamView", WinGeom *wg=NULL)
 
 StreamView (char *title, WinGeom *wg=NULL)
 
void show (MeshFunction< double > *xsln, MeshFunction< double > *ysln, int marker, double step, double eps=HERMES_EPS_NORMAL)
 
void show (MeshFunction< double > *xsln, MeshFunction< double > *ysln, int marker, double step, double eps, int xitem, int yitem)
 
void add_streamline (double x, double y)
 
- Public Member Functions inherited from Hermes::Hermes2D::Views::View
void init ()
 
 View (const char *title, WinGeom *wg=NULL)
 
 View (char *title, WinGeom *wg=NULL)
 
int create ()
 
void close ()
 
void refresh ()
 Refreshes views.
 
void set_title (const char *title)
 Changes the window name (in its title-bar) to 'title'.
 
void set_min_max_range (double min, double max)
 
void auto_min_max_range ()
 
void get_min_max_range (double &min, double &max)
 
void show_scale (bool show=true)
 
void set_scale_position (int horz, int vert)
 
void set_scale_size (int width, int height, int numticks)
 
void set_scale_format (const char *fmt)
 
void fix_scale_width (int width=80)
 
void save_screenshot (const char *bmpname, bool high_quality=false)
 
void save_numbered_screenshot (const char *format, int number, bool high_quality=false)
 
void set_palette (ViewPaletteType type)
 
void set_num_palette_steps (int num)
 
void set_palette_filter (bool linear)
 
void wait_for_keypress (const char *text=NULL)
 Waits for keypress. Deprecated.
 
void wait_for_close ()
 
void wait_for_draw ()
 
void draw_help ()
 
virtual void reset_view (bool force_reset)
 Resets view based on the axis-aligned bounding box of the mesh. Assumes that the bounding box is set up. Does not reset if view_not_reset is false.
 

Protected Member Functions

int find_triangle_in_tree (double x, double y, Node *father, double x_min, double x_max, double y_min, double y_max, double3 &bar)
 
void add_element_to_tree (Node *father, int e_idx, double x_min, double x_max, double y_min, double y_max)
 
void build_tree ()
 Builds kD-tree.
 
void delete_tree (Node *father)
 
bool is_in_triangle (int idx, double x, double y, double3 &bar)
 
bool get_solution_values (double x, double y, double &xval, double &yval)
 Gets values of velocities at given point using built kD-tree.
 
int create_streamline (double x_start, double y_start, int idx)
 
void find_initial_points (int marker, double step, double2 *&initial_points)
 
int find_initial_edge (int num_edges, int3 *edges)
 
virtual void on_display ()
 
virtual void on_mouse_move (int x, int y)
 
virtual void on_key_down (unsigned char key, int x, int y)
 
virtual void on_left_mouse_down (int x, int y)
 
virtual const char * get_help_text () const
 
- Protected Member Functions inherited from Hermes::Hermes2D::Views::View
void draw_fps ()
 draws current FPS
 
virtual void on_create (int output_id)
 
virtual void on_reshape (int width, int height)
 
virtual void on_left_mouse_up (int x, int y)
 
virtual void on_left_mouse_double_click (int x, int y)
 
virtual void on_right_mouse_down (int x, int y)
 
virtual void on_right_mouse_up (int x, int y)
 
virtual void on_right_mouse_double_click (int x, int y)
 
virtual void on_middle_mouse_down (int x, int y)
 
virtual void on_middle_mouse_up (int x, int y)
 
virtual void on_middle_mouse_double_click (int x, int y)
 
virtual void on_special_key (int key, int x, int y)
 
virtual void on_entry (int state)
 
virtual void on_close ()
 
virtual void update_layout ()
 Updates layout, i.e., centers mesh.
 
void create_gl_palette ()
 Creates pallete texture in OpenGL. Assumes that view_sync is locked.
 
virtual void get_palette_color (double x, float *gl_color)
 Fills gl_color with palette color. Assumes that gl_color points to a vector of three components (RGB).
 
double transform_x (double x)
 
double transform_y (double y)
 
double untransform_x (double x)
 
double untransform_y (double y)
 
virtual void clear_background ()
 Clears background.
 
void pre_display ()
 
void display_antialiased ()
 
void set_ortho_projection (bool no_jitter=false)
 
void set_3d_projection (int fov, double znear, double zfar)
 
void draw_text (double x, double y, const char *text, int align=-1)
 
int get_text_width (const char *text)
 
char * get_screenshot_file_name ()
 
void save_screenshot_internal (const char *filename)
 
virtual void scale_dispatch ()
 
virtual int measure_scale_labels ()
 
void draw_continuous_scale (char *title, bool righttext)
 
void draw_discrete_scale (int numboxes, const char *boxnames[], const float boxcolors[][3])
 
void update_tex_adjust ()
 

Protected Attributes

Vectorizervec
 
double max_mag
 
bool lines
 
bool pmode
 
double initial_tau
 
double min_tau
 
double max_tau
 
int num_stream
 
double2 ** streamlines
 
int * streamlength
 
Noderoot
 
double root_x_min
 
double root_x_max
 
double root_y_min
 
double root_y_max
 
- Protected Attributes inherited from Hermes::Hermes2D::Views::View
double rendering_frames [FPS_FRAME_SIZE]
 time spend in rendering of frames[in ms]
 
int rendering_frames_top
 the new location of the next FPS
 
bool view_not_reset
 True if the view was not reset and therefore it has to be.
 
double vertices_min_x
 
double vertices_max_x
 
double vertices_min_y
 
double vertices_max_y
 AABB of shown mesh.
 
double scale
 
double log_scale
 
double trans_x
 
double trans_y
 
double center_x
 
double center_y
 
int margin
 
int lspace
 
int rspace
 
int mouse_x
 
int mouse_y
 
int scx
 
int scy
 
double objx
 
double objy
 
bool dragging
 
bool scaling
 
std::string title
 
int output_id
 
int output_x
 
int output_y
 
int output_width
 
int output_height
 
float jitter_x
 
float jitter_y
 
bool hq_frame
 
bool frame_ready
 
ViewPaletteType pal_type
 
int pal_steps
 
int pal_filter
 
double tex_scale
 
double tex_shift
 
bool range_auto
 
double range_min
 
double range_max
 
bool b_scale
 
bool b_help
 
bool scale_focused
 
bool scale_dragging
 
int pos_horz
 
int pos_vert
 
int scale_x
 
int scale_y
 
int scale_width
 
int scale_height
 
int labels_width
 
int scale_numticks
 
int scale_box_height
 
int scale_box_skip
 
char scale_fmt [20]
 
int scale_fixed_width
 
bool want_screenshot
 
std::string screenshot_filename
 
unsigned int gl_pallete_tex_id
 OpenGL texture object ID.
 

Additional Inherited Members

- Static Public Member Functions inherited from Hermes::Hermes2D::Views::View
static void wait (const char *text)
 Closes all views at once.
 
static void wait (ViewWaitEvent wait_event=HERMES_WAIT_CLOSE, const char *text=NULL)
 Waits for an event.
 
- Static Protected Member Functions inherited from Hermes::Hermes2D::Views::View
static double get_tick_count ()
 returns a current time[in ms]
 
- Static Protected Attributes inherited from Hermes::Hermes2D::Views::View
static int screenshot_no = 1
 

Detailed Description

Visualizes streamlines of a vector PDE solution.

StreamView is a visualization window for all vector-valued PDE solutions (especially for flow problems).

Definition at line 39 of file stream_view.h.

Member Function Documentation

void Hermes::Hermes2D::Views::StreamView::add_element_to_tree ( Node father,
int  e_idx,
double  x_min,
double  x_max,
double  y_min,
double  y_max 
)
protected

Adds triangle to the kD-tree. If father Node has more than 100 elements it splits computation domain into 2 parts (vertically or horizontally).

Definition at line 81 of file stream_view.cpp.

void Hermes::Hermes2D::Views::StreamView::add_streamline ( double  x,
double  y 
)

Creates additional streamline with strarting point (x, y) Note: Can be called only after StreamView::show

Definition at line 430 of file stream_view.cpp.

int Hermes::Hermes2D::Views::StreamView::create_streamline ( double  x_start,
double  y_start,
int  idx 
)
protected

Starts from initial point (x_start, y_start) and using adaptive RK method finds streamline with "idx".

Definition at line 188 of file stream_view.cpp.

int Hermes::Hermes2D::Views::StreamView::find_initial_edge ( int  num_edges,
int3 *  edges 
)
protected

Finds initial boundary edge (one whose first vertex is not second vertex for any other edge).

Definition at line 292 of file stream_view.cpp.

void Hermes::Hermes2D::Views::StreamView::find_initial_points ( int  marker,
double  step,
double2 *&  initial_points 
)
protected

Finds initial points for all steamlines along boundary with given marker with "step" distance between each other.

Definition at line 320 of file stream_view.cpp.

int Hermes::Hermes2D::Views::StreamView::find_triangle_in_tree ( double  x,
double  y,
Node father,
double  x_min,
double  x_max,
double  y_min,
double  y_max,
double3 &  bar 
)
protected

Recurent function that finds linearized triangle which contain point (x, y). As side effect it returns bacycentric coordinates of point (x, y) in that triangle.

Definition at line 135 of file stream_view.cpp.

bool Hermes::Hermes2D::Views::StreamView::is_in_triangle ( int  idx,
double  x,
double  y,
double3 &  bar 
)
protected

Tests whether given point (x, y) lies in given triangle using barycentric coordinates (returned as side efect).

Definition at line 62 of file stream_view.cpp.

void Hermes::Hermes2D::Views::StreamView::show ( MeshFunction< double > *  xsln,
MeshFunction< double > *  ysln,
int  marker,
double  step,
double  eps = HERMES_EPS_NORMAL 
)

Using velocity components (xsln, ysln) it creates streamlines that begin at the boundary with "marker" and the distance between starting points is "step"

Definition at line 53 of file stream_view.cpp.


The documentation for this class was generated from the following files: