Sandals  v0.0.0
A C++ library for ODEs/DAEs integration
Loading...
Searching...
No Matches
Sandals::ExplicitWrapper< Real, N, M > Class Template Reference

Class container for the system of explicit ODEs/DAEs wrapper. More...

#include <Explicit.hh>

Inherits Sandals::Explicit< Real, N, 0 >.

Public Types

using Pointer = std::shared_ptr<ExplicitWrapper<Real, N, M>>
using FunctionF = std::function<VectorF(VectorF const &, Real const)>
using FunctionJF = std::function<MatrixJF(VectorF const &, Real const)>
using FunctionH = std::function<VectorH(VectorF const &, Real const)>
using FunctionJH = std::function<MatrixJH(VectorF const &, Real const)>
using FunctionID = std::function<bool(VectorF const &, Real const)>
Public Types inherited from Sandals::Explicit< Real, N, 0 >
using Pointer
using VectorF
using MatrixJF
using Type
Public Types inherited from Sandals::Implicit< Real, N, M >
using Type
using Pointer
using VectorF
using MatrixJF
using VectorH
using MatrixJH

Public Member Functions

 ExplicitWrapper (FunctionF t_f, FunctionJF t_Jf_x, FunctionH t_h=DefaultH, FunctionJH t_Jh_x=DefaultJH, FunctionID t_in_domain=DefaultID)
 ExplicitWrapper (std::string t_name, FunctionF t_f, FunctionJF t_Jf_x, FunctionH t_h=DefaultH, FunctionJH t_Jh_x=DefaultJH, FunctionID t_in_domain=DefaultID)
 ~ExplicitWrapper ()
FunctionFf ()
FunctionJFJf_x ()
FunctionHh ()
FunctionJHJh_x ()
FunctionIDin_domain ()
VectorF f (VectorF const &x, Real const t) const override
MatrixJF Jf_x (VectorF const &x, Real const t) const override
VectorH h (VectorF const &x, Real const t) const override
MatrixJH Jh_x (VectorF const &x, Real const t) const override
bool in_domain (VectorF const &x, Real const t) const override
Public Member Functions inherited from Sandals::Explicit< Real, N, 0 >
VectorF F (VectorF const &x, VectorF const &x_dot, Real const t) const override
MatrixJF JF_x (VectorF const &x, VectorF const &, Real const t) const override
MatrixJF JF_x_dot (VectorF const &, VectorF const &, Real) const override
VectorF f_reverse (VectorF const &x, Real const t) const
MatrixJF Jf_x_reverse (VectorF const &x, Real const t) const
VectorF F_reverse (VectorF const &x, VectorF const &x_dot, Real const t) const
MatrixJF JF_x_reverse (VectorF const &x, VectorF const &, Real const t) const
MatrixJF JF_x_dot_reverse (VectorF const &, VectorF const &, Real) const
Public Member Functions inherited from Sandals::Implicit< Real, N, M >
virtual ~Implicit ()
Type type () const
bool is_implicit () const
bool is_explicit () const
bool is_semiexplicit () const
std::string & name ()
Integer equations_number () const
Integer invariants_number () const
VectorF F_reverse (VectorF const &x, VectorF const &x_dot, Real const t) const
MatrixJF JF_x_reverse (VectorF const &x, VectorF const &x_dot, Real const t) const
MatrixJF JF_x_dot_reverse (VectorF const &x, VectorF const &x_dot, Real const t) const

Static Public Attributes

static const FunctionH DefaultH = [](VectorF const &, Real const) {return VectorH::Zero();}
static const FunctionJH DefaultJH = [](VectorF const &, Real const) {return MatrixJH::Zero();}
static const FunctionID DefaultID = [](VectorF const &, Real const) {return true;}

Private Attributes

FunctionF m_f {nullptr}
FunctionJF m_Jf_x {nullptr}
FunctionH m_h {nullptr}
FunctionJH m_Jh_x {nullptr}
FunctionID m_in_domain {nullptr}

Additional Inherited Members

Protected Member Functions inherited from Sandals::Explicit< Real, N, 0 >
 Explicit (Type t_type, std::string t_name)
Protected Member Functions inherited from Sandals::Implicit< Real, N, M >
 Implicit (Type t_type, std::string t_name)

Detailed Description

template<typename Real, Integer N, Integer M = 0>
class Sandals::ExplicitWrapper< Real, N, M >

Class container for the system of explicit ordinary differential equations (ODEs) or differential algebraic equations (DAEs) of the type \( \mathbf{F}(\mathbf{x}, \mathbf{x}^{\prime}, t) = \mathbf{0} \), with invariants manifold \( \mathbf{h}(\mathbf{x}, t) = \mathbf{0} \).

Template Parameters
RealThe scalar number type.
NThe dimension of the explicit ODE system.
MThe dimension of the invariants manifold.

Member Typedef Documentation

◆ FunctionF

template<typename Real, Integer N, Integer M = 0>
using Sandals::ExplicitWrapper< Real, N, M >::FunctionF = std::function<VectorF(VectorF const &, Real const)>

