13#ifndef SANDALS_SEMIEXPLICIT_SYSTEM_HXX
14#define SANDALS_SEMIEXPLICIT_SYSTEM_HXX
37 template <Integer N, Integer M = 0>
41 using Pointer = std::shared_ptr<SemiExplicit<N, M>>;
45 using TensorTA =
typename std::vector<MatrixJF>;
51 mutable Eigen::FullPivLU<MatrixA>
m_lu;
81 return this->
A(x, t)*x_dot - this->
b(x, t);
103 return -this->
Jf_x(x, x_dot, t);
123 return this->
A(x, t);
139 this->m_lu.compute(this->
A(x, t));
141 "Sandals:SemiExplicit::f(...): singular mass matrix A detected.");
142 return this->m_lu.solve(this->
b(x, t));
164 for (
Integer i{0}; i < N; ++i) {tAp.col(i) =
TA_x[i] * x_dot;}
165 this->m_lu.compute(this->
A(x, t));
167 "Sandals:SemiExplicit::Jf_x(...): singular mass matrix A detected.");
168 return this->m_lu.solve(this->
Jb_x(x, t) - tAp);
#define SANDALS_ASSERT(COND, MSG)
Definition Sandals.hh:43
typename Implicit< N, M >::MatrixJF MatrixJF
Definition Explicit.hxx:42
Explicit(Type t_type, std::string t_name)
Definition Explicit.hxx:52
typename Implicit< N, M >::Type Type
Definition Explicit.hxx:43
typename Implicit< N, M >::VectorF VectorF
Definition Explicit.hxx:41
virtual TensorTA TA_x(VectorF const &x, Real t) const =0
SemiExplicit()
Definition SemiExplicit.hxx:58
VectorF F(VectorF const &x, VectorF const &x_dot, Real t) const override
Definition SemiExplicit.hxx:79
typename Explicit< N, M >::VectorF VectorB
Definition SemiExplicit.hxx:46
virtual MatrixA A(VectorF const &x, Real t) const =0
SemiExplicit(std::string t_name)
Definition SemiExplicit.hxx:64
typename Explicit< N, M >::MatrixJF MatrixA
Definition SemiExplicit.hxx:44
typename Explicit< N, M >::Type Type
Definition SemiExplicit.hxx:48
MatrixJF Jf_x(VectorF const &x, VectorF const &x_dot, Real t) const
Definition SemiExplicit.hxx:160
Eigen::FullPivLU< MatrixA > m_lu
Definition SemiExplicit.hxx:51
MatrixJF Jf_x(VectorF const &x, Real t) const override
Definition SemiExplicit.hxx:185
MatrixJF JF_x_dot(VectorF const &x, VectorF const &, Real t) const override
Definition SemiExplicit.hxx:121
typename std::vector< MatrixJF > TensorTA
Definition SemiExplicit.hxx:45
typename Explicit< N, M >::MatrixJF MatrixJF
Definition SemiExplicit.hxx:43
virtual VectorB b(VectorF const &x, Real t) const =0
typename Explicit< N, M >::MatrixJF MatrixJB
Definition SemiExplicit.hxx:47
MatrixJF JF_x(VectorF const &x, VectorF const &x_dot, Real t) const override
Definition SemiExplicit.hxx:101
virtual MatrixJB Jb_x(VectorF const &x, Real t) const =0
std::shared_ptr< SemiExplicit< N, M > > Pointer
Definition SemiExplicit.hxx:41
typename Explicit< N, M >::VectorF VectorF
Definition SemiExplicit.hxx:42
VectorF f(VectorF const &x, Real t) const override
Definition SemiExplicit.hxx:137
The namespace for the Sandals library.
Definition Sandals.hh:73
double Real
Definition Sandals.hh:84
int Integer
Definition Sandals.hh:85