37 {{CONSTRUCTOR_IMPLEMENTATION}}
41double {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::getMaxMeshSize()
const {
42 return getMaxPatchSize();
46double {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::getMinMeshSize()
const {
47 return getMinPatchSize();
51double {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::getMinPatchSize(
bool ofCurrentlyRunningGridSweep)
const {
52 return getMinGridCellSize(ofCurrentlyRunningGridSweep) * NumberOfGridCellsPerPatchPerAxis;
56double {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::getMaxPatchSize(
bool ofCurrentlyRunningGridSweep)
const {
57 return getMaxGridCellSize(ofCurrentlyRunningGridSweep) * NumberOfGridCellsPerPatchPerAxis;
61double {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::getMinGridCellSize(
bool ofCurrentlyRunningGridSweep)
const {
66double {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::getMaxGridCellSize(
bool ofCurrentlyRunningGridSweep)
const {
71double {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::getMinTimeStamp(
bool ofCurrentlyRunningGridSweep)
const {
76double {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::getMaxTimeStamp(
bool ofCurrentlyRunningGridSweep)
const {
81double {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::getMinTimeStepSize()
const {
86double {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::getMaxTimeStepSize()
const {
90void {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::suspendSolversForOneGridSweep() {}
93void {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::update(
double timeStepSize,
double timeStamp,
double patchSize) {
97 assertion1(timeStepSize<std::numeric_limits<double>::max()/10.0,timeStepSize);
105 _localMinTimeStampThisTimeStep = std::min(_localMinTimeStampThisTimeStep, timeStamp);
106 _localMaxTimeStampThisTimeStep = std::max(_localMaxTimeStampThisTimeStep, timeStamp);
109 assertion1(timeStamp<std::numeric_limits<double>::max()/10.0,timeStamp);
117 assertion1(patchSize<std::numeric_limits<double>::max()/NumberOfGridCellsPerPatchPerAxis,patchSize);
122 logDebug(
"update(double,double,double)",
"updated with dt=" << timeStepSize <<
", t=" << timeStamp <<
", h=" << patchSize <<
": t(new)=" <<
_minTimeStampThisTimeStep );
126{{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::SolverState {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::getSolverState()
const {
131{%
if REFINEMENT_CRITERION_IMPLEMENTATION!=
"<user-defined>" %}
133 const double * __restrict__ Q,
138 {%
if REFINEMENT_CRITERION_IMPLEMENTATION==
"<empty>" %}
144 {{REFINEMENT_CRITERION_IMPLEMENTATION}}
150{%
if INITIAL_CONDITIONS_IMPLEMENTATION!=
"<user-defined>" %}
151void {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::initialCondition(
152 double * __restrict__ Q,
155 bool gridIsConstructed
157 {{INITIAL_CONDITIONS_IMPLEMENTATION}}
162{%
if BOUNDARY_CONDITIONS_IMPLEMENTATION!=
"<user-defined>" and BOUNDARY_CONDITIONS_IMPLEMENTATION!=
"<none>" %}
163void {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::boundaryConditions(
164 const double * __restrict__ Qinside,
165 double * __restrict__ Qoutside,
171 {%
if BOUNDARY_CONDITIONS_IMPLEMENTATION!=
"<empty>" %}
172 {{BOUNDARY_CONDITIONS_IMPLEMENTATION}}
178void {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::startGridConstructionStep() {
179 assertion( _solverState == SolverState::GridConstruction );
183void {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::finishGridConstructionStep() {
187void {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::startGridInitialisationStep() {
188 _solverState = SolverState::GridInitialisation;
192void {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::finishGridInitialisationStep() {
196void {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::startTimeStep(
197 double globalMinTimeStamp,
198 double globalMaxTimeStamp,
199 double globalMinTimeStepSize,
200 double globalMaxTimeStepSize
202 switch (_solverState) {
203 case SolverState::GridConstruction:
204 _solverState = SolverState::GridInitialisation;
206 {%
if RECONSTRUCTION_STAGES==0 %}
207 {%
for item in range(RK_STEPS-1) %}
208 case SolverState::RungeKuttaSubStep{{item}}:
209 _solverState = SolverState::RungeKuttaSubStep{{item+1}};
213 {%
for item in range(RK_STEPS-1) %}
214 case SolverState::ReconstructionSubStep{{item}}:
215 _solverState = SolverState::RungeKuttaSubStep{{item}};
217 case SolverState::RungeKuttaSubStep{{item}}:
218 _solverState = SolverState::ReconstructionSubStep{{item+1}};
221 case SolverState::ReconstructionSubStep{{RK_STEPS-1}}:
222 _solverState = SolverState::RungeKuttaSubStep{{RK_STEPS-1}};
225 case SolverState::Suspended:
226 case SolverState::Plotting:
227 case SolverState::PlottingAfterGridInitialisation:
228 case SolverState::GridInitialisation:
229 case SolverState::RungeKuttaSubStep{{RK_STEPS-1}}:
230 {%
if RECONSTRUCTION_STAGES==0 %}
231 _solverState = SolverState::RungeKuttaSubStep0;
233 _solverState = SolverState::ReconstructionSubStep0;
237 case SolverState::RungeKuttaSubStep0AfterGridInitialisation:
238 {%
if RECONSTRUCTION_STAGES==0 %}
239 _solverState = SolverState::RungeKuttaSubStep1;
241 _solverState = SolverState::ReconstructionSubStep1;
245 case SolverState::RungeKuttaSubStep0AfterGridInitialisation:
246 {%
if RECONSTRUCTION_STAGES==0 %}
247 _solverState = SolverState::RungeKuttaSubStep0;
249 _solverState = SolverState::ReconstructionSubStep0;
255 {{START_TIME_STEP_IMPLEMENTATION}}
257 if ( isFirstGridSweepOfTimeStep() ) {
276 _localMinTimeStampThisTimeStep = std::numeric_limits<double>::max();
277 _localMaxTimeStampThisTimeStep = std::numeric_limits<double>::min();
284void {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::finishTimeStep() {
285 if ( isLastGridSweepOfTimeStep() ) {
295 double newLocalMinTimeStamp = _localMinTimeStampThisTimeStep;
296 double newLocalMaxTimeStamp = _localMaxTimeStampThisTimeStep;
346 &newLocalMinTimeStamp,
347 &_localMinTimeStampThisTimeStep,
353 &newLocalMaxTimeStamp,
354 &_localMaxTimeStampThisTimeStep,
377 {{FINISH_TIME_STEP_IMPLEMENTATION}}
381void {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::startPlottingStep(
382 double globalMinTimeStamp,
383 double globalMaxTimeStamp,
384 double globalMinTimeStepSize,
385 double globalMaxTimeStepSize
387 if ( _solverState==SolverState::GridInitialisation ) {
388 _solverState = SolverState::PlottingAfterGridInitialisation;
391 _solverState = SolverState::Plotting;
396void {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::finishPlottingStep() {
400std::string {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}
::toString(SolverState
state) {
402 case SolverState::GridConstruction:
403 return "grid-construction";
404 case SolverState::GridInitialisation:
405 return "grid-initialisation";
406 case SolverState::Plotting:
408 case SolverState::Suspended:
410 case SolverState::PlottingAfterGridInitialisation:
411 return "plotting-after-grid-initialisation";
412 case SolverState::RungeKuttaSubStep0AfterGridInitialisation:
413 return "runge-kutta-step-0-after-grid-initialisation";
414 {%
for item in range(RK_STEPS) %}
415 case SolverState::RungeKuttaSubStep{{item}}:
416 return "runge-kutta-step-{{item}}";
419 {%
if RECONSTRUCTION_STAGES!=0 %}
420 {%
for item in range(RECONSTRUCTION_STAGES) %}
421 case SolverState::ReconstructionSubStep{{item}}:
422 return "reconstruction-step-{{item}}";
431bool {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::mayPlot()
const {
432 return isLastGridSweepOfTimeStep()
433 or _solverState==SolverState::GridInitialisation
434 or _solverState==SolverState::Plotting;
438bool {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::isFirstGridSweepOfTimeStep()
const {
439 {%
if RECONSTRUCTION_STAGES!=0 %}
440 return _solverState==SolverState::ReconstructionSubStep0
441 or _solverState==SolverState::RungeKuttaSubStep0AfterGridInitialisation;
443 return _solverState==SolverState::RungeKuttaSubStep0
444 or _solverState==SolverState::RungeKuttaSubStep0AfterGridInitialisation;
449bool {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::isLastGridSweepOfTimeStep()
const {
450 return _solverState==SolverState::RungeKuttaSubStep{{RK_STEPS-1}};
454{{ABSTRACT_SOLVER_USER_DEFINITIONS}}
458void {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::startSimulation() {
463void {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::finishSimulation() {