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

Go to the source code of this file.

Data Structures

struct  Cartesian
 
struct  _Point
 

Macros

#define GRIDNAME   "Cartesian"
 
#define dimension   2
 
#define GHOSTS   1
 
#define _I   (point.i - 1)
 
#define _J   (point.j - 1)
 
#define _DELTA   (1./(real)N)
 
#define cartesian   ((Cartesian *)grid)
 
#define foreach_edge()   for (int _i = 0; _i < _N; _i++) /* foreach_face */
 

Typedefs

typedef double real
 

Functions

undef val define val (a, k, l, m)(((real *)((Cartesian *) grid) -> d)[(point.i+k+_index(a, m) *(size_t)(point.n+2)) *(point.n+2)+point.j+l]) @define allocated(...) true macro POINT_VARIABLES(Point point=point)
 
macro2 foreach (char flags=0, Reduce reductions=None)
 
macro2 foreach_face_generic (char flags=0, Reduce reductions=None, const char *order="xyz")
 
macro1 is_face_x (Point p=point)
 
macro1 is_face_y (Point p=point)
 
if TRASH undef trash define trash (list) reset(list
 
if TRASH undef trash define undefined endif void reset (void *alist, double val)
 
macro2 foreach_boundary_dir (int l, int d)
 
define neighbor (o, p, q)((Point)
 
def is_boundary() point (point.i< 1||point.i >=point.n+1||point.j< 1||point.j >=point.n+1) @ static int _ig[]
 
static void box_boundary_level_normal (const Boundary *b, scalar *list, int l)
 
static void box_boundary_level_tangent (const Boundary *b, scalar *list, int l)
 
static double periodic_bc (Point point, Point neighbor, scalar s, bool *data)
 
macro2 for (int _b=0;_b< 1;_b++)
 
static void box_boundary_level (const Boundary *b, scalar *list, int l)
 
 for (int _s=0;_s< 1;_s++) if(!is_constant(s) &&s.block > 0)
 
 if (!list1) return
 
 OMP_PARALLEL ()
 
 free (list1)
 
undef VT void free_grid (void)
 
void init_grid (int n)
 
void realloc_scalar (int size)
 
Point locate (double xp=0, double yp=0, double zp=0)
 

Variables

static Point last_point
 
def is_boundary() _jg [] = {0,0,1,-1}
 
double(* default_scalar_bc [])(Point, Point, scalar, bool *)
 
define VT _attribute[s.i] v y scalarlist
 
define VT _attribute[s.i] v y scalar int l
 

Macro Definition Documentation

◆ _DELTA

#define _DELTA   (1./(real)N)

Definition at line 17 of file cartesian.h.

◆ _I

#define _I   (point.i - 1)

Definition at line 15 of file cartesian.h.

◆ _J

#define _J   (point.j - 1)

Definition at line 16 of file cartesian.h.

◆ cartesian

#define cartesian   ((Cartesian *)grid)

Definition at line 36 of file cartesian.h.

◆ dimension

#define dimension   2

Definition at line 12 of file cartesian.h.

◆ foreach_edge

#define foreach_edge ( )    for (int _i = 0; _i < _N; _i++) /* foreach_face */

Definition at line 77 of file cartesian.h.

◆ GHOSTS

#define GHOSTS   1

Definition at line 13 of file cartesian.h.

◆ GRIDNAME

#define GRIDNAME   "Cartesian"

Definition at line 10 of file cartesian.h.

Typedef Documentation

◆ real

Definition at line 6 of file cartesian.h.

Function Documentation

◆ box_boundary_level()

static void box_boundary_level ( const Boundary b,
scalar list,
int  l 
)
static

Definition at line 216 of file cartesian.h.

References _ig, _jg, _k, b, box_boundary_level_normal(), box_boundary_level_tangent(), cartesian, d, free(), scalar::i, Point::i, l, left, list_add(), neighbor(), normal, OMP_PARALLEL(), periodic_bc(), point, right, s, top, val(), and x.

Referenced by init_grid().

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

◆ box_boundary_level_normal()

static void box_boundary_level_normal ( const Boundary b,
scalar list,
int  l 
)
static

Definition at line 154 of file cartesian.h.

References _ig, _jg, _k, b, cartesian, d, GHOSTS, Point::i, left, neighbor(), OMP_PARALLEL(), point, right, s, top, val(), and x.

Referenced by box_boundary_level().

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

◆ box_boundary_level_tangent()

static void box_boundary_level_tangent ( const Boundary b,
scalar list,
int  l 
)
static

Definition at line 181 of file cartesian.h.

References _ig, _jg, _k, b, cartesian, d, GHOSTS, Point::i, left, neighbor(), OMP_PARALLEL(), point, right, s, top, val(), and x.

Referenced by box_boundary_level().

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

◆ for() [1/2]

macro2 for ( )

Definition at line 208 of file cartesian.h.

References b, default_scalar_bc, depth, foreach_boundary_dir(), is_boundary, periodic_bc(), and point.

Here is the call graph for this function:

◆ for() [2/2]

for ( ) &&

Definition at line 279 of file cartesian.h.

◆ foreach()

macro2 foreach ( char  flags = 0,
Reduce  reductions = None 
)

Definition at line 44 of file cartesian.h.

References _k, cartesian, Point::i, OMP_PARALLEL(), point, reductions, and x.

Here is the call graph for this function:

◆ foreach_boundary_dir()

macro2 foreach_boundary_dir ( int  l,
int  d 
)

Definition at line 112 of file cartesian.h.

References _i, bottom, cartesian, d, GHOSTS, Point::i, left, OMP_PARALLEL(), point, right, top, and x.

Referenced by box_boundary_level(), and for().

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

◆ foreach_face_generic()

macro2 foreach_face_generic ( char  flags = 0,
Reduce  reductions = None,
const char order = "xyz" 
)

Definition at line 60 of file cartesian.h.

References _k, cartesian, Point::i, OMP_PARALLEL(), point, reductions, and x.

Here is the call graph for this function:

◆ free()

free ( list1  )

Referenced by adapt_wavelet(), add_cexpr(), advection(), apply_bc(), array_free(), array_remove(), array_shrink(), boundary_flux(), boundary_internal(), boundary_stencil(), box_boundary_level(), box_boundary_level(), buffer_unref(), bview_destroy(), cartesian_boundary_face(), cartesian_debug(), cartesian_init_scalar(), cartesian_scalar_clone(), check_snd_rcv_matrix(), check_stencil(), coarsen_distance(), compdir(), compile_expression(), createShaderFromString(), debug_plot(), delete(), delete_distance(), delete_terrain(), destroy_layer(), display(), display_command(), display_control_internal(), display_control_update(), display_destroy(), display_init(), display_onopen(), display_send(), display_update(), distance(), dopen(), event_acceleration(), event_cleanup(), event_metric(), event_pressure(), event_tracer_diffusion(), event_vof(), exiting(), fclone(), free_boundaries(), free_cexpr(), free_display_defaults(), free_exts(), free_grid(), free_grid(), free_solver(), gpu_boundary_level(), gpu_errors(), gpu_errorsfree(), gpu_free_solver(), horizontal_diffusion(), incfree(), inclex(), include(), includes(), input_gfs(), input_pgm(), kdt_destroy(), loadNormalShader(), main(), matrix_free(), mem_destroy(), mempool_destroy(), memrange_free(), merge(), mg_solve(), mpi_boundary_destroy(), mpi_boundary_refine(), mpi_boundary_update_buffers(), msolve(), multigrid_restriction(), no_coalescence(), open_ext(), open_image_cleanup(), periodic_boundary_level_x(), postfree(), psort(), rcv_destroy(), rcv_free_buf(), rcv_pid_destroy(), rcv_pid_sync(), read_file_into_buffer(), receive_tree(), restore_mpi(), RPE(), run(), runge_kutta(), terrain(), tree_boundary_level(), update(), update_conservation(), update_distance(), and ws_send_array().

◆ free_grid()

undef VT void free_grid ( void  )

Definition at line 313 of file cartesian.h.

References cartesian, free(), free_boundaries(), grid, and x.

Referenced by init_grid().

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

◆ if()

if ( list1)

◆ init_grid()

void init_grid ( int  n)

Definition at line 323 of file cartesian.h.

References add_boundary(), all, b, box(), box_boundary_level(), cartesian, d, datasize, dimension, free_grid(), grid, _Boundary::level, Grid::n, N, n, nboundary, p, periodic_boundary_level_x(), qcalloc, qmalloc, reset, sq(), Grid::tn, and x.

Here is the call graph for this function:

◆ is_face_x()

macro1 is_face_x ( Point  p = point)

Definition at line 79 of file cartesian.h.

References p, and x.

◆ is_face_y()

macro1 is_face_y ( Point  p = point)

Definition at line 86 of file cartesian.h.

References p, and x.

◆ locate()

Point locate ( double  xp = 0,
double  yp = 0,
double  zp = 0 
)

Definition at line 358 of file cartesian.h.

References cartesian, Point::i, L0, Point::level, point, x, X0, and Y0.

◆ neighbor()

define neighbor ( o  ,
p  ,
q   
)

◆ OMP_PARALLEL()

OMP_PARALLEL ( )

Definition at line 292 of file cartesian.h.

References cartesian, GHOSTS, i, j, point, s, and x.

Referenced by box_boundary_level(), box_boundary_level_normal(), box_boundary_level_tangent(), foreach(), foreach_boundary_dir(), foreach_face_generic(), and is_refined_check().

Here is the caller graph for this function:

◆ periodic_bc()

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

Referenced by box_boundary_level(), for(), and for().

Here is the caller graph for this function:

◆ point()

def is_boundary() point ( point.i< 1||point.i = point.n + 1 || point.j < 1 || point.j >= point.n + 1)

◆ realloc_scalar()

void realloc_scalar ( int  size)

Definition at line 351 of file cartesian.h.

References cartesian, datasize, p, size, sq(), and x.

Here is the call graph for this function:

◆ reset()

if TRASH undef trash define undefined endif void reset ( void alist,
double  val 
)

Definition at line 100 of file cartesian.h.

References cartesian, scalar::i, i, list, s, sq(), val(), and x.

Here is the call graph for this function:

◆ trash()

if TRASH undef trash define trash ( list  )

Referenced by advance_generic(), and delete().

Here is the caller graph for this function:

◆ val()

undef val define val ( a  ,
k  ,
l  ,
m   
) -> d)[(point.i + k + _index(a,m)*(size_t)(point.n + 2))*(point.n + 2) + point.j + l]) @define allocated(...) true macro POINT_VARIABLES (Point point = point)

Definition at line 39 of file cartesian.h.

References VARIABLES().

Referenced by box_boundary_level(), box_boundary_level_normal(), box_boundary_level_tangent(), and reset().

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

Variable Documentation

◆ _jg

def is_boundary() _jg[] = {0,0,1,-1}

◆ default_scalar_bc

double(* default_scalar_bc[])(Point, Point, scalar, bool *) ( Point  ,
Point  ,
scalar  ,
bool  
)
extern

Referenced by for().

◆ l

Initial value:
{
int x
Definition common.h:76

Definition at line 276 of file cartesian.h.

◆ last_point

Point last_point
static

Definition at line 34 of file cartesian.h.

Referenced by catch_fpe(), and gdb().

◆ list