SOFA API  b3f2f2a4
Open source framework for multi-physics simuation
sofa::component::solidmechanics::spring::LinearSpring< T > Class Template Reference

#include <LinearSpring.h>

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

Detailed Description

template<class T>
class sofa::component::solidmechanics::spring::LinearSpring< T >

This class contains the description of one linear spring.

Public Attributes

sofa::Index m1
 
sofa::Index 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 (const sofa::Index m1=0, const sofa::Index m2=0, Real ks=0.0, Real kd=0.0, Real initpos=0.0, const bool noCompression=false, const 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

◆ elongationOnly

template<class T >
bool sofa::component::solidmechanics::spring::LinearSpring< T >::elongationOnly

only forbid elongation, not compression

◆ enabled

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

◆ initpos

rest length of the spring

◆ kd

damping factor

◆ ks

spring stiffness

◆ m1

template<class T >
sofa::Index sofa::component::solidmechanics::spring::LinearSpring< T >::m1

◆ m2

template<class T >
sofa::Index sofa::component::solidmechanics::spring::LinearSpring< T >::m2

the two extremities of the spring: masses m1 and m2

Constructor details

◆ LinearSpring()

template<class T >
sofa::component::solidmechanics::spring::LinearSpring< T >::LinearSpring ( const sofa::Index  m1 = 0,
const sofa::Index  m2 = 0,
Real  ks = 0.0,
Real  kd = 0.0,
Real  initpos = 0.0,
const bool  noCompression = false,
const bool  enabled = true 
)
inlineexplicit

Related details

◆ operator<<

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

◆ operator>>

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