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

Go to the source code of this file.

Macros

#define boundary(...)    boundary_internal ((scalar *)__VA_ARGS__, __FILE__, LINENO)
 

Typedefs

typedef int bid
 

Functions

define _val_constant (a, k, l, m)((const double) _constant[a.i -_NVARMAX]) @define val_diagonal(a
 
define m ((k)==0 &&(l)==0 &&(m)==0) macro2 foreach_point(double _x=0.
 
void init_const_scalar (scalar s, const char *name, double val)
 
scalar new_const_scalar (const char *name, int i, double val)
 
void init_const_vector (vector v, const char *name, double *val)
 
vector new_const_vector (const char *name, int i, double *val)
 
static void cartesian_scalar_clone (scalar clone, scalar src)
 
scalarlist_clone (scalar *l)
 
void delete (scalar *list)
 
void free_solver ()
 
void boundary_flux (vector *list) __attribute__((deprecated))
 
static scalarlist_add_depends (scalar *list, scalar s)
 
trace void boundary_internal (scalar *list, const char *fname, int line)
 There are two types of boundary conditions: "full" boundary conditions, done by boundary_internal() and "flux" boundary conditions (i.e.
 
void cartesian_boundary_level (scalar *list, int l)
 
void cartesian_boundary_face (vectorl vl)
 
static double symmetry (Point point, Point neighbor, scalar s, bool *data)
 
static double antisymmetry (Point point, Point neighbor, scalar s, bool *data)
 
scalar cartesian_init_scalar (scalar s, const char *name)
 
scalar cartesian_init_vertex_scalar (scalar s, const char *name)
 
vector cartesian_init_vector (vector v, const char *name)
 
vector cartesian_init_face_vector (vector v, const char *name)
 
tensor cartesian_init_tensor (tensor t, const char *name)
 
void output_cells (FILE *fp=stdout, coord c={0}, double size=0.)
 
static charreplace_ (const char *vname)
 
static void debug_plot (FILE *fp, const char *name, const char *cells, const char *stencil)
 
void cartesian_debug (Point point)
 
void cartesian_methods ()
 
tensor init_symmetric_tensor (tensor t, const char *name)
 
static double interpolate_linear (Point point, scalar v, double xp=0., double yp=0., double zp=0.)
 
trace double interpolate (scalar v, double xp=0., double yp=0., double zp=0., bool linear=true)
 
trace void interpolate_array (scalar *list, coord *a, int n, double *v, bool linear=false)
 
bid new_bid ()
 
static double periodic_bc (Point point, Point neighbor, scalar s, bool *data)
 
static void periodic_boundary (int d)
 
void periodic (int dir)
 
double getvalue (Point point, scalar s, int i, int j, int k)
 
void default_stencil (Point p, scalar *list)
 
static void write_stencil_index (int *index)
 This displays a (1D,2D,3D) stencil index.
 
void stencil_val (Point p, scalar s, int i, int j, int k, const char *file, int line, bool overflow)
 
void stencil_val_a (Point p, scalar s, int i, int j, int k, bool input, const char *file, int line)
 

Variables

void(* debug )(Point)
 
define k
 
define l
 
define double _y = 0.
 
define double double _z = 0.
 
define double double char flags = 0
 
define double double char Reduce reductions
 
void(* boundary_level )(scalar *, int l)
 
void(* boundary_face )(vectorl)
 
BoundaryFunc default_scalar_bc []
 
BoundaryFunc default_vector_bc []
 

Macro Definition Documentation

◆ boundary

#define boundary (   ...)     boundary_internal ((scalar *)__VA_ARGS__, __FILE__, LINENO)

Definition at line 512 of file cartesian-common.h.

Typedef Documentation

◆ bid

Definition at line 1009 of file cartesian-common.h.

Function Documentation

◆ _val_constant()

define _val_constant ( a  ,
k  ,
l  ,
m   
) const

◆ antisymmetry()

static double antisymmetry ( Point  point,
Point  neighbor,
scalar  s,
bool data 
)
static

Definition at line 618 of file cartesian-common.h.

References s.

Referenced by cartesian_init_tensor(), cartesian_init_vector(), new_bid(), and viscosity().

Here is the caller graph for this function:

◆ boundary_flux()

void boundary_flux ( vector list)

Definition at line 517 of file cartesian-common.h.

References boundary_face, dimension, free(), list_append(), v, vectorl::x, and x.

Here is the call graph for this function:

◆ boundary_internal()

trace void boundary_internal ( scalar list,
const char fname,
int  line 
)

There are two types of boundary conditions: "full" boundary conditions, done by boundary_internal() and "flux" boundary conditions (i.e.

normal components on faces only) done by boundary_face().

Definition at line 541 of file cartesian-common.h.

References boundary_face, boundary_level, cm, dimension, flux, free(), scalar::i, i, list, list_add(), list_add_depends(), s, s_centered, s_face, scalar_is_dirty(), vectorl::x, and x.

Referenced by boundary_stencil().

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

◆ cartesian_boundary_face()

void cartesian_boundary_face ( vectorl  vl)

Definition at line 600 of file cartesian-common.h.

References boundary_level, dimension, free(), list_add_depends(), s, s_face, and x.

Referenced by cartesian_methods().

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

◆ cartesian_boundary_level()

void cartesian_boundary_level ( scalar list,
int  l 
)

Definition at line 595 of file cartesian-common.h.

References boundary_iterate, l, level, and list.

Referenced by cartesian_methods(), and gpu_boundary_level().

Here is the caller graph for this function:

◆ cartesian_debug()

void cartesian_debug ( Point  point)

Definition at line 831 of file cartesian-common.h.

References _attribute, allocated(), debug_plot(), dimension, fflush(), fp, free(), scalar::i, k, l, m(), output_cells(), replace_(), s, v, x, y, and z.

Referenced by cartesian_methods(), and multigrid_debug().

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

◆ cartesian_init_face_vector()

vector cartesian_init_face_vector ( vector  v,
const char name 
)

Definition at line 704 of file cartesian-common.h.

References cartesian_init_vector(), d, dimension, nboundary, v, and x.

Referenced by cartesian_methods(), multigrid_init_face_vector(), and tree_init_face_vector().

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

◆ cartesian_init_scalar()

scalar cartesian_init_scalar ( scalar  s,
const char name 
)

Definition at line 627 of file cartesian-common.h.

References b, boundary, boundary_stencil(), default_scalar_bc, dimension, free(), scalar::i, nboundary, s, strdup(), symmetry(), and x.

Referenced by cartesian_init_vector(), cartesian_init_vertex_scalar(), cartesian_methods(), and multigrid_init_scalar().

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

◆ cartesian_init_tensor()

tensor cartesian_init_tensor ( tensor  t,
const char name 
)

Definition at line 716 of file cartesian-common.h.

References antisymmetry(), assert, b, cartesian_init_vector(), default_scalar_bc, default_vector_bc, dimension, nboundary, symmetry(), t, x, y, and z.

Referenced by cartesian_methods(), and multigrid_init_tensor().

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

◆ cartesian_init_vector()

vector cartesian_init_vector ( vector  v,
const char name 
)

Definition at line 682 of file cartesian-common.h.

References antisymmetry(), cartesian_init_scalar(), d, default_vector_bc, dimension, nboundary, v, x, y, and z.

Referenced by cartesian_init_face_vector(), cartesian_init_tensor(), cartesian_methods(), and multigrid_init_vector().

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

◆ cartesian_init_vertex_scalar()

scalar cartesian_init_vertex_scalar ( scalar  s,
const char name 
)

Definition at line 666 of file cartesian-common.h.

References cartesian_init_scalar(), d, dimension, nboundary, s, and x.

Referenced by cartesian_methods(), and multigrid_init_vertex_scalar().

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

◆ cartesian_methods()

void cartesian_methods ( )

Definition at line 918 of file cartesian-common.h.

References boundary_face, boundary_level, cartesian_boundary_face(), cartesian_boundary_level(), cartesian_debug(), cartesian_init_face_vector(), cartesian_init_scalar(), cartesian_init_tensor(), cartesian_init_vector(), cartesian_init_vertex_scalar(), cartesian_scalar_clone(), debug, init_face_vector, init_scalar, init_tensor, init_vector, init_vertex_scalar, and scalar_clone.

Referenced by cartesian1D_methods(), gpu_cartesian_methods(), and multigrid_methods().

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

◆ cartesian_scalar_clone()

static void cartesian_scalar_clone ( scalar  clone,
scalar  src 
)
static

Definition at line 379 of file cartesian-common.h.

References _attribute, assert, boundary, boundary_stencil(), free(), i, list_copy(), _Attributes::name, nboundary, and x.

Referenced by cartesian_methods().

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

◆ debug_plot()

static void debug_plot ( FILE fp,
const char name,
const char cells,
const char stencil 
)
static

Definition at line 809 of file cartesian-common.h.

References cells(), dimension, fp, free(), replace_(), and x.

Referenced by cartesian_debug().

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

◆ default_stencil()

void default_stencil ( Point  p,
scalar list 
)

Definition at line 1083 of file cartesian-common.h.

References c, scalar::i, s, s_input, s_nowarning, s_output, v, and x.

◆ delete()

void delete ( scalar list)

Definition at line 419 of file cartesian-common.h.

References all, baseblock, f, free(), scalar::i, i, list, s, trash(), and x.

Here is the call graph for this function:

◆ free_solver()

void free_solver ( )

Definition at line 464 of file cartesian-common.h.

References _attribute, _constant, _val_higher_dimension, a, all, array_free(), assert, baseblock, Events, f, free(), free_grid, free_solver_funcs, i, kh_destroy, _Event::last, Array::len, _Event::next, Array::p, qpclose_all(), and x.

Here is the call graph for this function:

◆ getvalue()

double getvalue ( Point  point,
scalar  s,
int  i,
int  j,
int  k 
)

Definition at line 1078 of file cartesian-common.h.

References i, j, k, and s.

◆ init_const_scalar()

void init_const_scalar ( scalar  s,
const char name,
double  val 
)

Definition at line 346 of file cartesian-common.h.

References _constant, scalar::i, i, realloc(), s, val(), and x.

Referenced by init_const_vector(), and new_const_scalar().

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

◆ init_const_vector()

void init_const_vector ( vector  v,
const char name,
double val 
)

Definition at line 364 of file cartesian-common.h.

References dimension, init_const_scalar(), v, val(), and x.

Referenced by new_const_vector().

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

◆ init_symmetric_tensor()

tensor init_symmetric_tensor ( tensor  t,
const char name 
)

Definition at line 931 of file cartesian-common.h.

References init_tensor, and t.

◆ interpolate()

trace double interpolate ( scalar  v,
double  xp = 0.,
double  yp = 0.,
double  zp = 0.,
bool  linear = true 
)

Definition at line 968 of file cartesian-common.h.

References interpolate_linear(), min, nodata, point, v, val(), and x.

Referenced by output_vtk(), and slave_interpolate().

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

◆ interpolate_array()

trace void interpolate_array ( scalar list,
coord a,
int  n,
double v,
bool  linear = false 
)

Definition at line 978 of file cartesian-common.h.

References a, i, interpolate_linear(), j, min, n, nodata, p, point, s, v, w, x, y, and z.

Referenced by output_gauges().

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

◆ interpolate_linear()

static double interpolate_linear ( Point  point,
scalar  v,
double  xp = 0.,
double  yp = 0.,
double  zp = 0. 
)
static

Definition at line 936 of file cartesian-common.h.

References i, j, k, sign(), v, x, y, and z.

Referenced by interp(), interpolate(), interpolate_array(), and segment_flux().

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

◆ list_add_depends()

static scalar * list_add_depends ( scalar list,
scalar  s 
)
static

Definition at line 528 of file cartesian-common.h.

References d, scalar::i, list, list_add_depends(), list_append(), s, s_centered, t, and x.

Referenced by boundary_internal(), cartesian_boundary_face(), and list_add_depends().

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

◆ list_clone()

scalar * list_clone ( scalar l)

Definition at line 400 of file cartesian-common.h.

References c, datasize, dimension, scalar::i, i, list, list_append(), s, scalar_clone, and x.

Referenced by event_pressure(), horizontal_diffusion(), mg_solve(), msolve(), run(), runge_kutta(), and update().

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

◆ m()

◆ new_bid()

bid new_bid ( )

Definition at line 1011 of file cartesian-common.h.

References antisymmetry(), b, dimension, scalar::i, nboundary, realloc(), s, sizeof(), symmetry(), v, and x.

Here is the call graph for this function:

◆ new_const_scalar()

scalar new_const_scalar ( const char name,
int  i,
double  val 
)

Definition at line 357 of file cartesian-common.h.

References i, init_const_scalar(), s, val(), and x.

Here is the call graph for this function:

◆ new_const_vector()

vector new_const_vector ( const char name,
int  i,
double val 
)

Definition at line 370 of file cartesian-common.h.

References dimension, scalar::i, i, init_const_vector(), v, val(), vector::x, and x.

Here is the call graph for this function:

◆ output_cells()

void output_cells ( FILE fp = stdout,
coord  c = {0},
double  size = 0. 
)

Definition at line 752 of file cartesian-common.h.

Referenced by balance(), cartesian_debug(), and check_two_one().

Here is the caller graph for this function:

◆ periodic()

void periodic ( int  dir)

Definition at line 1061 of file cartesian-common.h.

References assert, bottom, c, dir, left, Period, periodic_boundary(), and x.

Here is the call graph for this function:

◆ periodic_bc()

static double periodic_bc ( Point  point,
Point  neighbor,
scalar  s,
bool data 
)
static

Definition at line 1035 of file cartesian-common.h.

References s.

Referenced by event_defaults(), and periodic_boundary().

Here is the caller graph for this function:

◆ periodic_boundary()

static void periodic_boundary ( int  d)
static

Definition at line 1040 of file cartesian-common.h.

References d, default_scalar_bc, default_vector_bc, is_vertex_scalar(), periodic_bc(), s, v, and x.

Referenced by periodic().

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

◆ replace_()

static char * replace_ ( const char vname)
static

Definition at line 798 of file cartesian-common.h.

References c, strdup(), and x.

Referenced by cartesian_debug(), and debug_plot().

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

◆ stencil_val()

void stencil_val ( Point  p,
scalar  s,
int  i,
int  j,
int  k,
const char file,
int  line,
bool  overflow 
)

Definition at line 1107 of file cartesian-common.h.

References d, dimension, fflush(), file, scalar::i, i, index, j, k, line, p, s, s_input, s_output, write_stencil_index(), and x.

Here is the call graph for this function:

◆ stencil_val_a()

void stencil_val_a ( Point  p,
scalar  s,
int  i,
int  j,
int  k,
bool  input,
const char file,
int  line 
)

Definition at line 1154 of file cartesian-common.h.

References d, dimension, fflush(), file, scalar::i, i, index, input(), j, k, line, p, s, s_input, s_output, write_stencil_index(), and x.

Here is the call graph for this function:

◆ symmetry()

static double symmetry ( Point  point,
Point  neighbor,
scalar  s,
bool data 
)
static

Definition at line 613 of file cartesian-common.h.

References s.

Referenced by cartesian_init_scalar(), cartesian_init_tensor(), and new_bid().

Here is the caller graph for this function:

◆ write_stencil_index()

static void write_stencil_index ( int index)
static

This displays a (1D,2D,3D) stencil index.

Definition at line 1099 of file cartesian-common.h.

References d, dimension, index, and x.

Referenced by stencil_val(), and stencil_val_a().

Here is the caller graph for this function:

Variable Documentation

◆ _y

define double _y = 0.

Definition at line 13 of file cartesian-common.h.

◆ _z

define double double _z = 0.

Definition at line 13 of file cartesian-common.h.

◆ boundary_face

void(* boundary_face) (vectorl) ( vectorl  )

◆ boundary_level

◆ debug

void(* debug) (Point) ( Point  )

Definition at line 5 of file cartesian-common.h.

Referenced by cartesian_methods().

◆ default_scalar_bc

BoundaryFunc default_scalar_bc[]
Initial value:
= {
}
static double symmetry(Point point, Point neighbor, scalar s, bool *data)

Definition at line 623 of file cartesian-common.h.

Referenced by box_boundary_level(), cartesian_init_scalar(), cartesian_init_tensor(), and periodic_boundary().

◆ default_vector_bc

BoundaryFunc default_vector_bc[]
Initial value:
= {
}
static double antisymmetry(Point point, Point neighbor, scalar s, bool *data)

Definition at line 676 of file cartesian-common.h.

Referenced by cartesian_init_tensor(), cartesian_init_vector(), and periodic_boundary().

◆ flags

◆ k

◆ l

define l

Definition at line 8 of file cartesian-common.h.

Referenced by _stencil_is_face_x(), _stencil_is_face_y(), _stencil_is_face_z(), adapt_wavelet(), advance_saint_venant(), apply_bc(), area(), balance(), box_boundary_level(), box_matrix(), cartesian_boundary_level(), cartesian_debug(), check_depth(), check_snd_rcv_matrix(), code(), coeffs1(), coeffs2(), constant_NNT(), correct_qz(), debug_mpi(), delete_distance(), distance(), event_defaults(), event_metric(), event_pressure(), event_viscous_term(), for(), foreach_cell_post_root(), foreach_coarse_level_stencil(), foreach_level_or_leaf_stencil(), foreach_slice_x(), foreach_slice_y(), geometric_beta(), gpu_boundary_level(), h_relax(), halo_face(), heights(), includes_point(), index(), intersection(), intersects_point(), inverse_wavelet(), kdt_includes(), kdt_intersects(), kdt_rect_write(), level(), list_copy(), list_lookup(), main(), matrix(), matrix1(), mg_cycle(), mpi_boundary_coarsen(), mpi_boundary_level(), mpi_boundary_restriction(), mpi_boundary_update_buffers(), msolve(), multigrid_debug(), multigrid_restriction(), no_coalescence(), parabola_fit_add(), quad_neighbor(), rcv_pid_receive(), rcv_pid_row(), rcv_pid_send(), rcv_pid_sync(), rcv_print(), refine_cell(), relative(), relax(), relax_diffusion(), relax_GN(), relax_nh(), relax_nh(), relax_nh1(), relax_psi(), relax_thermal(), relax_viscosity(), residual_nh(), residual_nh2(), residual_nh3(), segment_flux(), size(), smatrix_inverse(), solve(), solve_hessenberg(), subtree_size(), tag(), terrain(), tree_boundary_level(), union_bound(), update_conservation(), update_saint_venant(), vectors_copy(), vertical_diffusion(), vertical_fluxes(), vertical_viscosity(), wavelet(), and z_indexing().

◆ reductions