19 #undef _MINIMUM_GHOSTS_ 24 #define _MINIMUM_GHOSTS_ 2 91 int ghosts = solver->
ghosts;
92 int ndims = solver->
ndims;
93 int nvars = solver->
nvars;
97 double half = 1.0/2.0;
101 int indexC[ndims], indexI[ndims], index_outer[ndims], bounds_outer[ndims], bounds_inter[ndims];
102 _ArrayCopy1D_(dim,bounds_outer,ndims); bounds_outer[dir] = 1;
103 _ArrayCopy1D_(dim,bounds_inter,ndims); bounds_inter[dir] += 1;
108 #pragma omp parallel for schedule(auto) default(shared) private(i,index_outer,indexC,indexI) 109 for (i=0; i<N_outer; i++) {
113 for (indexI[dir] = 0; indexI[dir] < dim[dir]+1; indexI[dir]++) {
116 indexC[dir] = indexI[dir]-2;
_ArrayIndex1D_(ndims,dim,indexC,ghosts,qm2);
117 indexC[dir] = indexI[dir]-1;
_ArrayIndex1D_(ndims,dim,indexC,ghosts,qm1);
118 indexC[dir] = indexI[dir] ;
_ArrayIndex1D_(ndims,dim,indexC,ghosts,qp1);
119 for (v=0; v<nvars; v++) {
122 m2 = fC[qm2*nvars+v];
123 m1 = fC[qm1*nvars+v];
124 p1 = fC[qp1*nvars+v];
126 double slope_ratio = (m1 - m2) / ((p1 - m1) + 1e-40);
128 fI[p*nvars+v] = m1 + 0.5 * phi * (p1-m1);
133 #pragma omp parallel for schedule(auto) default(shared) private(i,index_outer,indexC,indexI) 134 for (i=0; i<N_outer; i++) {
138 for (indexI[dir] = 0; indexI[dir] < dim[dir]+1; indexI[dir]++) {
141 indexC[dir] = indexI[dir]-1;
_ArrayIndex1D_(ndims,dim,indexC,ghosts,qm1);
142 indexC[dir] = indexI[dir] ;
_ArrayIndex1D_(ndims,dim,indexC,ghosts,qp1);
143 indexC[dir] = indexI[dir]+1;
_ArrayIndex1D_(ndims,dim,indexC,ghosts,qp2);
144 for (v=0; v<nvars; v++) {
147 m1 = fC[qm1*nvars+v];
148 p1 = fC[qp1*nvars+v];
149 p2 = fC[qp2*nvars+v];
151 double slope_ratio = (p1 - m1) / ((p2 - p1) + 1e-40);
153 fI[p*nvars+v] = p1 + 0.5 * phi * (p1-p2);
MPI related function definitions.
Contains function definitions for common mathematical functions.
Some basic definitions and macros.
double(* LimiterFunction)(double)
#define _ArrayIndexnD_(N, index, imax, i, ghost)
Structure containing all solver-specific variables and functions.
int Interp1PrimSecondOrderMUSCL(double *fI, double *fC, double *u, double *x, int upw, int dir, void *s, void *m, int uflag)
2nd order MUSCL scheme (component-wise) on a uniform grid
Contains structure definition for hypar.
#define _ArrayIndex1D_(N, imax, i, ghost, index)
Structure of variables/parameters needed by the MUSCL scheme.
Definitions for the functions computing the interpolated value of the primitive at the cell interface...
#define _ArrayCopy1D_(x, y, size)
Contains macros and function definitions for common array operations.
#define _ArrayProduct1D_(x, size, p)