8#if defined(GPUOffloadingOMP)
9#pragma omp declare target
11template <
class QInEnumeratorType,
class QOutEnumeratorType>
13 const double* __restrict__ QIn,
14 const QInEnumeratorType& QInEnumerator,
18 double* __restrict__ QOut,
19 const QOutEnumeratorType& QOutEnumerator
21 QOut[ QOutEnumerator(patchIndex,volumeIndex,unknown) ] = QIn[ QInEnumerator(patchIndex,volumeIndex,unknown) ];
23#if defined(GPUOffloadingOMP)
24#pragma omp end declare target
27#if defined(GPUOffloadingOMP)
28#pragma omp declare target
30template <
class QOutEnumeratorType>
35 double* __restrict__ QOut,
36 const QOutEnumeratorType& QOutEnumerator
38 QOut[ QOutEnumerator(patchIndex,volumeIndex,unknown) ] = 0.0;
40#if defined(GPUOffloadingOMP)
41#pragma omp end declare target
44template <
class QInEnumeratorType,
class QOutEnumeratorType>
46 const double* __restrict__ QIn,
47 const QInEnumeratorType& QInEnumerator,
55 double* __restrict__ QOut,
56 const QOutEnumeratorType& QOutEnumerator
58 double* QInGathered =
new double[QInEnumerator._unknowns+QInEnumerator._numberOfAuxiliaryVariables];
59 double* QAlgebraicSourceGathered =
new double[QInEnumerator._unknowns];
62 for (
int unknown=0; unknown<QInEnumerator._unknowns+QInEnumerator._numberOfAuxiliaryVariables; unknown++) {
63 QInGathered[unknown] = QIn[ QInEnumerator(patchIndex,volumeIndex,unknown) ];
72 QAlgebraicSourceGathered
75 for (
int unknown=0; unknown<QOutEnumerator._unknowns; unknown++) {
76 QOut[ QOutEnumerator(patchIndex,volumeIndex,unknown) ] +=
dt * QAlgebraicSourceGathered[unknown];
78 QOut[ QOutEnumerator(patchIndex, volumeIndex,unknown) ]==QOut[ QOutEnumerator(patchIndex, volumeIndex,unknown) ],
79 dt, unknown, volumeIndex,
80 QOutEnumerator(patchIndex,volumeIndex,unknown)
85 delete[] QAlgebraicSourceGathered;
88template <
typename Solver,
class QInEnumeratorType,
class QOutEnumeratorType>
90 const double* __restrict__ QIn,
91 const QInEnumeratorType& QInEnumerator,
98 double* __restrict__ QOut,
99 const QOutEnumeratorType& QOutEnumerator
101 double* QInGathered =
new double[QInEnumerator._unknowns+QInEnumerator._numberOfAuxiliaryVariables];
102 double* QAlgebraicSourceGathered =
new double[QInEnumerator._unknowns];
105 for (
int unknown=0; unknown<QInEnumerator._unknowns+QInEnumerator._numberOfAuxiliaryVariables; unknown++) {
106 QInGathered[unknown] = QIn[ QInEnumerator(patchIndex,volumeIndex,unknown) ];
115 QAlgebraicSourceGathered,
119 for (
int unknown=0; unknown<QOutEnumerator._unknowns; unknown++) {
120 QOut[ QOutEnumerator(patchIndex,volumeIndex,unknown) ] +=
dt * QAlgebraicSourceGathered[unknown];
122 QOut[ QOutEnumerator(patchIndex, volumeIndex,unknown) ]==QOut[ QOutEnumerator(patchIndex, volumeIndex,unknown) ],
123 dt, unknown, volumeIndex,
124 QOutEnumerator(patchIndex,volumeIndex,unknown)
128 delete[] QInGathered;
129 delete[] QAlgebraicSourceGathered;
132template <
typename Solver>
134 const double* __restrict__ QIn,
142 double* __restrict__ QOut,
145 double* QAlgebraicSourceGathered =
new double[QInEnumerator.
_unknowns];
148 & (QIn[ QInEnumerator(patchIndex,volumeIndex,0) ]),
153 QAlgebraicSourceGathered,
157 for (
int unknown=0; unknown<QOutEnumerator.
_unknowns; unknown++) {
158 QOut[ QOutEnumerator(patchIndex,volumeIndex,unknown) ] +=
dt * QAlgebraicSourceGathered[unknown];
160 QOut[ QOutEnumerator(patchIndex, volumeIndex,unknown) ]==QOut[ QOutEnumerator(patchIndex, volumeIndex,unknown) ],
161 dt, unknown, volumeIndex,
162 QOutEnumerator(patchIndex,volumeIndex,unknown)
166 delete[] QAlgebraicSourceGathered;
169template <
class QOutEnumeratorType>
171 const double* __restrict__ QOut,
172 const QOutEnumeratorType& QOutEnumerator,
181 double* QGathered =
new double[QOutEnumerator._unknowns+QOutEnumerator._numberOfAuxiliaryVariables];
184 #if defined(SharedOMP)
187 for (
int unknown=0; unknown<QOutEnumerator._unknowns+QOutEnumerator._numberOfAuxiliaryVariables; unknown++) {
188 QGathered[unknown] = QOut[ QOutEnumerator(patchIndex,volumeIndex,unknown) ];
212template <
typename Solver>
214 const double* __restrict__ QOut,
227 Solver::maxEigenvalue(
228 &( QOut[ QOutEnumerator(patchIndex,volumeIndex,0) ] ),
#define assertion4(expr, param0, param1, param2, param3)
KeywordToAvoidDuplicateSymbolsForInlinedFunctions double maxEigenvalue(const double *const Q, int normal, const double CCZ4e, const double CCZ4ds, const double CCZ4GLMc, const double CCZ4GLMd) InlineMethod
static void copySolution_LoopBody(const double *__restrict__ QIn, const QInEnumeratorType &QInEnumerator, int patchIndex, const tarch::la::Vector< Dimensions, int > &volumeIndex, int unknown, double *__restrict__ QOut, const QOutEnumeratorType &QOutEnumerator) InlineMethod
static void addAlgebraicSourceTerm_LoopBody(const double *__restrict__ QIn, const QInEnumeratorType &QInEnumerator, exahype2::fd::Source AlgebraicSource, const tarch::la::Vector< Dimensions, double > &patchCentre, const tarch::la::Vector< Dimensions, double > &patchSize, int patchIndex, const tarch::la::Vector< Dimensions, int > &volumeIndex, double t, double dt, double *__restrict__ QOut, const QOutEnumeratorType &QOutEnumerator) InlineMethod
Copy previous solution over into new time step and add source term.
static void clearSolution_LoopBody(int patchIndex, const tarch::la::Vector< Dimensions, int > &volumeIndex, int unknown, double *__restrict__ QOut, const QOutEnumeratorType &QOutEnumerator) InlineMethod
The complicated way to write =0.
static double reduceMaxEigenvalue_LoopBody(const double *__restrict__ QOut, const QOutEnumeratorType &QOutEnumerator, exahype2::fd::MaxEigenvalue maxEigenvalue, const tarch::la::Vector< Dimensions, double > &patchCentre, const tarch::la::Vector< Dimensions, double > &patchSize, int patchIndex, const tarch::la::Vector< Dimensions, int > &volumeIndex, double t, double dt) InlineMethod
std::function< void(const double *__restrict__ Q, const tarch::la::Vector< Dimensions, double > &gridCellX, const tarch::la::Vector< Dimensions, double > &gridCellH, double t, double dt, double *__restrict__ AlgeSrc) Source)
static tarch::la::Vector< 2, double > getGridCellCentre(const tarch::la::Vector< 2, double > &x, const tarch::la::Vector< 2, double > &h, int numberOfGridCellsPerPatchPerAxis, const tarch::la::Vector< 2, int > &index)
In ExaHyPE's Finite Volume setup, a cell hosts a patch of Finite Volumes.
static tarch::la::Vector< 2, double > getGridCellSize(const tarch::la::Vector< 2, double > &h, int numberOfGridCellsPerPatchPerAxis)
std::function< double(const double *__restrict__ Q, const tarch::la::Vector< Dimensions, double > &gridCellX, const tarch::la::Vector< Dimensions, double > &gridCellH, double t, double dt, int normal) MaxEigenvalue)
The max eigenvalue is used if and only if you have adaptive time stepping.
Array of struct enumerator.
const int _numberOfDoFsPerAxisInCell