|
| | AbstractTimestepper (const ConfigTree &config, AbstractAssembler< VectorType, SparseMatrixType, dim > &assembler, OutputSession_impl< dim, VectorType > &data_out, const bool implicit_stepper, const bool explicit_stepper) |
| | Construct without mesh adaptation.
|
| |
| | AbstractTimestepper (const ConfigTree &config, AbstractAssembler< VectorType, SparseMatrixType, dim > &assembler, OutputSession_impl< dim, VectorType > &data_out, AbstractAdaptor< VectorType > &adaptor, const bool implicit_stepper, const bool explicit_stepper) |
| | Construct with a mesh adaptor, which is called between steps (where the stepper supports it, see abstract_timestepper.hh).
|
| |
| void | run (AbstractFlowingVariables< NumberType, VectorType > &initial_condition, double t_start, const double t_stop) |
| | Evolve initial_condition from t_start to t_stop.
|
| |
| bool | is_implicit () const |
| | Whether this stepper reads /timestepping/implicit.
|
| |
| bool | is_explicit () const |
| | Whether this stepper reads /timestepping/explicit.
|
| |
template<typename VectorType_, typename SparseMatrixType_,
uint dim_>
class DiFfRG::AbstractTimestepper< VectorType_, SparseMatrixType_, dim_ >
Base class of all timesteppers.
Reads the /timestepping parameters (see abstract_timestepper.hh for the list), and implements run(), which handles snapshots and restarts around the stepper's run_segment().
- Template Parameters
-
| VectorType_ | vector type of the assembler: dealii::Vector<double>, or a PETSc MPI vector in an MPI build. |
| SparseMatrixType_ | sparse matrix type of the assembler. |
| dim_ | spatial dimension; 0 for a pure-variables system. |
template<typename VectorType_ , typename SparseMatrixType_ ,
uint dim_>
template<typename EmitFinalFrame >
| void finalize_output_after_failure |
( |
EmitFinalFrame && | emit_final_frame | ) |
|
|
inlineprotected |
Best-effort output cleanup while a timestepping failure is being reported.
Writes one final frame for the state that failed, then pushes everything pending to disk. Both steps are swallowed on error: a readout that cannot cope with a diverged solution must not replace the failure the caller is actually trying to report, and a drain error is latched anyway and resurfaces at finish().
Callers rethrow the original exception afterwards.
template<typename VectorType_ , typename SparseMatrixType_ ,
uint dim_>
Evolve initial_condition from t_start to t_stop.
The time stepping itself is done by the derived class in run_segment(). Around it, run() provides two optional features, both driven by the configuration:
- Snapshots. At every time of /timestepping/snapshots (see SnapshotSchedule) the flow is split into segments, and the state at each boundary is written to
<run name>_snapshot_<nnn>.h5 next to the run's other output. The stepper is restarted at each snapshot, which costs one solver restart per snapshot.
- Restart. If /restart/file names a snapshot, the first call to run() restores the mesh, the state, the model's history-dependent state and the adaptation schedule from it, logs every configuration entry that differs from the snapshot's, and starts at the snapshot's time;
t_start is then ignored. initial_condition must still have been set up as usual (interpolate()), so that its block structure exists.
Snapshots are never overwritten: run() throws before stepping if one it would write exists. A restart from one of this run's own snapshots continues the run, numbering its snapshots on from there; finding a later one already on disk then means the run has continued before.
Without either, this is exactly one call to run_segment().
- Parameters
-
| initial_condition | The state; on return it holds the state at the end of the run. |
| t_start | The start time of the simulation. |
| t_stop | The run method will evolve the system from t_start to t_stop. |
template<typename VectorType_ , typename SparseMatrixType_ ,
uint dim_>
Any derived class must implement this method to run the timestepping algorithm.
It must return the state at t_stop in initial_condition, because run() writes snapshots from it. Called once per segment, i.e. possibly several times per run() with consecutive intervals.
- Parameters
-
| initial_condition | The flowing variables object that contains the initial condition. |
| t_start | The start time of the segment. |
| t_stop | The end time of the segment. |
Implemented in TimeStepperBoostRK_impl< VectorType, SparseMatrixType, dim, prec >, TimeStepperImplicitEuler_impl< VectorType, SparseMatrixType, dim, LinearSolver >, TimeStepperSUNDIALS_IDA_BoostABM_impl< VectorType, SparseMatrixType, dim, LinearSolver >, TimeStepperSUNDIALS_IDA_BoostRK_impl< VectorType, SparseMatrixType, dim, LinearSolver, prec >, TimeStepperSUNDIALS_IDA_impl< VectorType, SparseMatrixType, dim, LinearSolver >, and TimeStepperTRBDF2_impl< VectorType, SparseMatrixType, dim, LinearSolver >.