|
Dune::Copasi
|
Simple time stepper of one-step operators. More...
#include <stepper.hh>

Public Member Functions | |
| TimeStepper (std::function< TimeQuantity &(State &)> time_mut, std::function< const TimeQuantity &(const State &)> time_const) | |
| Construct a new time stepper. | |
| template<std::same_as< void > = void> requires requires(const State& cstate, State& mstate) { { cstate.time } -> std::convertible_to<const TimeQuantity&>; { mstate.time } -> std::convertible_to<TimeQuantity&>; } | |
| TimeStepper () | |
| Construct a new time stepper. | |
| TimeStepper (const TimeStepper &)=delete | |
| TimeStepper (TimeStepper &&)=delete | |
| TimeStepper & | operator= (const TimeStepper &)=delete |
| TimeStepper & | operator= (TimeStepper &&)=delete |
| virtual | ~TimeStepper ()=default |
| Time stepper destructor. | |
| virtual PDELab::ErrorCondition | do_step (PDELab::OneStep< State > &one_step, const State &in, State &out, DurationQuantity &dt) const |
| Perform one step of the system. | |
| PDELab::ErrorCondition | evolve (PDELab::OneStep< State > &one_step, const State &in, State &out, DurationQuantity &dt, TimeQuantity end_time, std::function< void(const State &)> callable=[](const State &) {}, bool snap_to_end_time=true) const |
Evolve the system until end_time | |
| PDELab::ErrorCondition | snap_to_time (PDELab::OneStep< State > &one_step, const State &in, State &out, DurationQuantity &dt, TimeQuantity snap_time, std::function< void(const State &)> callable=[](const State &) {}) const |
| Snap the output to a specific time. | |
Simple time stepper of one-step operators.
The polymorphic method do_step advances one time step from input to output state with a given duration. Then, this class is able to evolve a system until a final time.
| TimeQuantity | Type representing time quantities |
| DurationQuantity | Type representing duration quantities |
| State | Type representing states |
|
inline |
Construct a new time stepper.
| time_mut | Functor that obtains a mutable time quantity from a given state |
| time_const | Functor that obtains a constant time quantity from a given constant state |
|
inline |
Construct a new time stepper.
|
delete |
|
delete |
|
virtualdefault |
Time stepper destructor.
|
inlinevirtual |
Perform one step of the system.
The input state is advanced a delta time dt and placed in out state.
| one_step | System that contain suitable operators to advance in time |
| in | Input state to advance time from |
| out | Output state where result will be placed |
| dt | Mutable delta time to perform step |
Reimplemented in Dune::Copasi::SimpleAdaptiveStepper< State, TimeQuantity, DurationQuantity >.
|
inline |
Evolve the system until end_time
The input state is advanced by time steps dt to approach end_time. The application of each timestep is performed using the polymorphic do_step method, which may adapt the timestep dt dynamically.
| one_step | System that contain suitable operators to advance in time |
| in | Input state to advance time from |
| out | Output state where result will be placed. |
| dt | Mutable delta time to perform step |
| end_time | Final time that out state must reach |
| callable | A function called with an state at the end of each successful step |
| snap_to_end_time | True if end_time must be reached exactly, otherwise it will be reached from below with the provided dt |
|
delete |
|
delete |
|
inline |
Snap the output to a specific time.
This method is used to advance towards a snap_time avoiding very small timesteps. It work best if the snap time is a couple of timesteps ahead of the suggested dt. It differs from evolve in that the steps might be done with a suitable stepper for wider range of timesteps.
| one_step | System that contain suitable operators to advance in time. |
| dt | Suggested delta time to reach snap time. It will be modified to reach snap time exactly. |
| snap_time | Final time that out state must reach |
| callable | A function called with an state at the end of each successful step |