Peano
Loading...
Searching...
No Matches
StaticLimitingAbstract.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
9#include "Constants.h"
10
11#include "exahype2/Solver.h"
12
14#include "tarch/la/Vector.h"
15#include "tarch/logging/Log.h"
16#include "tarch/mpi/Rank.h"
18
20
21#include "kernels/{{SOLVER_NAME}}/Quadrature.h"
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 LimiterStatusSpreadingToNeighbours,
41 TimeStep,
42 Plotting,
43 PlottingAfterGridInitialisation,
44 Suspended
45 };
46
47 static std::string toString(SolverState);
48
49 {{CLASSNAME}}();
50 ~{{CLASSNAME}}();
51
52 SolverState getSolverState() const;
53
54 double getMinTimeStamp(bool ofCurrentlyRunningGridSweep=false) const final;
55 double getMaxTimeStamp(bool ofCurrentlyRunningGridSweep=false) const final;
56 double getMinTimeStepSize() const final;
57 double getMaxTimeStepSize() const final;
58
59 virtual double getMaxMeshSize() const override final;
60 virtual double getMinMeshSize() const override final;
61
62 //TODO: link these to the max and min of the other solvers
63 static constexpr double MaxAdmissibleCellH = 1000.;
64 static constexpr double MinAdmissibleCellH = 0.;
65
70 virtual void startGridConstructionStep() override;
71
76 virtual void finishGridConstructionStep() override;
77
78
83 virtual void startGridInitialisationStep() override;
84
89 virtual void finishGridInitialisationStep() override;
90
91
92 virtual void suspendSolversForOneGridSweep() override;
93
94
99 virtual void startTimeStep(
100 double globalMinTimeStamp,
101 double globalMaxTimeStamp,
102 double globalMinTimeStepSize,
103 double globalMaxTimeStepSize
104 ) override;
105
110 virtual void finishTimeStep() override;
111
112
117 virtual void startPlottingStep(
118 double globalMinTimeStamp,
119 double globalMaxTimeStamp,
120 double globalMinTimeStepSize,
121 double globalMaxTimeStepSize
122 ) override;
123
128 virtual void finishPlottingStep() override;
129
133 virtual bool mayPlot() const override;
134
139 bool isFirstGridSweepOfTimeStep() const;
140 bool isLastGridSweepOfTimeStep() const;
141
146 virtual void startSimulation() override;
147
152 virtual void finishSimulation() override;
153
154
155 public:
161 void addTroubledCell();
162 int getNumberOfTroubledCells() const;
163
167 void mapDiscreteMaximumPrincipleObservables(double* const observables, const double* const Q) const {
168 ::tarch::triggerNonCriticalAssertion( __FILE__, __LINE__, "map discrete maximum principle observables was called, it should never be.", "" );
169 }
170
174 double getDiscreteMaximumPrincipleRelaxationParameter(
175 const double& specifiedRelaxationParameter,
176 const int& observable,
177 const double& localMin,
178 const double& localMax,
179 const double& boundaryMinPerObservable,
180 const double& previousMax) const {
181 ::tarch::triggerNonCriticalAssertion( __FILE__, __LINE__, "get discrete maximum principle relaxation parameter was called, it should never be.", "" );
182 return 0.0;
183 }
184
185{% if ADMISSIBILITY_IMPLEMENTATION!="<none>" %}
186 virtual bool isPhysicallyAdmissible(
187 const double* const Q,
190 const double timeStamp) {% if ADMISSIBILITY_IMPLEMENTATION=="<user-defined>" %} = 0 {% else %} final {% endif %};
191{% endif %}
192
193 protected:
195
196 SolverState _solverState;
197
198 int _cellUpdates;
199
201
203
204 {{SOLVER_USER_DECLARATIONS}}
205};
Log Device.
Definition Log.h:516
std::string toString(Filter filter)
Definition convert.cpp:170
tarch::logging::Log _log("exahype2::fv")
void triggerNonCriticalAssertion(std::string file, int line, std::string expression, std::string parameterValuePairs)
Trigger a non-critical assertion.
Simple vector class.
Definition Vector.h:150