20 #undef _MINIMUM_GHOSTS_
25 #define _MINIMUM_GHOSTS_ 2
109 int ghosts = solver->
ghosts;
110 int ndims = solver->
ndims;
111 int nvars = solver->
nvars;
115 double one_third = 1.0/3.0;
116 double one_sixth = 1.0/6.0;
120 int indexC[ndims], indexI[ndims], index_outer[ndims], bounds_outer[ndims], bounds_inter[ndims];
121 _ArrayCopy1D_(dim,bounds_outer,ndims); bounds_outer[dir] = 1;
122 _ArrayCopy1D_(dim,bounds_inter,ndims); bounds_inter[dir] += 1;
126 double R[nvars*nvars], L[nvars*nvars], uavg[nvars], fchar[nvars];
129 #pragma omp parallel for schedule(auto) default(shared) private(i,k,v,R,L,uavg,fchar,index_outer,indexC,indexI)
130 for (i=0; i<N_outer; i++) {
135 for (indexI[dir] = 0; indexI[dir] < dim[dir]+1; indexI[dir]++) {
139 indexC[dir] = indexI[dir]-2;
_ArrayIndex1D_(ndims,dim,indexC,ghosts,qm2);
140 indexC[dir] = indexI[dir]-1;
_ArrayIndex1D_(ndims,dim,indexC,ghosts,qm1);
141 indexC[dir] = indexI[dir] ;
_ArrayIndex1D_(ndims,dim,indexC,ghosts,qp1);
155 for (v = 0; v < nvars; v++) {
159 for (k = 0; k < nvars; k++) {
160 m2 += L[v*nvars+k] * fC[qm2*nvars+k];
161 m1 += L[v*nvars+k] * fC[qm1*nvars+k];
162 p1 += L[v*nvars+k] * fC[qp1*nvars+k];
165 double slope_ratio = (m1 - m2) / ((p1 - m1) + 1e-40);
167 fchar[v] = m1 + 0.5 * phi * (p1-m1);
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];
211 double slope_ratio = (p1 - m1) / ((p2 - p1) + 1e-40);
213 fchar[v] = p1 + 0.5 * phi * (p1-p2);
Definitions for the functions computing the interpolated value of the primitive at the cell interface...
#define _ArrayIndexnD_(N, index, imax, i, ghost)
int Interp1PrimSecondOrderMUSCLChar(double *, double *, double *, double *, int, int, void *, void *, int)
2nd order MUSCL scheme (characteristic-based) on a uniform grid
int(* GetRightEigenvectors)(double *, double *, void *, int)
MPI related function definitions.
double(* LimiterFunction)(double)
#define _ArrayIndex1D_(N, imax, i, ghost, index)
int(* AveragingFunction)(double *, double *, double *, void *)
#define MatVecMult(N, y, A, x)
Contains function definitions for common mathematical functions.
int(* GetLeftEigenvectors)(double *, double *, void *, int)
#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.
Contains macros and function definitions for common matrix multiplication.