An atom has an unique index in the physical model object, a 3D position, and different basic properties. More...
#include <Atom.h>
Public Member Functions | |
Atom (PhysicalModel *myPM) | |
Default constructor : set the position to the origin, generate a unique index. More... | |
Atom (PhysicalModel *myPM, const double pos[3]) | |
constructor : generate a unique index More... | |
Atom (PhysicalModel *myPM, const unsigned int ind) | |
set the position to the origin More... | |
Atom (PhysicalModel *myPM, const unsigned int ind, const double pos[3]) | |
constructor : generate a unique index More... | |
Atom (PhysicalModel *myPM, physicalModel::Atom atom, unsigned int id=-1) | |
constructor from xml node: try to read and get the parameters from xml and set the index in atom SC (if possible) More... | |
unsigned int | getIndexInAtoms () const |
get the index of this atom in the global atom structural component, i.e. its order number in atoms More... | |
void | getPosition (double pos[3]) const |
get the position of the atom (array of 3 doubles) More... | |
AtomProperties * | getProperties () const |
Get a ptr to the AtomProperties. More... | |
bool | isInstanceOf (const char *) const override |
return true only if the parameter is equal to "Atom" More... | |
bool | setIndex (const unsigned int) override |
set the index. More... | |
void | setPosition (const double, const double, const double) |
set the position of the atom More... | |
void | setPosition (const double[3]) |
set the position of the atom More... | |
void | xmlPrint (std::ostream &, const StructuralComponent *) override |
print to an output stream in "pseudo" XML format. More... | |
~Atom () override | |
std destructor More... | |
Public Member Functions inherited from Structure | |
virtual void | addStructuralComponent (StructuralComponent *) |
add a particular StructuralComponent in the list More... | |
std::vector< StructuralComponent * > | getAllStructuralComponents () |
get the list of all the StructuralComponent that are using this structure More... | |
unsigned int | getIndex () const |
get the structure unique index (stored in its property) More... | |
std::string | getName () const |
get the name of the structure More... | |
unsigned int | getNumberOfStructuralComponents () const |
get the number of StructuralComponent that are using this structure More... | |
StructuralComponent * | getStructuralComponent (unsigned int i) |
get a particular StructuralComponent that is using this structure More... | |
StructureProperties::GeometricType | getType () const |
get the type of index More... | |
void | removeStructuralComponent (StructuralComponent *) |
remove a particular StructuralComponent from the list More... | |
void | setName (std::string) |
set the name of the structure More... | |
virtual void | setPhysicalModel (PhysicalModel *) |
set the physical model More... | |
Structure () | |
Base constructor. More... | |
virtual | ~Structure ()=default |
Virtual destructor needed here as this is an abstract class (pure virtual) More... | |
Additional Inherited Members | |
Public Attributes inherited from Structure | |
bool | hasIndex |
indicate if the Structure has an index (which is not the case all the time) More... | |
Protected Attributes inherited from Structure | |
StructureProperties * | properties {nullptr} |
Property of the current structure. More... | |
An atom has an unique index in the physical model object, a 3D position, and different basic properties.
It is the most basic structure composing a physical model. It is on an atoms that the forces and loads could be applied in order to generate dynamics.
Atom::Atom | ( | PhysicalModel * | myPM | ) |
Default constructor : set the position to the origin, generate a unique index.
myPM | the physical model the atom belongs to |
References Structure::properties.
Atom::Atom | ( | PhysicalModel * | myPM, |
physicalModel::Atom | atom, | ||
unsigned int | id = -1 |
||
) |
constructor from xml node: try to read and get the parameters from xml and set the index in atom SC (if possible)
myPM | the physical model the atom belongs to |
atom | the xsd class representing the atom to read information from. |
id | the index in the atoms structural component (useful to directly access the memory block corresponding to the position) |
References Structure::properties.
Atom::Atom | ( | PhysicalModel * | myPM, |
const double | pos[3] | ||
) |
constructor : generate a unique index
myPM | the physical model the atom belongs to |
pos | the initial position of the created atom (array of 3 double) |
References Structure::properties.
Atom::Atom | ( | PhysicalModel * | myPM, |
const unsigned int | ind | ||
) |
set the position to the origin
myPM | the physical model the atom belongs to |
ind | give the unique index |
References Structure::properties.
Atom::Atom | ( | PhysicalModel * | myPM, |
const unsigned int | ind, | ||
const double | pos[3] | ||
) |
constructor : generate a unique index
myPM | the physical model the atom belongs to |
ind | give the unique index |
pos | the initial position of the created atom (array of 3 double) |
References Structure::properties.
|
override |
std destructor
References Structure::properties.
unsigned int Atom::getIndexInAtoms | ( | ) | const |
get the index of this atom in the global atom structural component, i.e. its order number in atoms
|
inline |
get the position of the atom (array of 3 doubles)
References AtomProperties::getPosition(), and getProperties().
Referenced by MonitorDisplacement::calculate(), MonitorDistanceX::calculate(), MonitorDistanceY::calculate(), MonitorDistanceZ::calculate(), MonitorGeometricDeviation::calculate(), MonitorNormDisplacement::calculate(), MonitorPointFinalSetDistance::calculate(), MonitorPointSetDistance::calculate(), MonitorPointToTriangleMeshDistanceFinal::calculate(), MonitorPosition::calculate(), MonitorRen::calculate(), PhysicalModel::exportAnsysMesh(), PhysicalModel::exportPatran(), Reference::getDistanceToTriangularMesh(), and Reference::getNearest().
|
inline |
Get a ptr to the AtomProperties.
References Structure::properties.
Referenced by getPosition(), and setPosition().
|
inlineoverridevirtual |
return true only if the parameter is equal to "Atom"
Implements Structure.
|
overridevirtual |
set the index.
The index have to be unique otherwise this method has no effect. The sub-classes method will check that this index is not in use.
Reimplemented from Structure.
References PhysicalModel::addGlobalIndexAtomPair(), Properties::getPhysicalModel(), Structure::properties, and Structure::setIndex().
|
inline |
set the position of the atom
References getProperties(), and AtomProperties::setPosition().
|
inline |
set the position of the atom
References getProperties(), and AtomProperties::setPosition().
Referenced by PhysicalModel::setAtomPosition(), and Simulator::updatePositions().
|
overridevirtual |
print to an output stream in "pseudo" XML format.
Implements Structure.
References PhysicalModel::getAtoms(), Structure::getIndex(), Properties::getPhysicalModel(), and Structure::properties.