< Templetized matrix type. Explicit ODE system function type.

◆ FunctionH

template<typename Real, Integer N, Integer M = 0>
using Sandals::ExplicitWrapper< Real, N, M >::FunctionH = std::function<VectorH(VectorF const &, Real const)>

Invariants function type.

◆ FunctionID

template<typename Real, Integer N, Integer M = 0>
using Sandals::ExplicitWrapper< Real, N, M >::FunctionID = std::function<bool(VectorF const &, Real const)>

In-domain function type.

◆ FunctionJF

template<typename Real, Integer N, Integer M = 0>
using Sandals::ExplicitWrapper< Real, N, M >::FunctionJF = std::function<MatrixJF(VectorF const &, Real const)>

Jacobian of the ODE system function function type.

◆ FunctionJH

template<typename Real, Integer N, Integer M = 0>
using Sandals::ExplicitWrapper< Real, N, M >::FunctionJH = std::function<MatrixJH(VectorF const &, Real const)>

Jacobian of the invariants function type.

◆ Pointer

template<typename Real, Integer N, Integer M = 0>
using Sandals::ExplicitWrapper< Real, N, M >::Pointer = std::shared_ptr<ExplicitWrapper<Real, N, M>>

Shared pointer to an explicit ODE system.

Constructor & Destructor Documentation

◆ ExplicitWrapper() [1/2]

template<typename Real, Integer N, Integer M = 0>
Sandals::ExplicitWrapper< Real, N, M >::ExplicitWrapper ( FunctionF t_f,
FunctionJF t_Jf_x,
FunctionH t_h = DefaultH,
FunctionJH t_Jh_x = DefaultJH,
FunctionID t_in_domain = DefaultID )
inline

Class constructor for the explicit ODE/DAE system wrapper.

Parameters
[in]t_fThe explicit ODE system function.
[in]t_Jf_xThe Jacobian of the explicit ODE system function with respect to the states.
[in]t_hThe system's invariants.
[in]t_Jh_xThe Jacobian of the system's invariants with respect to the states.
[in]t_in_domainThe in-domain function.

◆ ExplicitWrapper() [2/2]

template<typename Real, Integer N, Integer M = 0>
Sandals::ExplicitWrapper< Real, N, M >::ExplicitWrapper ( std::string t_name,
FunctionF t_f,
FunctionJF t_Jf_x,
FunctionH t_h = DefaultH,
FunctionJH t_Jh_x = DefaultJH,
FunctionID t_in_domain = DefaultID )
inline

Class constructor for the explicit ODE system wrapper.

Parameters
[in]t_nameThe name of the explicit ODE system.
[in]t_fThe explicit ODE system function.
[in]t_Jf_xThe Jacobian of the explicit ODE system function with respect to the states.
[in]t_hThe system's invariants.
[in]t_Jh_xThe Jacobian of the system's invariants with respect to the states.
[in]t_in_domainThe in-domain function.

◆ ~ExplicitWrapper()

template<typename Real, Integer N, Integer M = 0>
Sandals::ExplicitWrapper< Real, N, M >::~ExplicitWrapper ( )
inline

Class destructor for the explicit ODE/DAE system wrapper.

Member Function Documentation

◆ f() [1/2]

template<typename Real, Integer N, Integer M = 0>
FunctionF & Sandals::ExplicitWrapper< Real, N, M >::f ( )
inline

Get the explicit ODE system function.

Returns
The explicit ODE system function.

◆ f() [2/2]

template<typename Real, Integer N, Integer M = 0>
VectorF Sandals::ExplicitWrapper< Real, N, M >::f ( VectorF const & x,
Real const t ) const
inlineoverridevirtual

Evaluate the ODE/DAE system \( \mathbf{f}(\mathbf{x}, t) \).

Parameters
[in]xStates \( \mathbf{x} \).
[in]tIndependent variable (or time) \( t \).
Returns
The system function \( \mathbf{f}(\mathbf{x}, t) \).

Implements Sandals::Explicit< Real, N, 0 >.

◆ h() [1/2]

template<typename Real, Integer N, Integer M = 0>
FunctionH & Sandals::ExplicitWrapper< Real, N, M >::h ( )
inline

Get the system's invariants.

Returns
The system's invariants.

◆ h() [2/2]

template<typename Real, Integer N, Integer M = 0>
VectorH Sandals::ExplicitWrapper< Real, N, M >::h ( VectorF const & x,
Real const t ) const
inlineoverridevirtual

Evaluate the ODE/DAE system invariants \( \mathbf{h}(\mathbf{x}, t) \).

Parameters
[in]xStates \( \mathbf{x} \).
[in]tIndependent variable (or time) \( t \).
Returns
The system invariants \( \mathbf{h}(\mathbf{x}, t) \).

Implements Sandals::Implicit< Real, N, M >.

◆ in_domain() [1/2]

template<typename Real, Integer N, Integer M = 0>
FunctionID & Sandals::ExplicitWrapper< Real, N, M >::in_domain ( )
inline

Get the in-domain function.

Returns
The in-domain function.

◆ in_domain() [2/2]

