Peano
Loading...
Searching...
No Matches
SeparateSweepsWithEnclaveTaskingAbstract.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
12#include "tarch/la/Vector.h"
15
17
18#include "Constants.h"
19
20{% if USE_VARIABLE_SHORTCUT is sameas True %}
21#include "VariableShortcuts.h"
22{% endif %}
23
24{{SOLVER_INCLUDES}}
25
26{% for item in NAMESPACE -%}
27 namespace {{ item }} {
28
29{%- endfor %}
30 class {{CLASSNAME}};
31
32{% for item in NAMESPACE -%}
33 }
34{%- endfor %}
35
36class {{NAMESPACE | join("::")}}::{{CLASSNAME}}: public ::exahype2::Solver {
37 public:
38 enum class SolverState {
39 GridConstruction,
40 GridInitialisation,
41 Suspended,
42 PlottingAfterGridInitialisation,
43 RungeKuttaPrimarySubStep0AfterGridInitialisation,
44 Plotting {% for item in range(RK_STEPS) -%}
45 ,
46 RungeKuttaPrimarySubStep{{item}},
47 RungeKuttaSecondarySubStep{{item}}
48 {%- endfor %}
49 };
50
51 static std::string toString(SolverState);
52
53 static constexpr int NumberOfGridCellsPerPatchPerAxis = {{NUMBER_OF_GRID_CELLS_PER_PATCH_PER_AXIS}};
54
60 static constexpr double MaxAdmissiblePatchH = {{MAX_GRID_CELL_H}} * NumberOfGridCellsPerPatchPerAxis;
61 static constexpr double MaxAdmissibleGridCellH = {{MAX_GRID_CELL_H}};
62 static constexpr double MaxAdmissibleCellH = MaxAdmissiblePatchH;
63
72 static constexpr double MinAdmissiblePatchH = {{MIN_GRID_CELL_H}} * NumberOfGridCellsPerPatchPerAxis;
73 static constexpr double MinAdmissibleGridCellH = {{MIN_GRID_CELL_H}};
74 static constexpr double MinAdmissibleCellH = MinAdmissiblePatchH;
75
76
77 {{CLASSNAME}}();
78
82 static std::bitset<Dimensions> PeriodicBC;
83
84 double getMinTimeStamp(bool ofCurrentlyRunningGridSweep=false) const final;
85 double getMaxTimeStamp(bool ofCurrentlyRunningGridSweep=false) const final;
86 double getMinTimeStepSize() const final;
87 double getMaxTimeStepSize() const final;
88
89
94 virtual ::exahype2::RefinementCommand refinementCriterion(
95 const double * __restrict__ Q, // Q[{{NUMBER_OF_UNKNOWNS}}+{{NUMBER_OF_AUXILIARY_VARIABLES}}],
96 const tarch::la::Vector<Dimensions,double>& meshCellCentre,
97 const tarch::la::Vector<Dimensions,double>& meshCellH,
98 double t
99 ) {% if REFINEMENT_CRITERION_IMPLEMENTATION=="<user-defined>" %}= 0{% else %} final {% endif %};
100
101
102 virtual void initialCondition(
103 double * __restrict__ Q,
104 const tarch::la::Vector<Dimensions,double>& meshCellCentre,
106 bool gridIsConstructed
107 ) {% if INITIAL_CONDITIONS_IMPLEMENTATION=="<user-defined>" %}= 0{% else %} final {% endif %};
108
109
110 {% if BOUNDARY_CONDITIONS_IMPLEMENTATION=="<none>" %}
111 {% else %}
118 virtual void boundaryConditions(
119 const double * __restrict__ Qinside, // Qinside[{{NUMBER_OF_UNKNOWNS}}+{{NUMBER_OF_AUXILIARY_VARIABLES}}]
120 double * __restrict__ Qoutside, // Qoutside[{{NUMBER_OF_UNKNOWNS}}+{{NUMBER_OF_AUXILIARY_VARIABLES}}]
121 const tarch::la::Vector<Dimensions,double>& faceCentre,
123 double t,
124 int normal
125 ) {% if BOUNDARY_CONDITIONS_IMPLEMENTATION=="<user-defined>" %}= 0{% else %} final{% endif %};
126 {% endif %}
127
128
129
130
135 virtual void startGridConstructionStep() override;
136
141 virtual void finishGridConstructionStep() override;
142
143
148 virtual void startGridInitialisationStep() override;
149
154 virtual void finishGridInitialisationStep() override;
155
156
157 virtual void suspendSolversForOneGridSweep() override;
158
159
164 virtual void startTimeStep(
165 double globalMinTimeStamp,
166 double globalMaxTimeStamp,
167 double globalMinTimeStepSize,
168 double globalMaxTimeStepSize
169 ) override;
170
175 virtual void finishTimeStep() override;
176
177
182 virtual void startPlottingStep(
183 double globalMinTimeStamp,
184 double globalMaxTimeStamp,
185 double globalMinTimeStepSize,
186 double globalMaxTimeStepSize
187 ) override;
188
193 virtual void finishPlottingStep() override;
194
195
205 double getMaxPatchSize(bool currentTimeStep = true) const;
206 double getMinPatchSize(bool currentTimeStep = true) const;
207 double getMaxGridCellSize(bool currentTimeStep = true) const;
208 double getMinGridCellSize(bool currentTimeStep = true) const;
209
216 virtual double getMaxMeshSize() const override final;
217 virtual double getMinMeshSize() const override final;
218
225 void update(double timeStepSize, double timeStamp, double patchSize);
226
227 SolverState getSolverState() const;
228
229 #if defined(GPUOffloadingOMP)
230 #pragma omp declare target
231 #endif
232 static constexpr int NumberOfUnknowns = {{NUMBER_OF_UNKNOWNS}};
233 static constexpr int NumberOfAuxiliaryVariables = {{NUMBER_OF_AUXILIARY_VARIABLES}};
234 {{SOLVER_CONSTANTS}}
235 #if defined(GPUOffloadingOMP)
236 #pragma omp end declare target
237 #endif
238
242 virtual bool mayPlot() const override;
243
248 bool isFirstGridSweepOfTimeStep() const;
249 bool isLastGridSweepOfTimeStep() const;
250
255 virtual void startSimulation() override;
256
261 virtual void finishSimulation() override;
262
263 {% if STATELESS_PDE_TERMS %}
270 {% else %}
277 {% endif %}
278 virtual bool patchCanUseStatelessPDETerms(
279 const tarch::la::Vector<Dimensions,double>& patchCentre,
281 double t,
282 double dt
283 ) const;
284
285 protected:
287
288 SolverState _solverState;
289
290 double _minTimeStamp;
291 double _maxTimeStamp;
292
295
296 double _localMinTimeStampThisTimeStep;
297 double _localMaxTimeStampThisTimeStep;
298
299 double _minGridCellH;
300 double _maxGridCellH;
301
304
305 double _minTimeStepSize;
306 double _maxTimeStepSize;
307
310
311 int _patchUpdates;
312
314
315 {{ABSTRACT_SOLVER_USER_DECLARATIONS}}
316};
317
318
319
320{# Empty line here #}
_minGridCellHThisTimeStep(std::numeric_limits< double >::max()/NumberOfGridCellsPerPatchPerAxis/2.0)
_maxGridCellHThisTimeStep(0.0)
_minGridCellH(std::numeric_limits< double >::max()/NumberOfGridCellsPerPatchPerAxis/2.0)
_maxGridCellH(0.0)
_maxTimeStampThisTimeStep(0.0)
_minTimeStepSize(std::numeric_limits< double >::max())
_minTimeStamp(0.0)
_maxTimeStepSizeThisTimeStep(0.0)
_maxTimeStamp(0.0)
_minTimeStampThisTimeStep(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