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 {
91void {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::suspendSolversForOneGridSweep() {
92 _solverState = SolverState::Suspended;
96void {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::update(
double timeStepSize,
double timeStamp,
double patchSize) {
100 assertion1(timeStepSize<std::numeric_limits<double>::max()/10.0,timeStepSize);
108 _localMinTimeStampThisTimeStep = std::min(_localMinTimeStampThisTimeStep, timeStamp);
109 _localMaxTimeStampThisTimeStep = std::max(_localMaxTimeStampThisTimeStep, timeStamp);
112 assertion1(timeStamp<std::numeric_limits<double>::max()/10.0,timeStamp);
120 assertion1(patchSize<std::numeric_limits<double>::max()/NumberOfGridCellsPerPatchPerAxis,patchSize);
125 logDebug(
"update(double,double,double)",
"updated with dt=" << timeStepSize <<
", t=" << timeStamp <<
", h=" << patchSize <<
": t(new)=" <<
_minTimeStampThisTimeStep );
129{{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::SolverState {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::getSolverState()
const {
134{%
if REFINEMENT_CRITERION_IMPLEMENTATION!=
"<user-defined>" %}
136 const double * __restrict__ Q,
141 {%
if REFINEMENT_CRITERION_IMPLEMENTATION==
"<empty>" %}
147 {{REFINEMENT_CRITERION_IMPLEMENTATION}}
153{%
if INITIAL_CONDITIONS_IMPLEMENTATION!=
"<user-defined>" %}
154void {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::initialCondition(
155 double * __restrict__ Q,
158 bool gridIsConstructed
160 {{INITIAL_CONDITIONS_IMPLEMENTATION}}
165{%
if BOUNDARY_CONDITIONS_IMPLEMENTATION!=
"<user-defined>" and BOUNDARY_CONDITIONS_IMPLEMENTATION!=
"<none>" %}
166void {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::boundaryConditions(
167 const double * __restrict__ Qinside,
168 double * __restrict__ Qoutside,
174 {%
if BOUNDARY_CONDITIONS_IMPLEMENTATION!=
"<empty>" %}
175 {{BOUNDARY_CONDITIONS_IMPLEMENTATION}}
181void {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::startGridConstructionStep() {
182 assertion( _solverState == SolverState::GridConstruction );
186void {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::finishGridConstructionStep() {
190void {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::startGridInitialisationStep() {
191 _solverState = SolverState::GridInitialisation;
195void {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::finishGridInitialisationStep() {
199void {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::startTimeStep(
200 double globalMinTimeStamp,
201 double globalMaxTimeStamp,
202 double globalMinTimeStepSize,
203 double globalMaxTimeStepSize
205 switch (_solverState) {
206 case SolverState::GridConstruction:
207 _solverState = SolverState::GridInitialisation;
209 {%
for item in range(RK_STEPS-1) %}
210 case SolverState::RungeKuttaSubStep{{item}}:
211 _solverState = SolverState::RungeKuttaSubStep{{item+1}};
214 case SolverState::Suspended:
215 case SolverState::Plotting:
216 case SolverState::PlottingAfterGridInitialisation:
217 case SolverState::GridInitialisation:
218 case SolverState::RungeKuttaSubStep{{RK_STEPS-1}}:
219 _solverState = SolverState::RungeKuttaSubStep0;
222 case SolverState::RungeKuttaSubStep0AfterGridInitialisation:
223 _solverState = SolverState::RungeKuttaSubStep1;
226 case SolverState::RungeKuttaSubStep0AfterGridInitialisation:
227 _solverState = SolverState::RungeKuttaSubStep0;
232 {{START_TIME_STEP_IMPLEMENTATION}}
234 if ( isFirstGridSweepOfTimeStep() ) {
253 _localMinTimeStampThisTimeStep = std::numeric_limits<double>::max();
254 _localMaxTimeStampThisTimeStep = std::numeric_limits<double>::min();
261void {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::finishTimeStep() {
262 if ( isLastGridSweepOfTimeStep() ) {
272 double newLocalMinTimeStamp = _localMinTimeStampThisTimeStep;
273 double newLocalMaxTimeStamp = _localMaxTimeStampThisTimeStep;
323 &newLocalMinTimeStamp,
324 &_localMinTimeStampThisTimeStep,
330 &newLocalMaxTimeStamp,
331 &_localMaxTimeStampThisTimeStep,
354 {{FINISH_TIME_STEP_IMPLEMENTATION}}
358void {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::startPlottingStep(
359 double globalMinTimeStamp,
360 double globalMaxTimeStamp,
361 double globalMinTimeStepSize,
362 double globalMaxTimeStepSize
364 if ( _solverState==SolverState::GridInitialisation ) {
365 _solverState = SolverState::PlottingAfterGridInitialisation;
368 _solverState = SolverState::Plotting;
373void {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::finishPlottingStep() {
377std::string {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}
::toString(SolverState
state) {
379 case SolverState::GridConstruction:
380 return "grid-construction";
381 case SolverState::Suspended:
383 case SolverState::GridInitialisation:
384 return "grid-initialisation";
385 case SolverState::Plotting:
387 case SolverState::PlottingAfterGridInitialisation:
388 return "plotting-after-grid-initialisation";
389 case SolverState::RungeKuttaSubStep0AfterGridInitialisation:
390 return "runge-kutta-step-0-after-grid-initialisation";
391 {%
for item in range(RK_STEPS) %}
392 case SolverState::RungeKuttaSubStep{{item}}:
393 return "runge-kutta-step-{{item}}";
401bool {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::mayPlot()
const {
402 return isLastGridSweepOfTimeStep()
403 or _solverState==SolverState::GridInitialisation
404 or _solverState==SolverState::Plotting;
408bool {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::isFirstGridSweepOfTimeStep()
const {
409 return _solverState==SolverState::RungeKuttaSubStep0
410 or _solverState==SolverState::RungeKuttaSubStep0AfterGridInitialisation;
414bool {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::isLastGridSweepOfTimeStep()
const {
415 return _solverState==SolverState::RungeKuttaSubStep{{RK_STEPS-1}};
419{{ABSTRACT_SOLVER_USER_DEFINITIONS}}
423void {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::startSimulation() {
428void {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::finishSimulation() {