Fully-discrete systems#

Header: <pressio/ode_steppers_implicit.hpp>

Public namespace: pressio::ode

Scope#

An “implicit stepper” in pressio is an abstraction that represents “how” to take a step when applying an implicit scheme to initial value problems expressable in the following fully discrete form

\[\boldsymbol{R}(\boldsymbol{y_{n}}, \boldsymbol{y_{n-1}}, ..., t_n, dt_n; ...) = \boldsymbol{0}, \qquad y(t_0) = y_0\]

Here, \(y_{n}\) is the state at the n-th step, \(t\) is independent variable, and \(R\) is the residual.

Recall the definition of implicit methods

Implicit methods update the state by solving a (potentially nonlinear) system of equations involving the current, the predicted state and possibly previous states.

API#

namespace pressio{ namespace ode{

template<int TotalNumberOfDesiredStates, class SystemType>
#if defined PRESSIO_ENABLE_CXX20
  requires RealValuedFullyDiscreteSystemWithJacobian<
     mpl::remove_cvref_t<SystemType>, TotalNumberOfDesiredStates>
  && (Traits<typename mpl::remove_cvref_t<SystemType>::state_type>::rank == 1)
  && (Traits<typename mpl::remove_cvref_t<SystemType>::discrete_residual_type>::rank == 1)
  && (Traits<typename mpl::remove_cvref_t<SystemType>::discrete_jacobian_type>::rank == 2)
  && requires(      typename mpl::remove_cvref_t<SystemType>::state_type & s,
	            typename mpl::remove_cvref_t<SystemType>::discrete_residual_type & r,
	            typename mpl::remove_cvref_t<SystemType>::discrete_jacobian_type & J,
	      const typename mpl::remove_cvref_t<SystemType>::state_type & s1,
	      const typename mpl::remove_cvref_t<SystemType>::state_type & s2,
	      const typename mpl::remove_cvref_t<SystemType>::state_type & s3,
	      ode::scalar_of_t< mpl::remove_cvref_t<SystemType>, TotalNumberOfDesiredStates > a)
  {
    { ::pressio::ops::deep_copy(s, s1) };
  }
#endif
auto create_implicit_stepper(SystemType && system)

}} // end namespace pressio::ode

Parameters and templates#

  • TotalNumberOfDesiredStates: defines how many totaly states you need/want. For example, say that your arbitrary scheme needs \(y_n+1, y_n, y_n-1\). In such case, you use: TotalNumberOfDesiredStates = 3. If you need three auxiliary states (beside) the main state to update, then use: TotalNumberOfDesiredStates = 4.

  • system: problem instance to evaluate the discrete residual and jacobian

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.

  • TotalNumberOfDesiredStates: currently must be set to one of {2, 3}

Preconditions#

  • system must bind to an lvalue object whose lifetime is longer that that of the instantiated stepper, i.e., it is destructed after the stepper goes out of scope

Examples#

TBD