iMSTK
Interactive Medical Simulation Toolkit
imstkCorotationalFemForceModel.h
1 /*
2 ** This file is part of the Interactive Medical Simulation Toolkit (iMSTK)
3 ** iMSTK is distributed under the Apache License, Version 2.0.
4 ** See accompanying NOTICE for details.
5 */
6 
7 #pragma once
8 
9 #include "imstkInternalForceModel.h"
10 
11 namespace vega
12 {
13 class VolumetricMesh;
14 class CorotationalLinearFEM;
15 class SparseMatrix;
16 } // namespace vega
17 
18 namespace imstk
19 {
26 {
27 public:
32  CorotationalFemForceModel(std::shared_ptr<vega::VolumetricMesh> mesh, const int warp = 1);
33  CorotationalFemForceModel() = delete;
34  ~CorotationalFemForceModel() override = default;
35 
39  void getInternalForce(const Vectord& u, Vectord& internalForce) override;
40 
44  void getTangentStiffnessMatrix(const Vectord& u, SparseMatrixd& tangentStiffnessMatrix) override;
45 
49  void getTangentStiffnessMatrixTopology(vega::SparseMatrix** tangentStiffnessMatrix) override;
50 
54  void getForceAndMatrix(const Vectord& u, Vectord& internalForce, SparseMatrixd& tangentStiffnessMatrix) override;
55 
59  void setWarp(const int warp);
60 
64  void setTangentStiffness(std::shared_ptr<vega::SparseMatrix> K) override;
65 
66 protected:
67  std::shared_ptr<vega::CorotationalLinearFEM> m_corotationalLinearFem;
68  std::shared_ptr<vega::SparseMatrix> m_vegaTangentStiffnessMatrix;
69  int m_warp;
70 };
71 } // namespace imstk
Force model for corotational based finite elements formulation.
Compound Geometry.
Base class for internal force model within the following context.