Biomechanical Joint Model
 Author: Anderson Maciel

COME_Molecule Class Reference

#include <comemolecule.h>

Inherits COME_SubSpaceElement.

Inheritance diagram for COME_Molecule:

Inheritance graph
[legend]
Collaboration diagram for COME_Molecule:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 COME_Molecule ()
 COME_Molecule (COME_Point3D positionN, double radiusN, double frictionConstN, COME_Material *materialN, COME_Vector3D velocityN, COME_BioStructure *parentN)
 COME_Molecule (COME_Point3D &positionN, double &radiusN, double &frictionConstN, COME_Material *materialN, COME_Vector3D &velocityN, COME_BioStructure *parentN)
 ~COME_Molecule ()
void setRadius (double radiusN)
void setFrictionConst (double frictionConstN)
void setConnectionList (list< COME_MoleculeLink * > *listN)
void setExternalForces (vector< COME_TimeForce * > listN)
void setOnSurface (bool flag)
void setCollisionForce (COME_Force forceN)
void setIfGreaterCollisionForce (COME_Force forceN)
void setPosition (COME_Point3D &positionN)
void setIntersectClamp (int type)
void setCollide (bool yesno)
void setUpdated (bool yesno)
void addCollisionForce (COME_Force forceN)
 Accumulate the given force with other contact's forces.
double getRadius () const
double getFrictionConst () const
list< COME_MoleculeLink * > * getConnectionList () const
vector< COME_Molecule * > & getOrthogonalNeighbors ()
vector< COME_TimeForce * > getExternalForces () const
vector< COME_Vertex3D * > * getBuois ()
vector< int > * getBuoisIndices ()
bool isOnSurface () const
COME_Force getCollisionForce () const
COME_Vector3D getLastDisplacement () const
COME_MatrixgetLocalFrame ()
double getVolume () const
double getLiquidLevel () const
double getLiquidFraction () const
double getNominalRadius () const
double getPermeability () const
double getPressureArea () const
bool intersectClamp () const
bool intersectClampFix () const
bool intersectClampMobile () const
bool isCollide () const
bool isUpdated () const
void addLink (COME_MoleculeLink *linkN)
void addBuoy (COME_Vertex3D *buoyN, int index)
void addOrthogonalNeighbor (COME_Molecule *newNeighbor)
void addExternalForce (COME_TimeForce *forceN)
void clearExternalForces ()
void createLink (COME_Molecule *moleculeN)
void createLink (COME_Molecule *moleculeN, double globalHooke)
void makeLocalFrame ()
void makeOriginalFrame ()
void initializeOrthogonalNeighbors ()
void resetPosition ()
void checkPosition ()
void setINITPosition (COME_Point3D &newPos)
COME_Point3D getINITPositionGlobal ()
void derivs (double currTime, double timestep, COME_Point3D *positionsIN, COME_Vector3D *velocitiesIN, COME_Vector3D *velocitiesOUT, COME_Vector3D *accelerationsOUT, int currIndex)
int updateLinks ()
COME_Force externalForceTo (double currTime)

Public Attributes

COME_Force fOriginal
COME_Force fDamping
COME_Force fFriction
COME_Force fLocal
COME_Force fGravity
COME_Force fExternal
COME_Force fCollision
double * liquidSharingArray

Protected Member Functions

COME_Force calculateForce (double currTime, COME_Point3D *positionsIN, COME_Vector3D *velocitiesIN, int currIndex)
void removeLink (COME_Molecule *moleculeN)

Protected Attributes

double radius
double nominalRadius
double frictionConst
list< COME_MoleculeLink * > * connectionList
vector< COME_Molecule * > orthogonalNeighbors
vector< COME_Vertex3D * > buois
vector< int > buoisIndices
COME_MatrixlocalFrame
vector< COME_Vector3DoriginalLocalFrame
COME_Point3D initPosition
bool onSurface
bool collide
bool updated
vector< COME_TimeForce * > externalForces
COME_Force collisionForce
COME_Vector3D lastDisplacement
double liquidFraction
double permeability
int intersecClamp

Detailed Description

