20 #undef _MINIMUM_GHOSTS_
25 #define _MINIMUM_GHOSTS_ 2
95 int ghosts = solver->
ghosts;
96 int ndims = solver->
ndims;
97 int nvars = solver->
nvars;
102 int indexC[ndims], indexI[ndims], index_outer[ndims], bounds_outer[ndims], bounds_inter[ndims];
103 _ArrayCopy1D_(dim,bounds_outer,ndims); bounds_outer[dir] = 1;
104 _ArrayCopy1D_(dim,bounds_inter,ndims); bounds_inter[dir] += 1;
108 double R[nvars*nvars], L[nvars*nvars], uavg[nvars], fchar[nvars];
110 static const double c1 = 7.0 / 12.0;
111 static const double c2 = -1.0 / 12.0;
113 #pragma omp parallel for schedule(auto) default(shared) private(i,k,v,R,L,uavg,fchar,index_outer,indexC,indexI)
114 for (i=0; i<N_outer; i++) {
119 for (indexI[dir] = 0; indexI[dir] < dim[dir]+1; indexI[dir]++) {
121 int pLL, pL, pR, pRR;
122 indexC[dir] = indexI[dir]-2;
_ArrayIndex1D_(ndims,dim,indexC,ghosts,pLL);
123 indexC[dir] = indexI[dir]-1;
_ArrayIndex1D_(ndims,dim,indexC,ghosts,pL );
124 indexC[dir] = indexI[dir] ;
_ArrayIndex1D_(ndims,dim,indexC,ghosts,pR );
125 indexC[dir] = indexI[dir]+1;
_ArrayIndex1D_(ndims,dim,indexC,ghosts,pRR);
137 for (v = 0; v < nvars; v++) {
140 double fcLL = 0, fcL = 0, fcR = 0, fcRR = 0;
141 for (k = 0; k < nvars; k++) {
142 fcLL += L[v*nvars+k] * fC[pLL*nvars+k];
143 fcL += L[v*nvars+k] * fC[pL *nvars+k];
144 fcR += L[v*nvars+k] * fC[pR *nvars+k];
145 fcRR += L[v*nvars+k] * fC[pRR*nvars+k];
149 fchar[v] = c2*fcLL + c1*fcL + c1*fcR + c2*fcRR;
Definitions for the functions computing the interpolated value of the primitive at the cell interface...
#define _ArrayIndexnD_(N, index, imax, i, ghost)
int(* GetRightEigenvectors)(double *, double *, void *, int)
MPI related function definitions.
#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 Interp1PrimFourthOrderCentralChar(double *, double *, double *, double *, int, int, void *, void *, int)
4th order central reconstruction (characteristic-based) on a uniform grid
int(* GetLeftEigenvectors)(double *, double *, void *, int)
#define _ArrayCopy1D_(x, y, size)
Contains structure definition for hypar.
Some basic definitions and macros.
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.