20 #undef _MINIMUM_GHOSTS_ 25 #define _MINIMUM_GHOSTS_ 3 108 int ghosts = solver->
ghosts;
109 int ndims = solver->
ndims;
110 int nvars = solver->
nvars;
114 double one_third = 1.0/3.0;
115 double one_sixth = 1.0/6.0;
119 int indexC[ndims], indexI[ndims], index_outer[ndims], bounds_outer[ndims], bounds_inter[ndims];
120 _ArrayCopy1D_(dim,bounds_outer,ndims); bounds_outer[dir] = 1;
121 _ArrayCopy1D_(dim,bounds_inter,ndims); bounds_inter[dir] += 1;
125 double R[nvars*nvars], L[nvars*nvars], uavg[nvars], fchar[nvars];
128 #pragma omp parallel for schedule(auto) default(shared) private(i,k,v,R,L,uavg,fchar,index_outer,indexC,indexI) 129 for (i=0; i<N_outer; i++) {
134 for (indexI[dir] = 0; indexI[dir] < dim[dir]+1; indexI[dir]++) {
138 indexC[dir] = indexI[dir]-2;
_ArrayIndex1D_(ndims,dim,indexC,ghosts,qm2);
139 indexC[dir] = indexI[dir]-1;
_ArrayIndex1D_(ndims,dim,indexC,ghosts,qm1);
140 indexC[dir] = indexI[dir] ;
_ArrayIndex1D_(ndims,dim,indexC,ghosts,qp1);
154 for (v = 0; v < nvars; v++) {
158 for (k = 0; k < nvars; k++) {
159 m2 += L[v*nvars+k] * fC[qm2*nvars+k];
160 m1 += L[v*nvars+k] * fC[qm1*nvars+k];
161 p1 += L[v*nvars+k] * fC[qp1*nvars+k];
163 double fdiff = p1 - m1;
164 double bdiff = m1 - m2;
165 double limit = (3*fdiff*bdiff + muscl->
eps)
166 / (2*(fdiff-bdiff)*(fdiff-bdiff) + 3*fdiff*bdiff + muscl->
eps);
167 fchar[v] = m1 + limit * (one_third*fdiff + one_sixth*bdiff);
175 #pragma omp parallel for schedule(auto) default(shared) private(i,k,v,R,L,uavg,fchar,index_outer,indexC,indexI) 176 for (i=0; i<N_outer; i++) {
181 for (indexI[dir] = 0; indexI[dir] < dim[dir]+1; indexI[dir]++) {
185 indexC[dir] = indexI[dir]-1;
_ArrayIndex1D_(ndims,dim,indexC,ghosts,qm1);
186 indexC[dir] = indexI[dir] ;
_ArrayIndex1D_(ndims,dim,indexC,ghosts,qp1);
187 indexC[dir] = indexI[dir]+1;
_ArrayIndex1D_(ndims,dim,indexC,ghosts,qp2);
201 for (v = 0; v < nvars; v++) {
205 for (k = 0; k < nvars; k++) {
206 m1 += L[v*nvars+k] * fC[qm1*nvars+k];
207 p1 += L[v*nvars+k] * fC[qp1*nvars+k];
208 p2 += L[v*nvars+k] * fC[qp2*nvars+k];
210 double fdiff = p2 - p1;
211 double bdiff = p1 - m1;
212 double limit = (3*fdiff*bdiff + muscl->
eps)
213 / (2*(fdiff-bdiff)*(fdiff-bdiff) + 3*fdiff*bdiff + muscl->
eps);
214 fchar[v] = p1 - limit * (one_third*fdiff + one_sixth*bdiff);
MPI related function definitions.
Contains function definitions for common mathematical functions.
int(* AveragingFunction)(double *, double *, double *, void *)
Some basic definitions and macros.
#define _ArrayIndexnD_(N, index, imax, i, ghost)
Structure containing all solver-specific variables and functions.
Contains structure definition for hypar.
#define _ArrayIndex1D_(N, imax, i, ghost, index)
int Interp1PrimThirdOrderMUSCLChar(double *fI, double *fC, double *u, double *x, int upw, int dir, void *s, void *m, int uflag)
3rd order MUSCL scheme with Koren's limiter (characteristic-based) on a uniform grid ...
Structure of variables/parameters needed by the MUSCL scheme.
Contains macros and function definitions for common matrix multiplication.
Definitions for the functions computing the interpolated value of the primitive at the cell interface...
#define MatVecMult(N, y, A, x)
#define _ArrayCopy1D_(x, y, size)
Contains macros and function definitions for common array operations.
int(* GetRightEigenvectors)(double *, double *, void *, int)
#define _ArrayProduct1D_(x, size, p)
int(* GetLeftEigenvectors)(double *, double *, void *, int)