This class represents a generic molecular subdivision of an object. Each molecule replaces a set of molecules of the real object and it is, in fact, a spherical volume with a constant radius that approaches and diverges of its neighbours without regard to geometrical penetration.

Definition at line 57 of file comemolecule.h.


Constructor & Destructor Documentation

COME_Molecule::COME_Molecule  ) 
 

Default constructor.

Definition at line 42 of file comemolecule.cpp.

References collide, connectionList, COME_SubSpaceElement::fixed, intersecClamp, liquidSharingArray, localFrame, COME::parent, COME_SubSpaceElement::stress, and updated.

COME_Molecule::COME_Molecule COME_Point3D  positionN,
double  radiusN,
double  frictionConstN,
COME_Material materialN,
COME_Vector3D  velocityN,
COME_BioStructure parentN
 

Complete constructor.

Definition at line 60 of file comemolecule.cpp.

References COME_SubSpaceElement::fixed, frictionConst, COME_Material::getDensity(), COME_Material::getLiquidFraction(), COME_Material::getPermeability(), getVolume(), initPosition, liquidFraction, localFrame, nominalRadius, onSurface, COME::parent, permeability, radius, COME_SubSpaceElement::setMass(), COME_SubSpaceElement::setMaterial(), setPosition(), and COME_SubSpaceElement::setVelocity().

Here is the call graph for this function:

COME_Molecule::COME_Molecule COME_Point3D positionN,
double &  radiusN,
double &  frictionConstN,
COME_Material materialN,
COME_Vector3D velocityN,
COME_BioStructure parentN
 

Definition at line 96 of file comemolecule.cpp.

References COME_SubSpaceElement::fixed, frictionConst, COME_Material::getDensity(), COME_Material::getLiquidFraction(), COME_Material::getPermeability(), getVolume(), initPosition, liquidFraction, localFrame, nominalRadius, onSurface, COME::parent, permeability, radius, COME_SubSpaceElement::setMass(), COME_SubSpaceElement::setMaterial(), setPosition(), and COME_SubSpaceElement::setVelocity().

Here is the call graph for this function:

COME_Molecule::~COME_Molecule  ) 
 

Definition at line 133 of file comemolecule.cpp.

References connectionList.


Member Function Documentation

void COME_Molecule::addBuoy COME_Vertex3D buoyN,
int  index
 

This method adds linkN to the end of this molecule list of connections.

Definition at line 383 of file comemolecule.cpp.

References buois, and buoisIndices.

void COME_Molecule::addCollisionForce COME_Force  forceN  ) 
 

Accumulate the given force with other contact's forces.

Definition at line 422 of file comemolecule.cpp.

References collisionForce.

void COME_Molecule::addExternalForce COME_TimeForce forceN  ) 
 

This method adds forceN to the end of this molecule list of external forces.

Definition at line 403 of file comemolecule.cpp.

References externalForces.

void COME_Molecule::addLink COME_MoleculeLink linkN  ) 
 

This method adds linkN to the end of this molecule list of connections.

Definition at line 374 of file comemolecule.cpp.

References connectionList.

Referenced by createLink().

void COME_Molecule::addOrthogonalNeighbor COME_Molecule newNeighbor  ) 
 

This method adds .

Definition at line 394 of file comemolecule.cpp.

References orthogonalNeighbors.

COME_Force COME_Molecule::calculateForce double  currTime,
COME_Point3D positionsIN,
COME_Vector3D velocitiesIN,
int  currIndex
[protected]
 

This method calculates the resulting force being applied to this molecule at this moment. It is obtained by adding local forces, global forces and connection forces.

Calculates gravity force.

Calculates external force.

Totalize connection's forces

Calculate external friction

Totalize forces

Calculate stress and strain

Definition at line 521 of file comemolecule.cpp.

References COME_Vector3D::vpModule().

Referenced by derivs().

Here is the call graph for this function:

void COME_Molecule::checkPosition  ) 
 

This method sets the initPosition as being the current, establishing a checkpoint for the position.

Definition at line 753 of file comemolecule.cpp.

