45 int v, done, p, p1, p2;
46 double *SourceI = solver->
fluxI;
47 double *SourceC = solver->
fluxC;
48 double *SourceL = solver->
fL;
49 double *SourceR = solver->
fR;
51 int ndims = solver->
ndims;
52 int ghosts = solver->
ghosts;
54 double *x = solver->
x;
55 double *dxinv = solver->
dxinv;
56 int index[ndims],index1[ndims],index2[ndims],dim_interface[ndims];
80 source[_MODEL_NVARS_*p+v] += (SourceI[_MODEL_NVARS_*p2+v]-SourceI[_MODEL_NVARS_*p1+v])*dx_inverse;
100 double term[
_MODEL_NVARS_] = { 0.0, -param->
g * (h + param->
b[p]), 0.0 };
102 source[_MODEL_NVARS_*p+v] += term[v]*(SourceI[_MODEL_NVARS_*p2+v]-SourceI[_MODEL_NVARS_*p1+v])*dx_inverse;
129 source[_MODEL_NVARS_*p+v] += (SourceI[_MODEL_NVARS_*p2+v]-SourceI[_MODEL_NVARS_*p1+v])*dy_inverse;
149 double term[
_MODEL_NVARS_] = { 0.0, 0.0, -param->
g * (h + param->
b[p]) };
151 source[_MODEL_NVARS_*p+v] += term[v]*(SourceI[_MODEL_NVARS_*p2+v]-SourceI[_MODEL_NVARS_*p1+v])*dy_inverse;
160 double h, uvel, vvel;
162 double ycoord;
_GetCoordinate_(_YDIR_,index[_YDIR_],dim,ghosts,solver->
x,ycoord);
163 double coeff = param->
fhat + param->
beta * (ycoord - 0.5*param->
D);
164 double coriolis_x = coeff * vvel,
165 coriolis_y = -coeff * uvel;
207 int ghosts = solver->
ghosts;
209 int ndims = solver->
ndims;
210 int index[ndims], bounds[ndims], offset[ndims];
214 int i;
for (i=0; i<ndims; i++) bounds[i] += 2*ghosts;
223 (f+
_MODEL_NVARS_*p)[1] = (dir == _XDIR_ ? 0.5 * param->
g * param->
b[p] * param->
b[p] : 0.0 );
264 int ghosts = solver->
ghosts;
266 int ndims = solver->
ndims;
267 int index[ndims], bounds[ndims], offset[ndims];
271 int i;
for (i=0; i<ndims; i++) bounds[i] += 2*ghosts;
#define _ArraySetValue_(x, size, value)
#define _ArrayIncrementIndex_(N, imax, i, done)
MPI related function definitions.
int ShallowWater2DSource(double *, double *, void *, void *, double)
#define _GetCoordinate_(dir, i, dim, ghosts, x, coord)
static int ShallowWater2DSourceFunction2(double *, double *, double *, void *, void *, double, int)
#define _ArrayIndex1D_(N, imax, i, ghost, index)
int(* SourceUpwind)(double *, double *, double *, double *, int, void *, double)
2D Shallow Water Equations
#define _ArrayIndex1DWO_(N, imax, i, offset, ghost, index)
#define _ArrayCopy1D_(x, y, size)
int(* InterpolateInterfacesHyp)(double *, double *, double *, double *, int, int, void *, void *, int)
#define _ShallowWater2DGetFlowVar_(u, h, uvel, vvel)
Contains structure definition for hypar.
Some basic definitions and macros.
static int ShallowWater2DSourceFunction1(double *, double *, double *, void *, void *, double, int)
Contains macros and function definitions for common array operations.
Structure of MPI-related variables.
Structure containing variables and parameters specific to the 2D Shallow Water equations. This structure contains the physical parameters, variables, and function pointers specific to the 2D ShallowWater equations.
Structure containing all solver-specific variables and functions.