Base class for all springs It handles the node ids to which it is connected and requires all derived classes to compute the force and its derivatives (the stiffness and damping matrices) A extra method also exist to compute all of them at once for performance purposes. More...
#include <SurgSim/Physics/Spring.h>
Public Member Functions  
virtual  ~Spring () 
Virtual destructor. More...  
size_t  getNumNodes () const 
Gets the number of nodes the spring is connecting. More...  
size_t  getNodeId (size_t springNodeId) const 
Gets the springNodeIdth 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::Matrix *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  addStiffness (const SurgSim::Math::OdeState &state, SurgSim::Math::Matrix *K, double scale=1.0)=0 
Adds the spring stiffness matrix K (= df/dx) (computed for a given state) to a complete system stiffness matrix K (assembly) More...  
virtual void  addFDK (const SurgSim::Math::OdeState &state, SurgSim::Math::Vector *F, SurgSim::Math::Matrix *D, SurgSim::Math::Matrix *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 matrixvector contribution F += (alphaD.D + alphaK.K).x (computed for a given state) into a complete system data structure F (assembly) More...  
Protected Attributes  
std::vector< size_t >  m_nodeIds 
Node ids connected by this spring. More...  
Base class for all springs It handles the node ids to which it is connected and requires all derived classes to compute the force and its derivatives (the stiffness and damping matrices) A extra method also exist to compute all of them at once for performance purposes.
It holds on to the actual computed values (m_f, m_K, m_D) as its size is not predefined from outside and would requires intensive (de)allocation or a temporary variable anyway

inlinevirtual 
Virtual destructor.

pure virtual 
Adds the spring damping matrix D (= df/dv) (computed for a given state) to a complete system damping matrix D (assembly)
state  The state to compute the damping matrix with  
[in,out]  D  The complete system damping matrix to add the spring damping matrix into 
scale  A factor to scale the added damping matrix with 
Implemented in SurgSim::Physics::LinearSpring.

pure virtual 
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)
state  The state to compute everything with  
[in,out]  F  The complete system force vector to add the spring force into 
[in,out]  D  The complete system damping matrix to add the spring damping matrix into 
[in,out]  K  The complete system stiffness matrix to add the spring stiffness matrix into 
Implemented in SurgSim::Physics::LinearSpring.

pure virtual 
Adds the spring force (computed for a given state) to a complete system force vector F (assembly)
state  The state to compute the force with  
[in,out]  F  The complete system force vector to add the spring force into 
scale  A factor to scale the added force with 
Implemented in SurgSim::Physics::LinearSpring.

pure virtual 
Adds the spring matrixvector contribution F += (alphaD.D + alphaK.K).x (computed for a given state) into a complete system data structure F (assembly)
state  The state to compute everything with  
alphaD  The scaling factor for the damping contribution  
alphaK  The scaling factor for the stiffness contribution  
x  A complete system vector to use as the vector in the matrixvector multiplication  
[in,out]  F  The complete system force vector to add the element matrixvector contribution into 
Implemented in SurgSim::Physics::LinearSpring.

pure virtual 
Adds the spring stiffness matrix K (= df/dx) (computed for a given state) to a complete system stiffness matrix K (assembly)
state  The state to compute the stiffness matrix with  
[in,out]  K  The complete system stiffness matrix to add the spring stiffness matrix into 
scale  A factor to scale the added stiffness matrix with 
Implemented in SurgSim::Physics::LinearSpring.

inline 
Gets the springNodeIdth node id.

inline 
Gets the node ids for this spring.

inline 
Gets the number of nodes the spring is connecting.

protected 
Node ids connected by this spring.