advance_n_steps#

Header: <pressio/ode_advancers.hpp>

API#

namespace pressio { namespace ode{

template<
  class StepperType,
  class StateType,
  class IndVarType>
#ifdef PRESSIO_ENABLE_CXX20
  requires Steppable<StepperType>
#endif
void advance_n_steps(StepperType & stepper,                        (1)
                     StateType & state,
                     const IndVarType & startVal,
                     const IndVarType & stepSize,
                     ::pressio::ode::StepCount numSteps);

template<
  class StepperType,
  class StateType,
  class IndVarType,
  class StepSizePolicyType>
#ifdef PRESSIO_ENABLE_CXX20
  requires Steppable<StepperType>
        && StepSizePolicy<StepSizePolicyType, IndVarType>
#endif
void advance_n_steps(StepperType & stepper,                        (2)
                     StateType & state,
                     const IndVarType & startVal,
                     const StepSizePolicyType & stepSizePolicy,
                     ::pressio::ode::StepCount numSteps);

template<
  class StepperType,
  class StateType,
  class IndVarType,
  class ObserverType>
#ifdef PRESSIO_ENABLE_CXX20
  requires Steppable<StepperType>
        && StateObserver<ObserverType,IndVarType, StateType>
#endif
void advance_n_steps(StepperType & stepper,                        (3)
                     StateType & state,
                     const IndVarType & startVal,
                     const IndVarType & stepSize,
                     ::pressio::ode::StepCount numSteps,
                     ObserverType && observer);


  class StepperType,
  class StateType,
  class IndVarType,
  class StepSizePolicyType,
  class ObserverType>
#ifdef PRESSIO_ENABLE_CXX20
  requires Steppable<StepperType>
        && StepSizePolicy<StepSizePolicyType, IndVarType>
        && StateObserver<ObserverType, IndVarType, StateType>
#endif
void advance_n_steps(StepperType & stepper,                        (4)
                     StateType & state,
                     const IndVarType & startVal,
                     const StepSizePolicyType & stepSizePolicy,
                     ::pressio::ode::StepCount numSteps,
                     ObserverType && observer);

template<
  class StepperType,
  class StateType,
  class IndVarType,
  class AuxT,
  class ...Args>
#ifdef PRESSIO_ENABLE_CXX20
  requires SteppableWithAuxiliaryArgs<StepperType, AuxT, Args...>
#endif
void advance_n_steps(StepperType & stepper,                        (5)
                     StateType & state,
                     const IndVarType & startVal,
                     const IndVarType & stepSize,
                     ::pressio::ode::StepCount numSteps,
                     AuxT && auxArg,
                     Args && ... args);

template<
  class StepperType,
  class StateType,
  class StepSizePolicyType,
  class IndVarType,
  class AuxT,
  class ...Args>
#ifdef PRESSIO_ENABLE_CXX20
  requires SteppableWithAuxiliaryArgs<StepperType, AuxT, Args...>
        && StepSizePolicy<StepSizePolicyType, IndVarType>
#endif
void advance_n_steps(StepperType & stepper,                        (6)
                     StateType & state,
                     const IndVarType & startVal,
                     StepSizePolicyType && stepSizePolicy,
                     ::pressio::ode::StepCount numSteps,
                     AuxT && auxArg,
                     Args && ... args);

template<
  class StepperType,
  class StateType,
  class ObserverType,
  class IndVarType,
  class AuxT,
  class ...Args>
#ifdef PRESSIO_ENABLE_CXX20
  requires SteppableWithAuxiliaryArgs<StepperType, AuxT, Args...>
        && StateObserver<ObserverType, IndVarType, StateType>
#endif
void advance_n_steps(StepperType & stepper,                        (7)
                     StateType & state,
                     const IndVarType & startVal,
                     const IndVarType & stepSize,
                     ::pressio::ode::StepCount numSteps,
                     ObserverType && observer,
                     AuxT && auxArg,
                     Args && ... args);

template<
  class StepperType,
  class StateType,
  class StepSizePolicyType,
  class ObserverType,
  class IndVarType,
  class AuxT,
  class ...Args>
#ifdef PRESSIO_ENABLE_CXX20
  requires SteppableWithAuxiliaryArgs<StepperType, AuxT, Args...>
        && StepSizePolicy<StepSizePolicyType, IndVarType>
        && StateObserver<ObserverType, IndVarType, StateType>
#endif
void advance_n_steps(StepperType & stepper,                        (8)
                     StateType & state,
                     const IndVarType & startVal,
                     StepSizePolicyType && stepSizePolicy,
                     ::pressio::ode::StepCount numSteps,
                     ObserverType && observer,
                     AuxT && auxArg,
                     Args && ... args);

}} // end namespace pressio::ode

Description#

Perform \(n\) steps of a stepper object and update a state.

Parameters#

stepper

object that knows how to perform a single step

state

the “state” information to update

startVal

starting value of the independent variable

numSteps

how many steps to take

stepSizePolicy

functor to set the step size

stepSize

constant step size to use for each step

observer

object to “observe” the state’s evolution, which can be used to potentially collect necessary data/metrics/statistics or do other things from the state

auxArg, args

extra arguments that might be needed by the stepper to execute one step

Constraints#

Concepts are documented here. Note: constraints are enforced via proper C++20 concepts when PRESSIO_ENABLE_CXX20 is enabled, otherwise via SFINAE and static asserts.

Preconditions#

finish

Mandates#

  • std::is_same<IndVarType, typename StepperType::independent_variable_type>

  • std::is_same<StateType, typename StepperType::state_type>

Return value#

None

Postconditions and Side Effects#

finish