16 #ifndef SURGSIM_PHYSICS_FEM3DELEMENTTETRAHEDRON_H 17 #define SURGSIM_PHYSICS_FEM3DELEMENTTETRAHEDRON_H 23 #include "SurgSim/Physics/Fem.h" 24 #include "SurgSim/Physics/FemElement.h" 31 SURGSIM_STATIC_REGISTRATION(Fem3DElementTetrahedron);
91 std::array<double, 4>* ai,
92 std::array<double, 4>* bi,
93 std::array<double, 4>* ci,
94 std::array<double, 4>* di)
const;
109 Eigen::Matrix<double, 12, 1>
m_x0;
113 namespace Tetrahedron {
114 template <
class Vector,
class SubVector>
115 void getSubVector(
const Vector& vector,
const std::vector<size_t>& blockIds, SubVector* subVector)
117 static const int blockSize = 3;
118 subVector->segment(blockSize * 0, blockSize) = vector.segment(blockSize * blockIds[0], blockSize);
119 subVector->segment(blockSize * 1, blockSize) = vector.segment(blockSize * blockIds[1], blockSize);
120 subVector->segment(blockSize * 2, blockSize) = vector.segment(blockSize * blockIds[2], blockSize);
121 subVector->segment(blockSize * 3, blockSize) = vector.segment(blockSize * blockIds[3], blockSize);
129 #endif // SURGSIM_PHYSICS_FEM3DELEMENTTETRAHEDRON_H Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui n...
Definition: AddRandomSphereBehavior.cpp:36
Class for Fem Element 3D based on a tetrahedron volume discretization.
Definition: Fem3DElementTetrahedron.h:41
Eigen::Matrix< double, 12, 1 > m_x0
The tetrahedon rest state.
Definition: Fem3DElementTetrahedron.h:109
void computeShapeFunctions(const SurgSim::Math::OdeState &state, double *volume, std::array< double, 4 > *ai, std::array< double, 4 > *bi, std::array< double, 4 > *ci, std::array< double, 4 > *di) const
Computes the tetrahedron shape functions.
Definition: Fem3DElementTetrahedron.cpp:237
void initializeMembers()
Initializes variables needed before Initialize() is called.
Definition: Fem3DElementTetrahedron.cpp:72
The state of an ode of 2nd order of the form with boundary conditions.
Definition: OdeState.h:38
void computeStiffness(const SurgSim::Math::OdeState &state, SurgSim::Math::Matrix *k)
Computes the tetrahedron stiffness matrix.
Definition: Fem3DElementTetrahedron.cpp:168
SurgSim::Math::Vector computeCartesianCoordinate(const SurgSim::Math::OdeState &state, const SurgSim::Math::Vector &naturalCoordinate) const override
Computes a given natural coordinate in cartesian coordinates.
Definition: Fem3DElementTetrahedron.cpp:361
Base class for all Fem Element (1D, 2D, 3D) It handles the node ids to which it is connected and requ...
Definition: FemElement.h:45
void computeMass(const SurgSim::Math::OdeState &state, SurgSim::Math::Matrix *m)
Computes the tetrahedron mass matrix.
Definition: Fem3DElementTetrahedron.cpp:123
Eigen::Matrix< double, Eigen::Dynamic, 1 > Vector
A dynamic size column vector.
Definition: Vector.h:68
Definitions of small fixed-size square matrix types.
Definitions of small fixed-size vector types.
SurgSim::Math::Vector computeNaturalCoordinate(const SurgSim::Math::OdeState &state, const SurgSim::Math::Vector &cartesianCoordinate) const override
Computes a natural coordinate given a global coordinate.
Definition: Fem3DElementTetrahedron.cpp:374
void doUpdateFMDK(const Math::OdeState &state, int options) override
Update the FemElement based on the given state.
Definition: Fem3DElementTetrahedron.cpp:77
void initialize(const SurgSim::Math::OdeState &state) override
Initialize the FemElement once everything has been set.
Definition: Fem3DElementTetrahedron.cpp:92
double getVolume(const SurgSim::Math::OdeState &state) const override
Gets the element volume based on the input state (in m-3)
Definition: Fem3DElementTetrahedron.cpp:218
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > Matrix
A dynamic size matrix.
Definition: Matrix.h:65
Fem3DElementTetrahedron()
Constructor.
Definition: Fem3DElementTetrahedron.cpp:49