13#ifndef SANDALS_IMPLICIT_SYSTEM_HH
14#define SANDALS_IMPLICIT_SYSTEM_HH
40 template <
typename Real, Integer N, Integer M = 0>
46 using
Type = enum class
Type :
Integer {IMPLICIT = 0, EXPLICIT = 1, SEMIEXPLICIT = 1};
47 using Pointer = std::shared_ptr<Implicit<Real, N, M>>;
92 bool is_implicit()
const {
return this->m_type == Type::IMPLICIT;}
98 bool is_explicit()
const {
return this->m_type == Type::EXPLICIT;}
110 std::string &
name() {
return this->m_name;}
116 std::string
const &
name()
const {
return this->m_name;}
214 return -this->
F(x, -x_dot, -t);
229 return -this->
JF_x(x, -x_dot, -t);
244 return this->
JF_x_dot(x, -x_dot, -t);
268 template <
typename Real, Integer N, Integer M = 0>
378 return this->
m_F(x, x_dot, t);
397 return this->
m_JF_x(x, x_dot, t);
428 return this->
m_h(x, t);
446 return this->
m_Jh_x(x, t);
#define SANDALS_BASIC_CONSTANTS(Real)
Definition Sandals.hh:70
virtual ~Implicit()
Definition Implicit.hh:80
std::string const & name() const
Definition Implicit.hh:116
bool is_semiexplicit() const
Definition Implicit.hh:104
Eigen::Matrix< Real, N, N > MatrixJF
Definition Implicit.hh:49
virtual MatrixJF JF_x(VectorF const &x, VectorF const &x_dot, Real t) const =0
virtual MatrixJH Jh_x(VectorF const &x, Real t) const =0
Implicit(Type t_type, std::string t_name)
Definition Implicit.hh:63
Eigen::Vector< Real, N > VectorF
Definition Implicit.hh:48
bool is_implicit() const
Definition Implicit.hh:92
Eigen::Vector< Real, M > VectorH
Definition Implicit.hh:50
Implicit()
Definition Implicit.hh:69
virtual bool in_domain(VectorF const &x, Real t) const =0
std::string & name()
Definition Implicit.hh:110
enum class Type :Integer {IMPLICIT=0, EXPLICIT=1, SEMIEXPLICIT=1} Type
Definition Implicit.hh:46
bool is_explicit() const
Definition Implicit.hh:98
Type m_type
Definition Implicit.hh:54
virtual VectorF F(VectorF const &x, VectorF const &x_dot, Real t) const =0
Integer equations_number() const
Definition Implicit.hh:122
std::string m_name
Definition Implicit.hh:55
Type type() const
Definition Implicit.hh:86
MatrixJF JF_x_dot_reverse(VectorF const &x, VectorF const &x_dot, Real t) const
Definition Implicit.hh:242
Integer invariants_number() const
Definition Implicit.hh:128
std::shared_ptr< Implicit< Real, N, M > > Pointer
Definition Implicit.hh:47
Eigen::Matrix< Real, M, N > MatrixJH
Definition Implicit.hh:51
VectorF F_reverse(VectorF const &x, VectorF const &x_dot, Real t) const
Definition Implicit.hh:212
MatrixJF JF_x_reverse(VectorF const &x, VectorF const &x_dot, Real t) const
Definition Implicit.hh:227
virtual VectorH h(VectorF const &x, Real t) const =0
virtual MatrixJF JF_x_dot(VectorF const &x, VectorF const &x_dot, Real t) const =0
Implicit(std::string t_name)
Definition Implicit.hh:75
FunctionID m_in_domain
Definition Implicit.hh:295
std::function< bool(VectorF const &, Real)> FunctionID
Definition Implicit.hh:283
FunctionJF & JF_x_dot()
Definition Implicit.hh:349
std::function< VectorH(VectorF const &, Real)> FunctionH
Definition Implicit.hh:281
FunctionF & F()
Definition Implicit.hh:337
std::function< VectorF(VectorF const &, VectorF const &, Real)> FunctionF
Definition Implicit.hh:279
FunctionJF m_JF_x
Definition Implicit.hh:291
typename Implicit< Real, N, M >::VectorH VectorH
Definition Implicit.hh:277
MatrixJH Jh_x(VectorF const &x, Real t) const override
Definition Implicit.hh:444
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)
Definition Implicit.hh:307
typename Implicit< Real, N, M >::VectorF VectorF
Definition Implicit.hh:275
FunctionID & in_domain()
Definition Implicit.hh:367
~ImplicitWrapper()
Definition Implicit.hh:331
bool in_domain(VectorF const &x, Real t) const override
Definition Implicit.hh:456
FunctionJF m_JF_x_dot
Definition Implicit.hh:292
FunctionJH & Jh_x()
Definition Implicit.hh:361
FunctionJH m_Jh_x
Definition Implicit.hh:294
std::function< MatrixJF(VectorF const &, VectorF const &, Real)> FunctionJF
Definition Implicit.hh:280
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)
Definition Implicit.hh:322
typename Implicit< Real, N, M >::MatrixJF MatrixJF
Definition Implicit.hh:276
static const FunctionID DefaultID
Definition Implicit.hh:287
FunctionF m_F
Definition Implicit.hh:290
FunctionJF & JF_x()
Definition Implicit.hh:343
FunctionH m_h
Definition Implicit.hh:293
static const FunctionH DefaultH
Definition Implicit.hh:285
std::shared_ptr< ImplicitWrapper< Real, N, M > > Pointer
Definition Implicit.hh:274
MatrixJF JF_x(VectorF const &x, VectorF const &x_dot, Real t) const override
Definition Implicit.hh:395
std::function< MatrixJH(VectorF const &, Real)> FunctionJH
Definition Implicit.hh:282
VectorF F(VectorF const &x, VectorF const &x_dot, Real t) const override
Definition Implicit.hh:376
static const FunctionJH DefaultJH
Definition Implicit.hh:286
FunctionH & h()
Definition Implicit.hh:355
VectorH h(VectorF const &x, Real t) const override
Definition Implicit.hh:426
MatrixJF JF_x_dot(VectorF const &x, VectorF const &x_dot, Real t) const override
Definition Implicit.hh:415
typename Implicit< Real, N, M >::MatrixJH MatrixJH
Definition Implicit.hh:278
The namespace for the Sandals library.
Definition Sandals.hh:89
SANDALS_DEFAULT_INTEGER_TYPE Integer
The Integer type as used for the API.
Definition Sandals.hh:97