Go to the documentation of this file.
16 #ifndef SURGSIM_PHYSICS_FEMELEMENT_INL_H
17 #define SURGSIM_PHYSICS_FEMELEMENT_INL_H
30 template <
typename DerivedSub,
typename T,
int Opt,
typename Index>
32 size_t blockSize, Eigen::SparseMatrix<T, Opt, Index>* matrix,
33 bool initialize)
const
37 const Index numBlocks =
static_cast<Index
>(blockIds.size());
38 for (Index block0 = 0; block0 < numBlocks; block0++)
40 Index subRow =
static_cast<Index
>(blockSize * block0);
41 for (Index block1 = 0; block1 < numBlocks; block1++)
43 Index subCol =
static_cast<Index
>(blockSize * block1);
44 addSubMatrix(subMatrix.block(subRow, subCol, blockSize, blockSize),
45 static_cast<Index
>(blockIds[block0]),
46 static_cast<Index
>(blockIds[block1]),
56 #endif // SURGSIM_PHYSICS_FEMELEMENT_INL_H
Definitions of small fixed-size square matrix types.
void addSubMatrix(const SubMatrix &subMatrix, size_t blockIdRow, size_t blockIdCol, size_t blockSizeRow, size_t blockSizeCol, Matrix *matrix)
Helper method to add a sub-matrix into a matrix, for the sake of clarity.
Definition: Matrix.h:157
Definitions of useful sparse matrix functions.
Definition: CompoundShapeToGraphics.cpp:30
virtual void initialize(const SurgSim::Math::OdeState &state)
Initialize the FemElement once everything has been set.
Definition: FemElement.cpp:34
void assembleMatrixBlocks(const DerivedSub &subMatrix, const std::vector< size_t > blockIds, size_t blockSize, Eigen::SparseMatrix< T, Opt, Index > *matrix, bool initialize=true) const
Helper method to add a sub-matrix made of squared-blocks into a matrix, for the sake of clarity.
Definition: FemElement-inl.h:31