13#ifndef SANDALS_IMPLICIT_SYSTEM_HH
14#define SANDALS_IMPLICIT_SYSTEM_HH
40 template <
typename Real, Integer N, Integer M = 0>
44 using Type =
enum class Type :
Integer {IMPLICIT = 0, EXPLICIT = 1, SEMIEXPLICIT = 1};
45 using Pointer = std::shared_ptr<Implicit<Real, N, M>>;
90 bool is_implicit()
const {
return this->m_type == Type::IMPLICIT;}
96 bool is_explicit()
const {
return this->m_type == Type::EXPLICIT;}
108 std::string &
name() {
return this->m_name;}
114 std::string
const &
name()
const {
return this->m_name;}
212 return -this->
F(x, -x_dot, -t);
227 return -this->
JF_x(x, -x_dot, -t);
242 return this->
JF_x_dot(x, -x_dot, -t);
266 template <
typename Real, Integer N, Integer M = 0>
270 using Pointer = std::shared_ptr<ImplicitWrapper<Real, N, M>>;
374 return this->
m_F(x, x_dot, t);
393 return this->
m_JF_x(x, x_dot, t);
424 return this->
m_h(x, t);
442 return this->
m_Jh_x(x, t);
virtual ~Implicit()
Definition Implicit.hh:78
std::string const & name() const
Definition Implicit.hh:114
bool is_semiexplicit() const
Definition Implicit.hh:102
Eigen::Matrix< Real, N, N > MatrixJF
Definition Implicit.hh:47
virtual VectorH h(VectorF const &x, Real const t) const =0
Implicit(Type t_type, std::string t_name)
Definition Implicit.hh:61
Eigen::Vector< Real, N > VectorF
Definition Implicit.hh:46
MatrixJF JF_x_reverse(VectorF const &x, VectorF const &x_dot, Real const t) const
Definition Implicit.hh:225
MatrixJF JF_x_dot_reverse(VectorF const &x, VectorF const &x_dot, Real const t) const
Definition Implicit.hh:240
virtual MatrixJF JF_x(VectorF const &x, VectorF const &x_dot, Real const t) const =0
bool is_implicit() const
Definition Implicit.hh:90
Eigen::Vector< Real, M > VectorH
Definition Implicit.hh:48
Implicit()
Definition Implicit.hh:67
std::string & name()
Definition Implicit.hh:108
enum class Type :Integer {IMPLICIT=0, EXPLICIT=1, SEMIEXPLICIT=1} Type
Definition Implicit.hh:44
bool is_explicit() const
Definition Implicit.hh:96
Type m_type
Definition Implicit.hh:52
VectorF F_reverse(VectorF const &x, VectorF const &x_dot, Real const t) const
Definition Implicit.hh:210
virtual MatrixJF JF_x_dot(VectorF const &x, VectorF const &x_dot, Real const t) const =0
Integer equations_number() const
Definition Implicit.hh:120
std::string m_name
Definition Implicit.hh:53
Type type() const
Definition Implicit.hh:84
virtual VectorF F(VectorF const &x, VectorF const &x_dot, Real const t) const =0
Integer invariants_number() const
Definition Implicit.hh:126
std::shared_ptr< Implicit< Real, N, M > > Pointer
Definition Implicit.hh:45
Eigen::Matrix< Real, M, N > MatrixJH
Definition Implicit.hh:49
virtual MatrixJH Jh_x(VectorF const &x, Real const t) const =0
virtual bool in_domain(VectorF const &x, Real const t) const =0
Implicit(std::string t_name)
Definition Implicit.hh:73
VectorH h(VectorF const &x, Real const t) const override
Definition Implicit.hh:422
std::function< bool(VectorF const &, Real const)> FunctionID
Definition Implicit.hh:279
FunctionID m_in_domain
Definition Implicit.hh:291
std::function< VectorF(VectorF const &, VectorF const &, Real const)> FunctionF
Definition Implicit.hh:275
FunctionJF & JF_x_dot()
Definition Implicit.hh:345
VectorF F(VectorF const &x, VectorF const &x_dot, Real const t) const override
Definition Implicit.hh:372
FunctionF & F()
Definition Implicit.hh:333
FunctionJF m_JF_x
Definition Implicit.hh:287
std::function< MatrixJF(VectorF const &, VectorF const &, Real const)> FunctionJF
Definition Implicit.hh:276
bool in_domain(VectorF const &x, Real const t) const override
Definition Implicit.hh:452
std::function< VectorH(VectorF const &, Real const)> FunctionH
Definition Implicit.hh:277
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:303
MatrixJF JF_x(VectorF const &x, VectorF const &x_dot, Real const t) const override
Definition Implicit.hh:391
FunctionID & in_domain()
Definition Implicit.hh:363
MatrixJH Jh_x(VectorF const &x, Real const t) const override
Definition Implicit.hh:440
~ImplicitWrapper()
Definition Implicit.hh:327
FunctionJF m_JF_x_dot
Definition Implicit.hh:288
FunctionJH & Jh_x()
Definition Implicit.hh:357
FunctionJH m_Jh_x
Definition Implicit.hh:290
std::function< MatrixJH(VectorF const &, Real const)> FunctionJH
Definition Implicit.hh:278
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:318
static const FunctionID DefaultID
Definition Implicit.hh:283
FunctionF m_F
Definition Implicit.hh:286
FunctionJF & JF_x()
Definition Implicit.hh:339
FunctionH m_h
Definition Implicit.hh:289
static const FunctionH DefaultH
Definition Implicit.hh:281
std::shared_ptr< ImplicitWrapper< Real, N, M > > Pointer
Definition Implicit.hh:270
MatrixJF JF_x_dot(VectorF const &x, VectorF const &x_dot, Real const t) const override
Definition Implicit.hh:411
static const FunctionJH DefaultJH
Definition Implicit.hh:282
FunctionH & h()
Definition Implicit.hh:351
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