|
Basilisk CFD
Adaptive Cartesian mesh PDE framework
|
Go to the source code of this file.
Macros | |
| #define | colorize_args() |
| #define | color_facet() |
| #define | color_vertex(val) |
| #define | colorize() |
| #define | COLORBAR_PARAMS |
| Parameters for an (optional) colorbar. | |
| #define | interpo(pv, v) (!pv ? v : ((t - start)*(pv) + (end - t)*(v))/(end - start)) |
Variables | ||
| struct { | ||
| int(* json )(char *s, int len) | ||
| } | bview_interface [] | |
| #define color_facet | ( | ) |
| #define colorize | ( | ) |
Definition at line 465 of file draw.h.
References assemble_node(), HUGE, scalar::i, i, lookup_field(), n, nodata, p, pi, s, val(), and x.
Referenced by assemble_node(), and compile_expression().
notics: do not draw tick marks (default is false). lc[]: an array of red, green, blue values between 0 and 1 which defines the line color. lw: the line width.
Definition at line 1397 of file draw.h.
Referenced by if(), and init_grid().
In 3D the intersections of the cells with a plane are displayed. The default plane is \(z=0\). This can be changed by setting n and alpha which define the plane
\[ n_x x + n_y y + n_z z = \alpha \]
Definition at line 1128 of file draw.h.
Referenced by debug_plot(), and if().
| void clear | ( | ) |
Definition at line 14 of file draw.h.
References draw(), get_view(), and view().
Referenced by process_line(), and redraw().
| trace bool colorbar | ( | Colormap | map = jet, |
| float | size = 15, |
||
| float | pos[2] = {-.95, -.95}, |
||
| char * | label = "", |
||
| double | lscale = 1, |
||
| double | min = -HUGE, |
||
| double | max = HUGE, |
||
| bool | horizontal = false, |
||
| bool | border = false, |
||
| bool | mid = false, |
||
| float | lc[3] = {0}, |
||
| float | lw = 3, |
||
| float | fsize = 50, |
||
| char * | format = "%g", |
||
| int | levels = 50 |
||
| ) |
map: the colormap. size: the size. pos: the relative screen position (default is lower-left corner). label: a label. lscale: the label scale factor. min, max: the range. horizontal: true for anb horizontal colorbar. border: adds a border. mid: adds a mid-value label. lc: the line color. lw: the line width. fsize: another size. format: how to format numbers. levels: the number of subdivisions.
Note that this cannot be used with jview (yet) because it mixes surface and line rendering.
Definition at line 615 of file draw.h.
References colormap_color(), GL_CLAMP_TO_EDGE, GL_FLOAT, GL_LINEAR, GL_RGB, GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_TEXTURE_MIN_FILTER, GL_TEXTURE_WRAP_S, GL_TEXTURE_WRAP_T, glColor3f, glDisable, glEnable, glTexImage1D, glTexParameteri, i, j, and x.
Definition at line 512 of file draw.h.
References _i, add_cexpr(), assemble_node(), evaluate_expression(), free(), get_cexpr(), get_view(), point, restriction, s, strdup(), view(), and x.
A similar technique can be used to traverse the cells which are both visible and intersected by a plane defined by.
\[ n_x x + n_y y + n_z z = \alpha \]
Definition at line 388 of file draw.h.
References color, GL_PROJECTION, glColor3f, glLineWidth, glMatrixMode, glPopMatrix, glPushMatrix, glTranslatef, view(), and x.
| trace bool draw_string | ( | char * | str, |
| int | pos = 0, |
||
| float | size = 40, |
||
| float | lc[3] = {0}, |
||
| float | lw = 1 |
||
| ) |
str: string to display. pos: position: "0" bottom left, "1" top left, "2" top right and "3" bottom right (default 0). size: the size of the text, given as the number of characters which can fit within the width of the screen. Default is 40. lc[]: an array of red, green, blue values between 0 and 1 which defines the text color. lw: the line width.
Definition at line 1659 of file draw.h.
Referenced by if().
| trace bool draw_vof | ( | char * | c, |
| char * | s = NULL, |
||
| bool | edges = false, |
||
| double | larger = 0., |
||
| int | filled = 0, |
||
| char * | color = NULL, |
||
| double | min = 0, |
||
| double | max = 0, |
||
| double | spread = 0, |
||
| bool | linear = false, |
||
| Colormap | map = jet, |
||
| float | fc[3] = {0}, |
||
| float | lc[3] = {0}, |
||
| float | lw = 1., |
||
| bool | expr = false, |
||
| bool | cbar = false, |
||
| float | size = 15, |
||
| float | pos[2] = {-.95, -.95}, |
||
| char * | label = "", |
||
| double | lscale = 1, |
||
| bool | horizontal = false, |
||
| bool | border = false, |
||
| bool | mid = false, |
||
| float | fsize = 50, |
||
| char * | format = "%g", |
||
| int | levels = 50 |
||
| ) |
c: the name (as a string) of the Volume-Of-Fluid field. s: the (optional) name of the face fraction field. edges: whether to display the edges or the facets. larger: makes each cell larger by this factor. This helps close the gaps in the VOF interface representation. Default is 1.1 in 3D and when edges are not displayed, otherwise it is 1. filled: in 2D, whether to fill the inside (1) or outside (-1). color: use this field to color each interface fragment. min, max: the minimum and maximum values to use for color mapping. spread: the "spread factor" to use if min and max are not defined. The maximum and minimum values will be taken as the average plus or minus spread times the standard deviation. Default is 5. If negative, the minimum and maximum values of the field are used. linear: if true the color will be linearly interpolated for each vertex of the facet. map: the colormap to use. Default is jet. fc[]: an array of red, green, blue values between 0 and 1 which defines the facet color. lc[]: an array of red, green, blue values between 0 and 1 which defines the line color. lw: the line width.
Definition at line 897 of file draw.h.
Referenced by if().
Definition at line 410 of file draw.h.
References assert, evaluate_expression(), i, k, n, point, pow(), s, undefined(), x, y, and z.
Referenced by compile_expression(), and evaluate_expression().
Definition at line 308 of file draw.h.
References _i, cell(), L0, Point::level, mapped_position(), point, POINT_VARIABLES(), VertexBuffer, view(), x, y, and z.
Definition at line 333 of file draw.h.
References flags, foreach_stencil(), and reductions.
Definition at line 838 of file draw.h.
References glVertex3d, p, view(), x, y, and z.
Referenced by glvertex_normal3d().
Definition at line 405 of file draw.h.
References interpolate_linear(), p, point, x, y, and z.
Referenced by glvertex_normal3d().
| trace bool isoline | ( | char * | phi, |
| double | val = 0., |
||
| int | n = 1, |
||
| bool | edges = false, |
||
| double | larger = 0., |
||
| int | filled = 0, |
||
| char * | color = NULL, |
||
| double | min = 0, |
||
| double | max = 0, |
||
| double | spread = 0, |
||
| bool | linear = false, |
||
| Colormap | map = jet, |
||
| float | fc[3] = {0}, |
||
| float | lc[3] = {0}, |
||
| float | lw = 1., |
||
| bool | expr = false, |
||
| bool | cbar = false, |
||
| float | size = 15, |
||
| float | pos[2] = {-.95, -.95}, |
||
| char * | label = "", |
||
| double | lscale = 1, |
||
| bool | horizontal = false, |
||
| bool | border = false, |
||
| bool | mid = false, |
||
| float | fsize = 50, |
||
| char * | format = "%g", |
||
| int | levels = 50 |
||
| ) |
Draws a single isoline at val of field phi, or n isolines between min and max (included).
Extra parameters are the same as for draw_vof().
Definition at line 1071 of file draw.h.
Referenced by if().
| trace bool isosurface | ( | char * | f, |
| double | v, | ||
| char * | color = NULL, |
||
| double | min = 0, |
||
| double | max = 0, |
||
| double | spread = 0, |
||
| bool | linear = false, |
||
| Colormap | map = jet, |
||
| float | fc[3] = {0}, |
||
| float | lc[3] = {0}, |
||
| float | lw = 1, |
||
| bool | expr = false, |
||
| bool | cbar = false, |
||
| float | size = 15, |
||
| float | pos[2] = {-.95, -.95}, |
||
| char * | label = "", |
||
| double | lscale = 1, |
||
| bool | horizontal = false, |
||
| bool | border = false, |
||
| bool | mid = false, |
||
| float | fsize = 50, |
||
| char * | format = "%g", |
||
| int | levels = 50 |
||
| ) |
f: the name (as a string) of the field. v: the value of the isosurface. edges: whether to draw the edges of isosurface facets. color: use this field to color each interface fragment.
The min, max, spread, map etc. arguments work as described in draw_vof().
Definition at line 1535 of file draw.h.
Referenced by if().
file: the gnuplot-formatted file containing the polyline(s). lc[]: an array of red, green, blue values between 0 and 1 which defines the line color. lw: the line width.
The tree structure is used to traverse only the cells which are within the field of view of the camera.
Definition at line 292 of file draw.h.
References i, j, k, p, q, sq(), view(), vector::x, x, vector::y, y, and z.
Referenced by foreach_visible().
| trace bool squares | ( | char * | color, |
| char * | z = NULL, |
||
| double | min = 0, |
||
| double | max = 0, |
||
| double | spread = 0, |
||
| bool | linear = false, |
||
| Colormap | map = jet, |
||
| float | fc[3] = {0}, |
||
| float | lc[3] = {0}, |
||
| bool | expr = false, |
||
| coord | n = {0,0,1}, |
||
| double | alpha = 0, |
||
| float | lw = 1, |
||
| bool | cbar = false, |
||
| float | size = 15, |
||
| float | pos[2] = {-.95, -.95}, |
||
| char * | label = "", |
||
| double | lscale = 1, |
||
| bool | horizontal = false, |
||
| bool | border = false, |
||
| bool | mid = false, |
||
| float | fsize = 50, |
||
| char * | format = "%g", |
||
| int | levels = 50 |
||
| ) |
The field name is given by color. The min, max, spread, map etc. arguments work as described in draw_vof().
In 2D, if z is specified, and linear is the true, the corresponding expression is used as z-coordinate.
In 3D the intersections of the field with a plane are displayed. The default plane is \(z=0\). This can be changed by setting n and alpha which define the plane
\[ n_x x + n_y y + n_z z = \alpha \]
Definition at line 1231 of file draw.h.
Referenced by if().
The block following this command will be drawn in a translated coordinate system.
Definition at line 216 of file draw.h.
References _view, draw(), _bview::frustum, GL_MODELVIEW, glMatrixMode, glPopMatrix, glPushMatrix, glTranslatef, x, y, and z.
| void view | ( | float | tx = 0., |
| float | ty = 0., |
||
| float | fov = 0., |
||
| float | quat[4] = {0}, |
||
| float | sx = 1., |
||
| float | sy = 1., |
||
| float | sz = 1., |
||
| unsigned | width = 800, |
||
| unsigned | height = 800, |
||
| unsigned | samples = 4, |
||
| float | bg[3] = {0}, |
||
| float | theta = 0., |
||
| float | phi = 0., |
||
| float | psi = 0., |
||
| bool | relative = false, |
||
| float | tz = 0., |
||
| float | near = 0., |
||
| float | far = 0., |
||
| float | res = 0., |
||
| char * | camera = NULL, |
||
| MapFunc | map = NULL, |
||
| int | cache = 0, |
||
| float | p1x = 0., |
||
| float | p1y = 0., |
||
| float | p2x = 0., |
||
| float | p2y = 0., |
||
| bview * | view1 = NULL |
||
| ) |
tx, ty: shifts the camera center point. fov: changes the field-of-view. quat[]: the quaternion defining the camera angles. sx, sy, sz: stretch factors for each axis. width, height, samples: the width and height (in pixels) of the image to render (default is 800 x 800). The image can optionally be generated by first rendering an image with samples times more pixels in each direction followed by subsampling. This provides a form of antialiasing. Default is four samples. bg[]: an array of red, green, blue values between 0 and 1 which defines the background color. theta, phi, psi: Euler-like angles (in radians), used (instead of quat[]) to define the camera angle. relative: whether the theta and phi angles are absolute or relative to the current position (i.e. increments of the current angles). tz, near, far: an alternative way of specifying the camera, compatible with the camera parameters in interactive Basilisk View. camera: predefined camera angles: "left", "right", "top", "bottom", "front", "back" and "iso". map: an optional coordinate mapping function. cache: the maximum number of cached compiled expressions.
Definition at line 52 of file draw.h.
Referenced by bview_draw(), clear(), compile_expression(), compose_image(), draw(), draw_lines(), foreach_visible(), glvertex2d(), glvertex3d(), glvertex_normal3d(), if(), mapped_position(), process_line(), redraw(), save(), and vertex_buffer_glBegin().
| struct { ... } bview_interface[] |
This is used by bview to automatically generate the user interface.
Referenced by bview_interface_json().