CellModules
PhysicsConstraints Class Reference

Class for managing physical constraints in a simulation. More...

#include <PhysicsConstraints.hpp>

Classes

class  Plane
 Represents a plane constraint. More...
 
class  SymAxis
 Represents a symmetrical axis constraint. More...
 

Public Member Functions

 PhysicsConstraints ()
 Default constructor. More...
 
void addPlane (MecaCell::Vec _n=MecaCell::Vec(0, 1, 0), MecaCell::Vec _p=MecaCell::Vec(0, 0, 0), bool _sticky=false)
 Adds a plane constraint. More...
 
void addSymAxis (std::function< double(double, MecaCell::Vec, MecaCell::Vec)> _radiusFunction, MecaCell::Vec _axis=MecaCell::Vec(0., 1., 0.), MecaCell::Vec _origin=MecaCell::Vec(0., 0., 0.), double _length=100, double _maxEffectRadius=100, bool _fitShape=true, double _velocity_attraction=0.001)
 Adds a symmetrical axis constraint. More...
 
void addVelocity (MecaCell::Vec _v=MecaCell::Vec(0, 1, 0))
 Adds a velocity constraint. More...
 
template<typename cell_t >
MecaCell::Vec getSymAxesConstraintsVelocity (cell_t *c)
 Computes the symmetrical axis constraints velocity for a cell. More...
 
template<typename cell_t >
MecaCell::Vec getConstraintVelocity (cell_t *c)
 Computes the constraint velocity for a cell. More...
 
void setCurvedBox (double radiusBoxPlane, double curvedDistToMaxSpeed, double maxSpeed)
 Sets the curved box parameters. More...
 
void setPoissonAndYoungOfPlane (double poisson, double young)
 Sets the Poisson's ratio and Young's modulus for the plane. More...
 
template<typename cell_t >
void applyPlaneConstraints (cell_t *c)
 Applies plane constraints to a cell. More...
 
template<typename cell_t >
void snapCellsToPlane (cell_t *c)
 Snaps cells to the plane. More...
 

Public Attributes

double overlapAdhesion = 0.2
 

Private Attributes

std::vector< Planeplanes
 
std::vector< SymAxissymAxes
 
std::vector< MecaCell::Vecvelocities
 
double ratioPoisson2OnYoung = 0.0000000000001
 
double velocity_center_attraction = 0.00001
 
double radiusBox = -1
 

Detailed Description

Class for managing physical constraints in a simulation.

Definition at line 13 of file PhysicsConstraints.hpp.

Constructor & Destructor Documentation

◆ PhysicsConstraints()

PhysicsConstraints::PhysicsConstraints ( )
inline

Default constructor.

Definition at line 95 of file PhysicsConstraints.hpp.

Member Function Documentation

◆ addPlane()

void PhysicsConstraints::addPlane ( MecaCell::Vec  _n = MecaCell::Vec(0, 1, 0),
MecaCell::Vec  _p = MecaCell::Vec(0, 0, 0),
bool  _sticky = false 
)
inline

Adds a plane constraint.

Parameters
_nNormal vector of the plane.
_pPoint on the plane.
_stickyIndicates if the plane is sticky.

Definition at line 104 of file PhysicsConstraints.hpp.

◆ addSymAxis()

void PhysicsConstraints::addSymAxis ( std::function< double(double, MecaCell::Vec, MecaCell::Vec)>  _radiusFunction,
MecaCell::Vec  _axis = MecaCell::Vec(0., 1., 0.),
MecaCell::Vec  _origin = MecaCell::Vec(0., 0., 0.),
double  _length = 100,
double  _maxEffectRadius = 100,
bool  _fitShape = true,
double  _velocity_attraction = 0.001 
)
inline

Adds a symmetrical axis constraint.

Parameters
_radiusFunctionRadius function.
_axisAxis vector.
_originOrigin point.
_lengthLength of the axis.
_maxEffectRadiusMaximum effect radius.
_fitShapeIndicates if the shape should fit.
_velocity_attractionAttraction velocity.