References initPosition, and COME_SubSpaceElement::position.

void COME_Molecule::clearExternalForces  ) 
 

This method clears list of external forces.

Definition at line 412 of file comemolecule.cpp.

References externalForces.

void COME_Molecule::createLink COME_Molecule moleculeN,
double  globalHooke
 

This method creates a connection between this molecule and moleculeN. A reference to the connection created will be added to the lists of connections of both molecules (this and moleculeN). All connection parameters will be calculated from global Hooke of the organ given.

Definition at line 466 of file comemolecule.cpp.

References addLink(), COME_Material::getAnisotropyVector(), COME_Material::getDamping(), getFrictionConst(), COME_SubSpaceElement::getMaterial(), COME_SubSpaceElement::getPosition(), COME_Point3D::getX(), COME_Point3D::getY(), COME_Point3D::getZ(), COME_SubSpaceElement::material, COME_SubSpaceElement::position, COME_MoleculeLink::setDampingConst(), COME_MoleculeLink::setFrictionConst(), COME_MoleculeLink::setHookeConst(), COME_MoleculeLink::setNominalDist(), and COME_Vector3D::vpNormalize().

Here is the call graph for this function:

void COME_Molecule::createLink COME_Molecule moleculeN  ) 
 

This method creates a connection between this molecule and moleculeN. A reference to the connection created will be added to the lists of connections of both molecules (this and moleculeN). All connection parameters will be calculated from the ones of molecules.

Definition at line 434 of file comemolecule.cpp.

References addLink(), COME_Material::getDamping(), getFrictionConst(), COME_SubSpaceElement::getMaterial(), COME_MoleculeLink::getNominalDist(), COME_SubSpaceElement::getPosition(), getRadius(), COME_Material::getYoungsModulus(), COME_MoleculeLink::setDampingConst(), COME_MoleculeLink::setFrictionConst(), COME_MoleculeLink::setHookeConst(), and COME_MoleculeLink::setNominalDist().

Referenced by COME_MoleculesTissue::addMolecule().

Here is the call graph for this function:

void COME_Molecule::derivs double  currTime,
double  timestep,
COME_Point3D positionsIN,
COME_Vector3D velocitiesIN,
COME_Vector3D velocitiesOUT,
COME_Vector3D accelerationsOUT,
int  currIndex
 

This method derivs the two sets of variables positions and velocities into the two new sets velocities and accelerations. It calls the protected method calculateForce() to compute the final force being applied on this molecule and apply Newton's laws to calculate the resultant acceleration and the final velocity.

Definition at line 636 of file comemolecule.cpp.

References COME_SubSpaceElement::acceleration, calculateForce(), COME_Force::getForceVector(), COME_SubSpaceElement::isFixed(), COME::parent, and updateLinks().

Here is the call graph for this function:

COME_Force COME_Molecule::externalForceTo double  currTime  ) 
 

This method linearly interpolates the vector of time-force of this molecule to calculate the force to be applied in the current time.

Definition at line 691 of file comemolecule.cpp.

References externalForces.

vector< COME_Vertex3D * > * COME_Molecule::getBuois  ) 
 

Definition at line 252 of file comemolecule.cpp.

References buois.

vector< int > * COME_Molecule::getBuoisIndices  ) 
 

Definition at line 258 of file comemolecule.cpp.

References buoisIndices.

COME_Force COME_Molecule::getCollisionForce  )  const
 

Definition at line 306 of file comemolecule.cpp.

References collisionForce.

list< COME_MoleculeLink * > * COME_Molecule::getConnectionList  )  const
 

Definition at line 240 of file comemolecule.cpp.

References connectionList.

Referenced by COME_MoleculeLink::getNeighbouringTetra(), and removeLink().

vector< COME_TimeForce * > COME_Molecule::getExternalForces  )  const
 

Definition at line 246 of file comemolecule.cpp.

References externalForces.

double COME_Molecule::getFrictionConst  )  const
 

Definition at line 234 of file comemolecule.cpp.

References frictionConst.

Referenced by createLink().

COME_Point3D COME_Molecule::getINITPositionGlobal  ) 
 