template<typename Real, Integer N, Integer M = 0>
bool Sandals::ExplicitWrapper< Real, N, M >::in_domain ( VectorF const & x,
Real const t ) const
inlineoverridevirtual

Return true if the values \( \mathbf{f}(\mathbf{x}, t) \) is in the domain of the ODE/DAE system.

Parameters
[in]xStates \( \mathbf{x} \).
[in]tIndependent variable (or time) \( t \).
Returns
True if \( \mathbf{f}(\mathbf{x}, t) \) is in the domain of the ODE/DAE system.

Implements Sandals::Implicit< Real, N, M >.

◆ Jf_x() [1/2]

template<typename Real, Integer N, Integer M = 0>
FunctionJF & Sandals::ExplicitWrapper< Real, N, M >::Jf_x ( )
inline

Get the Jacobian of the explicit ODE system function with respect to the states.

Returns
The Jacobian of the explicit ODE system function with respect to the states.

◆ Jf_x() [2/2]

template<typename Real, Integer N, Integer M = 0>
MatrixJF Sandals::ExplicitWrapper< Real, N, M >::Jf_x ( VectorF const & x,
Real const t ) const
inlineoverridevirtual

Evaluate the Jacobian of the explicit ODE system function \( \mathbf{f}(\mathbf{x}, t) \) with respect to the states \( \mathbf{x} \)

\[\mathbf{Jf}_{\mathbf{x}}(\mathbf{x}, t) = \displaystyle\frac{\partial\mathbf{f}(\mathbf{x}, t)}{\partial\mathbf{x}} \text{.} \]

Parameters
[in]xStates \( \mathbf{x} \).
[in]tIndependent variable (or time) \( t \).
Returns
The Jacobian \( \mathbf{Jf}_{\mathbf{x}}(\mathbf{x}, t) \).

Implements Sandals::Explicit< Real, N, 0 >.

◆ Jh_x() [1/2]

template<typename Real, Integer N, Integer M = 0>
FunctionJH & Sandals::ExplicitWrapper< Real, N, M >::Jh_x ( )
inline

Get the Jacobian of the system's invariants with respect to the states.

Returns
The Jacobian of the system's invariants with respect to the states.

◆ Jh_x() [2/2]

template<typename Real, Integer N, Integer M = 0>
MatrixJH Sandals::ExplicitWrapper< Real, N, M >::Jh_x ( VectorF const & x,
Real const t ) const
inlineoverridevirtual

Evaluate the Jacobian of the ODE/DAE system invariants \( \mathbf{h}(\mathbf{x}, t) \) with respect to the states \( \mathbf{x} \)

\[\mathbf{Jh}_{\mathbf{x}}(\mathbf{x} t) = \displaystyle\frac{\partial\mathbf{h}(\mathbf{x}, t)}{\partial\mathbf{x}} \text{.} \]

Parameters
[in]xStates \( \mathbf{x} \).
[in]tIndependent variable (or time) \( t \).
Returns
The Jacobian \( \mathbf{Jh}_{\mathbf{x}}(\mathbf{x}, t) \).

Implements Sandals::Implicit< Real, N, M >.

Member Data Documentation

◆ DefaultH

template<typename Real, Integer N, Integer M = 0>
const FunctionH Sandals::ExplicitWrapper< Real, N, M >::DefaultH = [](VectorF const &, Real const) {return VectorH::Zero();}
inlinestatic

Default mass matrix function.

◆ DefaultID

template<typename Real, Integer N, Integer M = 0>
const FunctionID Sandals::ExplicitWrapper< Real, N, M >::DefaultID = [](VectorF const &, Real const) {return true;}
inlinestatic

Default in-domain function.

◆ DefaultJH

template<typename Real, Integer N, Integer M = 0>
const FunctionJH Sandals::ExplicitWrapper< Real, N, M >::DefaultJH = [](VectorF const &, Real const) {return MatrixJH::Zero();}
inlinestatic

Default system matrix function.

◆ m_f

template<typename Real, Integer N, Integer M = 0>
FunctionF Sandals::ExplicitWrapper< Real, N, M >::m_f {nullptr}
private

Explicit ODE system function.

◆ m_h

template<typename Real, Integer N, Integer M = 0>
FunctionH Sandals::ExplicitWrapper< Real, N, M >::m_h {nullptr}
private

System invariants.

◆ m_in_domain

template<typename Real, Integer N, Integer M = 0>
FunctionID Sandals::ExplicitWrapper< Real, N, M >::m_in_domain {nullptr}
private

In-domain function.

◆ m_Jf_x

template<typename Real, Integer N, Integer M = 0>
FunctionJF Sandals::ExplicitWrapper< Real, N, M >::m_Jf_x {nullptr}
private

Jacobian of the explicit ODE system function with respect to the states.

◆ m_Jh_x

template<typename Real, Integer N, Integer M = 0>
FunctionJH Sandals::ExplicitWrapper< Real, N, M >::m_Jh_x {nullptr}
private

Jacobian of the system's invariants with respect to the states.


The documentation for this class was generated from the following file: