31 int ndims = solver->
ndims;
32 int nvars = solver->
nvars;
33 int ghosts= solver->
ghosts;
38 int index_outer[ndims], index_inter[ndims], bounds_outer[ndims], bounds_inter[ndims];
40 _ArrayCopy1D_(dim,bounds_inter,ndims); bounds_inter[dir] += 1;
47 for (index_inter[dir] = 0; index_inter[dir] < bounds_inter[dir]; index_inter[dir]++) {
49 for (v = 0; v < nvars; v++) {
50 fI[nvars*p+v] = (a[nvars*dir+v] > 0 ? fL[nvars*p+v] : fR[nvars*p+v] );
61 for (index_inter[dir] = 0; index_inter[dir] < bounds_inter[dir]; index_inter[dir]++) {
63 int indexL[ndims];
_ArrayCopy1D_(index_inter,indexL,ndims); indexL[dir]--;
67 for (v = 0; v < nvars; v++) {
68 double eigL = a[nvars*ndims*pL+nvars*dir+v],
69 eigR = a[nvars*ndims*pR+nvars*dir+v];
70 if ((eigL > 0) && (eigR > 0)) {
71 fI[nvars*p+v] = fL[nvars*p+v];
72 }
else if ((eigL < 0) && (eigR < 0)) {
73 fI[nvars*p+v] = fR[nvars*p+v];
76 fI[nvars*p+v] = 0.5 * (fL[nvars*p+v] + fR[nvars*p+v] - alpha * (uR[nvars*p+v] - uL[nvars*p+v]));
88 for (index_inter[dir] = 0; index_inter[dir] < bounds_inter[dir]; index_inter[dir]++) {
90 for (v = 0; v < nvars; v++) {
117 int ndims = solver->
ndims;
118 int nvars = solver->
nvars;
119 int ghosts= solver->
ghosts;
122 int index_outer[ndims], index_inter[ndims], bounds_outer[ndims], bounds_inter[ndims];
123 _ArrayCopy1D_(dim,bounds_outer,ndims); bounds_outer[dir] = 1;
124 _ArrayCopy1D_(dim,bounds_inter,ndims); bounds_inter[dir] += 1;
129 for (index_inter[dir] = 0; index_inter[dir] < bounds_inter[dir]; index_inter[dir]++) {
131 for (
int v = 0; v < nvars; v++) {
132 fI[nvars*p+v] = 0.5 * (fL[nvars*p+v] + fR[nvars*p+v]);
Contains function definitions for common mathematical functions.
Some basic definitions and macros.
Structure containing variables and parameters specific to the linear advection-diffusion-reaction mod...
Structure containing all solver-specific variables and functions.
Contains structure definition for hypar.
#define _ArrayIndex1D_(N, imax, i, ghost, index)
Linear Advection-Diffusion-Reaction model.
#define _ArraySetValue_(x, size, value)
#define _ArrayIncrementIndex_(N, imax, i, done)
int LinearADRCenteredFlux(double *fI, double *fL, double *fR, double *uL, double *uR, double *u, int dir, void *s, double t)
#define _ArrayCopy1D_(x, y, size)
Contains macros and function definitions for common array operations.
int LinearADRUpwind(double *fI, double *fL, double *fR, double *uL, double *uR, double *u, int dir, void *s, double t)