Computer Assited Medical Intervention Tool Kit  version 3.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
SofaSimulator Class Reference

TODO Comment class here. More...

#include <SofaSimulator.h>

+ Inheritance diagram for SofaSimulator:

Public Member Functions

std::string getScnFile ()
 
 SofaSimulator (MonitoringManager *monitoringManager)
 
 SofaSimulator (MonitoringManager *monitoringManager, const char *file)
 
virtual ~SofaSimulator ()
 
Simulator inherited
void doMove (double dt)
 ask the simulator do to one step of the simulation More...
 
void init ()
 initialize the simulator More...
 
void getPosition (int index, double position[3])
 get current position for one atom More...
 
void getForce (int index, double force[3])
 get current force for one atom More...
 
void end ()
 end simultor More...
 
void createPml (const char *inputFile, const char *pmlFile)
 Create a pml file from an imput file. More...
 
- Public Member Functions inherited from InteractiveSimulator
 InteractiveSimulator (MonitoringManager *monitoringManager)
 constructor More...
 
 InteractiveSimulator (MonitoringManager *monitoringManager, const char *file)
 constructor More...
 
virtual ~InteractiveSimulator ()
 destructor More...
 
- Public Member Functions inherited from Simulator
 Simulator (MonitoringManager *monitoringManager)
 default constructor build a simulation from context provided by monitoringManager More...
 
 Simulator (MonitoringManager *monitoringManager, const char *file)
 constructor with simulator file build a simulation from context provided by monitoringManager and physical model provided by a simulator specific input file More...
 
void updatePositions ()
 update all current positions and store last positions More...
 
virtual ~Simulator ()
 destructor More...
 

Private Member Functions

void build ()
 build structure More...
 
void buildConstraints ()
 translate loads into constraints More...
 
unsigned int getAtomIndex (unsigned int mechObjectIndex, unsigned int dofIndex)
 get the atom id corresponding to DOF of index dofIndex in the MechanicalObject of index mechObjectIndex More...
 
sofa::defaulttype::Vec3Types::Deriv getDOFForce (unsigned int atomIndex)
 Return the force std::vector corresponding to the Atom number i. More...
 
sofa::defaulttype::Vec3Types::Deriv getDOFForce (unsigned int mechObjectIndex, unsigned int dofIndex)
 get the force of the DOF of index dofIndex in the MechanicalObject of index mechObjectIndex More...
 
sofa::defaulttype::Vec3Types::Coord getDOFPosition (unsigned int atomIndex)
 Return the Coord std::vector corresponding to the Atom number i. More...
 
sofa::defaulttype::Vec3Types::Coord getDOFPosition (unsigned int mechObjectIndex, unsigned int dofIndex)
 get the position of the DOF of index dofIndex in the MechanicalObject of index mechObjectIndex More...
 
sofa::simulation::Node * getGNode ()
 get the sofa graph node root More...
 
sofa::component::container::MechanicalObject
< sofa::defaulttype::Vec3Types > * 
getMechanicalObject (unsigned int mechObjectIndex)
 get a mechanical object by its index More...
 
std::MechanicalObjectAtomDOFMap & getMechanicalObjectAtomDOFMap (unsigned int mechObjectIndex)
 get the MechanicalObjectAtomDOFMap for a given mechancial object More...
 
std::MechanicalObjectDOFAtomMap & getMechanicalObjectDOFAtomMap (unsigned int mechObjectIndex)
 get the MechanicalObjectAtomDOFMap for a given mechancial object More...
 
sofa::defaulttype::Vec3Types::VecDeriv getMechanicalObjectDOFForce (unsigned int mechObjectIndex)
 get the forces of all DOF for mechanical object mechObjectIndex More...
 
sofa::defaulttype::Vec3Types::VecCoord getMechanicalObjectDOFPosition (unsigned int mechObjectIndex)
 get the positions of all DOF for mechanical object mechObjectIndex More...
 
unsigned int getNumberOfMechanicalObjects ()
 get the number of mechanical objects More...
 

Private Attributes

std::AtomDOFMap atomsToDOF
 create a correspondance between the atoms and the DOFs (indexAtom<->indexMechObject[indexDOF]) More...
 
sofa::simulation::Node * groot
 the sofa graph node root More...
 
std::vector
< std::MechanicalObjectAtomDOFMap * > 
mechanicalObjectAtomDOFMap
 list of all MechanicalObjectAtomDOFMap More...
 
std::vector
< std::MechanicalObjectDOFAtomMap * > 
mechanicalObjectDOFAtomMap
 list of all MechanicalObjectDOFAtomMap More...
 
SofaVector< BaseMechanicalState * > mechanicalObjects
 all the mechanical objects More...
 
std::string scnFile
 path to .scn file More...
 
std::vector
< TranslationConstraint
< sofa::defaulttype::Vec3Types > * > 
translations
 the load constraints (i.e. Translation) for each mechanical Objects More...
 

Additional Inherited Members

- Protected Attributes inherited from Simulator
MonitoringManagermonitoringManager
 monitoring manager More...
 

Detailed Description

TODO Comment class here.

Constructor & Destructor Documentation

