|
| | Solver () |
| | The min and max time stamp and the time step size all start at 0, so the very first time step does not advance the solution.
|
| |
| virtual double | getMinTimeStamp () const |
| |
| virtual double | getMaxTimeStamp () const |
| |
| virtual double | getMinTimeStepSize () const |
| |
| virtual double | getMaxTimeStepSize () const |
| |
| virtual double | getAdmissibleTimeStepSize () const |
| | The time step size the solver would use if enforceTimeStepSize() had not been called, i.e.
|
| |
| virtual void | startTimeStep (double globalMinTimeStamp, double globalMaxTimeStamp, double globalMinTimeStepSize, double globalMaxTimeStepSize) |
| | Default implementation: rolls the previous sweep's accumulated _minTimeStampUpdatedThisTimeStep/_maxTimeStampUpdatedThisTimeStep, _minTimeStepSizeUpdatedThisTimeStep/_maxTimeStepSizeUpdatedThisTimeStep and _minVolumeHUpdatedThisTimeStep/_maxVolumeHUpdatedThisTimeStep over into the corresponding global attributes, and resets the UpdatedThisTimeStep accumulators (and _cellUpdates) so the new sweep about to start can accumulate its own contributions via updateCell().
|
| |
| virtual void | finishTimeStep () |
| | Default implementation: MPI-all-reduces the UpdatedThisTimeStep accumulators (min via MPI_MIN, max via MPI_MAX, _cellUpdates via MPI_SUM) across ranks, so every rank's startTimeStep() rolls over the same, globally synchronised values.
|
| |
| virtual void | startPlottingStep (double globalMinTimeStamp, double globalMaxTimeStamp, double globalMinTimeStepSize, double globalMaxTimeStepSize) |
| | Not pure virtual, unlike the other lifecycle hooks above: overriding it is optional.
|
| |
| virtual void | finishPlottingStep () |
| | Not pure virtual -.
|
| |
| virtual double | getMaxMeshSize () const |
| |
| virtual double | getMinMeshSize () const |
| |
| virtual std::string | toCheckpointMetaData () const |
| | Solver state for the header of a checkpoint.
|
| |
| virtual void | fromCheckpointMetaData (const std::string &metaData) |
| | Restore the solver state from the header of a checkpoint.
|
| |
| virtual bool | cellCanUseStatelessPDETerms (const tarch::la::Vector< Dimensions, double > &cellCentre, const tarch::la::Vector< Dimensions, double > &cellH, double t, double dt) const |
| | Default implementation: always returns true, i.e.
|
| |
| void | updateCell (double timeStepSize, double timeStamp) |
| | Thread-safely fold one cell's contribution into this time step's running time stamp and time step size bounds (protected by _semaphore).
|
| |
| void | enforceTimeStepSize (double timeStepSize) |
| | Thread-safely overwrite the current minimum and maximum time step size (protected by _semaphore), i.e.
|
| |
| void | resetTimeStepSize () |
| | Restart the time stepping with a time step size of zero.
|
| |
Definition at line 18 of file Solver.h.
This is a "fake" enum, i.e.
we do not use it to distinguish different variants. Instead, we use it as a fix that allows us to "overload" operations:
In C++ you cannot overload w.r.t. static. We however need functions which exist twice in ExaHyPE: Once as standard (virtual) member functions and once at static version which an be offloaded to a GPU as it does not have a state. Both function variants, in theory, have the same signature but if they had, a compiler could not distinguish them. So I use this enum for the GPU version.
If you create a solver without GPU support, this enum will not be used. It is however always created. Once you write a GPU version and then compile without GPU support, you will thus still be able to have all your GPU function variants, and you don't have to work with ifdefs.
Definition at line 37 of file Solver.h.
| virtual void exahype2::Solver::finishTimeStep |
( |
| ) |
|
|
virtual |
Default implementation: MPI-all-reduces the UpdatedThisTimeStep accumulators (min via MPI_MIN, max via MPI_MAX, _cellUpdates via MPI_SUM) across ranks, so every rank's startTimeStep() rolls over the same, globally synchronised values.
A no-op in a build without MPI support.
| virtual void exahype2::Solver::fromCheckpointMetaData |
( |
const std::string & |
metaData | ) |
|
|
virtual |
Restore the solver state from the header of a checkpoint.
Counterpart of toCheckpointMetaData(): The routine sets the time stamps, the time step sizes, the admissible time step size and the mesh sizes to the values in metaData. Attributes which metaData does not hold keep their values. Afterwards, it resets the bookkeeping of the time step as startTimeStep() does, so the next time step continues from the restored state. Generated solvers override it to restore their own attributes via getCheckpointMetaDataEntry().
exahype2.api.blockstructured.LoadCheckpoint calls the routine once the solution has been read from the checkpoint.
| virtual void exahype2::Solver::startTimeStep |
( |
double |
globalMinTimeStamp, |
|
|
double |
globalMaxTimeStamp, |
|
|
double |
globalMinTimeStepSize, |
|
|
double |
globalMaxTimeStepSize |
|
) |
| |
|
virtual |
Default implementation: rolls the previous sweep's accumulated _minTimeStampUpdatedThisTimeStep/_maxTimeStampUpdatedThisTimeStep, _minTimeStepSizeUpdatedThisTimeStep/_maxTimeStepSizeUpdatedThisTimeStep and _minVolumeHUpdatedThisTimeStep/_maxVolumeHUpdatedThisTimeStep over into the corresponding global attributes, and resets the UpdatedThisTimeStep accumulators (and _cellUpdates) so the new sweep about to start can accumulate its own contributions via updateCell().
globalMin/Max... are not used by the default implementation - they are there for solvers that need to react to the other solvers' bounds in a multi-solver project.
| virtual std::string exahype2::Solver::toCheckpointMetaData |
( |
| ) |
const |
|
virtual |
Solver state for the header of a checkpoint.
The checkpoint plotters (exahype2.api.fv.WriteCheckpoint and exahype2.api.rkfd4.WriteCheckpoint) write the result into the meta-data block of each Peano patch file. Every line holds one attribute as key-value pair, with the attribute's name without its leading underscore as key:
minTimeStamp 1.00000000000000006e-01
maxTimeStamp 1.00000000000000006e-01
The lines are separated by line breaks. The values carry 17 significant digits, so a double survives the round trip through the file unchanged.
The routine writes the time stamps, the time step sizes, the admissible time step size and the mesh sizes. It leaves out the bookkeeping of the time step which is currently running (the *UpdatedThisTimeStep attributes) and the cell update counter. Generated solvers override it to append their own attributes via toCheckpointMetaDataEntry().