Peano
Loading...
Searching...
No Matches
SeparateSweepsAbstract.template.h
Go to the documentation of this file.
1// **********************************************************************************************
2// *** !!!WARNING!!! ***
3// *** WARNING: AUTO GENERATED FILE! DO NOT MODIFY BY HAND! YOUR CHANGES WILL BE OVERWRITTEN! ***
4// *** !!!WARNING!!! ***
5// *** Generated by Peano's Python API: www.peano-framework.org ***
6// **********************************************************************************************
7#pragma once
8
10#include "exahype2/Solver.h"
11#include "tarch/la/Vector.h"
14
16
17#include "Constants.h"
18
19{% if USE_VARIABLE_SHORTCUT is sameas True %}
20#include "VariableShortcuts.h"
21{% endif %}
22
23{{SOLVER_INCLUDES}}
24
25{% for item in NAMESPACE -%}
26 namespace {{ item }} {
27
28{%- endfor %}
29 class {{CLASSNAME}};
30
31{% for item in NAMESPACE -%}
32 }
33{%- endfor %}
34
35class {{NAMESPACE | join("::")}}::{{CLASSNAME}}: public ::exahype2::Solver {
36 public:
37 enum class SolverState {
38 GridConstruction,
39 GridInitialisation,
40 Suspended,
41 Plotting {% for item in range(RK_STEPS) -%}
42 ,
43 ProjectOnFacesAndComputeVolumeIntegralOfStep{{item}},
44 SolveRiemannProblemAndAddToVolumeIntegralOfStep{{item}}
45 {%- endfor %}
46 };
47
48 static std::string toString(SolverState);
49
50 static constexpr int DGOrder = {{DG_ORDER}};
51
57 static constexpr double MaxAdmissibleCellH = {{MAX_CELL_H}};
58
59 static constexpr int NumberOfUnknowns = {{NUMBER_OF_UNKNOWNS}};
60 static constexpr int NumberOfAuxiliaryVariables = {{NUMBER_OF_AUXILIARY_VARIABLES}};
61
70 static constexpr double MinAdmissibleCellH = {{MIN_CELL_H}};
71
72{{BASIS_DECLARATIONS | indent(4,True) }}
73
74 {{SOLVER_CONSTANTS}}
75
76 {{CLASSNAME}}();
77
81 static std::bitset<Dimensions> PeriodicBC;
82
83 double getMinTimeStamp(bool ofCurrentlyRunningGridSweep=false) const final;
84 double getMaxTimeStamp(bool ofCurrentlyRunningGridSweep=false) const final;
85 double getMinTimeStepSize() const final;
86 double getMaxTimeStepSize() const final;
87
96 virtual ::exahype2::RefinementCommand refinementCriterion(
97 const double * __restrict__ Q, // Q[{{NUMBER_OF_UNKNOWNS}}+{{NUMBER_OF_AUXILIARY_VARIABLES}}]
98 const tarch::la::Vector<Dimensions,double>& volumeCentre,
99 const tarch::la::Vector<Dimensions,double>& volumeH,
100 double t
101 ) {% if REFINEMENT_CRITERION_IMPLEMENTATION=="<user-defined>" %}= 0{% else %} final {% endif %};
102
119 virtual void initialCondition(
120 double * __restrict__ Q, // Q[{{NUMBER_OF_UNKNOWNS}}+{{NUMBER_OF_AUXILIARY_VARIABLES}}]
124 bool gridIsConstructed
125 ) {% if INITIAL_CONDITIONS_IMPLEMENTATION=="<user-defined>" %}= 0{% else %} final {% endif %};
126
127 {% if BOUNDARY_CONDITIONS_IMPLEMENTATION=="<none>" %}
128 {% else %}
135 virtual void boundaryConditions(
136 const double * __restrict__ Qinside, // Qinside[{{NUMBER_OF_UNKNOWNS}}+{{NUMBER_OF_AUXILIARY_VARIABLES}}]
137 double * __restrict__ Qoutside, // Qoutside[{{NUMBER_OF_UNKNOWNS}}+{{NUMBER_OF_AUXILIARY_VARIABLES}}]
138 const tarch::la::Vector<Dimensions,double>& faceCentre,
139 double t,
140 int normal
141 ) {% if BOUNDARY_CONDITIONS_IMPLEMENTATION=="<user-defined>" %}= 0{% else %} final{% endif %};
142 {% endif %}
143
144
145 virtual void suspendSolversForOneGridSweep() override;
146
151 virtual void startGridConstructionStep() override;
152
157 virtual void finishGridConstructionStep() override;
158
163 virtual void startGridInitialisationStep() override;
164
169 virtual void finishGridInitialisationStep() override;
170
175 virtual void startTimeStep(
176 double globalMinTimeStamp,
177 double globalMaxTimeStamp,
178 double globalMinTimeStepSize,
179 double globalMaxTimeStepSize
180 ) override;
181
186 virtual void finishTimeStep() override;
187
192 virtual void startPlottingStep(
193 double globalMinTimeStamp,
194 double globalMaxTimeStamp,
195 double globalMinTimeStepSize,
196 double globalMaxTimeStepSize
197 ) override;
198
203 virtual void finishPlottingStep() override;
204
214 double getMaxCellSize(bool currentTimeStep = true) const;
215 double getMinCellSize(bool currentTimeStep = true) const;
216
220 virtual double getMaxMeshSize() const override final;
221 virtual double getMinMeshSize() const override final;
222
229 void update(double timeStepSize, double timeStamp, double cellSize);
230
231 SolverState getSolverState() const;
232
236 virtual bool mayPlot() const override;
237
242 bool isFirstGridSweepOfTimeStep() const;
243 bool isLastGridSweepOfTimeStep() const;
244
249 virtual void startSimulation() override;
250
255 virtual void finishSimulation() override;
256
257 {% if STATELESS_PDE_TERMS %}
264 {% else %}
271 {% endif %}
272 virtual bool cellCanUseStatelessPDETerms(
273 const tarch::la::Vector<Dimensions,double>& cellCentre,
275 double t,
276 double dt
277 ) const;
278
279 protected:
281
282 SolverState _solverState;
283
284 double _minTimeStamp;
285 double _maxTimeStamp;
286
289
290 double _localMinTimeStampThisTimeStep;
291 double _localMaxTimeStampThisTimeStep;
292
293 double _minCellH;
294 double _maxCellH;
295
298
299 double _minTimeStepSize;
300 double _maxTimeStepSize;
301
304
305 int _cellUpdates;
306
308
309 {{ABSTRACT_SOLVER_USER_DECLARATIONS}}
310};
_minCellH(0.0)
_maxCellHThisTimeStep(0.0)
_maxTimeStampThisTimeStep(0.0)
_minTimeStepSize(std::numeric_limits< double >::max())
_minTimeStamp(0.0)
_maxTimeStepSizeThisTimeStep(0.0)
_maxTimeStamp(0.0)
_maxCellH(0.0)
_minTimeStampThisTimeStep(0.0)
_minCellHThisTimeStep(0.0)
_minTimeStepSizeThisTimeStep(std::numeric_limits< double >::max())
_maxTimeStepSize(0.0)
Definition vec.h:7
Log Device.
Definition Log.h:516
std::string toString(Filter filter)
Definition convert.cpp:170
tarch::logging::Log _log("exahype2::fv")
For the generic kernels that I use here most of the time.
Definition CellAccess.h:13
Have to include this header, as I need access to the SYCL_EXTERNAL keyword.
Definition accelerator.h:19
Simple vector class.
Definition Vector.h:150