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

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

#include <SemiExplicit.hh>

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

Public Types

using Pointer = std::shared_ptr<SemiExplicitWrapper<Real, N, M>>
using VectorF = typename SemiExplicit<Real, N, M>::VectorF
using MatrixA = typename SemiExplicit<Real, N, M>::MatrixA
using TensorTA = typename SemiExplicit<Real, N, M>::TensorTA
using VectorB = typename SemiExplicit<Real, N, M>::VectorB
using MatrixJB = typename SemiExplicit<Real, N, M>::MatrixJB
using VectorH = typename SemiExplicit<Real, N, M>::VectorH
using MatrixJH = typename SemiExplicit<Real, N, M>::MatrixJH
using FunctionA = std::function<MatrixA(VectorF const &, Real)>
using FunctionTA = std::function<TensorTA(VectorF const &, Real)>
using FunctionB = std::function<VectorB(VectorF const &, Real)>
using FunctionJB = std::function<MatrixJB(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::SemiExplicit< Real, N, 0 >
using Pointer
using VectorF
using MatrixJF
using MatrixA
using TensorTA
using VectorB
using MatrixJB
using Type
Public Types inherited from Sandals::Explicit< Real, N, M >
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

 SemiExplicitWrapper (FunctionA t_A, FunctionTA t_TA_x, FunctionB t_b, FunctionJB t_Jb_x, FunctionH t_h=DefaultH, FunctionJH t_Jh_x=DefaultJH, FunctionID t_in_domain=DefaultID)
 SemiExplicitWrapper (std::string t_name, FunctionA t_A, FunctionTA t_TA_x, FunctionB t_b, FunctionJB t_Jb_x, FunctionH t_h=DefaultH, FunctionJH t_Jh_x=DefaultJH, FunctionID t_in_domain=DefaultID)
 ~SemiExplicitWrapper ()
FunctionAA ()
FunctionTATA_x ()
FunctionBb ()
FunctionJBJb_x ()
FunctionHh ()
FunctionJHJh_x ()
FunctionIDin_domain ()
MatrixA A (VectorF const &x, Real t) const override
TensorTA TA_x (VectorF const &x, Real t) const override
VectorB b (VectorF const &x, Real t) const override
MatrixJB Jb_x (VectorF const &x, 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::SemiExplicit< Real, N, 0 >
 SemiExplicit ()
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 &, Real t) const override
VectorF f (VectorF const &x, Real t) const override
MatrixJF Jf_x (VectorF const &x, VectorF const &x_dot, Real t) const
Public Member Functions inherited from Sandals::Explicit< Real, N, M >
virtual MatrixJF Jf_x (VectorF const &x, Real t) const=0
VectorF f_reverse (VectorF const &x, Real t) const
MatrixJF Jf_x_reverse (VectorF const &x, Real t) const
VectorF F_reverse (VectorF const &x, VectorF const &x_dot, Real t) const
MatrixJF JF_x_reverse (VectorF const &x, VectorF const &, Real 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 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

FunctionA m_A {nullptr}
FunctionTA m_TA_x {nullptr}
FunctionB m_b {nullptr}
FunctionJB m_Jb_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, M >
 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::SemiExplicitWrapper< Real, N, M >

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

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

Member Typedef Documentation

◆ FunctionA

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

Function type for the mass matrix.

◆ FunctionB

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

Function type for the right-hand-side.

◆ FunctionH

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

Invariants function type.

◆ FunctionID

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

In-domain function type.

◆ FunctionJB

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

Function type for the right-hand-side Jacobian.

◆ FunctionJH

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

Jacobian of the invariants function type.

◆ FunctionTA

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

Function type for the mass matrix.

◆ MatrixA

template<typename Real, Integer N, Integer M = 0>
using Sandals::SemiExplicitWrapper< Real, N, M >::MatrixA = typename SemiExplicit<Real, N, M>::MatrixA

Templetized matrix type.

◆ MatrixJB

template<typename Real, Integer N, Integer M = 0>
using Sandals::SemiExplicitWrapper< Real, N, M >::MatrixJB = typename SemiExplicit<Real, N, M>::MatrixJB

Templetized vector type.

◆ MatrixJH

template<typename Real, Integer N, Integer M = 0>
using Sandals::SemiExplicitWrapper< Real, N, M >::MatrixJH = typename SemiExplicit<Real, N, M>::MatrixJH

Templetized invariants Jacobian type.

◆ Pointer

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

< Basic constants. Shared pointer to a semi-explicit ODE/DAE system.

◆ TensorTA

template<typename Real, Integer N, Integer M = 0>
using Sandals::SemiExplicitWrapper< Real, N, M >::TensorTA = typename SemiExplicit<Real, N, M>::TensorTA

Templetized matrix type.

◆ VectorB

template<typename Real, Integer N, Integer M = 0>
using Sandals::SemiExplicitWrapper< Real, N, M >::VectorB = typename SemiExplicit<Real, N, M>::VectorB

Templetized vector type.

◆ VectorF

template<typename Real, Integer N, Integer M = 0>
using Sandals::SemiExplicitWrapper< Real, N, M >::VectorF = typename SemiExplicit<Real, N, M>::VectorF

Templetized vector type.

◆ VectorH

template<typename Real, Integer N, Integer M = 0>
using Sandals::SemiExplicitWrapper< Real, N, M >::VectorH = typename SemiExplicit<Real, N, M>::VectorH

Templetized invariants vector type.

Constructor & Destructor Documentation

◆ SemiExplicitWrapper() [1/2]

template<typename Real, Integer N, Integer M = 0>
Sandals::SemiExplicitWrapper< Real, N, M >::SemiExplicitWrapper ( FunctionA t_A,
FunctionTA t_TA_x,
FunctionB t_b,
FunctionJB t_Jb_x,
FunctionH t_h = DefaultH,
FunctionJH t_Jh_x = DefaultJH,
FunctionID t_in_domain = DefaultID )
inline

Class constructor for the semi-explicit ODE/DAE system wrapper.

Parameters
[in]t_AThe function for the mass matrix.
[in]t_TA_xThe function for the mass matrix.
[in]t_bThe function for the right-hand-side.
[in]t_Jb_xThe function for the right-hand-side Jacobian.
[in]t_hThe invariants function.
[in]t_Jh_xThe Jacobian of the invariants function.
[in]t_in_domainThe in-domain function.

◆ SemiExplicitWrapper() [2/2]

template<typename Real, Integer N, Integer M = 0>
Sandals::SemiExplicitWrapper< Real, N, M >::SemiExplicitWrapper ( std::string t_name,
FunctionA t_A,
FunctionTA t_TA_x,
FunctionB t_b,
FunctionJB t_Jb_x,
FunctionH t_h = DefaultH,
FunctionJH t_Jh_x = DefaultJH,
FunctionID t_in_domain = DefaultID )
inline

Class constructor for the semi-explicit ODE/DAE system wrapper.

Parameters
[in]t_nameThe name of the semi-explicit ODE/DAE system.
[in]t_AThe function for the mass matrix.
[in]t_TA_xThe function for the mass matrix.
[in]t_bThe function for the right-hand-side.
[in]t_Jb_xThe function for the right-hand-side Jacobian.
[in]t_hThe invariants function.
[in]t_Jh_xThe Jacobian of the invariants function.
[in]t_in_domainThe in-domain function.

◆ ~SemiExplicitWrapper()

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

Class destructor for the semi-explicit ODE/DAE system wrapper.

Member Function Documentation

◆ A() [1/2]

template<typename Real, Integer N, Integer M = 0>
FunctionA & Sandals::SemiExplicitWrapper< Real, N, M >::A ( )
inline

Get the function for the mass matrix.

Returns
The function for the mass matrix.

◆ A() [2/2]

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

Evaluate th e semi-explicit ODE/DAE system mass matrix \( \mathbf{A}(\mathbf{x}, t) \).

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

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

◆ b() [1/2]

template<typename Real, Integer N, Integer M = 0>
FunctionB & Sandals::SemiExplicitWrapper< Real, N, M >::b ( )
inline

Get the function for the right-hand-side.

Returns
The function for the right-hand-side.

◆ b() [2/2]

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

Evaluate the semi-explicit ODE/DAE system right-hand-side function \( \mathbf{b}(\mathbf{x}, t) \).

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

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

◆ h() [1/2]

template<typename Real, Integer N, Integer M = 0>
FunctionH & Sandals::SemiExplicitWrapper< 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::SemiExplicitWrapper< 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, M >.

◆ in_domain() [1/2]

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

◆ Jb_x() [1/2]

template<typename Real, Integer N, Integer M = 0>
FunctionJB & Sandals::SemiExplicitWrapper< Real, N, M >::Jb_x ( )
inline

Get the function for the right-hand-side Jacobian.

Returns
The function for the right-hand-side Jacobian.

◆ Jb_x() [2/2]

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

Evaluate the Jacobian of the semi-explicit ODE/DAE system right-hand-side function \( \mathbf{b} (\mathbf{x}, t) \) with respect to the states \( \mathbf{x} \)

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

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

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

◆ Jh_x() [1/2]

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

◆ TA_x() [1/2]

template<typename Real, Integer N, Integer M = 0>
FunctionTA & Sandals::SemiExplicitWrapper< Real, N, M >::TA_x ( )
inline

Get the function for the mass matrix tensor with respect to the states.

Returns
The function for the mass matrix tensor with respect to the states.

◆ TA_x() [2/2]

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

Evaluate the tensor of the semi-explicit ODE/DAE system mass matrix \( \mathbf{A}(\mathbf{x}, t) \) with respect to the states \( \mathbf{x} \)

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

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

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

Member Data Documentation

◆ DefaultH

template<typename Real, Integer N, Integer M = 0>
const FunctionH Sandals::SemiExplicitWrapper< 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::SemiExplicitWrapper< 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::SemiExplicitWrapper< Real, N, M >::DefaultJH = [](VectorF const &, Real) {return MatrixJH::Zero();}
inlinestatic

Default system matrix function.

◆ m_A

template<typename Real, Integer N, Integer M = 0>
FunctionA Sandals::SemiExplicitWrapper< Real, N, M >::m_A {nullptr}
private

Function for the mass matrix.

◆ m_b

template<typename Real, Integer N, Integer M = 0>
FunctionB Sandals::SemiExplicitWrapper< Real, N, M >::m_b {nullptr}
private

Function for the right-hand-side.

◆ m_h

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

Invariants function.

◆ m_in_domain

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

In-domain function.

◆ m_Jb_x

template<typename Real, Integer N, Integer M = 0>
FunctionJB Sandals::SemiExplicitWrapper< Real, N, M >::m_Jb_x {nullptr}
private

Function for the right-hand-side Jacobian.

◆ m_Jh_x

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

Jacobian of the invariants function.

◆ m_TA_x

template<typename Real, Integer N, Integer M = 0>
FunctionTA Sandals::SemiExplicitWrapper< Real, N, M >::m_TA_x {nullptr}
private

Function for the mass matrix.


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