5#define GRIDNAME "Cartesian 1D"
9#define _I (point.i - 1)
10#define _DELTA (1./point.n)
23#define cartesian ((Cartesian *)grid)
46 const char *
order =
"xyz")
64static int _ig[] = {1,-1};
81 for (
int _s = 0;
_s < 1;
_s++) {
95 for (
int _s = 0;
_s < 1;
_s++)
104 else if (
s.boundary[
d])
114 for (
int _s = 0;
_s < 1;
_s++)
128 for (
int _s = 0;
_s < 1;
_s++)
137 for (
int _s = 0;
_s < 1;
_s++)
140 for (
int _s = 0;
_s < 1;
_s++)
166 double *
v = (
double *)
data;
167 for (
int _s = 0;
_s < 1;
_s++)
184 double *
v = (
double *)
p->d;
185 for (
int i = 0;
i < len/
sizeof(
double);
i++)
190 for (
int d = 0;
d < 2;
d++) {
208 size_t len = (
p->n + 2);
vector g[]
We store the combined pressure gradient and acceleration field in g*.
if TRASH define &&NewPid *& val(newpid, 0, 0, 0)) -> pid > 0) @else @ define is_newpid()(((NewPid *)&val(newpid, 0, 0, 0)) ->pid > 0) @endif Array *linear_tree(size_t size, scalar newpid)
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.
Point locate(double xp=0, double yp=0, double zp=0)
if TRASH undef trash define trash(list) reset(list
macro2 foreach_face_generic(char flags=0, Reduce reductions=None, const char *order="xyz")
void cartesian1D_methods()
static void box_boundary_level(const Boundary *b, scalar *list, int l)
static double periodic_bc(Point point, Point neighbor, scalar s, bool *data)
static void periodic_boundary_level_x(const Boundary *b, scalar *list, int l)
static void box_boundary_level_normal(const Boundary *b, scalar *list, int l)
define neighbor(o, p, q)((Point)
define VT _attribute[s.i] v y scalar * list
scalar * list_add(scalar *list, scalar s)
else define undefined((double) DBL_MAX) @ define enable_fpe(flags) @ define disable_fpe(flags) static void set_fpe(void)
#define qcalloc(size, type)
#define qmalloc(size, type)
trace bool box(bool notics=false, float lc[3]={0}, float lw=1.)
#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)
macro VARIABLES(Point point=point, int _ig=ig, int _jg=jg, int _kg=kg)