Caribou
AssembleGlobalMatrix.h
1 #pragma once
2 
3 #include <sofa/simulation/MechanicalVisitor.h>
4 
5 namespace SofaCaribou::visitor {
6 
22 class AssembleGlobalMatrix : public sofa::simulation::MechanicalVisitor {
23  using Base = sofa::simulation::MechanicalVisitor;
24  using MechanicalParams = sofa::core::MechanicalParams;
25  using MultiMatrixAccessor = sofa::core::behavior::MultiMatrixAccessor;
26 public:
27  // Constructor
28  AssembleGlobalMatrix(const MechanicalParams* mparams, const MultiMatrixAccessor* matrix )
29  : Base(mparams), p_multi_matrix(matrix) {}
30 
31  Result fwdForceField(sofa::simulation::Node* node, sofa::core::behavior::BaseForceField* ff) override;
32 
33  bool stopAtMechanicalMapping(sofa::simulation::Node* node, sofa::core::BaseMapping* map) override;
34 
35  const char* getClassName() const override { return "AssembleGlobalMatrix"; }
36 private:
37  const sofa::core::behavior::MultiMatrixAccessor * p_multi_matrix;
38 };
39 
40 } // namespace SofaCaribou::visitor
SofaCaribou::visitor::AssembleGlobalMatrix
Assemble the stiffness matrix (M+B+K) of every mechanical object into the mutli-matrix.
Definition: AssembleGlobalMatrix.h:22