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
5#include "Functors.h"
6
7#include "exahype2/CellData.h"
8
12
14
15namespace exahype2 {
16 namespace fd {
18
24 int numberOfGridCellsPerPatchPerAxis,
25 int overlap,
26 int unknowns,
27 int auxiliaryVariables,
28 MaxEigenvalue maxEigenvalue
29 );
30
31 namespace internal {
32 #if defined(SharedOMP) and ((!defined(__INTEL_LLVM_COMPILER) and !defined(__clang__) and !defined(__GNUC__)) or !defined(GPUOffloadingOMP))
33 #pragma omp declare simd
34 #endif
35 #if defined(GPUOffloadingOMP)
36 #pragma omp declare target
37 #endif
38 template <class QInEnumeratorType, class QOutEnumeratorType>
40 const double* __restrict__ QIn,
41 const QInEnumeratorType& QInEnumerator,
42 int patchIndex,
44 int unknown,
45 double* __restrict__ QOut,
46 const QOutEnumeratorType& QOutEnumerator
48 #if defined(GPUOffloadingOMP)
49 #pragma omp end declare target
50 #endif
51
55 #if defined(SharedOMP) and ((!defined(__INTEL_LLVM_COMPILER) and !defined(__clang__) and !defined(__GNUC__)) or !defined(GPUOffloadingOMP))
56 #pragma omp declare simd
57 #endif
58 #if defined(GPUOffloadingOMP)
59 #pragma omp declare target
60 #endif
61 template <class QOutEnumeratorType>
63 int patchIndex,
65 int unknown,
66 double* __restrict__ QOut,
67 const QOutEnumeratorType& QOutEnumerator
69 #if defined(GPUOffloadingOMP)
70 #pragma omp end declare target
71 #endif
72
95 template <class QInEnumeratorType, class QOutEnumeratorType>
97 const double* __restrict__ QIn,
98 const QInEnumeratorType& QInEnumerator,
99 exahype2::fd::Source AlgebraicSource,
100 const tarch::la::Vector<Dimensions,double>& patchCentre,
102 int patchIndex,
104 double t,
105 double dt,
106 double* __restrict__ QOut,
107 const QOutEnumeratorType& QOutEnumerator
108 ) InlineMethod;
109
114 template <typename Solver, class QInEnumeratorType, class QOutEnumeratorType>
116 const double* __restrict__ QIn,
117 const QInEnumeratorType& QInEnumerator,
118 const tarch::la::Vector<Dimensions,double>& patchCentre,
120 int patchIndex,
122 double t,
123 double dt,
124 double* __restrict__ QOut,
125 const QOutEnumeratorType& QOutEnumerator
126 ) InlineMethod;
127
131 template <typename Solver>
133 const double* __restrict__ QIn,
135 const tarch::la::Vector<Dimensions,double>& patchCentre,
137 int patchIndex,
139 double t,
140 double dt,
141 double* __restrict__ QOut,
143 ) InlineMethod;
144
145 template <class QOutEnumeratorType>
147 const double* __restrict__ QOut,
148 const QOutEnumeratorType& QOutEnumerator,
149 exahype2::fd::MaxEigenvalue maxEigenvalue,
150 const tarch::la::Vector<Dimensions,double>& patchCentre,
152 int patchIndex,
154 double t,
155 double dt
156 ) InlineMethod;
157
161 template <>
163 const double* __restrict__ QOut,
165 exahype2::fd::MaxEigenvalue maxEigenvalue,
166 const tarch::la::Vector<Dimensions,double>& patchCentre,
168 int patchIndex,
170 double t,
171 double dt
172 ) InlineMethod;
173
177 template <typename Solver, class QOutEnumeratorType>
179 const double* __restrict__ QOut,
180 const QOutEnumeratorType& QOutEnumerator,
181 const tarch::la::Vector<Dimensions,double>& patchCentre,
183 int patchIndex,
185 double t,
186 double dt
187 ) InlineMethod;
188
192 template <typename Solver>
194 const double* __restrict__ QOut,
196 const tarch::la::Vector<Dimensions,double>& patchCentre,
198 int patchIndex,
200 double t,
201 double dt
202 ) InlineMethod;
203 }
204 }
205}
206
207#include "LoopBody.cpph"
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)
Definition Functors.h:20
void reduceMaxEigenvalue_patchwise_functors(::exahype2::CellData< double, double > &patchData, int numberOfGridCellsPerPatchPerAxis, int overlap, int unknowns, int auxiliaryVariables, MaxEigenvalue maxEigenvalue)
Definition LoopBody.cpp:5
constexpr int PickAllEntriesFromOutputVector
Definition LoopBody.h:17
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.
Definition Functors.h:53
For the generic kernels that I use here most of the time.
Definition CellAccess.h:13
auto volumeIndex(Args... args)
Definition VolumeIndex.h:54
Representation of a number of cells which contains all information that's required to process the sto...
Definition CellData.h:77
Simple vector class.
Definition Vector.h:150
#define InlineMethod
Generic identifier for inlined functions.
Definition tarch.h:66