Peano
Loading...
Searching...
No Matches
SelfSimilarInfallFV.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 "../../../../applications/exahype2/euler/EulerKernels.h"
12#include "AbstractSelfSimilarInfallFV.h"
13#include "tarch/logging/Log.h"
14
15#include "spherical-accretion/MassAccumulator.h"
16#include "spherical-accretion/GravityModel.h"
17
18
19
20namespace benchmarks {
21 namespace exahype2 {
22 namespace euler {
23 namespace sphericalaccretionupscaling {
24 class SelfSimilarInfallFV;
25 }
26 }
27 }
28}
29
30
31class benchmarks::exahype2::euler::sphericalaccretionupscaling::SelfSimilarInfallFV: public benchmarks::exahype2::euler::sphericalaccretionupscaling::AbstractSelfSimilarInfallFV {
32 private:
34
39
45 public:
46 static constexpr double BaseDensity = 0.1;
47 static constexpr double Gamma = 5.0/3.0;
48 static constexpr double pInitial = 1e-6;
49 static constexpr double aInitial = 0.001;
50 static constexpr double AdditionalMass = 0.15;
51 static constexpr double InitialTopHatRadius = 0.05;
52
54
59 const tarch::la::Vector<Dimensions,double>& volumeCentre,
61 double density
62 );
63
64
76 double * __restrict__ Q,
77 const tarch::la::Vector<Dimensions,double>& volumeCentre,
79 bool gridIsConstructed
80 ) override;
81
82
89 virtual void boundaryConditions(
90 const double * __restrict__ Qinside,
91 double * __restrict__ Qoutside,
94 double t,
95 int normal
96 ) override;
97
98
114 const double * __restrict__ Q,
115 const tarch::la::Vector<Dimensions,double>& volumeCentre,
117 double t,
118 double dt,
119 double * __restrict__ S
120 ) override;
121
122
132 virtual double maxEigenvalue(
133 const double * __restrict__ Q,
134 const tarch::la::Vector<Dimensions,double>& faceCentre,
136 double t,
137 double dt,
138 int normal
139 ) override;
140
141
146 virtual void flux(
147 const double * __restrict__ Q, // Q[5+0],
148 const tarch::la::Vector<Dimensions,double>& faceCentre,
150 double t,
151 double dt,
152 int normal,
153 double * __restrict__ F // F[5]
154 ) override;
155
156
158 const double * __restrict__ Q, // Q[5+0],
159 const tarch::la::Vector<Dimensions,double>& volumeCentre,
161 double t
162 ) override;
163
164
170 void finishTimeStep() override;
171
172
178 #if defined(GPUOffloadingOMP)
179 #pragma omp declare target
180 #endif
182 const double * __restrict__ Q,
183 const tarch::la::Vector<Dimensions,double>& volumeCentre,
185 double t,
186 double dt,
187 double * __restrict__ S,
188 Offloadable
189 ) {
190 for (int i=0; i<NumberOfUnknowns; i++) {
191 S[i] = 0.0;
192 }
193
195 S,
196 volumeCentre,
197 Q,
199 aInitial,
200 t
201 );
202 }
203 #if defined(GPUOffloadingOMP)
204 #pragma omp end declare target
205 #endif
206
207
212 #if defined(GPUOffloadingOMP)
213 #pragma omp declare target
214 #endif
216 const double * __restrict__ Q, // Q[5+0],
217 const tarch::la::Vector<Dimensions,double>& faceCentre,
219 double t,
220 double dt,
221 int normal,
222 Offloadable
223 ) {
224 return ::applications::exahype2::euler::maxEigenvalue(
225 Q,
226 faceCentre,
227 volumeH,
228 t,
229 dt,
230 normal,
231 NumberOfUnknowns,
232 NumberOfAuxiliaryVariables,
233 Gamma
234 );
235 }
236 #if defined(GPUOffloadingOMP)
237 #pragma omp end declare target
238 #endif
239
240
241
242
247 #if defined(GPUOffloadingOMP)
248 #pragma omp declare target
249 #endif
251 const double * __restrict__ Q, // Q[5+0],
252 const tarch::la::Vector<Dimensions,double>& faceCentre,
254 double t,
255 double dt,
256 int normal,
257 double * __restrict__ F, // F[5]
258 Offloadable
259 ) {
261 Q,
262 faceCentre,
263 volumeH,
264 t,
265 dt,
266 normal,
267 NumberOfUnknowns,
268 NumberOfAuxiliaryVariables,
269 F,
270 Gamma
271 );
272 }
273 #if defined(GPUOffloadingOMP)
274 #pragma omp end declare target
275 #endif
276
277
282 const tarch::la::Vector<Dimensions,double>& patchCentre,
284 double t,
285 double dt
286 ) const override;
287
288// Die Information was ausserhalb liegt, wird noch net im guard genutzt
289};
290
291
#define GPUCallableMethod
Definition accelerator.h:27
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, Offloadable)
Manually inlined.
void addDensity(const tarch::la::Vector< Dimensions, double > &volumeCentre, const tarch::la::Vector< Dimensions, double > &volumeH, double density)
Add density of one voxel to global bookkeeping.
static double TotalMassInPreviousTimeStep
After each time step, we backup the total mass in this static variable.
void initialCondition(double *__restrict__ Q, const tarch::la::Vector< Dimensions, double > &volumeCentre, const tarch::la::Vector< Dimensions, double > &volumeH, bool gridIsConstructed) override
We start with a top hat overdensity.
void finishTimeStep() override
According to the docu, I always call the superclass routine.
bool patchCanUseStatelessPDETerms(const tarch::la::Vector< Dimensions, double > &patchCentre, const tarch::la::Vector< Dimensions, double > &patchH, double t, double dt) const override
Outside of the critical area, we can use the stateless PDE terms.
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, Offloadable)
Manually inlined version of the source term.
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
Apply Neumann boundary conditions.
::exahype2::RefinementCommand refinementCriterion(const double *__restrict__ Q, const tarch::la::Vector< Dimensions, double > &volumeCentre, const tarch::la::Vector< Dimensions, double > &volumeH, double t) override
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
Fake source term.
virtual void flux(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__ F) override
Same story again: This is the standard Euler flux which is independent of any modification of the rig...
::applications::exahype2::euler::sphericalaccretion::MassAccumulator _accumulator
Use class from application folders.
static GPUCallableMethod void flux(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__ F, Offloadable)
Manually inlined.
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.
Log Device.
Definition Log.h:517
void addGravitationalSource_AlphaCDM(double *__restrict__ S, const tarch::la::Vector< Dimensions, double > &x, const double *__restrict__ Q, double mass, double aInitial, double t)
static GPUCallableInlineMethod void flux(const double *const __restrict__ Q, const tarch::la::Vector< Dimensions, double > &x, const tarch::la::Vector< Dimensions, double > &h, const double t, const double dt, const int normal, double *const __restrict__ F) InlineMethod
Definition euler.py:1
This file is part of the ExaHyPE 2 project within Peano 4.
Definition __init__.py:1
Simple vector class.
Definition Vector.h:159