Definition at line 769 of file comemolecule.cpp.

References COME::description, initPosition, COME_SubSpaceElement::isFixed(), and COME::parent.

Here is the call graph for this function:

COME_Vector3D COME_Molecule::getLastDisplacement  )  const
 

Definition at line 312 of file comemolecule.cpp.

References lastDisplacement.

Referenced by COME_Face::update().

double COME_Molecule::getLiquidFraction  )  const
 

Definition at line 352 of file comemolecule.cpp.

References liquidFraction.

double COME_Molecule::getLiquidLevel  )  const
 

Definition at line 342 of file comemolecule.cpp.

References getVolume(), liquidFraction, M_PI, and nominalRadius.

Here is the call graph for this function:

COME_Matrix * COME_Molecule::getLocalFrame  ) 
 

Definition at line 324 of file comemolecule.cpp.

References localFrame.

double COME_Molecule::getNominalRadius  )  const
 

Definition at line 358 of file comemolecule.cpp.

References nominalRadius.

vector< COME_Molecule * > & COME_Molecule::getOrthogonalNeighbors  ) 
 

Definition at line 318 of file comemolecule.cpp.

References orthogonalNeighbors.

double COME_Molecule::getPermeability  )  const
 

Definition at line 364 of file comemolecule.cpp.

References permeability.

double COME_Molecule::getPressureArea  )  const
 

Definition at line 336 of file comemolecule.cpp.

References M_PI, and radius.

double COME_Molecule::getRadius  )  const
 

Getting

Definition at line 228 of file comemolecule.cpp.

References radius.

Referenced by COME_MoleculesTissue::addMolecule(), COME_Collision::COME_Collision(), COME_MoleculeLink::COME_MoleculeLink(), createLink(), and COME_MoleculeLink::getFractureDist().

double COME_Molecule::getVolume  )  const
 

Reimplemented from COME_SubSpaceElement.

Definition at line 330 of file comemolecule.cpp.

References M_PI, and radius.

Referenced by COME_Molecule(), and getLiquidLevel().

void COME_Molecule::initializeOrthogonalNeighbors  ) 
 

This method sets for this molecule the neighbour molecules and used it to build a "Molecule's Reference Frame".

Definition at line 785 of file comemolecule.cpp.

References connectionList.

bool COME_Molecule::intersectClamp  )  const
 

Definition at line 282 of file comemolecule.cpp.

References FREE, and intersecClamp.

bool COME_Molecule::intersectClampFix  )  const
 

Definition at line 298 of file comemolecule.cpp.

References CLAMPFIX, and intersecClamp.

bool COME_Molecule::intersectClampMobile  )  const
 

Definition at line 290 of file comemolecule.cpp.

References CLAMPMOBILE, and intersecClamp.

bool COME_Molecule::isCollide  )  const
 

Definition at line 270 of file comemolecule.cpp.

References collide.

bool COME_Molecule::isOnSurface  )  const
 

Definition at line 264 of file comemolecule.cpp.

References onSurface.

bool COME_Molecule::isUpdated  )  const
 

Definition at line 276 of file comemolecule.cpp.

References updated.

void COME_Molecule::makeLocalFrame  ) 
 

Build or rebuild the matrix representing the local frame of this molecule. It's made only if orthogonalNeighbors exist.

for debuging

Definition at line 912 of file comemolecule.cpp.

References COME_Vector3D::getAngle(), COME_SubSpaceElement::getGlobalPosition(), localFrame, Quaternion::makeFromVecs(), originalLocalFrame, orthogonalNeighbors, COME_Matrix::setValueAt(), Quaternion::ToMatrix(), and COME_Vector3D::vpNormalize().

Here is the call graph for this function:

void COME_Molecule::makeOriginalFrame  ) 
 

for debuging

Definition at line 871 of file comemolecule.cpp.

References COME_SubSpaceElement::getGlobalPosition(), localFrame, originalLocalFrame, orthogonalNeighbors, and COME_Vector3D::vpNormalize().

Here is the call graph for this function:

