Caribou
LUSolver.h
1 #pragma once
2 
3 #include <SofaCaribou/Solver/EigenSparseSolver.h>
4 #include <sofa/helper/OptionsGroup.h>
5 
6 namespace SofaCaribou::solver {
7 
8 template <class EigenSolver>
9 class LUSolver : public EigenSparseSolver<EigenSolver> {
10 public:
11  SOFA_CLASS(SOFA_TEMPLATE(LUSolver, EigenSolver), SOFA_TEMPLATE(EigenSparseSolver, EigenSolver));
12 
13  template <typename T>
14  using Data = sofa::Data<T>;
15 
16  LUSolver();
17 
22  inline bool symmetric() const override {return d_is_symmetric.getValue();}
23 
27  inline void set_symmetric(bool is_symmetric) override { d_is_symmetric.setValue(is_symmetric); }
28 
33  void assemble (const sofa::core::MechanicalParams* mparams) override;
34 
35  // Get the backend name of the class derived from the EigenSolver template parameter
36  static std::string BackendName();
37 private:
39  Data<sofa::helper::OptionsGroup> d_backend;
40 
42  Data<bool> d_is_symmetric;
43 };
44 
45 } // namespace SofaCaribou::solver
SofaCaribou::solver::LUSolver::set_symmetric
void set_symmetric(bool is_symmetric) override
Explicitly states if this matrix is symmetric.
Definition: LUSolver.h:27
SofaCaribou::solver::LUSolver::symmetric
bool symmetric() const override
States if the system matrix is symmetric.
Definition: LUSolver.h:22
SofaCaribou::solver::LUSolver
Definition: LUSolver.h:9
SofaCaribou::solver::LUSolver::assemble
void assemble(const sofa::core::MechanicalParams *mparams) override
Assemble the system matrix A = (mM + bB + kK) inside the SparseMatrix p_A.
Definition: LUSolver.inl:84
SofaCaribou::solver::EigenSparseSolver
Base class for sparse direct solvers using Eigen as a backend solver.
Definition: EigenSparseSolver.h:29