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

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

#include <Implicit.hh>

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

Public Types

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

Public Member Functions

 ImplicitWrapper (FunctionF t_F, FunctionJF t_JF_x, FunctionJF t_JF_x_dot, FunctionH t_h=DefaultH, FunctionJH t_Jh_x=DefaultJH, FunctionID t_in_domain=DefaultID)
 ImplicitWrapper (std::string t_name, FunctionF t_F, FunctionJF t_JF_x, FunctionJF t_JF_x_dot, FunctionH t_h=DefaultH, FunctionJH t_Jh_x=DefaultJH, FunctionID t_in_domain=DefaultID)
 ~ImplicitWrapper ()
FunctionFF ()
FunctionJFJF_x ()
FunctionJFJF_x_dot ()
FunctionHh ()
FunctionJHJh_x ()
FunctionIDin_domain ()
VectorF F (VectorF const &x, VectorF const &x_dot, Real t) const override
MatrixJF JF_x (VectorF const &x, VectorF const &x_dot, Real t) const override
MatrixJF JF_x_dot (VectorF const &x, VectorF const &x_dot, Real t) const override
VectorH h (VectorF const &x, Real t) const override
MatrixJH Jh_x (VectorF const &x, Real t) const override
bool in_domain (VectorF const &x, Real t) const override
Public Member Functions inherited from Sandals::Implicit< Real, N, 0 >
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 t) const
MatrixJF JF_x_reverse (VectorF const &x, VectorF const &x_dot, Real t) const
MatrixJF JF_x_dot_reverse (VectorF const &x, VectorF const &x_dot, Real t) const

Static Public Attributes

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

Private Attributes

FunctionF m_F {nullptr}
FunctionJF m_JF_x {nullptr}
FunctionJF m_JF_x_dot {nullptr}
FunctionH m_h {nullptr}
FunctionJH m_Jh_x {nullptr}
FunctionID m_in_domain {nullptr}

Additional Inherited Members

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

Detailed Description

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

Class container for the system of implicit 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 implicit ODE system.
MThe dimension of the invariants manifold.

Member Typedef Documentation

◆ FunctionF

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

Implicit ODE system function type.

◆ FunctionH

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

Invariants function type.

◆ FunctionID

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

In-domain function type.

◆ FunctionJF

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

Jacobian of the ODE system function function type.

◆ FunctionJH

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

Jacobian of the invariants function type.

◆ MatrixJF

template<typename Real, Integer N, Integer M = 0>
using Sandals::ImplicitWrapper< Real, N, M >::MatrixJF = typename Implicit<Real, N, M>::MatrixJF

Templetized matrix type.

◆ MatrixJH

template<typename Real, Integer N, Integer M = 0>
using Sandals::ImplicitWrapper< Real, N, M >::MatrixJH = typename Implicit<Real, N, M>::MatrixJH

Templetized matrix type.

◆ Pointer

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

< Basic constants. Shared pointer to an implicit ODE system.

◆ VectorF

template<typename Real, Integer N, Integer M = 0>
using Sandals::ImplicitWrapper< Real, N, M >::VectorF = typename Implicit<Real, N, M>::VectorF

Templetized vector type.

◆ VectorH

template<typename Real, Integer N, Integer M = 0>
using Sandals::ImplicitWrapper< Real, N, M >::VectorH = typename Implicit<Real, N, M>::VectorH

Templetized vector type.

Constructor & Destructor Documentation

◆ ImplicitWrapper() [1/2]

template<typename Real, Integer N, Integer M = 0>
Sandals::ImplicitWrapper< Real, N, M >::ImplicitWrapper ( FunctionF t_F,
FunctionJF t_JF_x,
FunctionJF t_JF_x_dot,
FunctionH t_h = DefaultH,
FunctionJH t_Jh_x = DefaultJH,
FunctionID t_in_domain = DefaultID )
inline

Class constructor for the implicit ODE/DAE system wrapper.

