Peano
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>
18
20
21
22namespace applications {
23 namespace exahype2 {
24 namespace ccz4 {
25 class CCZ4;
26 }
27 }
28}
29
30
31class applications::exahype2::ccz4::CCZ4: public AbstractCCZ4 {
32 private:
34
35 public:
37
74 const double * __restrict__ Q, // Q[59+0],
75 const tarch::la::Vector<Dimensions,double>& volumeCentre,
77 double t
78 ) override;
79
80#ifdef IncludeTwoPunctures
81 void prepare(TP::TwoPunctures* tp);
82#endif
83
85 double * __restrict__ Q,
86 const tarch::la::Vector<Dimensions,double>& volumeCentre,
88 bool gridIsConstructed
89 ) override;
90
91
92
93
94 virtual void boundaryConditions(
95 const double * __restrict__ Qinside, // Qinside[59+0]
96 double * __restrict__ Qoutside, // Qoutside[59+0]
99 double t,
100 int normal
101 ) override;
102
103
104
105 public:
106
108 const double * __restrict__ Q,
109 const tarch::la::Vector<Dimensions,double>& volumeCentre,
111 double t,
112 double dt,
113 double * __restrict__ S
114 ) override;
115
116
117
125 virtual void maxEigenvalue(
126 const double * __restrict__ Q, // Q[59+0],
127 const tarch::la::Vector<Dimensions,double>& faceCentre,
129 double t,
130 double dt,
131 int normal,
132 double* __restrict__ maxEigenvalue
133 ) override;
134
135
137 const double * __restrict__ Q, // Q[59+0],
138 const double * __restrict__ deltaQ, // [59+0]
139 const tarch::la::Vector<Dimensions,double>& faceCentre,
141 double t,
142 double dt,
143 int normal,
144 double * __restrict__ BgradQ // BgradQ[59]
145 ) override;
146
147
162 #if defined(GPUOffloadingOMP)
163 #pragma omp declare target
164 #endif
166 const double * __restrict__ Q,
167 const tarch::la::Vector<Dimensions,double>& volumeCentre,
169 double t,
170 double dt,
171 double * __restrict__ S,
173 ) {
174 ::exagrype::ccz4::source(S,Q, CCZ4LapseType, CCZ4ds, CCZ4c, CCZ4e, CCZ4f, CCZ4bs, CCZ4sk, CCZ4xi, CCZ4itau, CCZ4eta, CCZ4k1, CCZ4k2, CCZ4k3, CCZ4SO);
175 }
176 #if defined(GPUOffloadingOMP)
177 #pragma omp end declare target
178 #endif
179
180
195 #if defined(GPUOffloadingOMP)
196 #pragma omp declare target
197 #endif
199 const double * __restrict__ Q, // Q[59+0],
200 const tarch::la::Vector<Dimensions,double>& faceCentre,
202 double t,
203 double dt,
204 int normal,
205 double* __restrict__ maxEigenvalue,
207 ) {
208 const double np = 1.0;
209 #if defined(CCZ4EINSTEIN)
210 const double qmin = std::min({Q[0],Q[3],Q[5]});
211 const double alpha = std::max({1.0, Q[16]}) * std::max({1.0, pow(Q[54],1.0/np)}) / std::sqrt(qmin);
212 #else
213 const double alpha = 1.0;
214 #endif
215
216 constexpr double sqrtwo = 1.4142135623730951;
217 // NOTE parameters are stored in abstract superclass
218 const double tempA = alpha * std::max({sqrtwo, CCZ4e, CCZ4ds, CCZ4GLMc/alpha, CCZ4GLMd/alpha});
219 const double tempB = Q[17+normal];//DOT_PRODUCT(Q(18:20),nv(:))
220 double tem = std::max({1.0, std::abs(-tempA-tempB), std::abs(tempA-tempB)});
221 bool flag = false;
222 maxEigenvalue[0]=tem;
223 }
224
225 #if defined(GPUOffloadingOMP)
226 #pragma omp end declare target
227 #endif
228
243 #if defined(GPUOffloadingOMP)
244 #pragma omp declare target
245 #endif
247 const double * __restrict__ Q, // Q[5+0],
248 const double * __restrict__ deltaQ, // [5+0]
249 const tarch::la::Vector<Dimensions,double>& faceCentre,
251 double t,
252 double dt,
253 int normal,
254 double * __restrict__ BgradQ, // BgradQ[5]
256 );
257 #if defined(GPUOffloadingOMP)
258 #pragma omp end declare target
259 #endif
260
261};
262
263
#define GPUCallableMethod
Definition accelerator.h:27
::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.
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...
static tarch::logging::Log _log
Definition CCZ4.h:33
virtual void 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, double *__restrict__ maxEigenvalue) override
Determine max eigenvalue over Jacobian in a given point with solution values (states) Q.
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
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:165
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
static GPUCallableMethod void 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, double *__restrict__ maxEigenvalue, ::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:198
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
void initialCondition(double *__restrict__ Q, const tarch::la::Vector< Dimensions, double > &volumeCentre, const tarch::la::Vector< Dimensions, double > &volumeH, bool gridIsConstructed) override
Offloadable
This is a "fake" enum, i.e.
Definition Solver.h:37
Log Device.
Definition Log.h:517
Definition ccz4.py:1
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)
The source term is one out of two terms that we use in our CCZ4 formulation.
This file is part of the ExaHyPE 2 project within Peano 4.
Definition __init__.py:1
-test-datastructures This Python script uses/invokes DaStGen2 to generate all the datatypes required ...
Simple vector class.
Definition Vector.h:159