CellModules
MecaCell::SpringConnection< Cell > Struct Template Reference

A Spring Connection is a connection between two cells that aims to models both attractive (for adhesion) and repulsive (for collision) forces. It can be seen as composed of 4 dynamically updated mass-spring-damper systems (which can also be seen as a simplified Euler-Bernouilli beam system): More...

#include <springconnection.hpp>

Public Member Functions

 SpringConnection ()
 
 SpringConnection (ordered_pair< Cell * > c)
 
std::pair< double, double > computeMidpoints (double distanceBtwnCenters)
 
void updateDirection ()
 
void updateCollisionParams ()
 
void updateAdhesionParams ()
 
void initJoints ()
 
void updateTorsParams ()
 
void updateFlexParams ()
 
void init ()
 
template<int n>
void updateJointsForces (double dt)
 
void update (double dt)
 

Public Attributes

double COLLISION_DAMPING_RATIO = 0.5
 
double ADH_DAMPING_RATIO = 1.0
 
double ANG_ADH_COEF = 10.0
 
double ADH_CONSTANT = 1.0
 
double MAX_TS_INCL
 
ordered_pair< Cell * > cells
 
Spring collision
 
Spring adhesion
 
std::pair< double, double > midpoint
 
double sqradius = 0
 
double area = 0
 
double adhArea = 0
 
Vector3D direction
 
double dist
 
std::pair< Joint, Jointflex
 
std::pair< Joint, Jointtors
 
bool adhesionEnabled = true
 
bool frictionEnabled = false
 
bool flexEnabled = false
 
bool torsEnabled = false
 
bool unbreakable = false
 
double adhCoef = 0.5
 

Detailed Description

template<typename Cell>
struct MecaCell::SpringConnection< Cell >

A Spring Connection is a connection between two cells that aims to models both attractive (for adhesion) and repulsive (for collision) forces. It can be seen as composed of 4 dynamically updated mass-spring-damper systems (which can also be seen as a simplified Euler-Bernouilli beam system):

  • 2 straight spring (collision + adhesion), called sc, directly attached to the cells centers and whose stiffness is dynamically updated and depends on the level of interpenetration (the deformation of the cells) as well as their mutual attractions (their adhesions).
  • 2 rotational springs (AKA joints), flex & tors, ensuring orientation lock when the cells are in contact. These 2 springs can also be used to simulated friction.
Template Parameters
Cella connectable cell class. Required methods for Cell:
  • Vec getPosition()
  • Vec getVelocity()
  • Vec getAngularVelocity()
  • Basis getOrientation()
  • Rotation getOrientationRotation()
  • double getInertia()
  • void receiveForce(double intensity, Vec direction, bool compressive)
  • void receiveTorque(Vec acc) An implementaiton of these methods is available in the Orientable and Movable classes.

Definition at line 35 of file springconnection.hpp.

Constructor & Destructor Documentation

◆ SpringConnection() [1/2]

template<typename Cell >
MecaCell::SpringConnection< Cell >::SpringConnection ( )
inline

Definition at line 57 of file springconnection.hpp.

◆ SpringConnection() [2/2]

template<typename Cell >
MecaCell::SpringConnection< Cell >::SpringConnection ( ordered_pair< Cell * >  c)
inline

Definition at line 58 of file springconnection.hpp.

Member Function Documentation

◆ computeMidpoints()

template<typename Cell >
std::pair< double, double > MecaCell::SpringConnection< Cell >::computeMidpoints ( double  distanceBtwnCenters)
inline

Definition at line 60 of file springconnection.hpp.

◆ init()

template<typename Cell >
void MecaCell::SpringConnection< Cell >::init ( )
inline

Definition at line 171 of file springconnection.hpp.

◆ initJoints()

template<typename Cell >
void MecaCell::SpringConnection< Cell >::initJoints ( )
inline

Definition at line 124 of file springconnection.hpp.

◆ update()

template<typename Cell >
void MecaCell::SpringConnection< Cell >::update ( double  dt)
inline

Definition at line 238 of file springconnection.hpp.

◆ updateAdhesionParams()

template<typename Cell >
void MecaCell::SpringConnection< Cell >::updateAdhesionParams ( )
inline

Definition at line 106 of file springconnection.hpp.

◆ updateCollisionParams()

template<typename Cell >
void MecaCell::SpringConnection< Cell >::updateCollisionParams ( )
inline

Definition at line 89 of file springconnection.hpp.

◆ updateDirection()

template<typename Cell >
void MecaCell::SpringConnection< Cell >::updateDirection ( )
inline

