SOFA API  c76874b7
Open source framework for multi-physics simuation
sofa::component::interactionforcefield::JointSpring< DataTypes > Class Template Reference

#include <JointSpringForceField.h>

JOINTSPRING. More...

Detailed Description

template<typename DataTypes>
class sofa::component::interactionforcefield::JointSpring< DataTypes >

JOINTSPRING.

Public Attributes

int m1
 Attributes. More...
 
int m2
 the two extremities of the spring: masses m1 and m2 More...
 
Real kd
 damping factor More...
 
Vector torsion
 torsion of the springs in axis/angle format More...
 
Vector lawfulTorsion
 projected torsion in allowed angles More...
 
Vector KT
 linear stiffness More...
 
Vector KR
 angular stiffness More...
 
defaulttype::Quat ref
 referential of the spring (p1) to use it in addSpringDForce() More...
 
Vector initTrans
 offset length of the spring More...
 
defaulttype::Quat initRot
 offset orientation of the spring More...
 
sofa::defaulttype::Vec< 6, boolfreeMovements
 defines the axis where the movements is free. (0,1,2)–> translation axis (3,4,5)–>rotation axis More...
 
Real softStiffnessTrans
 stiffness to apply on axis where the translations are free (default 0.0) More...
 
Real hardStiffnessTrans
 stiffness to apply on axis where the translations are forbidden (default 10000.0) More...
 
Real softStiffnessRot
 stiffness to apply on axis where the rotations are free (default 0.0) More...
 
Real hardStiffnessRot
 stiffness to apply on axis where the rotations are forbidden (default 10000.0) More...
 
Real blocStiffnessRot
 stiffness to apply on axis where the rotations are bloqued (=hardStiffnessRot/100) More...
 
bool needToInitializeTrans
 
bool needToInitializeRot
 
sofa::defaulttype::Vec< 6, ReallimitAngles
 limit angles on rotation axis (default no limit) More...
 

Public Member Functions

 JointSpring (int m1=0, int m2=0, Real softKst=0, Real hardKst=10000, Real softKsr=0, Real hardKsr=10000, Real blocKsr=100, Real axmin=-100000, Real axmax=100000, Real aymin=-100000, Real aymax=100000, Real azmin=-100000, Real azmax=100000, Real kd=0)
 Constructors. More...
 
Real getHardStiffnessRotation ()
 Accessors. More...
 
Real getSoftStiffnessRotation ()
 
Real getHardStiffnessTranslation ()
 
Real getSoftStiffnessTranslation ()
 
Real getBlocStiffnessRotation ()
 
sofa::defaulttype::Vec< 6, RealgetLimitAngles ()
 
sofa::defaulttype::Vec< 6, boolgetFreeAxis ()
 
Vector getInitLength ()
 
defaulttype::Quat getInitOrientation ()
 
void setHardStiffnessRotation (Real ksr)
 Affectors. More...
 
void setSoftStiffnessRotation (Real ksr)
 
void setHardStiffnessTranslation (Real kst)
 
void setSoftStiffnessTranslation (Real kst)
 
void setBlocStiffnessRotation (Real ksb)
 
void setLimitAngles (const sofa::defaulttype::Vec< 6, Real > &lims)
 
void setLimitAngles (Real minx, Real maxx, Real miny, Real maxy, Real minz, Real maxz)
 
void setInitLength (const Vector &l)
 
void setInitOrientation (const defaulttype::Quat &o)
 
void setInitOrientation (const Vector &o)
 
void setFreeAxis (const sofa::defaulttype::Vec< 6, bool > &axis)
 
void setFreeAxis (bool isFreeTx, bool isFreeTy, bool isFreeTz, bool isFreeRx, bool isFreeRy, bool isFreeRz)
 
void setDamping (Real _kd)
 

Friends

std::istream & operator>> (std::istream &in, JointSpring< DataTypes > &s)
 
std::ostream & operator<< (std::ostream &out, const JointSpring< DataTypes > &s)
 

