TODO Comment class here. More...
#include <SofaSimulator.h>
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::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... | |
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 | |
MonitoringManager * | monitoringManager |
monitoring manager More... | |
TODO Comment class here.
SofaSimulator::SofaSimulator | ( | MonitoringManager * | monitoringManager | ) |
References a, StructuralComponent::getAtoms(), PhysicalModel::getAtoms(), Component::getCell(), PhysicalModel::getComponentByName(), Structure::getIndex(), PhysicalModel::getNumberOfAtoms(), Component::getNumberOfCells(), StructuralComponent::getNumberOfStructures(), StructuralComponent::getStructure(), Structure::getType(), StructureProperties::HEXAHEDRON, StructureProperties::QUAD, StructureProperties::TETRAHEDRON, and StructureProperties::TRIANGLE.
SofaSimulator::SofaSimulator | ( | MonitoringManager * | monitoringManager, |
const char * | file | ||
) |
|
virtual |
|
private |
build structure
References getGNode(), mechanicalObjects, Simulator::monitoringManager, scnFile, and MonitoringManager::setDt().
Referenced by SofaSimulator().
|
private |
translate loads into constraints
References getGNode(), MonitoringManager::getLml(), getMechanicalObject(), getMechanicalObjectAtomDOFMap(), getNumberOfMechanicalObjects(), TranslationConstraint< DataTypes >::getTargets(), Simulator::monitoringManager, TranslationConstraint< DataTypes >::setInitTime(), and translations.
Referenced by init().
|
virtual |
Create a pml file from an imput file.
Implements InteractiveSimulator.
References a, SurfaceExtractor::AddCell(), StructuralComponent::addStructure(), MultiComponent::addSubComponent(), atomsToDOF, SurfaceExtractor::generateExternalSurface(), PhysicalModel::getAtom(), getAtomIndex(), getGNode(), getMechanicalObject(), getMechanicalObjectDOFPosition(), StructuralComponent::getNumberOfCells(), StructuralComponent::getNumberOfStructures(), StructureProperties::HEXAHEDRON, SurfaceExtractor::init(), mechanicalObjectAtomDOFMap, mechanicalObjectDOFAtomMap, mechanicalObjects, StructureProperties::QUAD, PhysicalModel::setAtoms(), Component::setExclusive(), PhysicalModel::setExclusiveComponents(), PhysicalModel::setInformativeComponents(), StructuralComponent::setMode(), PhysicalModel::setName(), StructureProperties::TETRAHEDRON, StructureProperties::TRIANGLE, RenderingMode::WIREFRAME_AND_SURFACE, and PhysicalModel::xmlPrint().
|
virtual |
ask the simulator do to one step of the simulation
dt | integration step |
Implements InteractiveSimulator.
References getGNode().
|
inlinevirtual |
end simultor
Implements InteractiveSimulator.
|
private |
get the atom id corresponding to DOF of index dofIndex in the MechanicalObject of index mechObjectIndex
References getMechanicalObjectDOFAtomMap().
Referenced by createPml().
|
private |
Return the force std::vector corresponding to the Atom number i.
References atomsToDOF.
|
private |
get the force of the DOF of index dofIndex in the MechanicalObject of index mechObjectIndex
References getMechanicalObjectDOFForce().
|
private |
Return the Coord std::vector corresponding to the Atom number i.
References atomsToDOF.
|
private |
get the position of the DOF of index dofIndex in the MechanicalObject of index mechObjectIndex
References getMechanicalObjectDOFPosition().
|
virtual |
get current force for one atom
Implements Simulator.
References atomsToDOF, and getMechanicalObjectDOFForce().
|
inlineprivate |
get the sofa graph node root
Referenced by build(), buildConstraints(), createPml(), doMove(), init(), and ~SofaSimulator().
|
private |
get a mechanical object by its index
References mechanicalObjects.
Referenced by buildConstraints(), createPml(), getMechanicalObjectDOFForce(), and getMechanicalObjectDOFPosition().
|
inlineprivate |
get the MechanicalObjectAtomDOFMap for a given mechancial object
References mechanicalObjectAtomDOFMap.
Referenced by buildConstraints().
|
inlineprivate |
get the MechanicalObjectAtomDOFMap for a given mechancial object
References mechanicalObjectDOFAtomMap.
Referenced by getAtomIndex().
|
inlineprivate |
get the forces of all DOF for mechanical object mechObjectIndex
References getMechanicalObject().
Referenced by getDOFForce(), and getForce().
|
inlineprivate |
get the positions of all DOF for mechanical object mechObjectIndex
References getMechanicalObject().
Referenced by createPml(), getDOFPosition(), and getPosition().
|
inlineprivate |
get the number of mechanical objects
References mechanicalObjects.
Referenced by buildConstraints().
|
virtual |
get current position for one atom
Implements InteractiveSimulator.
References atomsToDOF, and getMechanicalObjectDOFPosition().
|
inline |
References scnFile.
Referenced by SofaWidget::SofaWidget().
|
virtual |
initialize the simulator
Implements InteractiveSimulator.
References buildConstraints(), getGNode(), MonitoringManager::isLmlPresent(), and Simulator::monitoringManager.
|
private |
create a correspondance between the atoms and the DOFs (indexAtom<->indexMechObject[indexDOF])
Referenced by createPml(), getDOFForce(), getDOFPosition(), getForce(), and getPosition().
|
private |
list of all MechanicalObjectAtomDOFMap
Referenced by createPml(), and getMechanicalObjectAtomDOFMap().
|
private |
list of all MechanicalObjectDOFAtomMap
Referenced by createPml(), and getMechanicalObjectDOFAtomMap().
|
private |
the sofa graph node root
all the mechanical objects
Referenced by build(), createPml(), getMechanicalObject(), and getNumberOfMechanicalObjects().
|
private |
path to .scn file
Referenced by build(), and getScnFile().
|
private |
the load constraints (i.e. Translation) for each mechanical Objects
Referenced by buildConstraints().