34 int dim = boundary->
dim;
35 int face = boundary->
face;
40 int bounds[ndims], indexb[ndims], indexi[ndims];
48 if (face == 1) indexi[dim] = ghosts-1-indexb[dim];
49 else if (face == -1) indexi[dim] = size[dim]-indexb[dim]-1;
56 double h_gpt, uvel_gpt;
62 phi[nvars*p1+0] = h_gpt;
63 phi[nvars*p1+1] = h_gpt * uvel_gpt;
69 }
else if (ndims == 2) {
72 int bounds[ndims], indexb[ndims], indexi[ndims];
80 if (face == 1) indexi[dim] = ghosts-1-indexb[dim];
81 else if (face == -1) indexi[dim] = size[dim]-indexb[dim]-1;
88 double h_gpt, uvel_gpt, vvel_gpt;
95 }
else if (dim ==
_YDIR_) {
103 phi[nvars*p1+0] = h_gpt;
104 phi[nvars*p1+1] = h_gpt * uvel_gpt;
105 phi[nvars*p1+2] = h_gpt * vvel_gpt;
Containts the structures and definitions for boundary condition implementation.
1D Shallow Water Equations
Some basic definitions and macros.
2D Shallow Water Equations
Structure containing the variables and function pointers defining a boundary.
#define _ArraySubtract1D_(x, a, b, size)
#define _ArrayAdd1D_(x, a, b, size)
#define _ArrayIndex1D_(N, imax, i, ghost, index)
int BCSWSlipWallU(void *b, void *m, int ndims, int nvars, int *size, int ghosts, double *phi, double waqt)
#define _ArrayIndex1DWO_(N, imax, i, offset, ghost, index)
#define _ArraySetValue_(x, size, value)
#define _ArrayIncrementIndex_(N, imax, i, done)
#define _ShallowWater1DGetFlowVar_(u, h, v)
#define _ArrayCopy1D_(x, y, size)
Contains macros and function definitions for common array operations.
#define _ShallowWater2DGetFlowVar_(u, h, uvel, vvel)