iMSTK
Interactive Medical Simulation Toolkit
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
imstk::ReducedStVK Class Reference
Inheritance diagram for imstk::ReducedStVK:
Inheritance graph
[legend]
Collaboration diagram for imstk::ReducedStVK:
Collaboration graph
[legend]

Public Member Functions

 ReducedStVK ()
 Constructor.
 
virtual ~ReducedStVK () override
 Destructor.
 
void configure (const std::string &configFileName)
 Configure the force model from external file.
 
void configure (std::shared_ptr< ReducedStVKConfig > config=std::make_shared< ReducedStVKConfig >())
 
bool initialize () override
 Initialize the deformable body model.
 
void setForceModelConfiguration (std::shared_ptr< ReducedStVKConfig > config)
 Set/Get internal force model.
 
std::shared_ptr< ReducedStVKConfiggetForceModelConfiguration () const
 
void setInternalForceModel (std::shared_ptr< vega::StVKReducedInternalForces > fm)
 Set/Get time integrator. More...
 
std::shared_ptr< imstk::InternalForceModelgetInternalForceModel () const
 
void setTimeIntegrator (std::shared_ptr< TimeIntegrator > timeIntegrator)
 Set/Get time integrator.
 
std::shared_ptr< TimeIntegratorgetTimeIntegrator () const
 
void loadInitialStates ()
 Load the initial conditions of the deformable object.
 
bool initializeForceModel ()
 Initialize the force model.
 
bool initializeMassMatrix ()
 Initialize the mass matrix from the mesh.
 
bool initializeDampingMatrix ()
 Initialize the damping (combines structural and viscous damping) matrix.
 
bool initializeTangentStiffness ()
 Initialize the tangent stiffness matrix.
 
bool initializeGravityForce ()
 Initialize the gravity force.
 
bool initializeExplicitExternalForces ()
 Initialize explicit external forces.
 
void computeImplicitSystemRHS (kinematicState &prevState, kinematicState &newState, const StateUpdateType updateType)
 Compute the RHS of the resulting linear system.
 
void computeSemiImplicitSystemRHS (kinematicState &stateAtT, kinematicState &newState, const StateUpdateType updateType)
 Compute the RHS of the resulting linear system using semi-implicit scheme.
 
void computeImplicitSystemLHS (const kinematicState &prevState, kinematicState &newState, const StateUpdateType updateType)
 Compute the LHS of the resulting linear system.
 
void updateDampingMatrix ()
 Update damping Matrix.
 
void updateMassMatrix ()
 Update mass matrix Note: Not supported yet!
 
void applyBoundaryConditions (Matrixd &M, const bool withCompliance=false) const
 Applies boundary conditions to matrix and a vector.
 
void applyBoundaryConditions (Vectord &x) const
 
void updatePhysicsGeometry () override
 Updates the Physics geometry.
 
void updateBodyStates (const Vectord &solution, const StateUpdateType updateType)
 Update states.
 
void updateBodyIntermediateStates (const Vectord &solution, const StateUpdateType updateType)
 
void updateBodyPreviousStates ()
 Update the previous states given the current state.
 
NonLinearSystem< Matrixd >::VectorFunctionType getFunction ()
 Returns the "function" that evaluates the nonlinear function given the state vector.
 
NonLinearSystem< Matrixd >::UpdateFunctionType getUpdateFunction ()
 Get the function that updates the model given the solution.
 
NonLinearSystem< Matrixd >::UpdatePrevStateFunctionType getUpdatePrevStateFunction ()
 
NonLinearSystem< Matrixd >::MatrixFunctionType getFunctionGradient ()
 Returns the "function" that evaluates the gradient of the nonlinear function given the state vector.
 
Vectord & getContactForce ()
 Get the contact force vector.
 
Vectord & getUnknownVec ()
 Returns the unknown vectors.
 
void setUpdateType (const StateUpdateType &updateType)
 Set/Get the update type.
 
const StateUpdateTypegetUpdateType () const
 
