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

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

#include <Linear.hh>

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

Public Types

using Pointer = std::shared_ptr<LinearWrapper<Real, N, M>>
using VectorF = typename Linear<Real, N, M>::VectorF
using MatrixJF = typename Linear<Real, N, M>::MatrixJF
using MatrixE = typename Linear<Real, N, M>::MatrixJF
using MatrixA = typename Linear<Real, N, M>::MatrixJF
using VectorB = typename Linear<Real, N, M>::VectorF
using VectorH = typename Explicit<Real, N, M>::VectorH
using MatrixJH = typename Explicit<Real, N, M>::MatrixJH
using FunctionE = std::function<MatrixE(Real)>
using FunctionA = std::function<MatrixA(Real)>
using FunctionB = std::function<VectorB(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::Linear< Real, N, 0 >
using Pointer
using VectorF
using MatrixJF
using MatrixE
using MatrixA
using VectorB
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

 LinearWrapper (FunctionE t_E, FunctionA t_A, FunctionB t_b, FunctionH t_h=DefaultH, FunctionJH t_Jh_x=DefaultJH, FunctionID t_in_domain=DefaultID)
 LinearWrapper (std::string t_name, FunctionE t_E, FunctionA t_A, FunctionB t_b, FunctionH t_h=DefaultH, FunctionJH t_Jh_x=DefaultJH, FunctionID t_in_domain=DefaultID)
 ~LinearWrapper ()
FunctionEE ()
FunctionAA ()
FunctionBb ()
FunctionHh ()
FunctionJHJh_x ()
FunctionIDin_domain ()
MatrixE E (Real t) const override
MatrixA A (Real t) const override
VectorB b (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::Linear< Real, N, 0 >
 Linear ()
VectorF F (VectorF const &x, VectorF const &x_dot, Real t) const override
MatrixJF JF_x (VectorF const &, VectorF const &, Real t) const override
MatrixJF JF_x_dot (VectorF const &, VectorF const &, Real t) const override
VectorF f (VectorF const &x, Real t) const override
MatrixJF Jf_x (VectorF const &, Real t) const override
Public Member Functions inherited from Sandals::Explicit< Real, N, M >
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

FunctionE m_E {nullptr}
FunctionA m_A {nullptr}
FunctionB m_b {nullptr}
FunctionH m_h {nullptr}
FunctionJH m_Jh_x {nullptr}
FunctionID m_in_domain {nullptr}

Additional Inherited Members

Public Attributes inherited from Sandals::Linear< Real, N, 0 >
const Real SQRT_EPSILON
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::LinearWrapper< Real, N, M >

Class container for the system of linear ordinary differential equations (ODEs) or differential algebraic equations (DAEs) of the type \( \mathbf{E}(t)\mathbf{x}^{\prime} = \mathbf{A}(t) \mathbf{x} + \mathbf{b}(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::LinearWrapper< Real, N, M >::FunctionA = std::function<MatrixA(Real)>

System matrix function type.

◆ FunctionB

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

System vector function type.

◆ FunctionE

template<typename Real, Integer N, Integer M = 0>
using Sandals::LinearWrapper< Real, N, M >::FunctionE = std::function<MatrixE(Real)>

Mass matrix function type.

◆ FunctionH

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

Invariants function type.

◆ FunctionID

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

In-domain function type.

◆ FunctionJH

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

Jacobian of the invariants function type.

◆ MatrixA

template<typename Real, Integer N, Integer M = 0>
using Sandals::LinearWrapper< Real, N, M >::MatrixA = typename Linear<Real, N, M>::MatrixJF

Templetized matrix type.

◆ MatrixE

template<typename Real, Integer N, Integer M = 0>
using Sandals::LinearWrapper< Real, N, M >::MatrixE = typename Linear<Real, N, M>::MatrixJF

Templetized matrix type.

◆ MatrixJF

template<typename Real, Integer N, Integer M = 0>
using Sandals::LinearWrapper< Real, N, M >::MatrixJF = typename Linear<Real, N, M>::MatrixJF

Templetized matrix type.

◆ MatrixJH

template<typename Real, Integer N, Integer M = 0>
using Sandals::LinearWrapper< Real, N, M >::MatrixJH = typename Explicit<Real, N, M>::MatrixJH

Templetized matrix type.

◆ Pointer

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

< Basic constants. Shared pointer to a linear ODE/DAE system.

◆ VectorB

template<typename Real, Integer N, Integer M = 0>
using Sandals::LinearWrapper< Real, N, M >::VectorB = typename Linear<Real, N, M>::VectorF

Templetized vector type.

◆ VectorF

template<typename Real, Integer N, Integer M = 0>
using Sandals::LinearWrapper< Real, N, M >::VectorF = typename Linear<Real, N, M>::VectorF

Templetized vector type.

◆ VectorH

template<typename Real, Integer N, Integer M = 0>
using Sandals::LinearWrapper< Real, N, M >::VectorH = typename Explicit<Real, N, M>::VectorH

Templetized vector type.

Constructor & Destructor Documentation

◆ LinearWrapper() [1/2]

template<typename Real, Integer N, Integer M = 0>
Sandals::LinearWrapper< Real, N, M >::LinearWrapper ( FunctionE t_E,
FunctionA t_A,
FunctionB t_b,
FunctionH t_h = DefaultH,
FunctionJH t_Jh_x = DefaultJH,
FunctionID t_in_domain = DefaultID )
inline

Class constructor for the linear ODE/DAE system wrapper.

Parameters
[in]t_EThe mass matrix function.
[in]t_AThe system matrix function.
[in]t_bThe system vector function.
[in]t_hThe invariants function.
[in]t_Jh_xThe Jacobian of the invariants function.
[in]t_in_domainThe in-domain function.

◆ LinearWrapper() [2/2]

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

Class constructor for the linear ODE/DAE system wrapper.

Parameters
[in]t_nameThe name of the linear ODE/DAE system.
[in]t_EThe mass matrix function.
[in]t_AThe system matrix function.
[in]t_bThe system vector function.
[in]t_hThe invariants function.
[in]t_Jh_xThe Jacobian of the invariants function.
[in]t_in_domainThe in-domain function.

◆ ~LinearWrapper()

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

Class destructor for the linear ODE/DAE system wrapper.

Member Function Documentation

◆ A() [1/2]

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

Get the system matrix function.

Returns
The system matrix function.

◆ A() [2/2]

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

Evaluate the linear ODE/DAE system matrix \( \mathbf{A}(t) \).

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

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

◆ b() [1/2]

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

Get the system vector function.

Returns
The system vector function.

◆ b() [2/2]

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

Evaluate the linear ODE/DAE system vector \( \mathbf{b}(t) \).

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

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

◆ E() [1/2]

template<typename Real, Integer N, Integer M = 0>
FunctionE & Sandals::LinearWrapper< Real, N, M >::E ( )
inline

Get the mass matrix function.

Returns
The mass matrix function.

◆ E() [2/2]

template<typename Real, Integer N, Integer M = 0>
MatrixE Sandals::LinearWrapper< Real, N, M >::E ( Real t) const
inlineoverridevirtual

Evaluate the linear ODE/DAE system mass matrix \( \mathbf{E}(t) \).

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

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

◆ h() [1/2]

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

◆ Jh_x() [1/2]

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

Member Data Documentation

◆ DefaultH

template<typename Real, Integer N, Integer M = 0>
const FunctionH Sandals::LinearWrapper< 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::LinearWrapper< 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::LinearWrapper< 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::LinearWrapper< Real, N, M >::m_A {nullptr}
private

System matrix function.

◆ m_b

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

System vector function.

◆ m_E

template<typename Real, Integer N, Integer M = 0>
FunctionE Sandals::LinearWrapper< Real, N, M >::m_E {nullptr}
private

Mass matrix function.

◆ m_h

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

Invariants function.

◆ m_in_domain

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

In-domain function.

◆ m_Jh_x

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

Jacobian of the invariants function.


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