Dune::Copasi
|
Adapt an stepper into a simple adaptive time stepper. More...
#include <stepper.hh>
Public Member Functions | |
SimpleAdaptiveStepper (std::function< TimeQuantity &(State &)> time_mut, std::function< const TimeQuantity &(const State &)> time_const, double decrease_factor=0.5, double increase_factor=1.5, std::optional< DurationQuantity > min_step={}, std::optional< DurationQuantity > max_step={}) | |
Construct a new simple adaptive 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&>; } | |
SimpleAdaptiveStepper (double decrease_factor=0.5, double increase_factor=1.5, std::optional< DurationQuantity > min_step={}, std::optional< DurationQuantity > max_step={}) | |
Construct a new simple adaptive stepper. | |
PDELab::ErrorCondition | do_step (PDELab::OneStep< State > &one_step, const State &in, State &out, DurationQuantity &dt) const override |
Perform one simple adaptive time step of the system. | |
Public Member Functions inherited from Dune::Copasi::TimeStepper< State, TimeQuantity, DurationQuantity > | |
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. | |
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. | |
Adapt an stepper into a simple adaptive time stepper.
When a time step is not successful, the delta time will be decreased until step is successful or the minimum time step is reached. When step is successful, delta time is increased up to a maximum value
TimeQuantity | Type representing time quantities |
DurationQuantity | Type representing duration quantities |
State | Type representing states |
|
inline |
Construct a new simple adaptive 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 |
decrease_factor | Factor to decrease time step on failure |
increase_factor | Factor to increase time step on success |
min_step | Minimum step size |
max_step | Maximum step size |
|
inlineexplicit |
Construct a new simple adaptive stepper.
decrease_factor | Factor to decrease time step on failure |
increase_factor | Factor to increase time step on success |
min_step | Minimum step size |
max_step | Maximum step size |
|
inlineoverridevirtual |
Perform one simple adaptive time step of the system.
When a time step is not successful, the delta time will be decreased until step is successful or the minimum time step is reached. When step is successful, delta time is increased up to a maximum value
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 from Dune::Copasi::TimeStepper< State, TimeQuantity, DurationQuantity >.