42 {{CONSTRUCTOR_IMPLEMENTATION}}
46double {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::getMaxMeshSize()
const {
47 return getMaxPatchSize();
51double {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::getMinMeshSize()
const {
52 return getMinPatchSize();
56double {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::getMinPatchSize(
bool ofCurrentlyRunningGridSweep)
const {
57 return getMinGridCellSize(ofCurrentlyRunningGridSweep) * NumberOfGridCellsPerPatchPerAxis;
61double {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::getMaxPatchSize(
bool ofCurrentlyRunningGridSweep)
const {
62 return getMaxGridCellSize(ofCurrentlyRunningGridSweep) * NumberOfGridCellsPerPatchPerAxis;
66double {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::getMinGridCellSize(
bool ofCurrentlyRunningGridSweep)
const {
71double {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::getMaxGridCellSize(
bool ofCurrentlyRunningGridSweep)
const {
76double {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::getMinTimeStamp(
bool ofCurrentlyRunningGridSweep)
const {
81double {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::getMaxTimeStamp(
bool ofCurrentlyRunningGridSweep)
const {
86double {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::getMinTimeStepSize()
const {
91double {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::getMaxTimeStepSize()
const {
96void {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::suspendSolversForOneGridSweep() {
97 _solverState = SolverState::Suspended;
101void {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::update(
double timeStepSize,
double timeStamp,
double patchSize) {
105 assertion1(timeStepSize<std::numeric_limits<double>::max()/10.0,timeStepSize);
113 _localMinTimeStampThisTimeStep = std::min(_localMinTimeStampThisTimeStep, timeStamp);
114 _localMaxTimeStampThisTimeStep = std::max(_localMaxTimeStampThisTimeStep, timeStamp);
117 assertion1(timeStamp<std::numeric_limits<double>::max()/10.0,timeStamp);
125 assertion1(patchSize<std::numeric_limits<double>::max()/NumberOfGridCellsPerPatchPerAxis,patchSize);
130 logDebug(
"update(double,double,double)",
"updated with dt=" << timeStepSize <<
", t=" << timeStamp <<
", h=" << patchSize <<
": t(new)=" <<
_minTimeStampThisTimeStep );
134{{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::SolverState {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::getSolverState()
const {
139{%
if REFINEMENT_CRITERION_IMPLEMENTATION!=
"<user-defined>" %}
141 const double * __restrict__ Q,
146 {%
if REFINEMENT_CRITERION_IMPLEMENTATION==
"<empty>" %}
152 {{REFINEMENT_CRITERION_IMPLEMENTATION}}
158{%
if INITIAL_CONDITIONS_IMPLEMENTATION!=
"<user-defined>" %}
159void {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::initialCondition(
160 double * __restrict__ Q,
163 bool gridIsConstructed
165 {{INITIAL_CONDITIONS_IMPLEMENTATION}}
170{%
if BOUNDARY_CONDITIONS_IMPLEMENTATION!=
"<user-defined>" and BOUNDARY_CONDITIONS_IMPLEMENTATION!=
"<none>" %}
171void {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::boundaryConditions(
172 const double * __restrict__ Qinside,
173 double * __restrict__ Qoutside,
179 {%
if BOUNDARY_CONDITIONS_IMPLEMENTATION!=
"<empty>" %}
180 {{BOUNDARY_CONDITIONS_IMPLEMENTATION}}
186void {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::startGridConstructionStep() {
187 assertion( _solverState == SolverState::GridConstruction );
191void {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::finishGridConstructionStep() {
195void {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::startGridInitialisationStep() {
196 _solverState = SolverState::GridInitialisation;
200void {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::finishGridInitialisationStep() {
204void {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::startTimeStep(
205 double globalMinTimeStamp,
206 double globalMaxTimeStamp,
207 double globalMinTimeStepSize,
208 double globalMaxTimeStepSize
210 switch (_solverState) {
211 case SolverState::GridConstruction:
212 assertionMsg(
false,
"grid construction should lead into initialisation and not time stepping" );
214 {%
for item in range(RK_STEPS-1) %}
215 case SolverState::RungeKuttaPrimarySubStep{{item}}:
216 _solverState = SolverState::RungeKuttaSecondarySubStep{{item}};
218 case SolverState::RungeKuttaSecondarySubStep{{item}}:
219 _solverState = SolverState::RungeKuttaPrimarySubStep{{item+1}};
222 case SolverState::Suspended:
223 case SolverState::Plotting:
224 case SolverState::PlottingAfterGridInitialisation:
225 _solverState = SolverState::RungeKuttaPrimarySubStep0;
227 case SolverState::GridInitialisation:
228 _solverState = SolverState::RungeKuttaPrimarySubStep0AfterGridInitialisation;
230 case SolverState::RungeKuttaPrimarySubStep{{RK_STEPS-1}}:
231 _solverState = SolverState::RungeKuttaSecondarySubStep{{RK_STEPS-1}};
233 case SolverState::RungeKuttaSecondarySubStep{{RK_STEPS-1}}:
234 _solverState = SolverState::RungeKuttaPrimarySubStep0;
236 case SolverState::RungeKuttaPrimarySubStep0AfterGridInitialisation:
237 _solverState = SolverState::RungeKuttaSecondarySubStep0;
241 {{START_TIME_STEP_IMPLEMENTATION}}
243 if ( isFirstGridSweepOfTimeStep() ) {
262 _localMinTimeStampThisTimeStep = std::numeric_limits<double>::max();
263 _localMaxTimeStampThisTimeStep = std::numeric_limits<double>::min();
270void {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::finishTimeStep() {
271 if ( isLastGridSweepOfTimeStep() ) {
280 double newLocalMinTimeStamp = _localMinTimeStampThisTimeStep;
281 double newLocalMaxTimeStamp = _localMaxTimeStampThisTimeStep;
331 &newLocalMinTimeStamp,
332 &_localMinTimeStampThisTimeStep,
338 &newLocalMaxTimeStamp,
339 &_localMaxTimeStampThisTimeStep,
362 {{FINISH_TIME_STEP_IMPLEMENTATION}}
366void {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::startPlottingStep(
367 double globalMinTimeStamp,
368 double globalMaxTimeStamp,
369 double globalMinTimeStepSize,
370 double globalMaxTimeStepSize
372 if ( _solverState==SolverState::GridInitialisation ) {
373 _solverState = SolverState::PlottingAfterGridInitialisation;
376 _solverState = SolverState::Plotting;
381void {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::finishPlottingStep() {
385std::string {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}
::toString(SolverState
state) {
387 case SolverState::GridConstruction:
388 return "grid-construction";
389 case SolverState::GridInitialisation:
390 return "grid-initialisation";
391 case SolverState::Plotting:
393 case SolverState::Suspended:
395 case SolverState::PlottingAfterGridInitialisation:
396 return "plotting-after-grid-initialisation";
397 case SolverState::RungeKuttaPrimarySubStep0AfterGridInitialisation:
398 return "runge-kutta-primary-step-0-after-grid-initialisation";
399 {%
for item in range(RK_STEPS) %}
400 case SolverState::RungeKuttaPrimarySubStep{{item}}:
401 return "runge-kutta-primary-step-{{item}}";
403 case SolverState::RungeKuttaSecondarySubStep{{item}}:
404 return "runge-kutta-secondary-step-{{item}}";
412bool {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::mayPlot()
const {
413 return isLastGridSweepOfTimeStep() or _solverState==SolverState::Suspended
414 or _solverState==SolverState::GridInitialisation
415 or _solverState==SolverState::Plotting;
419bool {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::isFirstGridSweepOfTimeStep()
const {
420 return _solverState==SolverState::RungeKuttaPrimarySubStep0
421 or _solverState==SolverState::RungeKuttaPrimarySubStep0AfterGridInitialisation;
425bool {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::isLastGridSweepOfTimeStep()
const {
426 return _solverState==SolverState::RungeKuttaSecondarySubStep{{RK_STEPS-1}} or _solverState==SolverState::Suspended;
430{{ABSTRACT_SOLVER_USER_DEFINITIONS}}
434void {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::startSimulation() {
439void {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::finishSimulation() {
444bool {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::patchCanUseStatelessPDETerms(