Basilisk CFD
Adaptive Cartesian mesh PDE framework
Loading...
Searching...
No Matches
input.h File Reference
#include "utils.h"
Include dependency graph for input.h:
This graph shows which files directly or indirectly include this file:

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)
 

Macro Definition Documentation

◆ valgrd

#define valgrd (   v,
  i,
  j 
)    ((v)[(j) + 1 + ((i) + 1)*(nx + 2)])

Definition at line 322 of file input.h.

Function Documentation

◆ bc_grd()

static void bc_grd ( double v,
int  nx,
int  ny,
bool  periodic[2] 
)
static

Definition at line 324 of file input.h.

References i, j, periodic, v, valgrd, and x.

◆ input_gfs()

trace void input_gfs ( FILE fp = stdin,
scalar list = NULL,
char file = NULL 
)

<em>input_gfs()</em>: Gerris simulation format

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ input_grd()

void input_grd ( scalar  s,
FILE fp = stdin,
const char file = NULL,
double  nodatavalue = 0.12345678,
bool  linear = false,
bool  periodic[2] = {Period.xPeriod.y},
int  smooth = 0 
)

<em>input_grd()</em>: Raster format (Esri grid)

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.

◆ input_pgm()

void input_pgm ( scalar  s,
FILE fp,
double  ox = 0.,
double  oy = 0.,
double  width = L0 
)

<em>input_pgm()</em>: Importing Portable Gray Map (PGM) images

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.

Here is the call graph for this function:

◆ next_char()

static void next_char ( FILE fp,
int  target 
)
static

Definition at line 99 of file input.h.

References c, fp, target, and x.

Referenced by input_gfs().

Here is the caller graph for this function:

◆ next_string()

static int next_string ( FILE fp,
const char target 
)
static

Definition at line 113 of file input.h.

References c, fp, i, s, target, and x.

Referenced by input_gfs().

Here is the caller graph for this function: