Caribou
BackwardEulerODESolver.h
1 #pragma once
2 
3 #include <SofaCaribou/Ode/NewtonRaphsonSolver.h>
4 #include <SofaBaseLinearSolver/DefaultMultiMatrixAccessor.h>
5 #include <sofa/core/objectmodel/Data.h>
6 
7 namespace SofaCaribou::ode {
8 
94 public:
96 
97  template <typename T>
98  using Data = sofa::core::objectmodel::Data<T>;
99 
101 
102  void solve (const sofa::core::ExecParams* params, SReal dt, sofa::core::MultiVecCoordId x_id, sofa::core::MultiVecDerivId v_id) override;
103 private:
104 
106  void assemble_rhs_vector(const sofa::core::MechanicalParams & mechanical_parameters,
107  const sofa::core::behavior::MultiMatrixAccessor & matrix_accessor,
108  sofa::core::MultiVecDerivId & f_id,
109  sofa::defaulttype::BaseVector * f) final;
110 
112  void assemble_system_matrix(const sofa::core::MechanicalParams & mechanical_parameters,
113  sofa::component::linearsolver::DefaultMultiMatrixAccessor & matrix_accessor,
114  sofa::defaulttype::BaseMatrix * A) final;
115 
117  void propagate_position_increment(const sofa::core::MechanicalParams & mechanical_parameters,
118  const sofa::core::behavior::MultiMatrixAccessor & matrix_accessor,
119  const sofa::defaulttype::BaseVector * dx,
120  sofa::core::MultiVecCoordId & x_id,
121  sofa::core::MultiVecDerivId & v_id,
122  sofa::core::MultiVecDerivId & dx_id) final;
123 
125  Data<double> d_rayleigh_stiffness;
126  Data<double> d_rayleigh_mass;
127 
129 
131  sofa::core::MultiVecCoordId p_previous_x_id;
132 
134  sofa::core::MultiVecDerivId p_previous_v_id;
135 
137  sofa::core::MultiVecDerivId p_a_id;
138 };
139 
140 } // namespace SofaCaribou::ode
SofaCaribou::ode::NewtonRaphsonSolver
This class implements a generic Newton-Raphson solver for SOFA.
Definition: NewtonRaphsonSolver.h:40
SofaCaribou::ode::BackwardEulerODESolver
Implementation of an implicit backward euler solver compatible with non-linear materials.
Definition: BackwardEulerODESolver.h:93