13#ifndef SANDALS_SEMIEXPLICIT_SYSTEM_HH
14#define SANDALS_SEMIEXPLICIT_SYSTEM_HH
41 template <
typename Real, Integer N, Integer M = 0>
86 return this->
A(x, t)*x_dot - this->
b(x, t);
108 return -this->
Jf_x(x, x_dot, t);
128 return this->
A(x, t);
144 this->
m_lu.compute(this->
A(x, t));
146 "Sandals:SemiExplicit::f(...): singular mass matrix A detected.");
147 return this->
m_lu.solve(this->
b(x, t));
169 for (
Integer i{0}; i < N; ++i) {tAp.col(i) =
TA_x[i] * x_dot;}
170 this->
m_lu.compute(this->
A(x, t));
172 "Sandals:SemiExplicit::Jf_x(...): singular mass matrix A detected.");
173 return this->
m_lu.solve(this->
Jb_x(x, t) - tAp);
260 template <
typename Real, Integer N, Integer M = 0>
384 return this->
m_A(x, t);
402 return this->
m_TA_x(x, t);
413 return this->
m_b(x, t);
431 return this->
m_Jb_x(x, t);
443 return this->
m_h(x, t);
461 return this->
m_Jh_x(x, t);
#define SANDALS_BASIC_CONSTANTS(Real)
Definition Sandals.hh:70
#define SANDALS_ASSERT(COND, MSG)
Definition Sandals.hh:44
Explicit(Type t_type, std::string t_name)
Definition Explicit.hh:57
MatrixJF Jf_x(VectorF const &x, Real t) const override
Definition SemiExplicit.hh:190
SemiExplicit(std::string t_name)
Definition SemiExplicit.hh:69
typename Explicit< Real, N, M >::MatrixJF MatrixJB
Definition SemiExplicit.hh:53
typename Explicit< Real, N, M >::Type Type
Definition SemiExplicit.hh:54
virtual VectorB b(VectorF const &x, Real t) const =0
SemiExplicit()
Definition SemiExplicit.hh:63
typename Explicit< Real, N, M >::VectorF VectorF
Definition SemiExplicit.hh:48
virtual MatrixJB Jb_x(VectorF const &x, Real t) const =0
typename Explicit< Real, N, M >::MatrixJF MatrixJF
Definition SemiExplicit.hh:49
std::shared_ptr< SemiExplicit< Real, N, M > > Pointer
Definition SemiExplicit.hh:47
virtual TensorTA TA_x(VectorF const &x, Real t) const =0
MatrixJF Jf_x(VectorF const &x, VectorF const &x_dot, Real t) const
Definition SemiExplicit.hh:165
MatrixJF JF_x(VectorF const &x, VectorF const &x_dot, Real t) const override
Definition SemiExplicit.hh:106
Eigen::FullPivLU< MatrixA > m_lu
Definition SemiExplicit.hh:57
MatrixJF JF_x_dot(VectorF const &x, VectorF const &, Real t) const override
Definition SemiExplicit.hh:126
virtual MatrixA A(VectorF const &x, Real t) const =0
typename Explicit< Real, N, M >::VectorF VectorB
Definition SemiExplicit.hh:52
typename Explicit< Real, N, M >::MatrixJF MatrixA
Definition SemiExplicit.hh:50
typename std::vector< MatrixJF > TensorTA
Definition SemiExplicit.hh:51
VectorF F(VectorF const &x, VectorF const &x_dot, Real t) const override
Definition SemiExplicit.hh:84
VectorF f(VectorF const &x, Real t) const override
Definition SemiExplicit.hh:142
FunctionTA & TA_x()
Definition SemiExplicit.hh:344
MatrixJH Jh_x(VectorF const &x, Real t) const override
Definition SemiExplicit.hh:459
typename SemiExplicit< Real, N, M >::MatrixJH MatrixJH
Definition SemiExplicit.hh:273
typename SemiExplicit< Real, N, M >::VectorB VectorB
Definition SemiExplicit.hh:270
FunctionID m_in_domain
Definition SemiExplicit.hh:293
std::shared_ptr< SemiExplicitWrapper< Real, N, M > > Pointer
Definition SemiExplicit.hh:266
std::function< VectorH(VectorF const &, Real)> FunctionH
Definition SemiExplicit.hh:278
VectorH h(VectorF const &x, Real t) const override
Definition SemiExplicit.hh:441
FunctionJB m_Jb_x
Definition SemiExplicit.hh:290
VectorB b(VectorF const &x, Real t) const override
Definition SemiExplicit.hh:411
FunctionJH & Jh_x()
Definition SemiExplicit.hh:368
MatrixA A(VectorF const &x, Real t) const override
Definition SemiExplicit.hh:382
static const FunctionH DefaultH
Definition SemiExplicit.hh:282
bool in_domain(VectorF const &x, Real t) const override
Definition SemiExplicit.hh:471
std::function< VectorB(VectorF const &, Real)> FunctionB
Definition SemiExplicit.hh:276
typename SemiExplicit< Real, N, M >::TensorTA TensorTA
Definition SemiExplicit.hh:269
TensorTA TA_x(VectorF const &x, Real t) const override
Definition SemiExplicit.hh:400
FunctionB & b()
Definition SemiExplicit.hh:350
~SemiExplicitWrapper()
Definition SemiExplicit.hh:332
FunctionJB & Jb_x()
Definition SemiExplicit.hh:356
typename SemiExplicit< Real, N, M >::VectorH VectorH
Definition SemiExplicit.hh:272
MatrixJB Jb_x(VectorF const &x, Real t) const override
Definition SemiExplicit.hh:429
static const FunctionJH DefaultJH
Definition SemiExplicit.hh:283
FunctionB m_b
Definition SemiExplicit.hh:289
std::function< MatrixA(VectorF const &, Real)> FunctionA
Definition SemiExplicit.hh:274
std::function< MatrixJB(VectorF const &, Real)> FunctionJB
Definition SemiExplicit.hh:277
static const FunctionID DefaultID
Definition SemiExplicit.hh:284
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)
Definition SemiExplicit.hh:306
typename SemiExplicit< Real, N, M >::VectorF VectorF
Definition SemiExplicit.hh:267
FunctionID & in_domain()
Definition SemiExplicit.hh:374
typename SemiExplicit< Real, N, M >::MatrixJB MatrixJB
Definition SemiExplicit.hh:271
std::function< MatrixJH(VectorF const &, Real)> FunctionJH
Definition SemiExplicit.hh:279
FunctionJH m_Jh_x
Definition SemiExplicit.hh:292
FunctionH m_h
Definition SemiExplicit.hh:291
std::function< bool(VectorF const &, Real)> FunctionID
Definition SemiExplicit.hh:280
typename SemiExplicit< Real, N, M >::MatrixA MatrixA
Definition SemiExplicit.hh:268
FunctionTA m_TA_x
Definition SemiExplicit.hh:288
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)
Definition SemiExplicit.hh:323
std::function< TensorTA(VectorF const &, Real)> FunctionTA
Definition SemiExplicit.hh:275
FunctionA m_A
Definition SemiExplicit.hh:287
FunctionA & A()
Definition SemiExplicit.hh:338
FunctionH & h()
Definition SemiExplicit.hh:362
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