CellModules
DelaunayMassSpringDamper::PluginDelaunayMassSpringDamper< cell_t > Class Template Reference

Class for managing Delaunay triangulation and mass-spring-damper physics. More...

#include <PluginDelaunayMassSpringDamper.hpp>

Public Member Functions

 PluginDelaunayMassSpringDamper ()
 Constructor. More...
 
void setPhysicsDt (double dt)
 Sets the physics dt. More...
 
void setCoherenceCoeff (double c)
 Sets the coherence coefficient. More...
 
void setMaxSpeed (double s)
 Sets the maximum speed. More...
 
void setMinForce (double f)
 Sets the minimum force. More...
 
void setNeighbourCoeff (double c)
 Sets the neighbour coefficient. More...
 
template<typename world_t >
void endUpdate (world_t *w)
 End update hook for MecaCell. More...
 
template<typename world_t >
void onAddCell (world_t *w)
 On add cell hook for MecaCell. More...
 
template<typename world_t >
void preBehaviorUpdate (world_t *w)
 Pre-behavior update hook for MecaCell. More...
 
template<typename world_t >
void preDeleteDeadCellsUpdate (world_t *w)
 Pre-delete dead cells update hook for MecaCell. More...
 

Private Member Functions

bool isDelaunayCoherent ()
 Checks the coherence of the Delaunay triangulation. More...
 
void moveDelaunay ()
 Moves the points in the triangulation to match their real positions. More...
 
template<typename world_t >
void computeDelaunay (world_t *w)
 Computes the Delaunay triangulation from the list of cells. More...
 
void springCreation ()
 Creates the list of springs. More...
 
template<typename world_t >
void addCells (world_t *w)
 Adds new cells to the triangulation. More...
 
void removeCells ()
 Removes dead cells from the triangulation. More...
 
void updateForces ()
 Updates forces and checks if the forces are too weak to be considered. More...
 
template<typename world_t >
void updatePositions (world_t *w)
 Updates positions and checks if the movements are too weak to be considered. More...
 
template<typename world_t >
void resetForces (world_t *w)
 Resets the forces acting on the cells. More...
 
template<typename world_t >
void applyPhysics (world_t *w)
 Applies the physics with a coherent time step. More...
 

Private Attributes

std::vector< MassSpringDamper< cell_t > > springList
 
Delaunay triangulation
 
bool areForcesNegligible
 
bool areMovementsNegligible
 
double physicsDt = 0.01
 
double maxSpeed = 10.0
 
double minForce = 1.0
 
double neighbourCoeff = 1.1
 
double coherenceCoeff = 0.2
 

Detailed Description

template<typename cell_t>
class DelaunayMassSpringDamper::PluginDelaunayMassSpringDamper< cell_t >

Class for managing Delaunay triangulation and mass-spring-damper physics.

Template Parameters
cell_tType of the cell.

Definition at line 37 of file PluginDelaunayMassSpringDamper.hpp.

Constructor & Destructor Documentation

◆ PluginDelaunayMassSpringDamper()

template<typename cell_t >
DelaunayMassSpringDamper::PluginDelaunayMassSpringDamper< cell_t >::PluginDelaunayMassSpringDamper ( )
inline

Constructor.

Initializes the spring list and the triangulation.

Definition at line 258 of file PluginDelaunayMassSpringDamper.hpp.

Member Function Documentation

◆ addCells()

template<typename cell_t >
template<typename world_t >
void DelaunayMassSpringDamper::PluginDelaunayMassSpringDamper< cell_t >::addCells ( world_t *  w)
inlineprivate

Adds new cells to the triangulation.

Template Parameters
world_tType of the world.
Parameters
wPointer to the world.

Definition at line 158 of file PluginDelaunayMassSpringDamper.hpp.

◆ applyPhysics()

template<typename cell_t >
template<typename world_t >
void DelaunayMassSpringDamper::PluginDelaunayMassSpringDamper< cell_t >::applyPhysics ( world_t *  w)
inlineprivate

Applies the physics with a coherent time step.

Applies the physics with a coherent physics dt. Stops when movements or forces are too weak.

Template Parameters
world_tType of the world.
Parameters
wPointer to the world.

Definition at line 241 of file PluginDelaunayMassSpringDamper.hpp.

◆ computeDelaunay()

template<typename cell_t >
template<typename world_t >
void DelaunayMassSpringDamper::PluginDelaunayMassSpringDamper< cell_t >::computeDelaunay ( world_t *  w)
inlineprivate

