Peano 4
Loading...
Searching...
No Matches
CCZ4.h
Go to the documentation of this file.
1//
2// ExaHyPE2 solver file
3// Generated by Peano's Python API
4// www.peano-framework.org
5//
6// This is generated. If you change fundamental properties, you will have to
7// generate this file. Backup your manual changes before you do so.
8//
9#pragma once
10
11#include "AbstractCCZ4.h"
12#include "tarch/logging/Log.h"
13
14
15#include <cstring>
16#include "InitialValues.h"
17
18#include "CCZ4Kernels.h"
19
20
21namespace applications {
22 namespace exahype2 {
23 namespace ccz4 {
24 class CCZ4;
25 }
26 }
27}
28
29
30class applications::exahype2::ccz4::CCZ4: public AbstractCCZ4 {
31 private:
33
34 public:
35 CCZ4();
36
73 const double * __restrict__ Q, // Q[59+0],
74 const tarch::la::Vector<Dimensions,double>& volumeCentre,
76 double t
77 ) override;
78
79#ifdef IncludeTwoPunctures
80 void prepare(TP::TwoPunctures* tp);
81#endif
82
84 double * __restrict__ Q,
85 const tarch::la::Vector<Dimensions,double>& volumeCentre,
87 bool gridIsConstructed
88 ) override;
89
90
91
92
93 virtual void boundaryConditions(
94 const double * __restrict__ Qinside, // Qinside[59+0]
95 double * __restrict__ Qoutside, // Qoutside[59+0]
98 double t,
99 int normal
100 ) override;
101
102
103
104 public:
105
106 void sourceTerm(
107 const double * __restrict__ Q,
108 const tarch::la::Vector<Dimensions,double>& volumeCentre,
110 double t,
111 double dt,
112 double * __restrict__ S
113 ) override;
114
115
116
124 virtual double maxEigenvalue(
125 const double * __restrict__ Q, // Q[59+0],
126 const tarch::la::Vector<Dimensions,double>& faceCentre,
128 double t,
129 double dt,
130 int normal
131 ) override;
132
133
134
135 virtual void nonconservativeProduct(
136 const double * __restrict__ Q, // Q[59+0],
137 const double * __restrict__ deltaQ, // [59+0]
138 const tarch::la::Vector<Dimensions,double>& faceCentre,
140 double t,
141 double dt,
142 int normal,
143 double * __restrict__ BgradQ // BgradQ[59]
144 ) override;
145
146
147
148
163 #if defined(GPUOffloadingOMP)
164 #pragma omp declare target
165 #endif
167 const double * __restrict__ Q,
168 const tarch::la::Vector<Dimensions,double>& volumeCentre,
170 double t,
171 double dt,
172 double * __restrict__ S,
174 ) {
175 tarch::memset(S, 0, NumberOfUnknowns*sizeof(double));
176 source(S,Q, CCZ4LapseType, CCZ4ds, CCZ4c, CCZ4e, CCZ4f, CCZ4bs, CCZ4sk, CCZ4xi, CCZ4itau, CCZ4eta, CCZ4k1, CCZ4k2, CCZ4k3, CCZ4SO);
177 }
178 #if defined(GPUOffloadingOMP)
179 #pragma omp end declare target
180 #endif
181
182
183
184
199 #if defined(GPUOffloadingOMP)
200 #pragma omp declare target
201 #endif
203 const double * __restrict__ Q, // Q[59+0],
204 const tarch::la::Vector<Dimensions,double>& faceCentre,
206 double t,
207 double dt,
208 int normal,
210 ) {
211 const double np = 1.0;
212 #if defined(CCZ4EINSTEIN)
213 const double qmin = std::min({Q[0],Q[3],Q[5]});
214 const double alpha = std::max({1.0, Q[16]}) * std::max({1.0, pow(Q[54],1.0/np)}) / std::sqrt(qmin);
215 #else
216 const double alpha = 1.0;
217 #endif
218
219 constexpr double sqrtwo = 1.4142135623730951;
220 // NOTE parameters are stored in abstract superclass
221 const double tempA = alpha * std::max({sqrtwo, CCZ4e, CCZ4ds, CCZ4GLMc/alpha, CCZ4GLMd/alpha});
222 const double tempB = Q[17+normal];//DOT_PRODUCT(Q(18:20),nv(:))
223 double tem = std::max({1.0, std::abs(-tempA-tempB), std::abs(tempA-tempB)});
224 bool flag = false;
225 return tem;
226 }
227
228 #if defined(GPUOffloadingOMP)
229 #pragma omp end declare target
230 #endif
231
232
233
234
235
236
237
252 #if defined(GPUOffloadingOMP)
253 #pragma omp declare target
254 #endif
256 const double * __restrict__ Q, // Q[5+0],
257 const double * __restrict__ deltaQ, // [5+0]
258 const tarch::la::Vector<Dimensions,double>& faceCentre,
260 double t,
261 double dt,
262 int normal,
263 double * __restrict__ BgradQ, // BgradQ[5]
265 );
266 #if defined(GPUOffloadingOMP)
267 #pragma omp end declare target
268 #endif
269
270};
271
272
#define GPUCallableMethod
Definition accelerator.h:25
virtual void boundaryConditions(const double *__restrict__ Qinside, double *__restrict__ Qoutside, const tarch::la::Vector< Dimensions, double > &faceCentre, const tarch::la::Vector< Dimensions, double > &volumeH, double t, int normal) override
Definition CCZ4.cpp:231
virtual double maxEigenvalue(const double *__restrict__ Q, const tarch::la::Vector< Dimensions, double > &faceCentre, const tarch::la::Vector< Dimensions, double > &volumeH, double t, double dt, int normal) override
Determine max eigenvalue over Jacobian in a given point with solution values (states) Q.
Definition CCZ4.cpp:248
static GPUCallableMethod void nonconservativeProduct(const double *__restrict__ Q, const double *__restrict__ deltaQ, const tarch::la::Vector< Dimensions, double > &faceCentre, const tarch::la::Vector< Dimensions, double > &volumeH, double t, double dt, int normal, double *__restrict__ BgradQ, ::exahype2::Solver::Offloadable)
To obtain the best performance, I recommend to man inline command to this signature and to copy the i...
virtual void nonconservativeProduct(const double *__restrict__ Q, const double *__restrict__ deltaQ, const tarch::la::Vector< Dimensions, double > &faceCentre, const tarch::la::Vector< Dimensions, double > &volumeH, double t, double dt, int normal, double *__restrict__ BgradQ) override
Definition CCZ4.cpp:261
static tarch::logging::Log _log
Definition CCZ4.h:32
static GPUCallableMethod void sourceTerm(const double *__restrict__ Q, const tarch::la::Vector< Dimensions, double > &volumeCentre, const tarch::la::Vector< Dimensions, double > &volumeH, double t, double dt, double *__restrict__ S, ::exahype2::Solver::Offloadable)
To obtain the best performance, I recommend to man inline command to this signature and to copy the i...
Definition CCZ4.h:166
static GPUCallableMethod double maxEigenvalue(const double *__restrict__ Q, const tarch::la::Vector< Dimensions, double > &faceCentre, const tarch::la::Vector< Dimensions, double > &volumeH, double t, double dt, int normal, ::exahype2::Solver::Offloadable)
To obtain the best performance, I recommend to man inline command to this signature and to copy the i...
Definition CCZ4.h:202
::exahype2::RefinementCommand refinementCriterion(const double *__restrict__ Q, const tarch::la::Vector< Dimensions, double > &volumeCentre, const tarch::la::Vector< Dimensions, double > &volumeH, double t) override
Refinement criterion.
Definition CCZ4.cpp:318
void sourceTerm(const double *__restrict__ Q, const tarch::la::Vector< Dimensions, double > &volumeCentre, const tarch::la::Vector< Dimensions, double > &volumeH, double t, double dt, double *__restrict__ S) override
Definition CCZ4.cpp:178
void initialCondition(double *__restrict__ Q, const tarch::la::Vector< Dimensions, double > &volumeCentre, const tarch::la::Vector< Dimensions, double > &volumeH, bool gridIsConstructed) override
Definition CCZ4.cpp:129
Offloadable
This is a "fake" enum, i.e.
Definition Solver.h:32
Log Device.
Definition Log.h:516
KeywordToAvoidDuplicateSymbolsForInlinedFunctions void source(double *S, const double *const Q, const int CCZ4LapseType, const double CCZ4ds, const double CCZ4c, const double CCZ4e, const double CCZ4f, const double CCZ4bs, const double CCZ4sk, const double CCZ4xi, const double CCZ4itau, const double CCZ4eta, const double CCZ4k1, const double CCZ4k2, const double CCZ4k3, const double CCZ4SO) InlineMethod
The source term is one out of two terms that we use in our CCZ4 formulation.
This code is taken from the original ExaHyPE project written by colleagues from the University of Tre...
Definition CCZ4Kernels.h:14
Definition ccz4.py:1
Common routines required for a variety of Riemann solvers.
Definition AderUtils.h:16
double * memset(double *dest, double ch, size_t byteCount)
Alternative GPU-ready version of memset.
Simple vector class.
Definition Vector.h:134