std::vector< std::size_t > & getFixNodeIds ()
 Returns the unknown vectors.
 
virtual void setTimeStep (const double timeStep)
 Set the time step size.
 
virtual double getTimeStep () const
 Returns the time step size.
 
void setFixedSizeTimeStepping ()
 Set the time step size to fixed size.
 
void enableFixedBC ()
 Set the fixed BC implementation state.
 
void disableFixedBC ()
 
bool isFixedBCImplemented () const
 
void prolongate (const Vectord &uReduced, Vectord &u) const
 prolongate reduced vector into full space, ie, u = U * uReduced
 
void prolongate (kinematicState &uReduced, kinematicState &u) const
 prolongate reduced state into full space
 
void project (const Vectord &u, Vectord &uReduced) const
 project full-space vector into reduced space, uReduced = U^T u
 
void readModalMatrix (const std::string &fname)
 Read in the basis file and create m_modalMatrix. More...
 
std::shared_ptr< TaskNodegetSolveNode () const
 
std::shared_ptr< SolverBasegetSolver () const
 
void setSolver (std::shared_ptr< SolverBase > solver)
 
- Public Member Functions inherited from imstk::DynamicalModel< FeDeformBodyState >
 DynamicalModel (DynamicalModelType type=DynamicalModelType::None)
 
std::shared_ptr< FeDeformBodyStategetInitialState () const
 Return the initial state of the problem.
 
std::shared_ptr< FeDeformBodyStategetCurrentState () const
 Return the current state of the problem.
 
std::shared_ptr< FeDeformBodyStategetPreviousState () const
 Return the previous state of the problem.
 
void resetToInitialState () override
 Reset the current state to the initial state.
 
- Public Member Functions inherited from imstk::AbstractDynamicalModel
std::shared_ptr< TaskGraphgetTaskGraph () const
 
const DynamicalModelTypegetType () const
 Get the type of the object.
 
void setModelGeometry (std::shared_ptr< Geometry > geometry)
 Sets the model geometry.
 
bool isGeometryValid (const std::shared_ptr< Geometry > geometry)
 Checks if the given geometry is a valid geometry type for the model.
 
std::shared_ptr< GeometrygetModelGeometry () const
 Gets the model geometry.
 
void initGraphEdges ()
 Initializes the edges of the graph.
 
std::size_t getNumDegreeOfFreedom () const
 Get/Set the number of degrees of freedom.
 
void setNumDegreeOfFreedom (const size_t nDof)
 
virtual void setTimeStepSizeType (const TimeSteppingType type)
 Get/Set the type of approach used to update the time step size after every frame.
 
TimeSteppingType getTimeStepSizeType () const
 

Static Public Member Functions

static void initializeEigenMatrixFromStdVector (const std::vector< double > &v, Matrixd &eigenMatrix)
 Initialize the Eigen matrix with data inside vega sparse matrix.
 

Protected Member Functions

void initGraphEdges (std::shared_ptr< TaskNode > source, std::shared_ptr< TaskNode > sink) override
 Setup the computational graph of FEM.
 
- Protected Member Functions inherited from imstk::AbstractDynamicalModel
 AbstractDynamicalModel (DynamicalModelType type=DynamicalModelType::None)
 

Protected Attributes

std::shared_ptr< SolverBasem_solver = nullptr
 
std::shared_ptr< vega::StVKReducedInternalForces > m_internalForceModel
 
std::shared_ptr< vega::ReducedStVKForceModel > m_forceModel
 

Mathematical model for intenal forces


 
std::shared_ptr< TimeIntegratorm_timeIntegrator
 
std::shared_ptr< NonLinearSystem< Matrixd > > m_nonLinearSystem
 

Time integrator


 
std::shared_ptr< vega::ModalMatrix > m_modalMatrix
 

Nonlinear system resulting from TI and force model


 
std::shared_ptr< ReducedStVKConfigm_config
 
Matrixd m_M
 Matrices typical to a elastodynamics and 2nd order analogous systems.
 
Matrixd m_C
 

Mass matrix


 
Matrixd m_K
 