SofaSimulator::SofaSimulator ( MonitoringManager monitoringManager)
SofaSimulator::SofaSimulator ( MonitoringManager monitoringManager,
const char *  file 
)
virtual SofaSimulator::~SofaSimulator ( )
virtual

Member Function Documentation

void SofaSimulator::build ( )
private

build structure

void SofaSimulator::buildConstraints ( )
private

translate loads into constraints

void SofaSimulator::createPml ( const char *  inputFile,
const char *  pmlFile 
)
virtual

Create a pml file from an imput file.

Implements InteractiveSimulator.

void SofaSimulator::doMove ( double  dt)
virtual

ask the simulator do to one step of the simulation

Parameters
dtintegration step

Implements InteractiveSimulator.

void SofaSimulator::end ( )
inlinevirtual

end simultor

Implements InteractiveSimulator.

unsigned int SofaSimulator::getAtomIndex ( unsigned int  mechObjectIndex,
unsigned int  dofIndex 
)
private

get the atom id corresponding to DOF of index dofIndex in the MechanicalObject of index mechObjectIndex

sofa::defaulttype::Vec3Types::Deriv SofaSimulator::getDOFForce ( unsigned int  atomIndex)
private

Return the force std::vector corresponding to the Atom number i.

sofa::defaulttype::Vec3Types::Deriv SofaSimulator::getDOFForce ( unsigned int  mechObjectIndex,
unsigned int  dofIndex 
)
private

get the force of the DOF of index dofIndex in the MechanicalObject of index mechObjectIndex

sofa::defaulttype::Vec3Types::Coord SofaSimulator::getDOFPosition ( unsigned int  atomIndex)
private

Return the Coord std::vector corresponding to the Atom number i.

sofa::defaulttype::Vec3Types::Coord SofaSimulator::getDOFPosition ( unsigned int  mechObjectIndex,
unsigned int  dofIndex 
)
private

get the position of the DOF of index dofIndex in the MechanicalObject of index mechObjectIndex

void SofaSimulator::getForce ( int  index,
double  force[3] 
)
virtual

get current force for one atom

Implements Simulator.

sofa::simulation::Node * SofaSimulator::getGNode ( )
inlineprivate

get the sofa graph node root

References groot.

sofa::component::container::MechanicalObject<sofa::defaulttype::Vec3Types>* SofaSimulator::getMechanicalObject ( unsigned int  mechObjectIndex)
private

get a mechanical object by its index

Referenced by getMechanicalObjectDOFForce(), and getMechanicalObjectDOFPosition().

std::MechanicalObjectAtomDOFMap & SofaSimulator::getMechanicalObjectAtomDOFMap ( unsigned int  mechObjectIndex)
inlineprivate

get the MechanicalObjectAtomDOFMap for a given mechancial object

References mechanicalObjectAtomDOFMap.

std::MechanicalObjectDOFAtomMap & SofaSimulator::getMechanicalObjectDOFAtomMap ( unsigned int  mechObjectIndex)
inlineprivate

get the MechanicalObjectAtomDOFMap for a given mechancial object

References mechanicalObjectDOFAtomMap.

sofa::defaulttype::Vec3Types::VecDeriv SofaSimulator::getMechanicalObjectDOFForce ( unsigned int  mechObjectIndex)
inlineprivate

get the forces of all DOF for mechanical object mechObjectIndex

References getMechanicalObject().

sofa::defaulttype::Vec3Types::VecCoord SofaSimulator::getMechanicalObjectDOFPosition ( unsigned int  mechObjectIndex)
inlineprivate

get the positions of all DOF for mechanical object mechObjectIndex

References getMechanicalObject().

unsigned int SofaSimulator::getNumberOfMechanicalObjects ( )
inlineprivate

get the number of mechanical objects

References mechanicalObjects.

void SofaSimulator::getPosition ( int  index,
double  position[3] 
)
virtual

get current position for one atom

Implements InteractiveSimulator.

std::string SofaSimulator::getScnFile ( )
inline

References scnFile.

void SofaSimulator::init ( )
virtual

initialize the simulator

Implements InteractiveSimulator.

Member Data Documentation

std::AtomDOFMap SofaSimulator::atomsToDOF
private

create a correspondance between the atoms and the DOFs (indexAtom<->indexMechObject[indexDOF])

sofa::simulation::Node* SofaSimulator::groot
private

the sofa graph node root

Referenced by getGNode().

std::vector<std::MechanicalObjectAtomDOFMap*> SofaSimulator::mechanicalObjectAtomDOFMap
private

list of all MechanicalObjectAtomDOFMap

Referenced by getMechanicalObjectAtomDOFMap().

std::vector<std::MechanicalObjectDOFAtomMap*> SofaSimulator::mechanicalObjectDOFAtomMap
private

list of all MechanicalObjectDOFAtomMap

Referenced by getMechanicalObjectDOFAtomMap().

SofaVector<BaseMechanicalState*> SofaSimulator::mechanicalObjects
private

all the mechanical objects

Referenced by getNumberOfMechanicalObjects().

std::string SofaSimulator::scnFile
private

path to .scn file

Referenced by getScnFile().

std::vector<TranslationConstraint<sofa::defaulttype::Vec3Types> *> SofaSimulator::translations
private

the load constraints (i.e. Translation) for each mechanical Objects


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