|
Basilisk CFD
Adaptive Cartesian mesh PDE framework
|
Go to the source code of this file.
Data Structures | |
| struct | Color |
| Given a colormap and a minimum and maximum value, this function returns the red/green/blue triplet corresponding to val. More... | |
Macros | |
| #define | NCMAP 127 |
Typedefs | |
| typedef void(* | Colormap) (double cmap[127][3]) |
Variables | ||
| struct { | ||
| FILE ** fp | ||
| char ** names | ||
| int n | ||
| } | open_image_data = {NULL, NULL, 0} | |
| #define NCMAP 127 |
The open_image()/close_image() functions use pipes to convert PPM images to other formats, including .mp4, .ogv and .gif animations.
The functions check whether the 'ffmpeg' or 'convert' executables are accessible, if they are not the conversion is disabled and the raw PPM images are saved. An extra ".ppm" extension is added to the file name to indicate that this happened.
Definition at line 348 of file output.h.
Referenced by is_animation().
Definition at line 353 of file output.h.
References extension(), file, and x.
Referenced by close_image(), open_image(), and save().
Definition at line 428 of file output.h.
References assert, file, fp, free_solver_func_add(), is_animation(), LINENO, open_image_cleanup(), open_image_data, open_image_lookup(), popen, ppm_fallback(), strdup(), which(), and x.
Referenced by save().
Definition at line 368 of file output.h.
References free(), i, open_image_data, pclose, and x.
Referenced by open_image().
Definition at line 381 of file output.h.
References file, i, open_image_data, and x.
Referenced by close_image(), and open_image().
| trace void output_field | ( | scalar * | list = all, |
| FILE * | fp = stdout, |
||
| int | n = N, |
||
| bool | linear = false, |
||
| coord | box[2] = {{X0, Y0}, {X0 + L0, Y0 + L0*Dimensions.y/Dimensions.x}} |
||
| ) |
This function interpolates a list of fields on a n+1 x n+1 regular grid. The resulting data are written in text format in the file pointed to by fp. The correspondance between column numbers and variables is summarised in the first line of the file. The data are written row-by-row and each row is separated from the next by a blank line. This format is compatible with the splot command of gnuplot i.e. one could use something like
The arguments and their default values are:
list* : list of fields to output. Default is all.
fp* : file pointer. Default is stdout.
n* : number of points along each dimension. Default is N.
linear* : use first-order (default) or bilinear interpolation.
box* : the lower-left and upper-right coordinates of the domain to consider. Default is the entire domain.
| trace void output_grd | ( | scalar | f, |
| FILE * | fp = stdout, |
||
| double | Delta = L0/N, |
||
| bool | linear = false, |
||
| coord | box[2] = {{X0, Y0}, {X0 + L0, Y0 + L0*Dimensions.y/Dimensions.x}}, |
||
| scalar | mask = {-1} |
||
| ) |
The ESRI GRD format is a standard format for importing raster data into GIS systems.
The arguments and their default values are:
f* : a scalar field (compulsory).
fp* : a file pointer. Default is stdout.
\(\Delta\) : size of a grid element. Default is L0/N.
linear* : whether to use bilinear or first-order interpolation. Default is first-order.
box* : the lower-left and upper-right coordinates of the domain to consider. Default is the entire domain.
mask* : if set, this field will be used to mask out, the regions of the domain for which mask is negative.
| trace void output_matrix | ( | scalar | f, |
| FILE * | fp = stdout, |
||
| int | n = N, |
||
| bool | linear = false, |
||
| const char * | file = NULL, |
||
| coord | box[2] = {{X0, Y0}, {X0 + L0, Y0 + L0*Dimensions.y/Dimensions.x}} |
||
| ) |
This function writes a binary representation of a single field interpolated on a regular n x n grid. The format is compatible with the binary matrix format of gnuplot i.e. one could use
The arguments and their default values are:
f* : a scalar field (compulsory).
fp* : file pointer. Default is stdout.
n* : number of points along each dimension. Default is N.
linear* : use first-order (default) or bilinear interpolation.
box* : the lower-left and upper-right coordinates of the domain to consider. Default is the entire domain.
| trace void output_ppm | ( | scalar | f, |
| FILE * | fp = stdout, |
||
| int | n = N, |
||
| char * | file = NULL, |
||
| double | min = 0, |
||
| double | max = 0, |
||
| double | spread = 5, |
||
| double | z = 0, |
||
| bool | linear = false, |
||
| coord | box[2] = {{X0, Y0}, {X0 + L0, Y0 + L0*Dimensions.y/Dimensions.x}}, |
||
| scalar | mask = {-1}, |
||
| Colormap | map = jet, |
||
| char * | opt = NULL, |
||
| int | fps = 0, |
||
| FILE * | checksum = NULL |
||
| ) |
Given a field, this function outputs a colormaped representation as a Portable PixMap image.
If ImageMagick is installed on the system, this image can optionally be converted to any image format supported by ImageMagick.
The arguments and their default values are:
f* : a scalar field (compulsory).
fp* : a file pointer. Default is stdout.
n* : number of pixels. Default is N.
file* : sets the name of the file used as output for ImageMagick. This allows outputs in all formats supported by ImageMagick. For example, one could use
to get a PNG image.
min, max* : minimum and maximum values used to define the colorscale. By default these are set automatically using the spread parameter.
spread* : if not specified explicitly, min and max are set to the average of the field minus (resp. plus) spread times the standard deviation. By default spread is five. If negative, the minimum and maximum values of the field are used.
z* : the z-coordinate (in 3D) of the plane being represented.
linear* : whether to use bilinear or first-order interpolation. Default is first-order.
box* : the lower-left and upper-right coordinates of the domain to consider. Default is the entire domain.
mask* : if set, this field will be used to mask out (in black), the regions of the domain for which mask is negative.
map* : the colormap: jet, cool_warm or gray. Default is jet.
opt* : options to pass to 'convert' or to the 'ppm2???' scripts (used with file).
fps* : used only for online output on GPUs.
checksum* : write a checksum of the generated image in the file pointed.
Definition at line 389 of file output.h.
Referenced by close_image(), open_image(), and save().
| struct { ... } open_image_data |
Referenced by open_image(), open_image_cleanup(), and open_image_lookup().