CellModules
MecaCell::Spring Struct Reference

#include <spring.hpp>

Public Member Functions

 Spring ()
 
 Spring (const double &K, const double &C, const double &L)
 
void updateLength (double l)
 
double computeForce (double dt)
 
template<typename A , typename B >
void applyForce (A &a, B &b, const Vector3D &direction, double dt)
 

Public Attributes

double k = 1.0
 
double c = 1.0
 
double restLength = 1.0
 
double length = 1.0
 
double prevLength = 1.0
 
double minLengthRatio = 0.5
 

Detailed Description

Definition at line 10 of file spring.hpp.

Constructor & Destructor Documentation

◆ Spring() [1/2]

MecaCell::Spring::Spring ( )
inline

Definition at line 18 of file spring.hpp.

◆ Spring() [2/2]

MecaCell::Spring::Spring ( const double &  K,
const double &  C,
const double &  L 
)
inline

Definition at line 19 of file spring.hpp.

Member Function Documentation

◆ applyForce()

template<typename A , typename B >
void MecaCell::Spring::applyForce ( A &  a,
B &  b,
const Vector3D direction,
double  dt 
)
inline

Definition at line 33 of file spring.hpp.

◆ computeForce()

double MecaCell::Spring::computeForce ( double  dt)
inline

Definition at line 27 of file spring.hpp.

◆ updateLength()

void MecaCell::Spring::updateLength ( double  l)
inline

Definition at line 22 of file spring.hpp.

Member Data Documentation

◆ c

double MecaCell::Spring::c = 1.0

Definition at line 12 of file spring.hpp.

◆ k

double MecaCell::Spring::k = 1.0

Definition at line 11 of file spring.hpp.

◆ length

double MecaCell::Spring::length = 1.0

Definition at line 14 of file spring.hpp.

◆ minLengthRatio

double MecaCell::Spring::minLengthRatio = 0.5

Definition at line 16 of file spring.hpp.

◆ prevLength

double MecaCell::Spring::prevLength = 1.0

Definition at line 15 of file spring.hpp.

◆ restLength

double MecaCell::Spring::restLength = 1.0

Definition at line 13 of file spring.hpp.


The documentation for this struct was generated from the following file: