|
Basilisk CFD
Adaptive Cartesian mesh PDE framework
|
#include "utils.h"Go to the source code of this file.
Macros | |
| #define | valgrd(v, i, j) ((v)[(j) + 1 + ((i) + 1)*(nx + 2)]) |
Functions | |
| void | input_pgm (scalar s, FILE *fp, double ox=0., double oy=0., double width=L0) |
| static void | next_char (FILE *fp, int target) |
| static int | next_string (FILE *fp, const char *target) |
| trace void | input_gfs (FILE *fp=stdin, scalar *list=NULL, char *file=NULL) |
| static void | bc_grd (double *v, int nx, int ny, bool periodic[2]) |
| void | input_grd (scalar s, FILE *fp=stdin, const char *file=NULL, double nodatavalue=0.12345678, bool linear=false, bool periodic[2]={Period.x, Period.y}, int smooth=0) |
The function reads simulation data in the format used in Gerris simulation files. This is the reciprocal function of output_gfs().
The arguments and their default values are:
fp* : a file pointer. Default is file or stdin.
list* : a list of scalar fields to read. Default is all.
file* : the name of the file to read from (mutually exclusive with fp).
Definition at line 159 of file input.h.
References _i, a, all, c, cell(), cm, events, file, flags, fm, fp, free(), scalar::i, init_grid, input(), list, list_append(), next_char(), next_string(), point, qmalloc, realloc(), refine_cell(), s, set_dirty_stencil(), strdup(), t, tnext, and x.
Referenced by process_line().
| void input_grd | ( | scalar | s, |
| FILE * | fp = stdin, |
||
| const char * | file = NULL, |
||
| double | nodatavalue = 0.12345678, |
||
| bool | linear = false, |
||
| bool | periodic[2] = {Period.x, Period.y}, |
||
| int | smooth = 0 |
||
| ) |
This function reads a scalar field from a Raster file. This is the reciprocal function of output_grd().
The arguments and their default values are:
s* : the scalar where the data will be stored. No default value. You must specify this parameter
fp* : a file pointer. Default is file or stdin.
file* : the name of the file to read from (mutually exclusive with fp).
nodatavalue* : the value of the NoDataValue. Default is the same as that defined in the raster file.
linear* : if true, the raster data is bilinearly interpolated. Default is false.
periodic* : if true, the x-axis and/or y-axis are treated as periodic. Default is the same as the domain periodicity.
smooth* : the number of Laplacian smoothing passes applied to the data before interpolation. Default is zero.
Definition at line 383 of file input.h.
References Period.
This function reads in the PGM file in file fp and imports the corresponding values into field s. The grayscale is normalised and inverted so that the maximum value in field s is one (black) and the minimum value is zero (white).
By default the origin of the image (lower-left corner) is assumed to be at (0,0) and the width of the image is set to L0. This can be changed using the optional ox, oy and width parameters.
Definition at line 18 of file input.h.
References _i, a, fp, free(), i, j, line, n, qmalloc, s, v, x, and y.