Parameters
[in]t_FThe implicit ODE system function.
[in]t_JF_xThe Jacobian of the implicit ODE system function with respect to the states.
[in]t_JF_x_dotThe Jacobian of the implicit ODE system function with respect to the states derivative.
[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.

◆ ImplicitWrapper() [2/2]

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

Class constructor for the implicit ODE/DAE system wrapper.

Parameters
[in]t_nameThe name of the implicit ODE/DAE system.
[in]t_FThe implicit ODE system function.
[in]t_JF_xThe Jacobian of the implicit ODE system function with respect to the states.
[in]t_JF_x_dotThe Jacobian of the implicit ODE system function with respect to the states derivative.
[in]t_hThe implicit ODE system invariants.
[in]t_Jh_xThe Jacobian of the implicit ODE system invariants with respect to the states.
[in]t_in_domainThe in-domain function.

◆ ~ImplicitWrapper()

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

Class destructor for the implicit ODE/DAE system wrapper.

Member Function Documentation

◆ F() [1/2]

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

Get the implicit ODE system function.

Returns
The implicit ODE system function.

◆ F() [2/2]

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

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

Parameters
[in]xStates \( \mathbf{x} \).
[in]x_dotStates derivative \( \mathbf{x}^{\prime} \).
[in]tIndependent variable (or time) \( t \).
Returns
The system function \( \mathbf{F}(\mathbf{x}, \mathbf{x}^{\prime}, t) \).

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

◆ h() [1/2]

template<typename Real, Integer N, Integer M = 0>
FunctionH & Sandals::ImplicitWrapper< 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::ImplicitWrapper< Real, N, M >::h ( VectorF const & x,
Real 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, 0 >.

◆ in_domain() [1/2]

template<typename Real, Integer N, Integer M = 0>
FunctionID & Sandals::ImplicitWrapper< 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::ImplicitWrapper< Real, N, M >::in_domain ( VectorF const & x,
Real t ) const
inlineoverridevirtual

Return true if the values \( \mathbf{F}(\mathbf{x}, \mathbf{x}^{\prime}, 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, 0 >.

◆ JF_x() [1/2]

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

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

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

◆ JF_x() [2/2]

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

Evaluate the Jacobian of the implicit ODE system function \( \mathbf{F}(\mathbf{x}, \mathbf{x}^{\prime}, t) \) with respect to the states \( \mathbf{x} \)

\[\mathbf{JF}_{\mathbf{x}}(\mathbf{x}, \mathbf{x}^{\prime}, t) = \displaystyle\frac{ \partial\mathbf{F}(\mathbf{x}, \mathbf{x}^{\prime}, t)}{\partial\mathbf{x}} \text{.} \]

Parameters
[in]xStates \( \mathbf{x} \).
[in]x_dotStates derivative \( \mathbf{x}^{\prime} \).
[in]tIndependent variable (or time) \( t \).
Returns
The Jacobian \( \mathbf{JF}_{\mathbf{x}}(\mathbf{x}, \mathbf{x}^{\prime}, t) \).

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

◆ JF_x_dot() [1/2]

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

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

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

◆ JF_x_dot() [2/2]

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

Evaluate the Jacobian of the implicit ODE system function \( \mathbf{F}(\mathbf{x}, \mathbf{x}^{\prime}, t) \) with respect to the states derivative \( \mathbf{x}^{\prime} \)

\[\mathbf{JF}_{\mathbf{x}^{\prime}}(\mathbf{x}, \mathbf{x}^{\prime}, t) = \displaystyle \frac{\partial\mathbf{F}(\mathbf{x}, \mathbf{x}^{\prime}, t)}{\partial\mathbf{x}^{\prime}} \text{.} \]

Parameters
[in]xStates \( \mathbf{x} \).
[in]x_dotStates derivative \( \mathbf{x}^{\prime} \).
[in]tIndependent variable (or time) \( t \).
Returns
The Jacobian \( \mathbf{JF}_{\mathbf{x}^{\prime}}(\mathbf{x}, \mathbf{x}^{\prime}, t) \).

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

◆ Jh_x() [1/2]

template<typename Real, Integer N, Integer M = 0>
FunctionJH & Sandals::ImplicitWrapper< 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::ImplicitWrapper< Real, N, M >::Jh_x ( VectorF const & x,
Real 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, 0 >.

Member Data Documentation

◆ DefaultH

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

Default mass matrix function.

◆ DefaultID

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

Default in-domain function.

◆ DefaultJH

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

Default system matrix function.

◆ m_F

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

Implicit ODE system function.

◆ m_h

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

System's invariants.

◆ m_in_domain

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

In-domain function.

◆ m_JF_x

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

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

◆ m_JF_x_dot

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

Jacobian of the implicit ODE system function with respect to the states derivative.

◆ m_Jh_x

template<typename Real, Integer N, Integer M = 0>
FunctionJH Sandals::ImplicitWrapper< 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: