Fem3DElementCorotationalTetrahedron.h
Go to the documentation of this file.
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 
21 
22 namespace SurgSim
23 {
24 
25 namespace Physics
26 {
27 
40 {
41 public:
48  explicit Fem3DElementCorotationalTetrahedron(std::array<size_t, 4> nodeIds);
49 
50  virtual void initialize(const SurgSim::Math::OdeState& state) override;
51 
52  virtual void addForce(const SurgSim::Math::OdeState& state, SurgSim::Math::Vector* F, double scale = 1.0) override;
53 
54  virtual void addStiffness(const SurgSim::Math::OdeState& state, SurgSim::Math::Matrix* K,
55  double scale = 1.0) override;
56 
57  virtual void addMatVec(const SurgSim::Math::OdeState& state,
58  double alphaM, double alphaD, double alphaK,
59  const SurgSim::Math::Vector& vector, SurgSim::Math::Vector* result) override;
60 
65  virtual bool update(const SurgSim::Math::OdeState& state) override;
66 
67 protected:
70 
72  Eigen::Matrix<double, 12, 12> m_corotationalStiffnessMatrix;
73 
77 };
78 
79 } // namespace Physics
80 
81 } // namespace SurgSim
82 
83 #endif // SURGSIM_PHYSICS_FEM3DELEMENTCOROTATIONALTETRAHEDRON_H
Definition: DriveElementFromInputBehavior.cpp:27
virtual void initialize(const SurgSim::Math::OdeState &state) override
Initialize the FemElement once everything has been set.
Definition: Fem3DElementCorotationalTetrahedron.cpp:36
Class for Fem Element 3D based on a tetrahedron volume discretization.
Definition: Fem3DElementTetrahedron.h:38
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > Matrix
A dynamic size matrix.
Definition: Matrix.h:65
OdeState defines the state y of an ode of 2nd order of the form M(x,v).a = F(x, v) with boundary cond...
Definition: OdeState.h:34
virtual void addForce(const SurgSim::Math::OdeState &state, SurgSim::Math::Vector *F, double scale=1.0) override
Adds the element force (computed for a given state) to a complete system force vector F (assembly) ...
Definition: Fem3DElementCorotationalTetrahedron.cpp:66
Fem3DElementCorotationalTetrahedron(std::array< size_t, 4 > nodeIds)
Constructor.
Definition: Fem3DElementCorotationalTetrahedron.cpp:31
virtual void addStiffness(const SurgSim::Math::OdeState &state, SurgSim::Math::Matrix *K, double scale=1.0) override
Adds the element stiffness matrix K (= -df/dx) (computed for a given state) to a complete system stif...
Definition: Fem3DElementCorotationalTetrahedron.cpp:82
Eigen::Matrix< double, 4, 4, Eigen::RowMajor > Matrix44d
A 4x4 matrix of doubles.
Definition: Matrix.h:55
virtual bool update(const SurgSim::Math::OdeState &state) override
Update the element co-rotational frame.
Definition: Fem3DElementCorotationalTetrahedron.cpp:115
Eigen::Matrix< double, Eigen::Dynamic, 1 > Vector
A dynamic size column vector.
Definition: Vector.h:67
virtual void addMatVec(const SurgSim::Math::OdeState &state, double alphaM, double alphaD, double alphaK, const SurgSim::Math::Vector &vector, SurgSim::Math::Vector *result) override
Adds the element matrix-vector contribution F += (alphaM.M + alphaD.D + alphaK.K).x (computed for a given state) into a complete system data structure F (assembly)
Definition: Fem3DElementCorotationalTetrahedron.cpp:88
SurgSim::Math::Matrix33d m_rotation
The element rigid rotation.
Definition: Fem3DElementCorotationalTetrahedron.h:69
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:76
Fem Element 3D co-rotational based on a tetrahedron volume discretization.
Definition: Fem3DElementCorotationalTetrahedron.h:39
Eigen::Matrix< double, 3, 3, Eigen::RowMajor > Matrix33d
A 3x3 matrix of doubles.
Definition: Matrix.h:51
Eigen::Matrix< double, 12, 12 > m_corotationalStiffnessMatrix
The co-rotational stiffness matrix.
Definition: Fem3DElementCorotationalTetrahedron.h:72