16 #ifndef SURGSIM_PHYSICS_FEMELEMENT_H 17 #define SURGSIM_PHYSICS_FEMELEMENT_H 21 #include "SurgSim/Framework/ObjectFactory.h" 25 #include "SurgSim/Physics/Fem.h" 61 static FactoryType& getFactory();
65 size_t getNumDofPerNode()
const;
69 size_t getNumNodes()
const;
73 size_t getNodeId(
size_t elementNodeId)
const;
77 const std::vector<size_t>& getNodeIds()
const;
81 void setYoungModulus(
double E);
84 double getYoungModulus()
const;
88 void setPoissonRatio(
double nu);
91 double getPoissonRatio()
const;
95 void setMassDensity(
double rho);
98 double getMassDensity()
const;
172 virtual void addMatVec(
double alphaM,
double alphaD,
double alphaK,
203 template <
typename T,
int Opt,
typename StorageIndex>
204 void assembleMatrixBlocks(
const Eigen::Ref<const Math::Matrix>& subMatrix,
205 const std::vector<size_t>& blockIds,
size_t blockSize, Eigen::SparseMatrix<T, Opt, StorageIndex>* matrix)
const;
213 template <
typename T,
int Opt,
typename StorageIndex>
214 void assembleMatrixBlocksNoInitialize(
const Eigen::Ref<const Math::Matrix>& subMatrix,
215 const std::vector<size_t>& blockIds,
size_t blockSize, Eigen::SparseMatrix<T, Opt, StorageIndex>* matrix)
const;
227 void setNumDofPerNode(
size_t numDofPerNode);
232 virtual void doUpdateFMDK(
const Math::OdeState& state,
int options) = 0;
235 void initializeFMDK();
238 virtual void doInitializeFMDK();
276 #include "SurgSim/Physics/FemElement-inl.h" 278 #endif // SURGSIM_PHYSICS_FEMELEMENT_H Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui n...
Definition: AddRandomSphereBehavior.cpp:36
size_t m_numDofPerNode
Number of degree of freedom per node for this element.
Definition: FemElement.h:241
Eigen::SparseMatrix< double > SparseMatrix
A sparse matrix.
Definition: SparseMatrix.h:32
double m_nu
Poisson ratio (unitless)
Definition: FemElement.h:268
SurgSim::Math::Matrix m_D
The damping matrix.
Definition: FemElement.h:256
SurgSim::Math::Matrix m_K
The stiffness matrix.
Definition: FemElement.h:250
The state of an ode of 2nd order of the form with boundary conditions.
Definition: OdeState.h:38
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
Definitions of useful sparse matrix functions.
double m_rho
Mass density (in Kg.m-3)
Definition: FemElement.h:262
SurgSim::Math::Vector m_f
The force vector.
Definition: FemElement.h:247
double m_E
Young modulus (in N.m-2)
Definition: FemElement.h:265
SurgSim::Math::Matrix m_M
The mass matrix.
Definition: FemElement.h:253
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.
std::vector< size_t > m_nodeIds
Node ids connected by this element.
Definition: FemElement.h:244
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > Matrix
A dynamic size matrix.
Definition: Matrix.h:65
bool m_useDamping
Flag to specify of the damping is used.
Definition: FemElement.h:259
An object factory, once a class is registered with the factory it can be used to create instances of ...
Definition: ObjectFactory.h:83