Damping coefficient matrix


 
Matrixd m_Keff
 

Tangent (derivative of internal force w.r.t displacements) stiffness matrix


 
Vectord m_Fcontact
 integrator) More...
 
Vectord m_Fgravity
 

Vector of contact forces


 
Vectord m_FexplicitExternal
 

Vector of gravity forces


 
Vectord m_qSol
 

Vector of explicitly defined external forces


 
Vectord m_Feff
 

Vector to maintain solution at each iteration of nonlinear solver


 
Vectord m_Finternal
 

Vector of effective forces


 
Vectord m_qSolReduced
 

Vector of internal forces


 
Vectord m_FcontactReduced
 

Vector to maintain solution at each iteration of nonlinear solver


 
Vectord m_FgravityReduced
 
Vectord m_FexplicitExternalReduced
 

Vector of gravity forces


 
size_t m_numDOFReduced
 

Vector of explicitly defined external forces


 
std::shared_ptr< vega::VolumetricMesh > m_vegaPhysicsMesh
 
std::vector< double > m_massMatrix
 

Mesh used for Physics


 
std::vector< double > m_stiffnessMatrix
 

Vega mass matrix


 
std::vector< double > m_dampingMatrix
 

Vega Tangent stiffness matrix


 
std::vector< std::size_t > m_fixedNodeIds
 

Vega Laplacian damping matrix


 
StateUpdateType m_updateType = StateUpdateType::DeltaVelocity
 

Nodal IDs of the nodes that are fixed


 
bool m_damped = false
 

Update type of the model


 
bool m_implementFixedBC = false
 

Viscous or structurally damped system


 
std::shared_ptr< kinematicStatem_initialStateReduced
 
std::shared_ptr< kinematicStatem_previousStateReduced
 
std::shared_ptr< kinematicStatem_currentStateReduced
 
- Protected Attributes inherited from imstk::DynamicalModel< FeDeformBodyState >
std::shared_ptr< FeDeformBodyStatem_initialState
 Initial state.
 
std::shared_ptr< FeDeformBodyStatem_currentState
 Current state.
 
std::shared_ptr< FeDeformBodyStatem_previousState
 Previous state.
 
- Protected Attributes inherited from imstk::AbstractDynamicalModel
DynamicalModelType m_type
 Mathematical model type.
 
std::size_t m_numDof
 Total number of degree of freedom.
 
std::shared_ptr< Geometrym_geometry = nullptr
 Physics geometry of the model.
 
std::set< std::string > m_validGeometryTypes
 Valid geometry types of this model.
 
TimeSteppingType m_timeStepSizeType = TimeSteppingType::Fixed
 
std::shared_ptr< TaskGraphm_taskGraph = nullptr
 

Additional Inherited Members

- Public Types inherited from imstk::AbstractDynamicalModel
enum  StateUpdateType {
  Displacement, Velocity, DeltaDisplacement, DeltaVelocity,
  None
}
 Type of the update of the state of the body.
 

Detailed Description

Definition at line 62 of file imstkReducedStVKBodyModel.h.

Member Function Documentation

◆ readModalMatrix()

void imstk::ReducedStVK::readModalMatrix ( const std::string &  fname)

Read in the basis file and create m_modalMatrix.

Todo:
: make it private/protected?

Definition at line 219 of file imstkReducedStVKBodyModel.cpp.

Here is the caller graph for this function:

◆ setInternalForceModel()

void imstk::ReducedStVK::setInternalForceModel ( std::shared_ptr< vega::StVKReducedInternalForces >  fm)

Set/Get time integrator.

Note
the return type is different from FEMDeformableBodyModel::setInternalForceModel

Definition at line 129 of file imstkReducedStVKBodyModel.cpp.

Member Data Documentation

◆ m_Fcontact

Vectord imstk::ReducedStVK::m_Fcontact
protected

integrator)

Effective stiffness matrix (dependent on internal force model and time

Definition at line 336 of file imstkReducedStVKBodyModel.h.


The documentation for this class was generated from the following files: