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>
17
19
20
21namespace benchmarks {
22 namespace exahype2 {
23 namespace ccz4 {
24 class CCZ4;
25 }
26 }
27}
28
29
30class benchmarks::exahype2::ccz4::CCZ4: public AbstractCCZ4 {
31 private:
33
34 public:
35
37 const double * __restrict__ Q, // Q[59+0],
38 const tarch::la::Vector<Dimensions,double>& volumeCentre,
40 double t
41 ) override;
42
43
45 double * __restrict__ Q,
46 const tarch::la::Vector<Dimensions,double>& volumeCentre,
48 bool gridIsConstructed
49 ) override;
50
51
52
53
54 virtual void boundaryConditions(
55 const double * __restrict__ Qinside, // Qinside[59+0]
56 double * __restrict__ Qoutside, // Qoutside[59+0]
59 double t,
60 int normal
61 ) override;
62
63
64
65 public:
66
68 const double * __restrict__ Q,
69 const tarch::la::Vector<Dimensions,double>& volumeCentre,
71 double t,
72 double dt,
73 double * __restrict__ S
74 ) override;
75
76
77
85 virtual double maxEigenvalue(
86 const double * __restrict__ Q, // Q[59+0],
89 double t,
90 double dt,
91 int normal
92 ) override;
93
94
96 const double * __restrict__ Q, // Q[59+0],
97 const double * __restrict__ deltaQ, // [59+0]
100 double t,
101 double dt,
102 int normal,
103 double * __restrict__ BgradQ // BgradQ[59]
104 ) override;
105
120 #if defined(GPUOffloadingOMP)
121 #pragma omp declare target
122 #endif
124 const double * __restrict__ Q,
125 const tarch::la::Vector<Dimensions,double>& volumeCentre,
127 double t,
128 double dt,
129 double * __restrict__ S,
131 ) {
132 memset(S, 0, NumberOfUnknowns*sizeof(double));
133 exagrype::ccz4::source(S,Q, CCZ4LapseType, CCZ4ds, CCZ4c, CCZ4e, CCZ4f, CCZ4bs, CCZ4sk, CCZ4xi, CCZ4itau, CCZ4eta, CCZ4k1, CCZ4k2, CCZ4k3, CCZ4SO);
134 }
135 #if defined(GPUOffloadingOMP)
136 #pragma omp end declare target
137 #endif
138
153 #if defined(GPUOffloadingOMP)
154 #pragma omp declare target
155 #endif
157 const double * __restrict__ Q, // Q[59+0],
158 const tarch::la::Vector<Dimensions,double>& faceCentre,
160 double t,
161 double dt,
162 int normal,
164 ) {
165 const double np = 1.0;
166 #if defined(CCZ4EINSTEIN)
167 const double qmin = std::min({Q[0],Q[3],Q[5]});
168 const double alpha = std::max({1.0, Q[16]}) * std::max({1.0, pow(Q[54],1.0/np)}) / std::sqrt(qmin);
169 #else
170 const double alpha = 1.0;
171 #endif
172
173 constexpr double sqrtwo = 1.4142135623730951;
174 // NOTE parameters are stored in abstract superclass
175 const double tempA = alpha * std::max({sqrtwo, CCZ4e, CCZ4ds, CCZ4GLMc/alpha, CCZ4GLMd/alpha});
176 const double tempB = Q[17+normal];//DOT_PRODUCT(Q(18:20),nv(:))
177 double tem = std::max({1.0, std::abs(-tempA-tempB), std::abs(tempA-tempB)});
178 bool flag = false;
179 return tem;
180 }
181
182 #if defined(GPUOffloadingOMP)
183 #pragma omp end declare target
184 #endif
185
200 #if defined(GPUOffloadingOMP)
201 #pragma omp declare target
202 #endif
204 const double * __restrict__ Q, // Q[5+0],
205 const double * __restrict__ deltaQ, // [5+0]
206 const tarch::la::Vector<Dimensions,double>& faceCentre,
208 double t,
209 double dt,
210 int normal,
211 double * __restrict__ BgradQ, // BgradQ[5]
213 );
214 #if defined(GPUOffloadingOMP)
215 #pragma omp end declare target
216 #endif
217
218};
219
220
#define GPUCallableMethod
Definition accelerator.h:27
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
void initialCondition(double *__restrict__ Q, const tarch::la::Vector< Dimensions, double > &volumeCentre, const tarch::la::Vector< Dimensions, double > &volumeH, bool gridIsConstructed) override
::exahype2::RefinementCommand refinementCriterion(const double *__restrict__ Q, const tarch::la::Vector< Dimensions, double > &volumeCentre, const tarch::la::Vector< Dimensions, double > &volumeH, double t) override
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.
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:123
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 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 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:156
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
static tarch::logging::Log _log
Definition CCZ4.h:32
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
Simple vector class.
Definition Vector.h:159