SOFA API  6a688117
Open source framework for multi-physics simuation
sofa::component::interactionforcefield::LinearSpring< T > Class Template Reference

#include <SpringForceField.h>

This class contains the description of one linear spring. More...

Detailed Description

template<class T>
class sofa::component::interactionforcefield::LinearSpring< T >

This class contains the description of one linear spring.

Public Attributes

int m1
 
int m2
 the two extremities of the spring: masses m1 and m2 More...
 
Real ks
 spring stiffness More...
 
Real kd
 damping factor More...
 
Real initpos
 rest length of the spring More...
 
bool elongationOnly
 only forbid elongation, not compression More...
 
bool enabled
 false to disable this spring (i.e. broken) More...
 

Public Member Functions

 LinearSpring (int m1=0, int m2=0, Real ks=0.0, Real kd=0.0, Real initpos=0.0, bool noCompression=false, bool enabled=true)
 

Friends

std::istream & operator>> (std::istream &in, LinearSpring< Real > &s)
 
std::ostream & operator<< (std::ostream &out, const LinearSpring< Real > &s)
 

Attribute details

template<class T >
bool sofa::component::interactionforcefield::LinearSpring< T >::elongationOnly

only forbid elongation, not compression

false to disable this spring (i.e. broken)

rest length of the spring

damping factor

spring stiffness

the two extremities of the spring: masses m1 and m2

Constructor details

template<class T >
sofa::component::interactionforcefield::LinearSpring< T >::LinearSpring ( int  m1 = 0,
int  m2 = 0,
Real  ks = 0.0,
Real  kd = 0.0,
Real  initpos = 0.0,
bool  noCompression = false,
bool  enabled = true 
)
inline

Related details

template<class T >
std::ostream& operator<< ( std::ostream &  out,
const LinearSpring< Real > &  s 
)
friend
template<class T >
std::istream& operator>> ( std::istream &  in,
LinearSpring< Real > &  s 
)
friend