opensurgsim
Public Member Functions | List of all members
SurgSim::Physics::MockSpring Class Reference
Inheritance diagram for SurgSim::Physics::MockSpring:
SurgSim::Physics::Spring

Public Member Functions

void addNode (size_t nodeId)
 
void addForce (const OdeState &state, Vector *F, double scale=1.0) override
 
void addDamping (const OdeState &state, SparseMatrix *D, double scale=1.0) override
 
void addStiffness (const SurgSim::Math::OdeState &state, SurgSim::Math::SparseMatrix *K, double scale=1.0) override
 Adds the spring stiffness matrix K (= -df/dx) (computed for a given state) to a complete system stiffness matrix K (assembly) More...
 
void addFDK (const OdeState &state, Vector *f, SparseMatrix *D, SparseMatrix *K) override
 
void addMatVec (const OdeState &state, double alphaD, double alphaK, const Vector &x, Vector *F) override
 
- Public Member Functions inherited from SurgSim::Physics::Spring
virtual ~Spring ()
 Virtual destructor.
 
virtual void initialize (const SurgSim::Math::OdeState &state)
 Initialize the Spring once everything has been set. More...
 
size_t getNumNodes () const
 Gets the number of nodes the spring is connecting. More...
 
size_t getNodeId (size_t springNodeId) const
 Gets the springNodeId-th node id. More...
 
const std::vector< size_t > & getNodeIds () const
 Gets the node ids for this spring. More...
 
virtual void addForce (const SurgSim::Math::OdeState &state, SurgSim::Math::Vector *F, double scale=1.0)=0
 Adds the spring force (computed for a given state) to a complete system force vector F (assembly) More...
 
virtual void addDamping (const SurgSim::Math::OdeState &state, SurgSim::Math::SparseMatrix *D, double scale=1.0)=0
 Adds the spring damping matrix D (= -df/dv) (computed for a given state) to a complete system damping matrix D (assembly) More...
 
virtual void addFDK (const SurgSim::Math::OdeState &state, SurgSim::Math::Vector *F, SurgSim::Math::SparseMatrix *D, SurgSim::Math::SparseMatrix *K)=0
 Adds the spring force vector, mass, stiffness and damping matrices (computed for a given state) into a complete system data structure F, D, K (assembly) More...
 
virtual void addMatVec (const SurgSim::Math::OdeState &state, double alphaD, double alphaK, const SurgSim::Math::Vector &x, SurgSim::Math::Vector *F)=0
 Adds the spring matrix-vector contribution F += (alphaD.D + alphaK.K).x (computed for a given state) into a complete system data structure F (assembly) More...
 

Additional Inherited Members

- Protected Attributes inherited from SurgSim::Physics::Spring
std::vector< size_t > m_nodeIds
 Node ids connected by this spring.
 

Member Function Documentation

§ addStiffness()

void SurgSim::Physics::MockSpring::addStiffness ( const SurgSim::Math::OdeState state,
SurgSim::Math::SparseMatrix K,
double  scale = 1.0 
)
overridevirtual

Adds the spring stiffness matrix K (= -df/dx) (computed for a given state) to a complete system stiffness matrix K (assembly)

Parameters
stateThe state to compute the stiffness matrix with
[in,out]KThe complete system stiffness matrix to add the spring stiffness matrix into
scaleA factor to scale the added stiffness matrix with

Implements SurgSim::Physics::Spring.


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