16 #ifndef SURGSIM_PHYSICS_SPRING_H
17 #define SURGSIM_PHYSICS_SPRING_H
74 double scale = 1.0) = 0;
82 double scale = 1.0) = 0;
90 double scale = 1.0) = 0;
120 #endif // SURGSIM_PHYSICS_SPRING_H
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) ...
Definition: DriveElementFromInputBehavior.cpp:27
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > Matrix
A dynamic size matrix.
Definition: Matrix.h:65
OdeState defines the state y of an ode of 2nd order of the form M(x,v).a = F(x, v) with boundary cond...
Definition: OdeState.h:34
std::vector< size_t > m_nodeIds
Node ids connected by this spring.
Definition: Spring.h:113
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...
Eigen::Matrix< double, Eigen::Dynamic, 1 > Vector
A dynamic size column vector.
Definition: Vector.h:67
Base class for all springs It handles the node ids to which it is connected and requires all derived ...
Definition: Spring.h:41
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) ...
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 ...
Definitions of small fixed-size square matrix types.
Definitions of small fixed-size vector types.
size_t getNumNodes() const
Gets the number of nodes the spring is connecting.
Definition: Spring.h:50
const std::vector< size_t > & getNodeIds() const
Gets the node ids for this spring.
Definition: Spring.h:64
virtual ~Spring()
Virtual destructor.
Definition: Spring.h:45
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 stiff...
size_t getNodeId(size_t springNodeId) const
Gets the springNodeId-th node id.
Definition: Spring.h:57