void COME_Molecule::removeLink COME_Molecule moleculeN  )  [protected]
 

This method remove the connection between this molecule and moleculeN. The references to the connection in the lists of connections of both molecules will be removed and the object connection will be destroied.

Definition at line 496 of file comemolecule.cpp.

References connectionList, and getConnectionList().

Here is the call graph for this function:

void COME_Molecule::resetPosition  ) 
 

This method restaures the position of this molecule to the original position used to construct it or the last checked position.

Definition at line 743 of file comemolecule.cpp.

References initPosition, and COME_SubSpaceElement::position.

void COME_Molecule::setCollide bool  yesno  ) 
 

Definition at line 212 of file comemolecule.cpp.

References collide.

void COME_Molecule::setCollisionForce COME_Force  forceN  ) 
 

Definition at line 192 of file comemolecule.cpp.

References collisionForce.

void COME_Molecule::setConnectionList list< COME_MoleculeLink * > *  listN  ) 
 

Definition at line 172 of file comemolecule.cpp.

References connectionList.

void COME_Molecule::setExternalForces vector< COME_TimeForce * >  listN  ) 
 

Definition at line 178 of file comemolecule.cpp.

References externalForces.

void COME_Molecule::setFrictionConst double  frictionConstN  ) 
 

Definition at line 166 of file comemolecule.cpp.

References frictionConst.

void COME_Molecule::setIfGreaterCollisionForce COME_Force  forceN  ) 
 

Definition at line 198 of file comemolecule.cpp.

References collisionForce, and COME_Force::getIntensity().

Here is the call graph for this function:

void COME_Molecule::setINITPosition COME_Point3D newPos  ) 
 

JUST FOR TESTING IN jOINT mODELER

Definition at line 763 of file comemolecule.cpp.

References initPosition.

void COME_Molecule::setIntersectClamp int  type  ) 
 

Definition at line 206 of file comemolecule.cpp.

References intersecClamp.

void COME_Molecule::setOnSurface bool  flag  ) 
 

Definition at line 186 of file comemolecule.cpp.

References onSurface.

void COME_Molecule::setPosition COME_Point3D positionN  ) 
 

This overloaded method does more than just set a new value to position. It uses old and new positions to calculate a displacement vector that is stored in the lastDisplacement attribute. All that with the goal of updating mesh faces associated to this molecule by the event of a deformation.

Reimplemented from COME_SubSpaceElement.

Definition at line 727 of file comemolecule.cpp.

References lastDisplacement, COME_SubSpaceElement::position, COME_Vector3D::setVector3D(), and COME_Point3D::vpDistance().

Referenced by COME_Molecule().

Here is the call graph for this function:

void COME_Molecule::setRadius double  radiusN  ) 
 

Setting

Definition at line 159 of file comemolecule.cpp.

References radius.

void COME_Molecule::setUpdated bool  yesno  ) 
 

Definition at line 218 of file comemolecule.cpp.

References updated.

int COME_Molecule::updateLinks  ) 
 

This method tests the distances of this molecule to the ones it is connected to. It calls the protected method removeLink() to remove the connections with molecules that are far than the maximum allowed distance before fracture away from this. It returns the number of connections removed.

Definition at line 659 of file comemolecule.cpp.

Referenced by derivs().


Member Data Documentation

vector<COME_Vertex3D*> COME_Molecule::buois [protected]
 

Definition at line 65 of file comemolecule.h.

Referenced by addBuoy(), and getBuois().

vector<int> COME_Molecule::buoisIndices [protected]
 

Definition at line 66 of file comemolecule.h.

Referenced by addBuoy(), and getBuoisIndices().

bool COME_Molecule::collide [protected]
 

Definition at line 72 of file comemolecule.h.

Referenced by COME_Molecule(), isCollide(), and setCollide().

COME_Force COME_Molecule::collisionForce [protected]
 

Definition at line 75 of file comemolecule.h.

Referenced by addCollisionForce(), getCollisionForce(), setCollisionForce(), and setIfGreaterCollisionForce().

list<COME_MoleculeLink*>* COME_Molecule::connectionList [protected]
 