Computes the Delaunay triangulation from the list of cells.

Template Parameters
world_tType of the world.
Parameters
wPointer to the world.

Definition at line 100 of file PluginDelaunayMassSpringDamper.hpp.

◆ endUpdate()

template<typename cell_t >
template<typename world_t >
void DelaunayMassSpringDamper::PluginDelaunayMassSpringDamper< cell_t >::endUpdate ( world_t *  w)
inline

End update hook for MecaCell.

Recomputes or readjusts the triangulation and regenerates the springs.

Template Parameters
world_tType of the world.
Parameters
wPointer to the world.

Definition at line 299 of file PluginDelaunayMassSpringDamper.hpp.

◆ isDelaunayCoherent()

template<typename cell_t >
bool DelaunayMassSpringDamper::PluginDelaunayMassSpringDamper< cell_t >::isDelaunayCoherent ( )
inlineprivate

Checks the coherence of the Delaunay triangulation.

Returns
False if the triangulation needs to be recomputed.

Definition at line 54 of file PluginDelaunayMassSpringDamper.hpp.

◆ moveDelaunay()

template<typename cell_t >
void DelaunayMassSpringDamper::PluginDelaunayMassSpringDamper< cell_t >::moveDelaunay ( )
inlineprivate

Moves the points in the triangulation to match their real positions.

Definition at line 77 of file PluginDelaunayMassSpringDamper.hpp.

◆ onAddCell()

template<typename cell_t >
template<typename world_t >
void DelaunayMassSpringDamper::PluginDelaunayMassSpringDamper< cell_t >::onAddCell ( world_t *  w)
inline

On add cell hook for MecaCell.

Adds the new cells to the triangulation.

Template Parameters
world_tType of the world.
Parameters
wPointer to the world.

Definition at line 313 of file PluginDelaunayMassSpringDamper.hpp.

◆ preBehaviorUpdate()

template<typename cell_t >
template<typename world_t >
void DelaunayMassSpringDamper::PluginDelaunayMassSpringDamper< cell_t >::preBehaviorUpdate ( world_t *  w)
inline

Pre-behavior update hook for MecaCell.

Applies the physics to each cell.

Template Parameters
world_tType of the world.
Parameters
wPointer to the world.

Definition at line 326 of file PluginDelaunayMassSpringDamper.hpp.

◆ preDeleteDeadCellsUpdate()

template<typename cell_t >
template<typename world_t >
void DelaunayMassSpringDamper::PluginDelaunayMassSpringDamper< cell_t >::preDeleteDeadCellsUpdate ( world_t *  w)
inline

Pre-delete dead cells update hook for MecaCell.

Removes the dead cells from the triangulation.

Template Parameters
world_tType of the world.
Parameters
wPointer to the world.

Definition at line 339 of file PluginDelaunayMassSpringDamper.hpp.

◆ removeCells()

template<typename cell_t >
void DelaunayMassSpringDamper::PluginDelaunayMassSpringDamper< cell_t >::removeCells ( )
inlineprivate

Removes dead cells from the triangulation.

Definition at line 173 of file PluginDelaunayMassSpringDamper.hpp.

◆ resetForces()

template<typename cell_t >
template<typename world_t >
void DelaunayMassSpringDamper::PluginDelaunayMassSpringDamper< cell_t >::resetForces ( world_t *  w)
inlineprivate

Resets the forces acting on the cells.

Template Parameters
world_tType of the world.
Parameters
wPointer to the world.

Definition at line 225 of file PluginDelaunayMassSpringDamper.hpp.

◆ setCoherenceCoeff()

template<typename cell_t >
void DelaunayMassSpringDamper::PluginDelaunayMassSpringDamper< cell_t >::setCoherenceCoeff ( double  c)
inline

Sets the coherence coefficient.

Parameters
cCoherence coefficient.

Definition at line 270 of file PluginDelaunayMassSpringDamper.hpp.

◆ setMaxSpeed()

template<typename cell_t >
void DelaunayMassSpringDamper::PluginDelaunayMassSpringDamper< cell_t >::setMaxSpeed ( double  s)
inline

Sets the maximum speed.

Parameters
sMaximum speed.

Definition at line 276 of file PluginDelaunayMassSpringDamper.hpp.

◆ setMinForce()

template<typename cell_t >
void DelaunayMassSpringDamper::PluginDelaunayMassSpringDamper< cell_t >::setMinForce ( double  f)
inline

Sets the minimum force.

Parameters
fMinimum force.

Definition at line 282 of file PluginDelaunayMassSpringDamper.hpp.

