19 #undef _MINIMUM_GHOSTS_
24 #define _MINIMUM_GHOSTS_ 2
90 int ghosts = solver->
ghosts;
91 int ndims = solver->
ndims;
92 int nvars = solver->
nvars;
96 double one_third = 1.0/3.0;
97 double one_sixth = 1.0/6.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 fdiff = p1 - m1;
127 double bdiff = m1 - m2;
128 double limit = (3*fdiff*bdiff + muscl->
eps)
129 / (2*(fdiff-bdiff)*(fdiff-bdiff) + 3*fdiff*bdiff + muscl->
eps);
131 fI[p*nvars+v] = m1 + limit * (one_third*fdiff + one_sixth*bdiff);
136 #pragma omp parallel for schedule(auto) default(shared) private(i,index_outer,indexC,indexI)
137 for (i=0; i<N_outer; i++) {
141 for (indexI[dir] = 0; indexI[dir] < dim[dir]+1; indexI[dir]++) {
144 indexC[dir] = indexI[dir]-1;
_ArrayIndex1D_(ndims,dim,indexC,ghosts,qm1);
145 indexC[dir] = indexI[dir] ;
_ArrayIndex1D_(ndims,dim,indexC,ghosts,qp1);
146 indexC[dir] = indexI[dir]+1;
_ArrayIndex1D_(ndims,dim,indexC,ghosts,qp2);
147 for (v=0; v<nvars; v++) {
150 m1 = fC[qm1*nvars+v];
151 p1 = fC[qp1*nvars+v];
152 p2 = fC[qp2*nvars+v];
154 double fdiff = p2 - p1;
155 double bdiff = p1 - m1;
156 double limit = (3*fdiff*bdiff + muscl->
eps)
157 / (2*(fdiff-bdiff)*(fdiff-bdiff) + 3*fdiff*bdiff + muscl->
eps);
159 fI[p*nvars+v] = p1 - limit * (one_third*fdiff + one_sixth*bdiff);
Definitions for the functions computing the interpolated value of the primitive at the cell interface...
#define _ArrayIndexnD_(N, index, imax, i, ghost)
MPI related function definitions.
int Interp1PrimThirdOrderMUSCL(double *, double *, double *, double *, int, int, void *, void *, int)
3rd order MUSCL scheme with Koren's limiter (component-wise) on a uniform grid
#define _ArrayIndex1D_(N, imax, i, ghost, index)
Contains function definitions for common mathematical functions.
#define _ArrayCopy1D_(x, y, size)
Contains structure definition for hypar.
Some basic definitions and macros.
Structure of variables/parameters needed by the MUSCL scheme.
Contains macros and function definitions for common array operations.
#define _ArrayProduct1D_(x, size, p)
Structure containing all solver-specific variables and functions.