10# define GRIDNAME "Cartesian"
15#define _I (point.i - 1)
16#define _J (point.j - 1)
17#define _DELTA (1./(real)N)
36#define cartesian ((Cartesian *)grid)
61 const char *
order =
"xyz")
77#define foreach_edge() for (int _i = 0; _i < _N; _i++)
104 for (
int _s = 0;
_s < 1;
_s++)
106 for (
size_t i = 0;
i < len;
i++)
152static int _ig[] = {1,-1,0,0},
_jg[] = {0,0,1,-1};
173 for (
int _s = 0;
_s < 1;
_s++) {
197 for (
int _s = 0;
_s < 1;
_s++) {
222 for (
int _s = 0;
_s < 1;
_s++)
252 for (
int _s = 0;
_s < 1;
_s++) {
299 for (
int _s = 0;
_s < 1;
_s++)
302 for (
int _s = 0;
_s < 1;
_s++)
vector q[]
The primitive variables are the momentum , pressure , density , (face) specific volume ,...
void add_boundary(Boundary *b)
define double double char flags
define double double char Reduce reductions
define m((k)==0 &&(l)==0 &&(m)==0) macro2 foreach_point(double _x=0.
static void periodic_boundary_level_x(const Boundary *b, scalar *list, int l)
Point locate(double xp=0, double yp=0, double zp=0)
define neighbor(o, p, q)((Point)
static void box_boundary_level_tangent(const Boundary *b, scalar *list, int l)
macro1 is_face_y(Point p=point)
if TRASH undef trash define trash(list) reset(list
macro2 foreach_face_generic(char flags=0, Reduce reductions=None, const char *order="xyz")
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)
undef VT void free_grid(void)
static void box_boundary_level(const Boundary *b, scalar *list, int l)
static double periodic_bc(Point point, Point neighbor, scalar s, bool *data)
define VT _attribute[s.i] v y scalar * list
static void box_boundary_level_normal(const Boundary *b, scalar *list, int l)
macro2 foreach_boundary_dir(int l, int d)
double(* default_scalar_bc[])(Point, Point, scalar, bool *)
static _Attributes * _attribute
scalar * list_add(scalar *list, scalar s)
static number sq(number x)
else define undefined((double) DBL_MAX) @ define enable_fpe(flags) @ define disable_fpe(flags) static void set_fpe(void)
#define qcalloc(size, type)
define _index(a, m)(a.i) @define val(a
#define qmalloc(size, type)
trace bool box(bool notics=false, float lc[3]={0}, float lw=1.)
*cs[i, 0, 0] a *[i -1, 0, 0] j
#define realloc_scalar(size)
macro
We also redefine the "per field" (inner) traversal.
void(* level)(const Boundary *b, scalar *list, int l)
def allocated(k, l, n)(mem_allocated(((Tree *) grid) -> L[point.level]->m, point.i+k, point.j+l)) @ @def NEIGHBOR(k, l, n)(((((Tree *) grid) ->L[point.level]->m) ->b[point.i+k][point.j+l])) @ @def PARENT(k, l, n)(((((Tree *) grid) ->L[point.level-1]->m) ->b[(point.i+2)/2+k][(point.j+2)/2+l])) @ @def allocated_child(k, l, n)(level< depth() &&mem_allocated(((Tree *) grid) ->L[point.level+1]->m, 2 *point.i- 2+k, 2 *point.j- 2+l)) @ @def CHILD(k, l, n)(((((Tree *) grid) ->L[point.level+1]->m) ->b[2 *point.i- 2+k][2 *point.j- 2+l])) @ @define CELL(m)(*((Cell *)(m))) @define depth()(grid->depth) @define aparent(k, l, n) CELL(PARENT(k, l, n)) @define child(k, l, n) CELL(CHILD(k, l, n)) @define cell CELL(NEIGHBOR(0, 0, 0)) @define neighbor(k, l, n) CELL(NEIGHBOR(k, l, n)) @def neighborp(l, m, n)(Point)
define n n define n n macro POINT_VARIABLES(Point point=point)
#define is_boundary(cell)
macro VARIABLES(Point point=point, int _ig=ig, int _jg=jg, int _kg=kg)