Attribute details

template<typename DataTypes >
Real sofa::component::interactionforcefield::JointSpring< DataTypes >::blocStiffnessRot

stiffness to apply on axis where the rotations are bloqued (=hardStiffnessRot/100)

template<typename DataTypes >
sofa::defaulttype::Vec<6,bool> sofa::component::interactionforcefield::JointSpring< DataTypes >::freeMovements

defines the axis where the movements is free. (0,1,2)–> translation axis (3,4,5)–>rotation axis

template<typename DataTypes >
Real sofa::component::interactionforcefield::JointSpring< DataTypes >::hardStiffnessRot

stiffness to apply on axis where the rotations are forbidden (default 10000.0)

template<typename DataTypes >
Real sofa::component::interactionforcefield::JointSpring< DataTypes >::hardStiffnessTrans

stiffness to apply on axis where the translations are forbidden (default 10000.0)

template<typename DataTypes >
defaulttype::Quat sofa::component::interactionforcefield::JointSpring< DataTypes >::initRot

offset orientation of the spring

template<typename DataTypes >
Vector sofa::component::interactionforcefield::JointSpring< DataTypes >::initTrans

offset length of the spring

template<typename DataTypes >
Real sofa::component::interactionforcefield::JointSpring< DataTypes >::kd

damping factor

template<typename DataTypes >
Vector sofa::component::interactionforcefield::JointSpring< DataTypes >::KR

angular stiffness

template<typename DataTypes >
Vector sofa::component::interactionforcefield::JointSpring< DataTypes >::KT

linear stiffness

template<typename DataTypes >
Vector sofa::component::interactionforcefield::JointSpring< DataTypes >::lawfulTorsion

projected torsion in allowed angles

template<typename DataTypes >
sofa::defaulttype::Vec<6,Real> sofa::component::interactionforcefield::JointSpring< DataTypes >::limitAngles

limit angles on rotation axis (default no limit)

template<typename DataTypes >
int sofa::component::interactionforcefield::JointSpring< DataTypes >::m1

Attributes.

template<typename DataTypes >
int sofa::component::interactionforcefield::JointSpring< DataTypes >::m2

the two extremities of the spring: masses m1 and m2

template<typename DataTypes >
bool sofa::component::interactionforcefield::JointSpring< DataTypes >::needToInitializeRot
template<typename DataTypes >
bool sofa::component::interactionforcefield::JointSpring< DataTypes >::needToInitializeTrans
template<typename DataTypes >
defaulttype::Quat sofa::component::interactionforcefield::JointSpring< DataTypes >::ref

referential of the spring (p1) to use it in addSpringDForce()

template<typename DataTypes >
Real sofa::component::interactionforcefield::JointSpring< DataTypes >::softStiffnessRot

stiffness to apply on axis where the rotations are free (default 0.0)

template<typename DataTypes >
Real sofa::component::interactionforcefield::JointSpring< DataTypes >::softStiffnessTrans

stiffness to apply on axis where the translations are free (default 0.0)

template<typename DataTypes >
Vector sofa::component::interactionforcefield::JointSpring< DataTypes >::torsion

torsion of the springs in axis/angle format

Constructor details

template<class DataTypes >
sofa::component::interactionforcefield::JointSpring< DataTypes >::JointSpring ( int  m1 = 0,
int  m2 = 0,
Real  softKst = 0,
Real  hardKst = 10000,
Real  softKsr = 0,
Real  hardKsr = 10000,
Real  blocKsr = 100,
Real  axmin = -100000,
Real  axmax = 100000,
Real  aymin = -100000,
Real  aymax = 100000,
Real  azmin = -100000,
Real  azmax = 100000,
Real  kd = 0 
)

Constructors.

Function details

