Peano
Loading...
Searching...
No Matches
SSInfall.h
Go to the documentation of this file.
1#pragma once
2
3#include <iomanip>
4
5#include "AbstractSSInfall.h"
6#include "tarch/logging/Log.h"
7
9 class SSInfall;
10} // namespace applications::exahype2::euler::sphericalaccretion
11
12
14private:
16
17 std::string plotGlobalMTot(bool plotCopy) const;
18 std::string plotRs() const;
19
20#if defined(GPUOffloadingOMP)
21#pragma omp declare target
22#endif
27 static double _rMax;
28
33 static double _rhoMax;
34
38 static double _mTotMax;
39
40 // @todo I've just removed this field. Couldn't find out where it is used.
41 // double t_record=0.0;
42
43#if defined(GPUOffloadingOMP)
44#pragma omp end declare target
45#endif
46
50 double getInitialMIn(double r_coord) const;
51
58 static double getForceDensityNorm(double r_coord, double m_in, double t, double density, double a_input);
59
60public:
62
64 double globalMinTimeStamp, double globalMaxTimeStamp, double globalMinTimeStepSize, double globalMaxTimeStepSize
65 ) override;
66
67 void finishTimeStep() override;
68
70 const double* __restrict__ Q, // Q[5+0],
71 const tarch::la::Vector<Dimensions, double>& volumeCentre,
73 double t
74 ) override;
75
76
78 double* __restrict__ Q,
79 const tarch::la::Vector<Dimensions, double>& volumeCentre,
81 bool gridIsConstructed
82 ) override;
83
84
90 const double* __restrict__ Q,
91 const tarch::la::Vector<Dimensions, double>& volumeCentre,
93 double t,
94 double dt,
95 double* __restrict__ S
96 ) override;
97
98
99#if defined(GPUOffloadingOMP)
100#pragma omp declare target
101#endif
106 static 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 Offloadable
114 );
115#if defined(GPUOffloadingOMP)
116#pragma omp end declare target
117#endif
118
119
120 virtual void boundaryConditions(
121 const double* __restrict__ Qinside, // Qinside[5+0]
122 double* __restrict__ Qoutside, // Qoutside[5+0]
125 double t,
126 int normal
127 ) override;
128
129
133 virtual double maxEigenvalue(
134 const double* __restrict__ Q, // Q[5+0],
137 double t,
138 double dt,
139 int normal
140 ) override;
141
142
143#if defined(GPUOffloadingOMP)
144#pragma omp declare target
145#endif
146 static double maxEigenvalue(
147 const double* __restrict__ Q, // Q[5+0],
150 double t,
151 double dt,
152 int normal,
153 Offloadable
154 );
155#if defined(GPUOffloadingOMP)
156#pragma omp end declare target
157#endif
158
167 virtual void flux(
168 const double* __restrict__ Q, // Q[5+0],
171 double t,
172 double dt,
173 int normal,
174 double* __restrict__ F // F[5]
175 ) override;
176
177
178#if defined(GPUOffloadingOMP)
179#pragma omp declare target
180#endif
181 static void flux(
182 const double* __restrict__ Q, // Q[5+0],
185 double t,
186 double dt,
187 int normal,
188 double* __restrict__ F, // F[5]
189 Offloadable
190 );
191#if defined(GPUOffloadingOMP)
192#pragma omp end declare target
193#endif
194
195
196 void add_mass(const double r_coor, const double rho, const double size);
197
198 double mass_interpolate(const double r_coor, const int MassCal);
199
206 const tarch::la::Vector<Dimensions, double>& patchCentre,
208 double t,
209 double dt
210 ) const;
211
212
230 ) const;
231};
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
The flux in the SSInfall does not depend on any variable of the solver.
static double _rMax
This is a straight 1:1 copy of r_s[sample_number-1].
Definition SSInfall.h:27
static 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)
This is the variation that's used on the GPU.
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
bool isOutsideOfLargestRadius(const tarch::la::Vector< Dimensions, double > &patchCentre, const tarch::la::Vector< Dimensions, double > &patchH) const
This is a very conservative routine.
static double _rhoMax
This is a straight 1:1 copy of rho_x[sample_number-1].
Definition SSInfall.h:33
void add_mass(const double r_coor, const double rho, const double size)
static const tarch::la::Vector< Dimensions, double > OverDensityCentre
Definition SSInfall.h:61
::exahype2::RefinementCommand refinementCriterion(const double *__restrict__ Q, const tarch::la::Vector< Dimensions, double > &volumeCentre, const tarch::la::Vector< Dimensions, double > &volumeH, double t) override
static 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)
static 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)
static double getForceDensityNorm(double r_coord, double m_in, double t, double density, double a_input)
double getInitialMIn(double r_coord) const
Returns m_in for time t=0.
static double _mTotMax
From m_tot_copy[sample_number-1].
Definition SSInfall.h:38
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
See flux() for a description why there are two maxEigenvalue() versions.
double mass_interpolate(const double r_coor, const int MassCal)
void initialCondition(double *__restrict__ Q, const tarch::la::Vector< Dimensions, double > &volumeCentre, const tarch::la::Vector< Dimensions, double > &volumeH, bool gridIsConstructed) override
virtual bool patchCanUseStatelessPDETerms(const tarch::la::Vector< Dimensions, double > &patchCentre, const tarch::la::Vector< Dimensions, double > &patchH, double t, double dt) const
Within the mass accumulation radius, I return false.
void startTimeStep(double globalMinTimeStamp, double globalMaxTimeStamp, double globalMinTimeStepSize, double globalMaxTimeStepSize) 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
There are two variants of the source term.
Log Device.
Definition Log.h:517
Simple vector class.
Definition Vector.h:159