5 int unknownsPlusAuxiliaryVariables,
7 int numberOfProjectedQuantities,
10 const double* __restrict__ srcQ,
11 double* __restrict__ destQ
14 unknownsPlusAuxiliaryVariables,
16 numberOfProjectedQuantities,
28 const double* __restrict__ quadratureWeights
31 for (
int d=0; d<Dimensions; d++) {
32 result *= cellSize(d) * quadratureWeights[ index(d) ];
40 int nodesPerCell=nodesPerAxis;
41 for(
int d=1; d<Dimensions; d++) {
42 nodesPerCell *= nodesPerAxis;
49 for(
int i=1; i<Dimensions; i++){
50 strides[i] = strides[i-1]*nodesPerAxis;
62 for(
int d=Dimensions-1; d>=0; d--){
63 index[d] = (node - tmp) / strides[d];
64 tmp += strides[d]*index[d];
74 const int orientation,
75 const int nodesPerAxis
95 for(
int dim=0; dim<Dimensions; dim++){
97 HullIndex += indexCell[dim]*stride;
98 stride *= nodesPerAxis;
105 return HullIndex + stride*(2*direction+orientation);
111 const double* __restrict__
const QCell,
112 const double* __restrict__
const derivativeOperator,
114 const int nodesPerAxis,
116 const int scalarIndex,
117 double* __restrict__ gradQ
123 for(
int dim=0; dim<Dimensions; dim++){
125 for(
int var=0; var<strideQ; var++){
126 gradQ[dim*strideQ+var] = 0.0;
129 for(
int node=0; node<nodesPerAxis; node++){
131 const double coeff = invDx * derivativeOperator[node+nodesPerAxis*index[dim]];
132 for(
int var=0; var<strideQ; var++){
133 gradQ[dim*strideQ+var] += coeff*QCell[(scalarIndex + (node-index[dim])*strides[dim])*strideQ + var];
142 double* __restrict__ QOut,
143 const double* __restrict__ Qsubstract,
146 const int auxiliaryVariables
148 const int nodesPerAxis = order+1;
150 const int strideQ = unknowns+auxiliaryVariables;
152 for(
int node=0; node<nodesPerCell; node++){
153 for(
int var=0; var<strideQ; var++){
154 QOut[node*strideQ+var] -= Qsubstract[node*strideQ+var];
161 const double* __restrict__ Q,
164 const int auxiliaryVariables
166 return ::exahype2::fv::plotPatch(
177 const double* __restrict__ Q,
180 const int auxiliaryVariables,
182 int numberOfQuantitiesProjectedOntoFace
184 return ::exahype2::fv::plotPatchOverlap(
189 numberOfQuantitiesProjectedOntoFace,
std::string plotFace(const double *__restrict__ Q, const int order, const int unknowns, const int auxiliaryVariables, int normal, int numberOfQuantitiesProjectedOntoFace)
tarch::la::Vector< Dimensions, int > getStrides(int nodesPerAxis)
void computeGradient(const double *__restrict__ const QCell, const double *__restrict__ const derivativeOperator, const double invDx, const int nodesPerAxis, const int strideQ, const int scalarIndex, double *__restrict__ gradQ)
double getQuadratureWeight(const tarch::la::Vector< 3, double > &cellSize, const tarch::la::Vector< 3, int > &index, const double *__restrict__ quadratureWeights)
Compute integral over shape function over cell defined by index.
tarch::la::Vector< Dimensions, int > getIndex(int node, tarch::la::Vector< Dimensions, int > strides)
int getNodesPerCell(int nodesPerAxis)
The number of nodes in a cell is basically the input to the power of d.
void subtractCell(double *__restrict__ QOut, const double *__restrict__ Qsubstract, const int order, const int unknowns, const int auxiliaryVariables)
void copyOneSideOfFaceProjection(int unknownsPlusAuxiliaryVariables, int order, int numberOfProjectedQuantities, int normal, int isRightFaceHalf, const double *__restrict__ srcQ, double *__restrict__ destQ)
Delegate to PatchUtils of the Finite Volume scheme.
std::string plotCell(const double *__restrict__ Q, const int order, const int unknowns, const int auxiliaryVariables)
int cellIndexToHullIndex(const tarch::la::Vector< Dimensions, int > &indexCell, const int direction, const int orientation, const int nodesPerAxis)
void copyHalfOfHalo(int unknownsPlusAuxiliaryVariables, int numberOfGridCellsPerPatchPerAxis, int haloSize, int normal, bool isRightLayer, const double *__restrict__ srcQ, double *__restrict__ destQ)
A face always holds a left and a right overlap.