27 #ifndef SIMULATOR_SIMULATORS_SOFA_SOFASIMULATOR_H
28 #define SIMULATOR_SIMULATORS_SOFA_SOFASIMULATOR_H
32 #include <sofa/simulation/tree/TreeSimulation.h>
33 #include <sofa/component/container/MechanicalObject.h>
34 #include <sofa/defaulttype/VecTypes.h>
35 #include <sofa/simulation/tree/GNode.h>
38 #define SofaVector sofa::helper::vector
46 typedef pair<unsigned int, unsigned int> MechanicalObjectDOFIndex;
50 typedef map <unsigned int, MechanicalObjectDOFIndex> AtomDOFMap;
54 typedef map<unsigned int, unsigned int> MechanicalObjectAtomDOFMap;
58 typedef map<unsigned int, unsigned int> MechanicalObjectDOFAtomMap;
82 void getForce(
int index,
double force[3]);
85 void createPml(
const char* inputFile,
const char* pmlFile);
101 sofa::defaulttype::Vec3Types::Coord
getDOFPosition(
unsigned int atomIndex);
104 sofa::defaulttype::Vec3Types::Coord
getDOFPosition(
unsigned int mechObjectIndex,
unsigned int dofIndex);
107 sofa::defaulttype::Vec3Types::Deriv
getDOFForce(
unsigned int atomIndex);
110 sofa::defaulttype::Vec3Types::Deriv
getDOFForce(
unsigned int mechObjectIndex,
unsigned int dofIndex);
113 unsigned int getAtomIndex(
unsigned int mechObjectIndex,
unsigned int dofIndex);
116 sofa::component::container::MechanicalObject<sofa::defaulttype::Vec3Types> *
getMechanicalObject(
unsigned int mechObjectIndex);
135 sofa::simulation::Node::SPtr
groot;
153 std::vector<TranslationConstraint<sofa::defaulttype::Vec3Types> *>
translations;
202 #endif // SIMULATOR_SIMULATORS_SOFA_SOFASIMULATOR_H
MonitoringManager * monitoringManager
monitoring manager
Definition: Simulator.h:82
unsigned int getAtomIndex(unsigned int mechObjectIndex, unsigned int dofIndex)
get the atom id corresponding to DOF of index dofIndex in the MechanicalObject of index mechObjectInd...
std::vector< std::MechanicalObjectDOFAtomMap * > mechanicalObjectDOFAtomMap
list of all MechanicalObjectDOFAtomMap
Definition: SofaSimulator.h:150
std::vector< std::MechanicalObjectAtomDOFMap * > mechanicalObjectAtomDOFMap
list of all MechanicalObjectAtomDOFMap
Definition: SofaSimulator.h:147
std::vector< TranslationConstraint< sofa::defaulttype::Vec3Types > * > translations
the load constraints (i.e. Translation) for each mechanical Objects
Definition: SofaSimulator.h:153
sofa::defaulttype::Vec3Types::VecDeriv getMechanicalObjectDOFForce(unsigned int mechObjectIndex)
get the forces of all DOF for mechanical object mechObjectIndex
Definition: SofaSimulator.h:193
void createPml(const char *inputFile, const char *pmlFile)
Create a pml file from an imput file.
std::string getScnFile()
Definition: SofaSimulator.h:198
sofa::simulation::Node * groot
the sofa graph node root
Definition: SofaSimulator.h:137
SofaSimulator(MonitoringManager *monitoringManager)
void end()
end simultor
Definition: SofaSimulator.h:83
TODO Comment class here.
Definition: SofaSimulator.h:68
void buildConstraints()
translate loads into constraints
sofa::defaulttype::Vec3Types::Deriv getDOFForce(unsigned int atomIndex)
Return the force std::vector corresponding to the Atom number i.
unsigned int getNumberOfMechanicalObjects()
get the number of mechanical objects
Definition: SofaSimulator.h:173
sofa::simulation::Node * getGNode()
get the sofa graph node root
Definition: SofaSimulator.h:160
SofaVector< BaseMechanicalState * > mechanicalObjects
all the mechanical objects
Definition: SofaSimulator.h:141
std::MechanicalObjectDOFAtomMap & getMechanicalObjectDOFAtomMap(unsigned int mechObjectIndex)
get the MechanicalObjectAtomDOFMap for a given mechancial object
Definition: SofaSimulator.h:183
std::MechanicalObjectAtomDOFMap & getMechanicalObjectAtomDOFMap(unsigned int mechObjectIndex)
get the MechanicalObjectAtomDOFMap for a given mechancial object
Definition: SofaSimulator.h:178
void getPosition(int index, double position[3])
get current position for one atom
sofa::defaulttype::Vec3Types::VecCoord getMechanicalObjectDOFPosition(unsigned int mechObjectIndex)
get the positions of all DOF for mechanical object mechObjectIndex
Definition: SofaSimulator.h:188
Manager of the benchmark tests.
Definition: MonitoringManager.h:50
CamiTK CamiTKDir txt file(STRINGS"${FIND_CAMITK_USER_BASE_DIR}/CamiTK/CamiTKDir.txt"FIND_CAMITK_USER_DIR_LAST_INSTALL) endif() find_program(CAMITK_CONFIG_EXECUTABLE NAMES camitk-config-debug camitk-config PATH_SUFFIXES"bin"PATHS"$
Definition: FindCamiTK.cmake:80
void init()
initialize the simulator
void doMove(double dt)
ask the simulator do to one step of the simulation
void build()
build structure
string(REGEX REPLACE"^.*-(.*)-.*""\\1"ARCH"${CAMITK_CONTINUOUS_INTEGRATION}") string(REGEX REPLACE"^.*-.*-(.*)""\\1"BUILDTYPE"$
Definition: continuous.cmake:34
An interactive simulator is a simulator that we can control step by step (ex: Sofa) ...
Definition: InteractiveSimulator.h:38
sofa::defaulttype::Vec3Types::Coord getDOFPosition(unsigned int atomIndex)
Return the Coord std::vector corresponding to the Atom number i.
sofa::component::container::MechanicalObject< sofa::defaulttype::Vec3Types > * getMechanicalObject(unsigned int mechObjectIndex)
get a mechanical object by its index
std::string scnFile
path to .scn file
Definition: SofaSimulator.h:156
std::AtomDOFMap atomsToDOF
create a correspondance between the atoms and the DOFs (indexAtom<->indexMechObject[indexDOF]) ...
Definition: SofaSimulator.h:144
void getForce(int index, double force[3])
get current force for one atom