Definition at line 119 of file PhysicsConstraints.hpp.

◆ addVelocity()

void PhysicsConstraints::addVelocity ( MecaCell::Vec  _v = MecaCell::Vec(0, 1, 0))
inline

Adds a velocity constraint.

Parameters
_vVelocity vector.

Definition at line 128 of file PhysicsConstraints.hpp.

◆ applyPlaneConstraints()

template<typename cell_t >
void PhysicsConstraints::applyPlaneConstraints ( cell_t *  c)
inline

Applies plane constraints to a cell.

Template Parameters
cell_tType of the cell.
Parameters
cPointer to the cell.

Definition at line 215 of file PhysicsConstraints.hpp.

◆ getConstraintVelocity()

template<typename cell_t >
MecaCell::Vec PhysicsConstraints::getConstraintVelocity ( cell_t *  c)
inline

Computes the constraint velocity for a cell.

Template Parameters
cell_tType of the cell.
Parameters
cPointer to the cell.
Returns
Constraint velocity.

Definition at line 172 of file PhysicsConstraints.hpp.

◆ getSymAxesConstraintsVelocity()

template<typename cell_t >
MecaCell::Vec PhysicsConstraints::getSymAxesConstraintsVelocity ( cell_t *  c)
inline

Computes the symmetrical axis constraints velocity for a cell.

Template Parameters
cell_tType of the cell.
Parameters
cPointer to the cell.
Returns
Symmetrical axis constraints velocity.

Definition at line 140 of file PhysicsConstraints.hpp.

◆ setCurvedBox()

void PhysicsConstraints::setCurvedBox ( double  radiusBoxPlane,
double  curvedDistToMaxSpeed,
double  maxSpeed 
)
inline

Sets the curved box parameters.

Parameters
radiusBoxPlaneRadius of the box plane.
curvedDistToMaxSpeedCurved distance to maximum speed.
maxSpeedMaximum speed.

Definition at line 193 of file PhysicsConstraints.hpp.

◆ setPoissonAndYoungOfPlane()

void PhysicsConstraints::setPoissonAndYoungOfPlane ( double  poisson,
double  young 
)
inline

Sets the Poisson's ratio and Young's modulus for the plane.

Parameters
poissonPoisson's ratio.
youngYoung's modulus.

Definition at line 204 of file PhysicsConstraints.hpp.

◆ snapCellsToPlane()

template<typename cell_t >
void PhysicsConstraints::snapCellsToPlane ( cell_t *  c)
inline

Snaps cells to the plane.

Template Parameters
cell_tType of the cell.
Parameters
cPointer to the cell.

Definition at line 244 of file PhysicsConstraints.hpp.

Member Data Documentation

◆ overlapAdhesion

double PhysicsConstraints::overlapAdhesion = 0.2

Definition at line 90 of file PhysicsConstraints.hpp.

◆ planes

std::vector<Plane> PhysicsConstraints::planes
private

Definition at line 52 of file PhysicsConstraints.hpp.

◆ radiusBox

double PhysicsConstraints::radiusBox = -1
private

Definition at line 87 of file PhysicsConstraints.hpp.

◆ ratioPoisson2OnYoung

double PhysicsConstraints::ratioPoisson2OnYoung = 0.0000000000001
private

Definition at line 85 of file PhysicsConstraints.hpp.

◆ symAxes

std::vector<SymAxis> PhysicsConstraints::symAxes
private

Definition at line 82 of file PhysicsConstraints.hpp.

◆ velocities

std::vector<MecaCell::Vec> PhysicsConstraints::velocities
private

Definition at line 84 of file PhysicsConstraints.hpp.

◆ velocity_center_attraction

double PhysicsConstraints::velocity_center_attraction = 0.00001
private

Definition at line 86 of file PhysicsConstraints.hpp.


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