Computer Assited Medical Intervention Tool Kit  version 4.1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
SofaSimulator Class Reference

TODO Comment class here. More...

#include <SofaSimulator.h>

Inherits InteractiveSimulator.

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...
 
 ~InteractiveSimulator () override=default
 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 ()=default
 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::MechanicalObjectAtomDOFMapgetMechanicalObjectAtomDOFMap (unsigned int mechObjectIndex)
 get the MechanicalObjectAtomDOFMap for a given mechancial object More...
 
std::MechanicalObjectDOFAtomMapgetMechanicalObjectDOFAtomMap (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...
 
std::vector< std::MechanicalObjectAtomDOFMap * > mechanicalObjectAtomDOFMap
 list of all MechanicalObjectAtomDOFMap More...
 
std::vector< std::MechanicalObjectDOFAtomMap * > mechanicalObjectDOFAtomMap
 list of all MechanicalObjectDOFAtomMap More...
 
SofaVector< BaseMechanicalState * > mechanicalObjects
 the sofa graph node root 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() [1/2]

SofaSimulator::SofaSimulator ( MonitoringManager monitoringManager)

◆ SofaSimulator() [2/2]

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

References build(), and scnFile.

◆ ~SofaSimulator()

SofaSimulator::~SofaSimulator ( )
virtual

References getGNode().

Member Function Documentation

◆ build()

void SofaSimulator::build ( )
private

◆ buildConstraints()

void SofaSimulator::buildConstraints ( )
private

◆ createPml()

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

◆ doMove()

void SofaSimulator::doMove ( double  dt)
virtual

ask the simulator do to one step of the simulation

Parameters
dtintegration step

Implements InteractiveSimulator.

References getGNode().

◆ end()

void SofaSimulator::end ( )
inlinevirtual

end simultor

Implements InteractiveSimulator.

◆ getAtomIndex()

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

References getMechanicalObjectDOFAtomMap().

Referenced by createPml().

◆ getDOFForce() [1/2]

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

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

References atomsToDOF.

◆ getDOFForce() [2/2]

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

References getMechanicalObjectDOFForce().

◆ getDOFPosition() [1/2]

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

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

References atomsToDOF.

◆ getDOFPosition() [2/2]

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

References getMechanicalObjectDOFPosition().

◆ getForce()

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

get current force for one atom

Implements Simulator.

References atomsToDOF, and getMechanicalObjectDOFForce().

◆ getGNode()

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

get the sofa graph node root

Referenced by build(), buildConstraints(), createPml(), doMove(), init(), and ~SofaSimulator().

◆ getMechanicalObject()

MechanicalObject< Vec3Types > * SofaSimulator::getMechanicalObject ( unsigned int  mechObjectIndex)
private

get a mechanical object by its index

References mechanicalObjects.

Referenced by buildConstraints(), and createPml().

◆ getMechanicalObjectAtomDOFMap()

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

get the MechanicalObjectAtomDOFMap for a given mechancial object

Referenced by buildConstraints().

◆ getMechanicalObjectDOFAtomMap()

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

get the MechanicalObjectAtomDOFMap for a given mechancial object

Referenced by getAtomIndex().

◆ getMechanicalObjectDOFForce()

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

get the forces of all DOF for mechanical object mechObjectIndex

Referenced by getDOFForce(), and getForce().

◆ getMechanicalObjectDOFPosition()

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

get the positions of all DOF for mechanical object mechObjectIndex

Referenced by createPml(), getDOFPosition(), and getPosition().

◆ getNumberOfMechanicalObjects()

unsigned int SofaSimulator::getNumberOfMechanicalObjects ( )
inlineprivate

get the number of mechanical objects

Referenced by buildConstraints().

◆ getPosition()

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

get current position for one atom

Implements InteractiveSimulator.

References atomsToDOF, and getMechanicalObjectDOFPosition().

◆ getScnFile()

std::string SofaSimulator::getScnFile ( )
inline

Referenced by SofaWidget::SofaWidget().

◆ init()

void SofaSimulator::init ( )
virtual

Member Data Documentation

◆ atomsToDOF

std::AtomDOFMap SofaSimulator::atomsToDOF
private

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

Referenced by createPml(), getDOFForce(), getDOFPosition(), getForce(), and getPosition().

◆ mechanicalObjectAtomDOFMap

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

list of all MechanicalObjectAtomDOFMap

Referenced by createPml().

◆ mechanicalObjectDOFAtomMap

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

list of all MechanicalObjectDOFAtomMap

Referenced by createPml().

◆ mechanicalObjects

SofaVector<BaseMechanicalState*> SofaSimulator::mechanicalObjects
private

the sofa graph node root

all the mechanical objects

Referenced by build(), createPml(), and getMechanicalObject().

◆ scnFile

std::string SofaSimulator::scnFile
private

path to .scn file

Referenced by build(), and SofaSimulator().

◆ translations

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

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

Referenced by buildConstraints().


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