19 #undef _MINIMUM_GHOSTS_
24 #define _MINIMUM_GHOSTS_ 3
103 int ghosts = solver->
ghosts;
104 int ndims = solver->
ndims;
105 int nvars = solver->
nvars;
109 static const double one_sixth = 1.0/6.0;
111 double *ww1, *ww2, *ww3;
112 ww1 = weno->
w1 + (upw < 0 ? 2*weno->size : 0) + (uflag ? weno->
size : 0) + weno->
offset[dir];
113 ww2 = weno->
w2 + (upw < 0 ? 2*weno->size : 0) + (uflag ? weno->
size : 0) + weno->
offset[dir];
114 ww3 = weno->
w3 + (upw < 0 ? 2*weno->size : 0) + (uflag ? weno->
size : 0) + weno->
offset[dir];
118 int indexC[ndims], indexI[ndims], index_outer[ndims], bounds_outer[ndims], bounds_inter[ndims];
119 _ArrayCopy1D_(dim,bounds_outer,ndims); bounds_outer[dir] = 1;
120 _ArrayCopy1D_(dim,bounds_inter,ndims); bounds_inter[dir] += 1;
124 double R[nvars*nvars], L[nvars*nvars], uavg[nvars], fchar[nvars];
126 #pragma omp parallel for schedule(auto) default(shared) private(i,k,v,R,L,uavg,fchar,index_outer,indexC,indexI)
127 for (i=0; i<N_outer; i++) {
132 for (indexI[dir] = 0; indexI[dir] < dim[dir]+1; indexI[dir]++) {
135 int qm1,qm2,qm3,qp1,qp2;
137 indexC[dir] = indexI[dir]-3;
_ArrayIndex1D_(ndims,dim,indexC,ghosts,qm3);
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);
141 indexC[dir] = indexI[dir]+1;
_ArrayIndex1D_(ndims,dim,indexC,ghosts,qp2);
143 indexC[dir] = indexI[dir]+2;
_ArrayIndex1D_(ndims,dim,indexC,ghosts,qm3);
144 indexC[dir] = indexI[dir]+1;
_ArrayIndex1D_(ndims,dim,indexC,ghosts,qm2);
145 indexC[dir] = indexI[dir] ;
_ArrayIndex1D_(ndims,dim,indexC,ghosts,qm1);
146 indexC[dir] = indexI[dir]-1;
_ArrayIndex1D_(ndims,dim,indexC,ghosts,qp1);
147 indexC[dir] = indexI[dir]-2;
_ArrayIndex1D_(ndims,dim,indexC,ghosts,qp2);
161 for (v = 0; v < nvars; v++) {
164 double fm3, fm2, fm1, fp1, fp2;
165 fm3 = fm2 = fm1 = fp1 = fp2 = 0;
166 for (k = 0; k < nvars; k++) {
167 fm3 += L[v*nvars+k] * fC[qm3*nvars+k];
168 fm2 += L[v*nvars+k] * fC[qm2*nvars+k];
169 fm1 += L[v*nvars+k] * fC[qm1*nvars+k];
170 fp1 += L[v*nvars+k] * fC[qp1*nvars+k];
171 fp2 += L[v*nvars+k] * fC[qp2*nvars+k];
176 f1 = (2*one_sixth)*fm3 - (7.0*one_sixth)*fm2 + (11.0*one_sixth)*fm1;
177 f2 = (-one_sixth)*fm2 + (5.0*one_sixth)*fm1 + (2*one_sixth)*fp1;
178 f3 = (2*one_sixth)*fm1 + (5*one_sixth)*fp1 - (one_sixth)*fp2;
182 w1 = *(ww1+p*nvars+v);
183 w2 = *(ww2+p*nvars+v);
184 w3 = *(ww3+p*nvars+v);
187 fchar[v] = w1*f1 + w2*f2 + w3*f3;
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.
Structure of variables/parameters needed by the WENO-type scheme.
#define _ArrayIndex1D_(N, imax, i, ghost, index)
int Interp1PrimFifthOrderWENOChar(double *, double *, double *, double *, int, int, void *, void *, int)
5th order WENO reconstruction (characteristic-based) on a uniform grid
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.
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.