Peano
Loading...
Searching...
No Matches
LoopBody.h
Go to the documentation of this file.
1// This file is part of the ExaHyPE2 project. For conditions of distribution and
2// use, please see the copyright notice at www.peano-framework.org
3#pragma once
4
6#include "KernelVariants.h"
7
11
13
14namespace exahype2 {
15 namespace fd {
16 namespace fd4 {
17 namespace internal {
18
25 #if defined(SharedOMP) and (!defined(__INTEL_LLVM_COMPILER) or !defined(GPUOffloadingOMP))
26 #pragma omp declare simd
27 #endif
28 template <class QInEnumeratorType, class QOutEnumeratorType>
30 double* __restrict__ QIn,
31 const QInEnumeratorType& QInEnumerator,
32 const tarch::la::Vector<Dimensions,double>& patchCentre,
34 int patchIndex,
36 int normal,
37 const QOutEnumeratorType& QOutEnumerator
39
47 #if defined(SharedOMP) and ((!defined(__INTEL_LLVM_COMPILER) and !defined(__clang__) and !defined(__GNUC__)) or !defined(GPUOffloadingOMP))
48 #pragma omp declare simd
49 #endif
50 template <class QInEnumeratorType, class QOutEnumeratorType>
52 const double* __restrict__ QIn,
53 const QInEnumeratorType& QInEnumerator,
54 exahype2::fd::NonconservativeProduct DifferentialSource,
55 const tarch::la::Vector<Dimensions,double>& patchCentre,
57 int patchIndex,
59 double t,
60 double dt,
61 int normal,
62 double* __restrict__ QDiffSrc,
63 const QOutEnumeratorType& QDiffSrcEnumerator,
66
67
68/*
69 * not implemented yet
70 * ===================
71
72 template <>
73 void computeDifferentialSourceTerm_LoopBody(
74 const double* __restrict__ QIn,
75 const exahype2::enumerator::AoSLexicographicEnumerator& QInEnumerator,
76 exahype2::fd::NonconservativeProduct DifferentialSource,
77 const tarch::la::Vector<Dimensions,double>& patchCentre,
78 const tarch::la::Vector<Dimensions,double>& patchSize,
79 int patchIndex,
80 const tarch::la::Vector<Dimensions,int>& volumeIndex,
81 double t,
82 double dt,
83 int normal,
84 double* __restrict__ QDiffSrc,
85 const exahype2::enumerator::AoSLexicographicEnumerator& QDiffSrcEnumerator,
86 DifferentialSourceTermVariant variant
87 ) InlineMethod;
88*/
89
90
94 template <typename Solver, class QInEnumeratorType, class QOutEnumeratorType>
96 const double* __restrict__ QIn,
97 const QInEnumeratorType& QInEnumerator,
98 const tarch::la::Vector<Dimensions,double>& patchCentre,
100 int patchIndex,
102 double t,
103 double dt,
104 int normal,
105 double* __restrict__ QDiffSrc,
106 const QOutEnumeratorType& QDiffSrcEnumerator,
108 ) InlineMethod;
109
110
119 #if defined(SharedOMP) and ((!defined(__INTEL_LLVM_COMPILER) and !defined(__clang__) and !defined(__GNUC__)) or !defined(GPUOffloadingOMP))
120 #pragma omp declare simd
121 #endif
122 #if defined(GPUOffloadingOMP)
123 #pragma omp declare target
124 #endif
125 template <typename QOutEnumeratorType>
127 const double* __restrict__ QDiffSrcX,
128 const double* __restrict__ QDiffSrcY,
129 const double* __restrict__ QDiffSrcZ,
130 const QOutEnumeratorType& QDiffSrcEnumerator,
131 const tarch::la::Vector<Dimensions,double>& patchCentre,
133 int patchIndex,
135 int unknown,
136 double dt,
137 double* __restrict__ QOut,
138 const QOutEnumeratorType& QOutEnumerator
139 ) InlineMethod;
140 #if defined(GPUOffloadingOMP)
141 #pragma omp end declare target
142 #endif
143
151 #if defined(SharedOMP) and ((!defined(__INTEL_LLVM_COMPILER) and !defined(__clang__) and !defined(__GNUC__)) or !defined(GPUOffloadingOMP))
152 #pragma omp declare simd
153 #endif
154 template <class QInEnumeratorType, class QOutEnumeratorType>
156 const double* __restrict__ QIn,
157 const QInEnumeratorType& QInEnumerator,
158 const tarch::la::Vector<Dimensions,double>& patchCentre,
160 int patchIndex,
162 double t,
163 double dt,
164 int normal,
165 double* __restrict__ QKODsp,
166 const QOutEnumeratorType& QKODspEnumerator
167 ) InlineMethod;
168
177 #if defined(SharedOMP) and ((!defined(__INTEL_LLVM_COMPILER) and !defined(__clang__) and !defined(__GNUC__)) or !defined(GPUOffloadingOMP))
178 #pragma omp declare simd
179 #endif
180 #if defined(GPUOffloadingOMP)
181 #pragma omp declare target
182 #endif
183 template <typename QOutEnumeratorType>
185 const double KOSigma,
186 const double* __restrict__ QKODspX,
187 const double* __restrict__ QKODspY,
188 const double* __restrict__ QKODspZ,
189 const QOutEnumeratorType& QKODspEnumerator,
190 const tarch::la::Vector<Dimensions,double>& patchCentre,
192 int patchIndex,
194 int unknown,
195 double dt,
196 double* __restrict__ QOut,
197 const QOutEnumeratorType& QOutEnumerator
198 ) InlineMethod;
199 #if defined(GPUOffloadingOMP)
200 #pragma omp end declare target
201 #endif
202
203
216 #if defined(SharedOMP) and ((!defined(__INTEL_LLVM_COMPILER) and !defined(__clang__) and !defined(__GNUC__)) or !defined(GPUOffloadingOMP))
217 #pragma omp declare simd
218 #endif
219 template <class QInEnumeratorType, class QOutEnumeratorType>
221 const double* __restrict__ QIn,
222 const QInEnumeratorType& QInEnumerator,
224 const tarch::la::Vector<Dimensions,double>& patchCentre,
226 int patchIndex,
228 double t,
229 double dt,
230 int normal,
231 double* __restrict__ QFlux,
232 const QOutEnumeratorType& QFluxEnumerator
233 ) InlineMethod;
234
235
239 template <typename Solver, class QInEnumeratorType, class QOutEnumeratorType>
241 const double* __restrict__ QIn,
242 const QInEnumeratorType& QInEnumerator,
243 const tarch::la::Vector<Dimensions,double>& patchCentre,
245 int patchIndex,
247 double t,
248 double dt,
249 int normal,
250 double* __restrict__ QFlux,
251 const QOutEnumeratorType& QFluxEnumerator
252 ) InlineMethod;
253
254
263 #if defined(SharedOMP) and ((!defined(__INTEL_LLVM_COMPILER) and !defined(__clang__) and !defined(__GNUC__)) or !defined(GPUOffloadingOMP))
264 #pragma omp declare simd
265 #endif
266 #if defined(GPUOffloadingOMP)
267 #pragma omp declare target
268 #endif
269 template <typename QOutEnumeratorType>
271 const double* __restrict__ tempFluxX,
272 const double* __restrict__ tempFluxY,
273 const double* __restrict__ tempFluxZ,
274 const QOutEnumeratorType& fluxEnumerator,
275 const tarch::la::Vector<Dimensions,double>& patchCentre,
277 int patchIndex,
279 int unknown,
280 double dt,
281 double* __restrict__ QOut,
282 const QOutEnumeratorType& QOutEnumerator
283 ) InlineMethod;
284 #if defined(GPUOffloadingOMP)
285 #pragma omp end declare target
286 #endif
287 }
288 }
289 }
290}
291
292#include "LoopBody.cpph"
293
static void computeAuxiliaryVariables_LoopBody(double *__restrict__ QIn, const QInEnumeratorType &QInEnumerator, const tarch::la::Vector< Dimensions, double > &patchCentre, const tarch::la::Vector< Dimensions, double > &patchSize, int patchIndex, const tarch::la::Vector< Dimensions, int > &volumeIndex, int normal, const QOutEnumeratorType &QOutEnumerator) InlineMethod
static void updateSolutionWithFlux_LoopBody(const double *__restrict__ tempFluxX, const double *__restrict__ tempFluxY, const double *__restrict__ tempFluxZ, const QOutEnumeratorType &fluxEnumerator, const tarch::la::Vector< Dimensions, double > &patchCentre, const tarch::la::Vector< Dimensions, double > &patchSize, int patchIndex, const tarch::la::Vector< Dimensions, int > &volumeIndex, int unknown, double dt, double *__restrict__ QOut, const QOutEnumeratorType &QOutEnumerator) InlineMethod
Plain update of flux in a finite differences scheme.
static void computeFlux_LoopBody(const double *__restrict__ QIn, const QInEnumeratorType &QInEnumerator, exahype2::fd::Flux flux, 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, int normal, double *__restrict__ QFlux, const QOutEnumeratorType &QFluxEnumerator) InlineMethod
This routine computes where i is the argument normal.
static void updateSolutionWithDifferentialSourceTerm_LoopBody(const double *__restrict__ QDiffSrcX, const double *__restrict__ QDiffSrcY, const double *__restrict__ QDiffSrcZ, const QOutEnumeratorType &QDiffSrcEnumerator, const tarch::la::Vector< Dimensions, double > &patchCentre, const tarch::la::Vector< Dimensions, double > &patchSize, int patchIndex, const tarch::la::Vector< Dimensions, int > &volumeIndex, int unknown, double dt, double *__restrict__ QOut, const QOutEnumeratorType &QOutEnumerator) InlineMethod
static void updateSolutionWithKODissipationTerm_LoopBody(const double KOSigma, const double *__restrict__ QKODspX, const double *__restrict__ QKODspY, const double *__restrict__ QKODspZ, const QOutEnumeratorType &QKODspEnumerator, const tarch::la::Vector< Dimensions, double > &patchCentre, const tarch::la::Vector< Dimensions, double > &patchSize, int patchIndex, const tarch::la::Vector< Dimensions, int > &volumeIndex, int unknown, double dt, double *__restrict__ QOut, const QOutEnumeratorType &QOutEnumerator) InlineMethod
static void computeKreissOligerDissipationTerm_LoopBody(const double *__restrict__ QIn, const QInEnumeratorType &QInEnumerator, 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, int normal, double *__restrict__ QKODsp, const QOutEnumeratorType &QKODspEnumerator) InlineMethod
static void computeDifferentialSourceTerm_LoopBody(const double *__restrict__ QIn, const QInEnumeratorType &QInEnumerator, exahype2::fd::NonconservativeProduct DifferentialSource, 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, int normal, double *__restrict__ QDiffSrc, const QOutEnumeratorType &QDiffSrcEnumerator, DifferentialSourceTermVariant variant) InlineMethod
This function calculates the source term that involves B_i\nabla_iQ where i is the spatial dimension.
std::function< void(const double *__restrict__ Q, const double *__restrict__ deltaQ, const tarch::la::Vector< Dimensions, double > &gridCellX, const tarch::la::Vector< Dimensions, double > &gridCellH, double t, double dt, int normal, double *__restrict__ DiffSrc) NonconservativeProduct)
Definition Functors.h:41
std::function< void(const double *__restrict__ Q, const tarch::la::Vector< Dimensions, double > &faceCentre, const tarch::la::Vector< Dimensions, double > &gridCellH, double t, double dt, int normal, double *__restrict__ F) Flux)
Definition Functors.h:30
For the generic kernels that I use here most of the time.
Definition CellAccess.h:13
auto volumeIndex(Args... args)
Definition VolumeIndex.h:54
Simple vector class.
Definition Vector.h:150
#define InlineMethod
Generic identifier for inlined functions.
Definition tarch.h:66