7 #include "imstkInternalForceModel.h" 14 auto rowLengths = vegaMatrix->GetRowLengths();
15 auto nonZeroValues = vegaMatrix->GetEntries();
20 for (
int row = 0, end = vegaMatrix->GetNumRows(); row < end; ++row)
24 for (
int j = 0, end_j = rowLengths[row]; j < end_j; ++j)
26 values[j + offset] = nonZeroValues[row][j];
29 offset += rowLengths[row];
virtual void getForceAndMatrix(const Vectord &u, Vectord &internalForce, SparseMatrixd &tangentStiffnessMatrix)
Compute both internal force internalForce and stiffness matrix tangentStiffnessMatrix at state ...
virtual void getTangentStiffnessMatrix(const Vectord &u, SparseMatrixd &tangentStiffnessMatrix)=0
Compute stiffness matrix tangentStiffnessMatrix at state .
virtual void getInternalForce(const Vectord &u, Vectord &internalForce)=0
Compute internal force internalForce at state u.
static void updateValuesFromMatrix(std::shared_ptr< vega::SparseMatrix > vegaMatrix, double *values)
Update the values of the Eigen sparse matrix given the linearized array of data from the Vega matrix...