Peano
Loading...
Searching...
No Matches
StaticCouplingAbstract.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 "exahype2/Solver.h"
10
11#include "tarch/la/Vector.h"
12#include "tarch/logging/Log.h"
13#include "tarch/NonCriticalAssertions.h"
14#include "tarch/mpi/Rank.h"
15#include "tarch/multicore/BooleanSemaphore.h"
16
17#include "peano4/Globals.h"
18
19#include "Constants.h"
20
21{{SOLVER_INCLUDES}}
22
23{% for item in NAMESPACE -%}
24 namespace {{ item }} {
25
26{%- endfor %}
27 class {{CLASSNAME}};
28
29{% for item in NAMESPACE -%}
30 }
31{%- endfor %}
32
33class {{NAMESPACE | join("::")}}::{{CLASSNAME}}: public ::exahype2::Solver {
34 public:
52 enum class Offloadable {
53 Yes
54 };
55
56 enum class SolverState {
57 GridConstruction,
58 GridInitialisation,
59 LimiterStatusSpreadingToNeighbours,
60 TimeStepping,
61 Plotting,
62 PlottingAfterGridInitialisation,
63 Suspended
64 };
65
66 static std::string toString(SolverState);
67
68 {{CLASSNAME}}();
69 ~{{CLASSNAME}}();
70
71 SolverState getSolverState() const;
72
73 double getMinTimeStamp() const final;
74 double getMaxTimeStamp() const final;
75 double getMinTimeStepSize() const final;
76 double getMaxTimeStepSize() const final;
77
78 virtual double getMaxMeshSize() const override final;
79 virtual double getMinMeshSize() const override final;
80
81 virtual int getNumberOfDoFs() const override final;
82
83 //TODO: link these to the max and min of the other solvers
84 static constexpr double MaxAdmissibleCellH = 1000.;
85 static constexpr double MinAdmissibleCellH = 0.;
86
91 virtual void startGridConstructionStep() override;
92
97 virtual void finishGridConstructionStep() override;
98
99
104 virtual void startGridInitialisationStep() override;
105
110 virtual void finishGridInitialisationStep() override;
111
112
113 virtual void suspendSolversForOneGridSweep() override;
114
115
120 virtual void startTimeStep() override;
121
126 virtual void finishTimeStep() override;
127
128 virtual void printTimeStep() override;
129
134 virtual void startPlottingStep() override;
135
140 virtual void finishPlottingStep() override;
141
145 virtual bool mayPlot() const override;
146
151 bool isFirstGridSweepOfTimeStep() const;
152 bool isLastGridSweepOfTimeStep() const;
153
158 virtual void startSimulation() override;
159
164 virtual void finishSimulation() override;
165
166
167 public:
173 void addTroubledCell();
174 int getNumberOfTroubledCells() const;
175
179 void mapDiscreteMaximumPrincipleObservables(double* const observables, const double* const Q) const {
180 ::tarch::triggerNonCriticalAssertion( __FILE__, __LINE__, "map discrete maximum principle observables was called, it should never be.", "" );
181 }
182
186 double getDiscreteMaximumPrincipleRelaxationParameter(
187 const double& specifiedRelaxationParameter,
188 const int& observable,
189 const double& localMin,
190 const double& localMax,
191 const double& boundaryMinPerObservable,
192 const double& previousMax) const {
193 ::tarch::triggerNonCriticalAssertion( __FILE__, __LINE__, "get discrete maximum principle relaxation parameter was called, it should never be.", "" );
194 return 0.0;
195 }
196
197{% if ADMISSIBILITY_IMPLEMENTATION!="<none>" %}
198 virtual bool isPhysicallyAdmissible(
199 const {{REGULAR_SOLVER_STORAGE_PRECISION}}* const Q,
200 const tarch::la::Vector<DIMENSIONS,double>& x,
201 const tarch::la::Vector<DIMENSIONS,double>& h,
202 const double timeStamp) {% if ADMISSIBILITY_IMPLEMENTATION=="<user-defined>" %} = 0 {% else %} final {% endif %};
203{% endif %}
204
205
206 protected:
207 static tarch::logging::Log _log;
208
209 SolverState _solverState;
210
211 int _cellUpdates;
212
214
215 tarch::multicore::BooleanSemaphore _semaphore;
216
217
218 {{SOLVER_USER_DECLARATIONS}}
219};
220
221
_cellUpdates(0)
constexpr double timeStamp
tarch::logging::Log _log("::")