template<typename DataTypes >
Real sofa::component::interactionforcefield::JointSpring< DataTypes >::getBlocStiffnessRotation ( )
inline
template<typename DataTypes >
sofa::defaulttype::Vec<6,bool> sofa::component::interactionforcefield::JointSpring< DataTypes >::getFreeAxis ( )
inline
template<typename DataTypes >
Real sofa::component::interactionforcefield::JointSpring< DataTypes >::getHardStiffnessRotation ( )
inline

Accessors.

template<typename DataTypes >
Real sofa::component::interactionforcefield::JointSpring< DataTypes >::getHardStiffnessTranslation ( )
inline
template<typename DataTypes >
Vector sofa::component::interactionforcefield::JointSpring< DataTypes >::getInitLength ( )
inline
template<typename DataTypes >
defaulttype::Quat sofa::component::interactionforcefield::JointSpring< DataTypes >::getInitOrientation ( )
inline
template<typename DataTypes >
sofa::defaulttype::Vec<6,Real> sofa::component::interactionforcefield::JointSpring< DataTypes >::getLimitAngles ( )
inline
template<typename DataTypes >
Real sofa::component::interactionforcefield::JointSpring< DataTypes >::getSoftStiffnessRotation ( )
inline
template<typename DataTypes >
Real sofa::component::interactionforcefield::JointSpring< DataTypes >::getSoftStiffnessTranslation ( )
inline
template<typename DataTypes >
void sofa::component::interactionforcefield::JointSpring< DataTypes >::setBlocStiffnessRotation ( Real  ksb)
inline
template<typename DataTypes >
void sofa::component::interactionforcefield::JointSpring< DataTypes >::setDamping ( Real  _kd)
inline
template<typename DataTypes >
void sofa::component::interactionforcefield::JointSpring< DataTypes >::setFreeAxis ( const sofa::defaulttype::Vec< 6, bool > &  axis)
inline
template<typename DataTypes >
void sofa::component::interactionforcefield::JointSpring< DataTypes >::setFreeAxis ( bool  isFreeTx,
bool  isFreeTy,
bool  isFreeTz,
bool  isFreeRx,
bool  isFreeRy,
bool  isFreeRz 
)
inline
template<typename DataTypes >
void sofa::component::interactionforcefield::JointSpring< DataTypes >::setHardStiffnessRotation ( Real  ksr)
inline

Affectors.

template<typename DataTypes >
void sofa::component::interactionforcefield::JointSpring< DataTypes >::setHardStiffnessTranslation ( Real  kst)
inline
template<typename DataTypes >
void sofa::component::interactionforcefield::JointSpring< DataTypes >::setInitLength ( const Vector l)
inline
template<typename DataTypes >
void sofa::component::interactionforcefield::JointSpring< DataTypes >::setInitOrientation ( const defaulttype::Quat o)
inline
template<typename DataTypes >
void sofa::component::interactionforcefield::JointSpring< DataTypes >::setInitOrientation ( const Vector o)
inline
template<typename DataTypes >
void sofa::component::interactionforcefield::JointSpring< DataTypes >::setLimitAngles ( const sofa::defaulttype::Vec< 6, Real > &  lims)
inline
template<typename DataTypes >
void sofa::component::interactionforcefield::JointSpring< DataTypes >::setLimitAngles ( Real  minx,
Real  maxx,
Real  miny,
Real  maxy,
Real  minz,
Real  maxz 
)
inline
template<typename DataTypes >
void sofa::component::interactionforcefield::JointSpring< DataTypes >::setSoftStiffnessRotation ( Real  ksr)
inline
template<typename DataTypes >
void sofa::component::interactionforcefield::JointSpring< DataTypes >::setSoftStiffnessTranslation ( Real  kst)
inline

Enum details

template<typename DataTypes >
anonymous enum
Enumerator

Related details

template<typename DataTypes >
std::ostream& operator<< ( std::ostream &  out,
const JointSpring< DataTypes > &  s 
)
friend
template<typename DataTypes >
std::istream& operator>> ( std::istream &  in,
JointSpring< DataTypes > &  s 
)
friend