◆ setNeighbourCoeff()

template<typename cell_t >
void DelaunayMassSpringDamper::PluginDelaunayMassSpringDamper< cell_t >::setNeighbourCoeff ( double  c)
inline

Sets the neighbour coefficient.

Parameters
cNeighbour coefficient.

Definition at line 288 of file PluginDelaunayMassSpringDamper.hpp.

◆ setPhysicsDt()

template<typename cell_t >
void DelaunayMassSpringDamper::PluginDelaunayMassSpringDamper< cell_t >::setPhysicsDt ( double  dt)
inline

Sets the physics dt.

Parameters
dtPhysics dt.

Definition at line 264 of file PluginDelaunayMassSpringDamper.hpp.

◆ springCreation()

template<typename cell_t >
void DelaunayMassSpringDamper::PluginDelaunayMassSpringDamper< cell_t >::springCreation ( )
inlineprivate

Creates the list of springs.

Definition at line 122 of file PluginDelaunayMassSpringDamper.hpp.

◆ updateForces()

template<typename cell_t >
void DelaunayMassSpringDamper::PluginDelaunayMassSpringDamper< cell_t >::updateForces ( )
inlineprivate

Updates forces and checks if the forces are too weak to be considered.

Definition at line 188 of file PluginDelaunayMassSpringDamper.hpp.

◆ updatePositions()

template<typename cell_t >
template<typename world_t >
void DelaunayMassSpringDamper::PluginDelaunayMassSpringDamper< cell_t >::updatePositions ( world_t *  w)
inlineprivate

Updates positions and checks if the movements are too weak to be considered.

Template Parameters
world_tType of the world.
Parameters
wPointer to the world.

Definition at line 205 of file PluginDelaunayMassSpringDamper.hpp.

Member Data Documentation

◆ areForcesNegligible

template<typename cell_t >
bool DelaunayMassSpringDamper::PluginDelaunayMassSpringDamper< cell_t >::areForcesNegligible
private

Definition at line 42 of file PluginDelaunayMassSpringDamper.hpp.

◆ areMovementsNegligible

template<typename cell_t >
bool DelaunayMassSpringDamper::PluginDelaunayMassSpringDamper< cell_t >::areMovementsNegligible
private

Definition at line 43 of file PluginDelaunayMassSpringDamper.hpp.

◆ coherenceCoeff

template<typename cell_t >
double DelaunayMassSpringDamper::PluginDelaunayMassSpringDamper< cell_t >::coherenceCoeff = 0.2
private

Coefficient used to determine the spatial coherence of each cell

Definition at line 48 of file PluginDelaunayMassSpringDamper.hpp.

◆ maxSpeed

template<typename cell_t >
double DelaunayMassSpringDamper::PluginDelaunayMassSpringDamper< cell_t >::maxSpeed = 10.0
private

Max velocity of a cell in µm/s

Definition at line 45 of file PluginDelaunayMassSpringDamper.hpp.

◆ minForce

template<typename cell_t >
double DelaunayMassSpringDamper::PluginDelaunayMassSpringDamper< cell_t >::minForce = 1.0
private

Minimal force to consider in pN

Definition at line 46 of file PluginDelaunayMassSpringDamper.hpp.

◆ neighbourCoeff

template<typename cell_t >
double DelaunayMassSpringDamper::PluginDelaunayMassSpringDamper< cell_t >::neighbourCoeff = 1.1
private

Coefficient used to set the maximal distance to consider 2 cells as neighbours

Definition at line 47 of file PluginDelaunayMassSpringDamper.hpp.

◆ physicsDt

template<typename cell_t >
double DelaunayMassSpringDamper::PluginDelaunayMassSpringDamper< cell_t >::physicsDt = 0.01
private

Physical dt is set to 0.01s supposing w->dt is in seconds

Definition at line 44 of file PluginDelaunayMassSpringDamper.hpp.

◆ springList

template<typename cell_t >
std::vector<MassSpringDamper<cell_t> > DelaunayMassSpringDamper::PluginDelaunayMassSpringDamper< cell_t >::springList
private

List of springs representing the connections between cells

Definition at line 40 of file PluginDelaunayMassSpringDamper.hpp.

◆ triangulation

template<typename cell_t >
Delaunay DelaunayMassSpringDamper::PluginDelaunayMassSpringDamper< cell_t >::triangulation
private

Contains and computes the Delaunay triangulation of the cells

Definition at line 41 of file PluginDelaunayMassSpringDamper.hpp.


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