Definition at line 63 of file comemolecule.h.

Referenced by addLink(), COME_Molecule(), getConnectionList(), initializeOrthogonalNeighbors(), removeLink(), setConnectionList(), and ~COME_Molecule().

vector<COME_TimeForce*> COME_Molecule::externalForces [protected]
 

Definition at line 74 of file comemolecule.h.

Referenced by addExternalForce(), clearExternalForces(), externalForceTo(), getExternalForces(), and setExternalForces().

COME_Force COME_Molecule::fCollision
 

Definition at line 152 of file comemolecule.h.

COME_Force COME_Molecule::fDamping
 

Definition at line 152 of file comemolecule.h.

COME_Force COME_Molecule::fExternal
 

Definition at line 152 of file comemolecule.h.

COME_Force COME_Molecule::fFriction
 

Definition at line 152 of file comemolecule.h.

COME_Force COME_Molecule::fGravity
 

Definition at line 152 of file comemolecule.h.

COME_Force COME_Molecule::fLocal
 

Definition at line 152 of file comemolecule.h.

COME_Force COME_Molecule::fOriginal
 

Definition at line 152 of file comemolecule.h.

double COME_Molecule::frictionConst [protected]
 

Definition at line 62 of file comemolecule.h.

Referenced by COME_Molecule(), getFrictionConst(), and setFrictionConst().

COME_Point3D COME_Molecule::initPosition [protected]
 

Definition at line 69 of file comemolecule.h.

Referenced by checkPosition(), COME_Molecule(), getINITPositionGlobal(), resetPosition(), and setINITPosition().

int COME_Molecule::intersecClamp [protected]
 

Definition at line 80 of file comemolecule.h.

Referenced by COME_Molecule(), intersectClamp(), intersectClampFix(), intersectClampMobile(), and setIntersectClamp().

COME_Vector3D COME_Molecule::lastDisplacement [protected]
 

Definition at line 76 of file comemolecule.h.

Referenced by getLastDisplacement(), and setPosition().

double COME_Molecule::liquidFraction [protected]
 

Definition at line 77 of file comemolecule.h.

Referenced by COME_Molecule(), getLiquidFraction(), and getLiquidLevel().

double* COME_Molecule::liquidSharingArray
 

Definition at line 154 of file comemolecule.h.

Referenced by COME_Molecule().

COME_Matrix* COME_Molecule::localFrame [protected]
 

Definition at line 67 of file comemolecule.h.

Referenced by COME_Molecule(), getLocalFrame(), makeLocalFrame(), and makeOriginalFrame().

double COME_Molecule::nominalRadius [protected]
 

Definition at line 61 of file comemolecule.h.

Referenced by COME_Molecule(), getLiquidLevel(), and getNominalRadius().

bool COME_Molecule::onSurface [protected]
 

Definition at line 71 of file comemolecule.h.

Referenced by COME_Molecule(), isOnSurface(), and setOnSurface().

vector<COME_Vector3D> COME_Molecule::originalLocalFrame [protected]
 

Definition at line 68 of file comemolecule.h.

Referenced by makeLocalFrame(), and makeOriginalFrame().

vector<COME_Molecule*> COME_Molecule::orthogonalNeighbors [protected]
 

Definition at line 64 of file comemolecule.h.

Referenced by addOrthogonalNeighbor(), getOrthogonalNeighbors(), makeLocalFrame(), and makeOriginalFrame().

double COME_Molecule::permeability [protected]
 

Definition at line 78 of file comemolecule.h.

Referenced by COME_Molecule(), and getPermeability().

double COME_Molecule::radius [protected]
 

Definition at line 60 of file comemolecule.h.

Referenced by COME_Molecule(), getPressureArea(), getRadius(), getVolume(), and setRadius().

bool COME_Molecule::updated [protected]
 

Definition at line 73 of file comemolecule.h.

Referenced by COME_Molecule(), isUpdated(), and setUpdated().


The documentation for this class was generated from the following files:
Generated on Thu Dec 1 10:14:24 2005 for COME - Biomechanical Joint Model by  doxygen 1.4.5