Definition at line 82 of file springconnection.hpp.

◆ updateFlexParams()

template<typename Cell >
void MecaCell::SpringConnection< Cell >::updateFlexParams ( )
inline

Definition at line 153 of file springconnection.hpp.

◆ updateJointsForces()

template<typename Cell >
template<int n>
void MecaCell::SpringConnection< Cell >::updateJointsForces ( double  dt)
inline

Definition at line 184 of file springconnection.hpp.

◆ updateTorsParams()

template<typename Cell >
void MecaCell::SpringConnection< Cell >::updateTorsParams ( )
inline

Definition at line 139 of file springconnection.hpp.

Member Data Documentation

◆ ADH_CONSTANT

template<typename Cell >
double MecaCell::SpringConnection< Cell >::ADH_CONSTANT = 1.0

Definition at line 39 of file springconnection.hpp.

◆ ADH_DAMPING_RATIO

template<typename Cell >
double MecaCell::SpringConnection< Cell >::ADH_DAMPING_RATIO = 1.0

Definition at line 37 of file springconnection.hpp.

◆ adhArea

template<typename Cell >
double MecaCell::SpringConnection< Cell >::adhArea = 0

Definition at line 49 of file springconnection.hpp.

◆ adhCoef

template<typename Cell >
double MecaCell::SpringConnection< Cell >::adhCoef = 0.5

Definition at line 55 of file springconnection.hpp.

◆ adhesion

template<typename Cell >
Spring MecaCell::SpringConnection< Cell >::adhesion

Definition at line 45 of file springconnection.hpp.

◆ adhesionEnabled

template<typename Cell >
bool MecaCell::SpringConnection< Cell >::adhesionEnabled = true

Definition at line 53 of file springconnection.hpp.

◆ ANG_ADH_COEF

template<typename Cell >
double MecaCell::SpringConnection< Cell >::ANG_ADH_COEF = 10.0

Definition at line 38 of file springconnection.hpp.

◆ area

template<typename Cell >
double MecaCell::SpringConnection< Cell >::area = 0

Definition at line 49 of file springconnection.hpp.

◆ cells

template<typename Cell >
ordered_pair<Cell *> MecaCell::SpringConnection< Cell >::cells

Definition at line 43 of file springconnection.hpp.

◆ collision

template<typename Cell >
Spring MecaCell::SpringConnection< Cell >::collision

Definition at line 44 of file springconnection.hpp.

◆ COLLISION_DAMPING_RATIO

template<typename Cell >
double MecaCell::SpringConnection< Cell >::COLLISION_DAMPING_RATIO = 0.5

Definition at line 36 of file springconnection.hpp.

◆ direction

template<typename Cell >
Vector3D MecaCell::SpringConnection< Cell >::direction

Definition at line 50 of file springconnection.hpp.

◆ dist

template<typename Cell >
double MecaCell::SpringConnection< Cell >::dist

Definition at line 51 of file springconnection.hpp.

◆ flex

template<typename Cell >
std::pair<Joint, Joint> MecaCell::SpringConnection< Cell >::flex

Definition at line 52 of file springconnection.hpp.

◆ flexEnabled

template<typename Cell >
bool MecaCell::SpringConnection< Cell >::flexEnabled = false

Definition at line 53 of file springconnection.hpp.

◆ frictionEnabled

template<typename Cell >
bool MecaCell::SpringConnection< Cell >::frictionEnabled = false

Definition at line 53 of file springconnection.hpp.

◆ MAX_TS_INCL

template<typename Cell >
double MecaCell::SpringConnection< Cell >::MAX_TS_INCL
Initial value:
=
0.1

Definition at line 40 of file springconnection.hpp.

◆ midpoint

template<typename Cell >
std::pair<double, double> MecaCell::SpringConnection< Cell >::midpoint

Definition at line 47 of file springconnection.hpp.

◆ sqradius

template<typename Cell >
double MecaCell::SpringConnection< Cell >::sqradius = 0

Definition at line 48 of file springconnection.hpp.

◆ tors

template<typename Cell >
std::pair<Joint, Joint> MecaCell::SpringConnection< Cell >::tors

Definition at line 52 of file springconnection.hpp.

◆ torsEnabled

template<typename Cell >
bool MecaCell::SpringConnection< Cell >::torsEnabled = false

Definition at line 54 of file springconnection.hpp.

◆ unbreakable

template<typename Cell >
bool MecaCell::SpringConnection< Cell >::unbreakable = false

Definition at line 54 of file springconnection.hpp.


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