opensurgsim
Fem3DElementCorotationalTetrahedron.h
1 // This file is a part of the OpenSurgSim project.
2 // Copyright 2013, SimQuest Solutions Inc.
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 
16 #ifndef SURGSIM_PHYSICS_FEM3DELEMENTCOROTATIONALTETRAHEDRON_H
17 #define SURGSIM_PHYSICS_FEM3DELEMENTCOROTATIONALTETRAHEDRON_H
18 
20 #include "SurgSim/Physics/Fem3DElementTetrahedron.h"
21 
22 namespace SurgSim
23 {
24 
25 namespace Physics
26 {
27 SURGSIM_STATIC_REGISTRATION(Fem3DElementCorotationalTetrahedron);
28 
41 {
42 public:
45 
52  explicit Fem3DElementCorotationalTetrahedron(std::array<size_t, 4> nodeIds);
53 
61  explicit Fem3DElementCorotationalTetrahedron(std::shared_ptr<FemElementStructs::FemElementParameter> elementData);
62 
64 
65  void initialize(const SurgSim::Math::OdeState& state) override;
66 
69 
70 protected:
77  Math::Matrix* Me, Math::Matrix* Ke) const;
78 
79  void doUpdateFMDK(const Math::OdeState& state, int options) override;
80 
84 
85  // The mass matrix of the linear tetrahedron
86  Eigen::Matrix<double, 12, 12> m_MLinear;
87 
88  // The stiffness matrix of the linear tetrahedron
89  Eigen::Matrix<double, 12, 12> m_KLinear;
90 
91  // The rotation matrix
93 };
94 
95 } // namespace Physics
96 
97 } // namespace SurgSim
98 
99 #endif // SURGSIM_PHYSICS_FEM3DELEMENTCOROTATIONALTETRAHEDRON_H
Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui n...
Definition: AddRandomSphereBehavior.cpp:36
void doUpdateFMDK(const Math::OdeState &state, int options) override
Update the FemElement based on the given state.
Definition: Fem3DElementCorotationalTetrahedron.cpp:77
void initialize(const SurgSim::Math::OdeState &state) override
Initialize the FemElement once everything has been set.
Definition: Fem3DElementCorotationalTetrahedron.cpp:48
Class for Fem Element 3D based on a tetrahedron volume discretization.
Definition: Fem3DElementTetrahedron.h:41
Eigen::Matrix< double, 4, 4, Eigen::RowMajor > Matrix44d
A 4x4 matrix of doubles.
Definition: Matrix.h:55
void computeRotationMassAndStiffness(const SurgSim::Math::OdeState &state, SurgSim::Math::Matrix33d *R, Math::Matrix *Me, Math::Matrix *Ke) const
Compute the rotation, mass and stiffness matrices of the element from the given state.
Definition: Fem3DElementCorotationalTetrahedron.cpp:116
The state of an ode of 2nd order of the form with boundary conditions.
Definition: OdeState.h:38
Definitions of 2x2 and 3x3 rigid (isometric) transforms.
SurgSim::Math::Matrix44d m_Vinverse
The constant inverse matrix of the undeformed tetrahedron homogeneous 4 points coordinates.
Definition: Fem3DElementCorotationalTetrahedron.h:83
Fem Element 3D co-rotational based on a tetrahedron volume discretization.
Definition: Fem3DElementCorotationalTetrahedron.h:40
Eigen::Matrix< double, 3, 3, Eigen::RowMajor > Matrix33d
A 3x3 matrix of doubles.
Definition: Matrix.h:51
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > Matrix
A dynamic size matrix.
Definition: Matrix.h:65
const SurgSim::Math::Matrix33d & getRotationMatrix() const
Gets the current rotation of the element.
Definition: Fem3DElementCorotationalTetrahedron.cpp:290