Peano
Loading...
Searching...
No Matches
SelfSimilarInfallDG.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 "AbstractSelfSimilarInfallDG.h"
12
13#include "tarch/logging/Log.h"
15
16#include "spherical-accretion/MassAccumulator.h"
17#include "spherical-accretion/GravityModel.h"
18
19#include "EulerKernels.h"
20
21
22namespace benchmarks {namespace exahype2 {namespace euler {namespace sphericalaccretionupscaling {
24
25}}}}
26
27
29 private:
31
36
42 public:
43 static constexpr double BaseDensity = 0.1;
44 static constexpr double Gamma = 5.0/3.0;
45 static constexpr double pInitial = 1e-6;
46 static constexpr double aInitial = 0.001;
47 static constexpr double AdditionalMass = 0.15;
48 static constexpr double InitialTopHatRadius = 0.05;
49
51
59 const tarch::la::Vector<3,double>& cellSize,
60 const tarch::la::Vector<3,int>& index,
61 double density
62 );
63
64
66 double * __restrict__ Q,
70 bool gridIsConstructed
71 ) override;
72
73
74 virtual void boundaryConditions(
75 const double * __restrict__ Qinside, // Qinside[5+0]
76 double * __restrict__ Qoutside, // Qoutside[5+0]
78 double t,
79 int normal
80 ) override;
81
82
84 const double * __restrict__ Q,
86 double t,
87 double dt,
88 double * __restrict__ S
89 ) override;
90
91
99 virtual double maxEigenvalue(
100 const double * __restrict__ Q, // Q[5+0],
102 double t,
103 double dt,
104 int normal
105 ) override;
106
107
108 virtual void flux(
109 const double * __restrict__ Q, // Q[5+0],
111 double t,
112 double dt,
113 int normal,
114 double * __restrict__ F // F[5]
115 ) override;
116
117
127 const double * __restrict__ Q, // Q[5+0]
130 double t
131 ) override;
132
133
139 void finishTimeStep() override;
140
142 const tarch::la::Vector<Dimensions,double>& patchCentre,
144 double t,
145 double dt
146 ) const override;
147
148
154 #if defined(GPUOffloadingOMP)
155 #pragma omp declare target
156 #endif
158 const double * __restrict__ Q,
160 double t,
161 double dt,
162 double * __restrict__ S,
163 Offloadable
164 ) {
165 for (int i=0; i<NumberOfUnknowns; i++) {
166 S[i] = 0.0;
167 }
168
170 S,
171 x,
172 Q,
174 aInitial,
175 t
176 );
177 }
178 #if defined(GPUOffloadingOMP)
179 #pragma omp end declare target
180 #endif
181
186 #if defined(GPUOffloadingOMP)
187 #pragma omp declare target
188 #endif
190 const double * __restrict__ Q, // Q[5+0],
192 double t,
193 double dt,
194 int normal,
195 double * __restrict__ F, // F[5]
196 Offloadable
197 ) {
199 Q,
200 x,
201 0.0, // no volume, as point-wise
202 t,
203 dt,
204 normal,
205 NumberOfUnknowns,
206 NumberOfAuxiliaryVariables,
207 F,
208 Gamma
209 );
210 }
211 #if defined(GPUOffloadingOMP)
212 #pragma omp end declare target
213 #endif
214};
215
216
#define GPUCallableMethod
Definition accelerator.h:27
virtual void flux(const double *__restrict__ Q, const tarch::la::Vector< Dimensions, double > &x, double t, double dt, int normal, double *__restrict__ F) override
static GPUCallableMethod void flux(const double *__restrict__ Q, const tarch::la::Vector< Dimensions, double > &x, double t, double dt, int normal, double *__restrict__ F, Offloadable)
Manually inlined.
::exahype2::RefinementCommand refinementCriterion(const double *__restrict__ Q, const tarch::la::Vector< Dimensions, double > &x, const tarch::la::Vector< Dimensions, double > &h, double t) override
Evaluate refinement criterion over cell.
static GPUCallableMethod void sourceTerm(const double *__restrict__ Q, const tarch::la::Vector< Dimensions, double > &x, double t, double dt, double *__restrict__ S, Offloadable)
Manually inlined version of the source term.
void finishTimeStep() override
According to the docu, I always call the superclass routine.
void initialCondition(double *__restrict__ Q, const tarch::la::Vector< Dimensions, double > &x, const tarch::la::Vector< Dimensions, double > &h, const tarch::la::Vector< Dimensions, int > &index, bool gridIsConstructed) override
static double TotalMassInPreviousTimeStep
After each time step, we backup the total mass in this static variable.
bool cellCanUseStatelessPDETerms(const tarch::la::Vector< Dimensions, double > &patchCentre, const tarch::la::Vector< Dimensions, double > &patchH, double t, double dt) const override
::applications::exahype2::euler::sphericalaccretion::MassAccumulator _accumulator
Use class from application folders.
virtual double maxEigenvalue(const double *__restrict__ Q, const tarch::la::Vector< Dimensions, double > &x, double t, double dt, int normal) 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 > &x, double t, int normal) override
void sourceTerm(const double *__restrict__ Q, const tarch::la::Vector< Dimensions, double > &x, double t, double dt, double *__restrict__ S) override
void addDensity(const tarch::la::Vector< Dimensions, double > &x, const tarch::la::Vector< 3, double > &cellSize, const tarch::la::Vector< 3, int > &index, double density)
Add mass corresponding to one degree of freedom.
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