SOFA API  ca665544
Open source framework for multi-physics simuation
sofa::component::statecontainer::MechanicalObject< DataTypes > Class Template Reference

#include <MechanicalObject.h>

This class can be overridden if needed for additional storage within template specializations. More...

Inheritance diagram for sofa::component::statecontainer::MechanicalObject< DataTypes >:

Detailed Description

template<class DataTypes>
class sofa::component::statecontainer::MechanicalObject< DataTypes >

This class can be overridden if needed for additional storage within template specializations.

MechanicalObject class.

Public Attributes

Data< VecCoordx
 position coordinates of the degrees of freedom More...
 
Data< VecDerivv
 velocity coordinates of the degrees of freedom More...
 
Data< VecDerivf
 force vector of the degrees of freedom More...
 
Data< VecCoordx0
 rest position coordinates of the degrees of freedom More...
 
Data< VecDerivexternalForces
 externalForces vector of the degrees of freedom More...
 
Data< VecDerivdx
 dx vector of the degrees of freedom More...
 
Data< VecCoordxfree
 free position coordinates of the degrees of freedom More...
 
Data< VecDerivvfree
 free velocity coordinates of the degrees of freedom More...
 
Data< MatrixDerivc
 constraints applied to the degrees of freedom More...
 
Data< MatrixDerivm
 mappingJacobian applied to the degrees of freedom More...
 
Data< VecCoordreset_position
 reset position coordinates of the degrees of freedom More...
 
Data< VecDerivreset_velocity
 reset velocity coordinates of the degrees of freedom More...
 
defaulttype::MapMapSparseMatrix< Derivc2
 
Data< SRealrestScale
 optional scaling of rest position coordinates (to simulated pre-existing internal tension).(default = 1.0) More...
 
Data< boold_useTopology
 Shall this object rely on any active topology to initialize its size and positions. More...
 
Data< boolshowObject
 Show objects. (default=false) More...
 
Data< floatshowObjectScale
 Scale for object display. (default=0.1) More...
 
Data< boolshowIndices
 Show indices. (default=false) More...
 
Data< floatshowIndicesScale
 Scale for indices display. (default=0.02) More...
 
Data< boolshowVectors
 Show velocity. (default=false) More...
 
Data< floatshowVectorsScale
 Scale for vectors display. (default=0.0001) More...
 
Data< int > drawMode
 The way vectors will be drawn: - 0: Line - 1:Cylinder - 2: Arrow. The DOFS will be drawn: - 0: point - >1: sphere. (default=0) More...
 
Data< type::RGBAColord_color
 Color for object display. (default=[1 1 1 1]) More...
 
- Public Attributes inherited from sofa::core::objectmodel::BaseObject
Data< boolf_listening
 if true, handle the events, otherwise ignore the events More...
 
- Public Attributes inherited from sofa::core::objectmodel::Base
std::vector< lifecycle::DeprecatedData * > m_oldAttributes
 
Data< int > d_messageLogCount
 
Data< std::string > name
 Name of the object. More...
 
Data< boolf_printLog
 if true, emits extra messages at runtime. More...
 
Data< sofa::core::objectmodel::TagSetf_tags
 list of the subsets the object belongs to More...
 
Data< sofa::type::BoundingBoxf_bbox
 this object bounding box More...
 
Data< sofa::core::objectmodel::ComponentStated_componentState
 The state of the component among (Dirty, Valid, Undefined, Loading, Invalid). More...
 
std::string m_definitionSourceFileName {""}
 
int m_definitionSourceFilePos {-1}
 
std::string m_instanciationSourceFileName {""}
 
int m_instanciationSourceFilePos {-1}
 
- Public Attributes inherited from sofa::core::State< DataTypes >
AccumulationVecId< DataTypes, V_DERIV, V_READ > accumulatedForces
 Stores all the VecDerivId corresponding to a force. They can then be accumulated. More...
 

Protected Attributes

Data< int > d_size
 Size of the vectors. More...
 
SingleLink< MechanicalObject< DataTypes >, core::topology::BaseMeshTopology, BaseLink::FLAG_STRONGLINK|BaseLink::FLAG_STOREPATHl_topology
 
Data< int > f_reserve
 Size to reserve when creating vectors. (default=0) More...
 
bool m_initialized
 
MechanicalObjectInternalData< DataTypesdata
 Given the number of a constraint Equation, find the index in the MatrixDeriv C, where the constraint is actually stored. More...
 
std::ofstream * m_gnuplotFileX
 
std::ofstream * m_gnuplotFileV
 
Initial geometric transformations
Data< type::Vec3translation
 Translation of the DOFs. More...
 
Data< type::Vec3rotation
 Rotation of the DOFs. More...
 
Data< type::Vec3scale
 Scale of the DOFs in 3 dimensions. More...
 
Data< type::Vec3translation2
 Translation of the DOFs, applied after the rest position has been computed. More...
 
Data< type::Vec3rotation2
 Rotation of the DOFs, applied the after the rest position has been computed. More...
 
- Protected Attributes inherited from sofa::core::objectmodel::BaseObject
SingleLink< BaseObject, BaseContext, BaseLink::FLAG_DOUBLELINKl_context
 
LinkSlaves l_slaves
 
SingleLink< BaseObject, BaseObject, BaseLink::FLAG_DOUBLELINKl_master
 
- Protected Attributes inherited from sofa::core::objectmodel::Base
std::map< std::string, sofa::core::DataTrackerCallbackm_internalEngine
 
VecData m_vecData
 List of fields (Data instances) More...
 
MapData m_aliasData
 name -> Data multi-map (includes names and aliases) More...
 
VecLink m_vecLink
 List of links. More...
 
MapLink m_aliasLink
 name -> Link multi-map (includes names and aliases) More...
 

Public Member Functions

 SOFA_CLASS (SOFA_TEMPLATE(MechanicalObject, DataTypes), SOFA_TEMPLATE(sofa::core::behavior::MechanicalState, DataTypes))
 
 SOFA_ATTRIBUTE_REPLACED__TYPEMEMBER (Vector3, sofa::type::Vec3)
 
 SOFA_ATTRIBUTE_REPLACED__TYPEMEMBER (Index, sofa::Index)
 
MechanicalObjectoperator= (const MechanicalObject &)
 
void parse (core::objectmodel::BaseObjectDescription *arg) override
 Parse the given description to assign values to this object's fields and potentially other parameters. More...
 
void init () override
 Initialization method called at graph creation and modification, during top-down traversal. More...
 
void reinit () override
 Update method called when variables used in precomputation are modified. More...
 
void storeResetState () override
 Save the initial state for later uses in reset() More...
 
void reset () override
 Reset to initial state. More...
 
void writeVec (core::ConstVecId v, std::ostream &out) override
 
void readVec (core::VecId v, std::istream &in) override
 
SReal compareVec (core::ConstVecId v, std::istream &in) override
 
void writeState (std::ostream &out) override
 Write current state to the given output stream. More...
 
void initGnuplot (const std::string path) override
 
void exportGnuplot (SReal time) override
 
void resize (Size vsize) override
 Resize all stored vector. More...
 
virtual void reserve (Size vsize)
 
Size getSize () const override
 Current size of all stored vectors. More...
 
SReal getPX (sofa::Index i) const override
 
SReal getPY (sofa::Index i) const override
 
SReal getPZ (sofa::Index i) const override
 
SReal getVX (sofa::Index i) const
 
SReal getVY (sofa::Index i) const
 
SReal getVZ (sofa::Index i) const
 
void replaceValue (const sofa::Index inputIndex, const sofa::Index outputIndex)
 Overwrite values at index outputIndex by the ones at inputIndex. More...
 
void swapValues (const sofa::Index idx1, const sofa::Index idx2)
 Exchange values at indices idx1 and idx2. More...
 
void renumberValues (const sofa::type::vector< sofa::Index > &index)
 Reorder values according to parameter. More...
 
void computeWeightedValue (const sofa::Index i, const sofa::type::vector< sofa::Index > &ancestors, const sofa::type::vector< double > &coefs)
 Replace the value at index by the sum of the ancestors values weithed by the coefs. More...
 
void forcePointPosition (const sofa::Index i, const sofa::type::vector< double > &m_x)
 Force the position of a point (and force its velocity to zero value) More...
 
void getIndicesInSpace (sofa::type::vector< sofa::Index > &indices, Real xmin, Real xmax, Real ymin, Real ymax, Real zmin, Real zmax) const override
 Get the indices of the particles located in the given bounding box. More...
 
bool addBBox (SReal *minBBox, SReal *maxBBox) override
 update the given bounding box, to include this More...
 
void computeBBox (const core::ExecParams *params, bool onlyVisible=false) override
 Bounding Box computation method. More...
 
virtual std::list< ConstraintBlockconstraintBlocks (const std::list< unsigned int > &indices) const override
 Express the matrix L in term of block of matrices, using the indices of the lines in the MatrixDeriv container. More...
 
SReal getConstraintJacobianTimesVecDeriv (unsigned int line, core::ConstVecId id) override
 Compute the error given a state vector and a line of the Jacobian (line in vector C) More...
 
void handleStateChange () override
 
bool pickParticles (const core::ExecParams *params, double rayOx, double rayOy, double rayOz, double rayDx, double rayDy, double rayDz, double radius0, double dRadius, std::multimap< double, std::pair< sofa::core::behavior::BaseMechanicalState *, int > > &particles) override
 
bool isIndependent () const
 if this mechanical object stores independent dofs (in opposition to mapped dofs) More...
 
void applyRotation (const type::Quat< SReal > q)
 Rotate the current state. More...
 
void addFromBaseVectorDifferentSize (core::VecId dest, const linearalgebra::BaseVector *src, unsigned int &offset)
 Perform dest[ offset + i ][j] += src[i][j] 0<= i < src_entries 0<= j < 3 (for 3D objects) 0 <= j < 2 (for 2D objects) More...
 
void addFromBaseVectorSameSize (core::VecId dest, const linearalgebra::BaseVector *src, unsigned int &offset)
 Perform dest[i][j] += src[offset + i][j] 0<= i < src_entries 0<= j < 3 (for 3D objects) 0 <= j < 2 (for 2D objects) More...
 
void draw (const core::visual::VisualParams *vparams)
 Render internal data of this object, for debugging purposes. More...
 
SOFA_COMPONENT_STATECONTAINER_API void applyRotation (const type::Quat< SReal > q)
 Rotate the current state. More...
 
SOFA_COMPONENT_STATECONTAINER_API void addFromBaseVectorSameSize (core::VecId dest, const linearalgebra::BaseVector *src, unsigned int &offset)
 Perform dest[i][j] += src[offset + i][j] 0<= i < src_entries 0<= j < 3 (for 3D objects) 0 <= j < 2 (for 2D objects) More...
 
SOFA_COMPONENT_STATECONTAINER_API void addFromBaseVectorDifferentSize (core::VecId dest, const linearalgebra::BaseVector *src, unsigned int &offset)
 Perform dest[ offset + i ][j] += src[i][j] 0<= i < src_entries 0<= j < 3 (for 3D objects) 0 <= j < 2 (for 2D objects) More...
 
SOFA_COMPONENT_STATECONTAINER_API void draw (const core::visual::VisualParams *vparams)
 Render internal data of this object, for debugging purposes. More...
 
New vectors access API based on VecId
Data< VecCoord > * write (core::VecCoordId v) override
 
const Data< VecCoord > * read (core::ConstVecCoordId v) const override
 
Data< VecDeriv > * write (core::VecDerivId v) override
 
const Data< VecDeriv > * read (core::ConstVecDerivId v) const override
 
Data< MatrixDeriv > * write (core::MatrixDerivId v) override
 
const Data< MatrixDeriv > * read (core::ConstMatrixDerivId v) const override
 
Initial transformations application methods.
void applyTranslation (const SReal dx, const SReal dy, const SReal dz) override
 Apply translation vector to the position. More...
 
void applyRotation (const SReal rx, const SReal ry, const SReal rz) override
 Rotation using Euler Angles in degree. More...
 
void applyRotation (const type::Quat< SReal > q) override
 Rotate the current state. More...
 
void applyScale (const SReal sx, const SReal sy, const SReal sz) override
 Scale the current state. More...
 
Base Matrices and Vectors Interface
void copyToBaseVector (linearalgebra::BaseVector *dest, core::ConstVecId src, unsigned int &offset) override
 
void copyFromBaseVector (core::VecId dest, const linearalgebra::BaseVector *src, unsigned int &offset) override
 
void copyToBaseMatrix (linearalgebra::BaseMatrix *dest, core::ConstMatrixDerivId src, unsigned int &offset) override
 Copy data to a global BaseMatrix from the state stored in a local vector. More...
 
void addToBaseVector (linearalgebra::BaseVector *dest, core::ConstVecId src, unsigned int &offset) override
 
void addFromBaseVectorSameSize (core::VecId dest, const linearalgebra::BaseVector *src, unsigned int &offset) override
 
void addFromBaseVectorDifferentSize (core::VecId dest, const linearalgebra::BaseVector *src, unsigned int &offset) override
 
Initial transformations accessors.
void setTranslation (SReal dx, SReal dy, SReal dz)
 
void setRotation (SReal rx, SReal ry, SReal rz)
 
void setScale (SReal sx, SReal sy, SReal sz)
 
virtual type::Vec3 getTranslation () const
 
virtual type::Vec3 getRotation () const
 
type::Vec3 getScale () const override
 
Integration related methods
void beginIntegration (SReal dt) override
 Called at the beginning of each integration step. More...
 
void endIntegration (const core::ExecParams *params, SReal dt) override
 Called at the end of each integration step. More...
 
void accumulateForce (const core::ExecParams *params, core::VecDerivId f=core::vec_id::write_access::force) override
 Add stored external forces to F. More...
 
void vAvail (const core::ExecParams *params, core::VecCoordId &v) override
 Increment the index of the given VecCoordId, so that all 'allocated' vectors in this state have a lower index. More...
 
void vAvail (const core::ExecParams *params, core::VecDerivId &v) override
 Increment the index of the given VecDerivId, so that all 'allocated' vectors in this state have a lower index. More...
 
void vAlloc (const core::ExecParams *params, core::VecCoordId v, const core::VecIdProperties &properties={}) override
 Increment the index of the given MatrixDerivId, so that all 'allocated' vectors in this state have a lower index. More...
 
void vAlloc (const core::ExecParams *params, core::VecDerivId v, const core::VecIdProperties &properties={}) override
 Allocate a new temporary vector. More...
 
void vRealloc (const core::ExecParams *params, core::VecCoordId v, const core::VecIdProperties &properties={}) override
 Allocate a new temporary vector. More...
 
void vRealloc (const core::ExecParams *params, core::VecDerivId v, const core::VecIdProperties &properties={}) override
 Reallocate a new temporary vector. More...
 
void vFree (const core::ExecParams *params, core::VecCoordId v) override
 Free a temporary vector. More...
 
void vFree (const core::ExecParams *params, core::VecDerivId v) override
 Free a temporary vector. More...
 
void vInit (const core::ExecParams *params, core::VecCoordId v, core::ConstVecCoordId vSrc) override
 Free a temporary vector. More...
 
void vInit (const core::ExecParams *params, core::VecDerivId v, core::ConstVecDerivId vSrc) override
 Initialize an unset vector. More...
 
void vOp (const core::ExecParams *params, core::VecId v, core::ConstVecId a=core::ConstVecId::null(), core::ConstVecId b=core::ConstVecId::null(), SReal f=1.0) override
 Initialize an unset vector. More...
 
void vMultiOp (const core::ExecParams *params, const VMultiOp &ops) override
 Perform a sequence of linear vector accumulation operation $r_i = sum_j (v_j*f_{ij})$. More...
 
void vThreshold (core::VecId a, SReal threshold) override
 Apply a threshold (lower bound) to all entries. More...
 
SReal vDot (const core::ExecParams *params, core::ConstVecId a, core::ConstVecId b) override
 Compute the scalar products between two vectors. More...
 
SReal vSum (const core::ExecParams *params, core::ConstVecId a, unsigned l) override
 Sum of the entries of state vector a at the power of l>0. This is used to compute the l-norm of the vector. More...
 
SReal vMax (const core::ExecParams *params, core::ConstVecId a) override
 Maximum of the absolute values of the entries of state vector a. This is used to compute the infinite-norm of the vector. More...
 
Size vSize (const core::ExecParams *params, core::ConstVecId v) override
 Get vector size. More...
 
void resetForce (const core::ExecParams *params, core::VecDerivId f=core::vec_id::write_access::force) override
 Set F = 0. More...
 
void resetAcc (const core::ExecParams *params, core::VecDerivId a=core::vec_id::write_access::dx) override
 Set Acc =0. More...
 
void resetConstraint (const core::ConstraintParams *cparams) override
 Reset the constraint matrix. More...
 
void getConstraintJacobian (const core::ConstraintParams *cparams, sofa::linearalgebra::BaseMatrix *J, unsigned int &off) override
 build the jacobian of the constraint in a baseMatrix More...
 
void buildIdentityBlocksInJacobian (const sofa::type::vector< unsigned int > &list_n, core::MatrixDerivId &mID) override
 fill the jacobian matrix (of the constraints) with identity blocks on the provided list of nodes(dofs) More...
 
Debug
void printDOF (core::ConstVecId, std::ostream &=std::cerr, int firstIndex=0, int range=-1) const override
 
unsigned printDOFWithElapsedTime (core::ConstVecId, unsigned=0, unsigned=0, std::ostream &=std::cerr) override
 
void draw (const core::visual::VisualParams *vparams) override
 Render internal data of this object, for debugging purposes. More...
 
- Public Member Functions inherited from sofa::core::behavior::MechanicalState< DataTypes >
 SOFA_CLASS2 (SOFA_TEMPLATE(MechanicalState, DataTypes), BaseMechanicalState, SOFA_TEMPLATE(State, DataTypes))
 
Size getCoordDimension () const override
 
Size getDerivDimension () const override
 
void copyToBuffer (SReal *dst, ConstVecId src, unsigned n) const override
 
void copyFromBuffer (VecId dst, const SReal *src, unsigned n) override
 
void addFromBuffer (VecId dst, const SReal *src, unsigned n) override
 
- Public Member Functions inherited from sofa::core::behavior::BaseMechanicalState
 SOFA_ABSTRACT_CLASS (BaseMechanicalState, BaseState)
 
 SOFA_BASE_CAST_IMPLEMENTATION (BaseMechanicalState)
 
bool insertInNode (objectmodel::BaseNode *node) override
 
bool removeInNode (objectmodel::BaseNode *node) override
 
virtual void handleStateChange (core::topology::Topology *t)
 Handle state Changes from a given Topology. More...
 
virtual Size getMatrixBlockSize () const
 Get the number of scalars per Deriv value, as necessary to build mechanical matrices and vectors. More...
 
virtual Size getMatrixSize () const
 Get the number of rows necessary to build mechanical matrices and vectors. More...
 
virtual void copyToBuffer (SReal *dst, ConstVecId src, unsigned int n) const =0
 Copy data to an external, user-allocated buffer. More...
 
virtual void copyFromBuffer (VecId dst, const SReal *src, unsigned int n)=0
 Copy data from an external, user-allocated buffer. More...
 
virtual void addFromBuffer (VecId dst, const SReal *src, unsigned int n)=0
 Add data from an external, user-allocated buffer. More...
 
- Public Member Functions inherited from sofa::core::BaseState
 SOFA_ABSTRACT_CLASS (BaseState, objectmodel::BaseObject)
 
- Public Member Functions inherited from sofa::core::objectmodel::BaseObject
 SOFA_CLASS (BaseObject, Base)
 
void setSrc (const std::string &v, std::vector< std::string > *attributeList=nullptr)
 Sets a source Object and parses it to collect dependent Data. More...
 
void setSrc (const std::string &v, const BaseObject *loader, std::vector< std::string > *attributeList=nullptr)
 
BasefindLinkDestClass (const BaseClass *destType, const std::string &path, const BaseLink *link) override
 
virtual std::string getPathName () const override
 Return the full path name of this object. More...
 
SReal getTime () const
 Current time. More...
 
const BaseContextgetContext () const
 
BaseContextgetContext ()
 
const BaseObjectgetMaster () const
 
BaseObjectgetMaster ()
 
const VecSlavesgetSlaves () const
 
BaseObjectgetSlave (const std::string &name) const
 
virtual void addSlave (BaseObject::SPtr s)
 
virtual void removeSlave (BaseObject::SPtr s)
 
virtual void handleEvent (Event *)
 Handle an event. More...
 
virtual void handleTopologyChange ()
 
virtual void handleTopologyChange (core::topology::Topology *t)
 
void parse (BaseObjectDescription *arg) override
 Parse the given description to assign values to this object's fields and potentially other parameters. More...
 
virtual void bwdInit ()
 Initialization method called at graph creation and modification, during bottom-up traversal. More...
 
void updateInternal ()
 Update method called when variables (used to compute other internal variables) are modified. More...
 
virtual void cleanup ()
 
- Public Member Functions inherited from sofa::core::objectmodel::Base
virtual const BaseClassgetClass () const
 
void addDeprecatedAttribute (lifecycle::DeprecatedData *attribute)
 
void addUpdateCallback (const std::string &name, std::initializer_list< BaseData * > inputs, std::function< sofa::core::objectmodel::ComponentState(const DataTracker &)> function, std::initializer_list< BaseData * > outputs)
 
void addOutputsToCallback (const std::string &name, std::initializer_list< BaseData * > outputs)
 
const std::string & getName () const
 Accessor to the object name. More...
 
void setName (const std::string &n)
 Set the name of this object. More...
 
void setName (const std::string &n, int counter)
 Set the name of this object, adding an integer counter. More...
 
std::string getTypeName () const
 Get the type name of this object (i.e. class and template types) More...
 
virtual std::string getClassName () const
 Get the class name of this object. More...
 
virtual std::string getTemplateName () const final
 Get the template type names (if any) used to instantiate this object. More...
 
std::string getNameSpaceName () const
 Get the template type names (if any) used to instantiate this object. More...
 
void setDefinitionSourceFileName (const std::string &sourceFileName)
 Set the source filename (where the component is implemented) More...
 
const std::string & getDefinitionSourceFileName () const
 Get the source filename (where the component is implemented) More...
 
void setDefinitionSourceFilePos (const int)
 Set the source location (where the component is implemented) More...
 
int getDefinitionSourceFilePos () const
 Get the source location (where the component is implemented) More...
 
void setInstanciationSourceFileName (const std::string &sourceFileName)
 
const std::string & getInstanciationSourceFileName () const
 
void setInstanciationSourceFilePos (const int)
 
int getInstanciationSourceFilePos () const
 
void addMessage (const sofa::helper::logging::Message &m) const
 
size_t countLoggedMessages (sofa::helper::logging::Message::TypeSet t=sofa::helper::logging::Message::AnyTypes) const
 
const std::deque< sofa::helper::logging::Message > & getLoggedMessages () const
 
const std::string getLoggedMessagesAsString (sofa::helper::logging::Message::TypeSet t=sofa::helper::logging::Message::AnyTypes) const
 
void clearLoggedMessages () const
 
bool notMuted () const
 
const sofa::core::objectmodel::TagSetgetTags () const
 Represents the subsets the object belongs to. More...
 
bool hasTag (Tag t) const
 Return true if the object belong to the given subset. More...
 
void addTag (Tag t)
 Add a subset qualification to the object. More...
 
void removeTag (Tag t)
 Remove a subset qualification to the object. More...
 
ComponentState getComponentState () const
 
bool isComponentStateValid () const
 
virtual bool parseField (const std::string &attribute, const std::string &value)
 Assign one field value (Data or Link) More...
 
virtual bool hasField (const std::string &attribute) const
 Check if a given Data field or Link exists. More...
 
void parseFields (const std::list< std::string > &str)
 Assign the field values stored in the given list of name + value pairs of strings. More...
 
virtual void parseFields (const std::map< std::string, std::string * > &str)
 Assign the field values stored in the given map of name -> value pairs. More...
 
void writeDatas (std::map< std::string, std::string * > &str)
 Write the current field values to the given map of name -> value pairs. More...
 
void writeDatas (std::ostream &out, const std::string &separator=" ")
 
BaseDatafindData (const std::string &name) const
 
std::vector< BaseData * > findGlobalField (const std::string &name) const
 Find data fields given a name: several can be found as we look into the alias map. More...
 
BaseLinkfindLink (const std::string &name) const
 
std::vector< BaseLink * > findLinks (const std::string &name) const
 Find link fields given a name: several can be found as we look into the alias map. More...
 
virtual void updateLinks (bool logErrors=true)
 Update pointers in case the pointed-to objects have appeared. More...
 
template<class T >
BaseData::BaseInitData initData (::sofa::core::objectmodel::Data< T > *field, const char *name, const char *help, ::sofa::core::objectmodel::BaseData::DataFlags dataflags)
 Helper method used to initialize a data field containing a value of type T. More...
 
template<class T >
BaseData::BaseInitData initData (Data< T > *field, const char *name, const char *help, bool isDisplayed=true, bool isReadOnly=false)
 Helper method used to initialize a data field containing a value of type T. More...
 
template<class T >
Data< T >::InitData initData (Data< T > *field, const T &value, const char *name, const char *help, bool isDisplayed=true, bool isReadOnly=false)
 Helper method used to initialize a data field containing a value of type T. More...
 
void addData (BaseData *f, const std::string &name)
 
void addData (BaseData *f)
 
void removeData (BaseData *f)
 Remove a data field. More...
 
void addAlias (BaseData *field, const char *alias)
 Add an alias to a Data. More...
 
void addLink (BaseLink *l)
 Add a link. More...
 
void addAlias (BaseLink *link, const char *alias)
 Add an alias to a Link. More...
 
const VecDatagetDataFields () const
 Accessor to the vector containing all the fields of this object. More...
 
const MapDatagetDataAliases () const
 Accessor to the map containing all the aliases of this object. More...
 
const VecLinkgetLinks () const
 Accessor to the vector containing all the fields of this object. More...
 
const MapLinkgetLinkAliases () const
 Accessor to the map containing all the aliases of this object. More...
 
virtual bool findDataLinkDest (BaseData *&ptr, const std::string &path, const BaseLink *link)
 
template<class T >
bool findLinkDest (T *&ptr, const std::string &path, const BaseLink *link)
 
- Public Member Functions inherited from sofa::core::State< DataTypes >
 SOFA_CLASS (SOFA_TEMPLATE(State, DataTypes), BaseState)
 
sofa::type::TBoundingBox< RealcomputeBBox () const
 Compute the bounding box independently from the visibility parameters. More...
 
void computeBBox (const core::ExecParams *params, bool onlyVisible=false) override
 
objectmodel::BaseDatabaseWrite (VecId v) override
 
const objectmodel::BaseDatabaseRead (ConstVecId v) const override
 
ReadVecCoord readPositions () const
 
WriteVecCoord writePositions ()
 
WriteOnlyVecCoord writeOnlyPositions ()
 
ReadVecCoord readRestPositions () const
 
WriteVecCoord writeRestPositions ()
 
WriteOnlyVecCoord writeOnlyRestPositions ()
 
ReadVecDeriv readVelocities () const
 
WriteVecDeriv writeVelocities ()
 
WriteOnlyVecDeriv writeOnlyVelocities ()
 
ReadVecDeriv readForces () const
 
WriteVecDeriv writeForces ()
 
WriteOnlyVecDeriv writeOnlyForces ()
 
ReadVecDeriv readDx () const
 
WriteVecDeriv writeDx ()
 
WriteOnlyVecDeriv writeOnlyDx ()
 
ReadVecDeriv readNormals () const
 
const AccumulationVecId< DataTypes, V_DERIV, V_READ > & readTotalForces () const
 Returns a proxy objects offering simplified access to elements of the cumulative sum of all force containers. More...
 
void addToTotalForces (core::ConstVecDerivId forceId) override
 The provided VecDerivId will contribute to the sum of all force containers. More...
 
void removeFromTotalForces (core::ConstVecDerivId forceId) override
 

Protected Member Functions

 MechanicalObject ()
 
virtual ~MechanicalObject ()
 
template<core::VecType vtype>
void vAvailImpl (core::TVecId< vtype, core::V_WRITE > &v, sofa::type::vector< Data< core::StateVecType_t< DataTypes, vtype > > * > &dataContainer)
 Generic implementation of the method vAvail. More...
 
template<core::VecType vtype>
void vAllocImpl (core::TVecId< vtype, core::V_WRITE > v, const core::VecIdProperties &properties)
 Generic implementation of the method vAlloc. More...
 
template<core::VecType vtype>
void vReallocImpl (core::TVecId< vtype, core::V_WRITE > v, const core::VecIdProperties &properties)
 Generic implementation of the method vRealloc. More...
 
template<core::VecType vtype>
void vFreeImpl (core::TVecId< vtype, core::V_WRITE > v)
 Generic implementation of the method vFree. More...
 
template<core::VecType vtype>
void vInitImpl (const core::ExecParams *params, core::TVecId< vtype, core::V_WRITE > vId, core::TVecId< vtype, core::V_READ > vSrcId)
 Generic implementation of the method vInit. More...
 
template<core::VecType vtype>
helper::WriteOnlyAccessor< core::objectmodel::Data< core::StateVecType_t< DataTypes, vtype > > > getWriteOnlyAccessor (core::VecId v)
 Shortcut to get a write-only accessor corresponding to the provided VecType from a VecId. More...
 
template<core::VecType vtype>
helper::WriteAccessor< core::objectmodel::Data< core::StateVecType_t< DataTypes, vtype > > > getWriteAccessor (core::VecId v)
 Shortcut to get a write accessor corresponding to the provided VecType from a VecId. More...
 
template<core::VecType vtype>
helper::ReadAccessor< core::objectmodel::Data< core::StateVecType_t< DataTypes, vtype > > > getReadAccessor (core::ConstVecId v)
 Shortcut to get a read accessor corresponding to the provided VecType from a VecId. More...
 
void drawIndices (const core::visual::VisualParams *vparams)
 Internal function : Draw indices in 3d coordinates. More...
 
void drawVectors (const core::visual::VisualParams *vparams)
 Internal function : Draw vectors. More...
 
- Protected Member Functions inherited from sofa::core::behavior::MechanicalState< DataTypes >
 ~MechanicalState () override
 
- Protected Member Functions inherited from sofa::core::behavior::BaseMechanicalState
 BaseMechanicalState ()
 
 ~BaseMechanicalState () override
 
- Protected Member Functions inherited from sofa::core::BaseState
 BaseState ()
 
 ~BaseState () override
 
- Protected Member Functions inherited from sofa::core::objectmodel::BaseObject
 BaseObject ()
 
 ~BaseObject () override
 
virtual void doUpdateInternal ()
 Implementation of the internal update. More...
 
void changeContextLink (BaseContext *before, BaseContext *&after)
 
void changeSlavesLink (BaseObject::SPtr ptr, std::size_t, bool add)
 This method insures that slaves objects have master and context links set correctly. More...
 
void trackInternalData (const BaseData &data)
 Method called to add the Data to the DataTracker (listing the Data to track) More...
 
void cleanTracker ()
 
bool hasDataChanged (const BaseData &data)
 Method called to know if a tracked Data has changed. More...
 
- Protected Member Functions inherited from sofa::core::objectmodel::Base
 Base ()
 
virtual ~Base ()
 
void initData0 (BaseData *field, BaseData::BaseInitData &res, const char *name, const char *help, bool isDisplayed=true, bool isReadOnly=false)
 Helper method used by initData() More...
 
void initData0 (BaseData *field, BaseData::BaseInitData &res, const char *name, const char *help, BaseData::DataFlags dataFlags)
 Helper method used by initData() More...
 
template<class T >
void initData0 (Data< T > *field, typename Data< T >::InitData &res, const T &value, const char *name, const char *help, bool isDisplayed=true, bool isReadOnly=false)
 Helper method used by initData() More...
 
- Protected Member Functions inherited from sofa::core::State< DataTypes >
 State ()
 
 ~State () override
 

Static Protected Member Functions

template<core::VecType vtype, core::VecAccess vaccess>
static void setVecIdProperties (core::TVecId< vtype, vaccess > v, const core::VecIdProperties &properties, core::BaseData *vec_d)
 

Friends

class MechanicalObjectInternalData< DataTypes >
 

Integration-related data

sofa::type::vector< Data< VecCoord > * > vectorsCoord
 Coordinates DOFs vectors table (static and dynamic allocated) More...
 
sofa::type::vector< Data< VecDeriv > * > vectorsDeriv
 Derivates DOFs vectors table (static and dynamic allocated) More...
 
sofa::type::vector< Data< MatrixDeriv > * > vectorsMatrixDeriv
 Constraint vectors table. More...
 
void setVecCoord (core::ConstVecCoordId, Data< VecCoord > *)
 Inserts VecCoord DOF coordinates vector at index in the vectorsCoord container. More...
 
void setVecDeriv (core::ConstVecDerivId, Data< VecDeriv > *)
 Inserts VecDeriv DOF derivates vector at index in the vectorsDeriv container. More...
 
void setVecMatrixDeriv (core::ConstMatrixDerivId, Data< MatrixDeriv > *)
 Inserts MatrixDeriv DOF at index in the MatrixDeriv container. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from sofa::core::behavior::MechanicalState< DataTypes >
static std::string shortName (const T *ptr=nullptr, objectmodel::BaseObjectDescription *arg=nullptr)
 
- Static Public Member Functions inherited from sofa::core::objectmodel::BaseObject
template<class T >
static bool canCreate (T *, BaseContext *, BaseObjectDescription *)
 Pre-construction check method called by ObjectFactory. More...
 
template<class T >
static T::SPtr create (T *, BaseContext *context, BaseObjectDescription *arg)
 Construction method called by ObjectFactory. More...
 
- Static Public Member Functions inherited from sofa::core::objectmodel::Base
static const BaseClassGetClass ()
 
template<class T >
static std::string shortName (const T *ptr=nullptr, BaseObjectDescription *=nullptr)
 

Attribute details

◆ c

constraints applied to the degrees of freedom

◆ c2

◆ d_color

Color for object display. (default=[1 1 1 1])

◆ d_size

template<class DataTypes >
Data< int > sofa::component::statecontainer::MechanicalObject< DataTypes >::d_size
protected

Size of the vectors.

◆ d_useTopology

template<class DataTypes >
Data< bool > sofa::component::statecontainer::MechanicalObject< DataTypes >::d_useTopology

Shall this object rely on any active topology to initialize its size and positions.

◆ data

Given the number of a constraint Equation, find the index in the MatrixDeriv C, where the constraint is actually stored.

◆ drawMode

template<class DataTypes >
Data< int > sofa::component::statecontainer::MechanicalObject< DataTypes >::drawMode

The way vectors will be drawn: - 0: Line - 1:Cylinder - 2: Arrow. The DOFS will be drawn: - 0: point - >1: sphere. (default=0)

◆ dx

dx vector of the degrees of freedom

◆ externalForces

template<class DataTypes >
Data< VecDeriv > sofa::component::statecontainer::MechanicalObject< DataTypes >::externalForces

externalForces vector of the degrees of freedom

◆ f

force vector of the degrees of freedom

◆ f_reserve

template<class DataTypes >
Data< int > sofa::component::statecontainer::MechanicalObject< DataTypes >::f_reserve
protected

Size to reserve when creating vectors. (default=0)

◆ l_topology

◆ m

mappingJacobian applied to the degrees of freedom

◆ m_gnuplotFileV

template<class DataTypes >
std::ofstream* sofa::component::statecontainer::MechanicalObject< DataTypes >::m_gnuplotFileV
protected

◆ m_gnuplotFileX

template<class DataTypes >
std::ofstream* sofa::component::statecontainer::MechanicalObject< DataTypes >::m_gnuplotFileX
protected

◆ m_initialized

template<class DataTypes >
bool sofa::component::statecontainer::MechanicalObject< DataTypes >::m_initialized
protected

◆ reset_position

template<class DataTypes >
Data< VecCoord > sofa::component::statecontainer::MechanicalObject< DataTypes >::reset_position

reset position coordinates of the degrees of freedom

◆ reset_velocity

template<class DataTypes >
Data< VecDeriv > sofa::component::statecontainer::MechanicalObject< DataTypes >::reset_velocity

reset velocity coordinates of the degrees of freedom

◆ restScale

template<class DataTypes >
Data< SReal > sofa::component::statecontainer::MechanicalObject< DataTypes >::restScale

optional scaling of rest position coordinates (to simulated pre-existing internal tension).(default = 1.0)

◆ rotation

template<class DataTypes >
Data< type::Vec3 > sofa::component::statecontainer::MechanicalObject< DataTypes >::rotation
protected

Rotation of the DOFs.

◆ rotation2

template<class DataTypes >
Data< type::Vec3 > sofa::component::statecontainer::MechanicalObject< DataTypes >::rotation2
protected

Rotation of the DOFs, applied the after the rest position has been computed.

◆ scale

template<class DataTypes >
Data< type::Vec3 > sofa::component::statecontainer::MechanicalObject< DataTypes >::scale
protected

Scale of the DOFs in 3 dimensions.

◆ showIndices

template<class DataTypes >
Data< bool > sofa::component::statecontainer::MechanicalObject< DataTypes >::showIndices

Show indices. (default=false)

◆ showIndicesScale

template<class DataTypes >
Data< float > sofa::component::statecontainer::MechanicalObject< DataTypes >::showIndicesScale

Scale for indices display. (default=0.02)

◆ showObject

template<class DataTypes >
Data< bool > sofa::component::statecontainer::MechanicalObject< DataTypes >::showObject

Show objects. (default=false)

◆ showObjectScale

template<class DataTypes >
Data< float > sofa::component::statecontainer::MechanicalObject< DataTypes >::showObjectScale

Scale for object display. (default=0.1)

◆ showVectors

template<class DataTypes >
Data< bool > sofa::component::statecontainer::MechanicalObject< DataTypes >::showVectors

Show velocity. (default=false)

◆ showVectorsScale

template<class DataTypes >
Data< float > sofa::component::statecontainer::MechanicalObject< DataTypes >::showVectorsScale

Scale for vectors display. (default=0.0001)

◆ translation

template<class DataTypes >
Data< type::Vec3 > sofa::component::statecontainer::MechanicalObject< DataTypes >::translation
protected

Translation of the DOFs.

◆ translation2

template<class DataTypes >
Data< type::Vec3 > sofa::component::statecontainer::MechanicalObject< DataTypes >::translation2
protected

Translation of the DOFs, applied after the rest position has been computed.

◆ v

velocity coordinates of the degrees of freedom

◆ vectorsCoord

template<class DataTypes >
sofa::type::vector< Data< VecCoord > * > sofa::component::statecontainer::MechanicalObject< DataTypes >::vectorsCoord
protected

Coordinates DOFs vectors table (static and dynamic allocated)

◆ vectorsDeriv

template<class DataTypes >
sofa::type::vector< Data< VecDeriv > * > sofa::component::statecontainer::MechanicalObject< DataTypes >::vectorsDeriv
protected

Derivates DOFs vectors table (static and dynamic allocated)

◆ vectorsMatrixDeriv

template<class DataTypes >
sofa::type::vector< Data< MatrixDeriv > * > sofa::component::statecontainer::MechanicalObject< DataTypes >::vectorsMatrixDeriv
protected

Constraint vectors table.

◆ vfree

free velocity coordinates of the degrees of freedom

◆ x

position coordinates of the degrees of freedom

◆ x0

rest position coordinates of the degrees of freedom

◆ xfree

free position coordinates of the degrees of freedom

Constructor details

◆ MechanicalObject()

◆ ~MechanicalObject()

template<class DataTypes >
sofa::component::statecontainer::MechanicalObject< DataTypes >::~MechanicalObject
protectedvirtual

Function details

◆ accumulateForce()

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::accumulateForce ( const core::ExecParams params,
core::VecDerivId  f = core::vec_id::write_access::force 
)
overridevirtual

Add stored external forces to F.

Reimplemented from sofa::core::behavior::BaseMechanicalState.

◆ addBBox()

template<class DataTypes >
bool sofa::component::statecontainer::MechanicalObject< DataTypes >::addBBox ( SReal minBBox,
SReal maxBBox 
)
overridevirtual

update the given bounding box, to include this

Reimplemented from sofa::core::behavior::BaseMechanicalState.

◆ addFromBaseVectorDifferentSize() [1/3]

void sofa::component::statecontainer::MechanicalObject< defaulttype::Rigid3Types >::addFromBaseVectorDifferentSize ( core::VecId  dest,
const linearalgebra::BaseVector src,
unsigned int &  offset 
)
virtual

Perform dest[ offset + i ][j] += src[i][j] 0<= i < src_entries 0<= j < 3 (for 3D objects) 0 <= j < 2 (for 2D objects)

Parameters
offsetthe offset in the MechanicalObject local vector specified by VecId dest. It will be updated to the first scalar value after the ones used by this operation when this method returns.

Implements sofa::core::behavior::BaseMechanicalState.

◆ addFromBaseVectorDifferentSize() [2/3]

SOFA_COMPONENT_STATECONTAINER_API void sofa::component::statecontainer::MechanicalObject< defaulttype::Rigid3Types >::addFromBaseVectorDifferentSize ( core::VecId  dest,
const linearalgebra::BaseVector src,
unsigned int &  offset 
)
virtual

Perform dest[ offset + i ][j] += src[i][j] 0<= i < src_entries 0<= j < 3 (for 3D objects) 0 <= j < 2 (for 2D objects)

Parameters
offsetthe offset in the MechanicalObject local vector specified by VecId dest. It will be updated to the first scalar value after the ones used by this operation when this method returns.

Implements sofa::core::behavior::BaseMechanicalState.

◆ addFromBaseVectorDifferentSize() [3/3]

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::addFromBaseVectorDifferentSize ( core::VecId  dest,
const linearalgebra::BaseVector src,
unsigned int &  offset 
)
overridevirtual

src size can be smaller or equal to dest size. Performs: dest[ offset + i ][j] += src[i][j] 0<= i < src_entries 0<= j < 3 (for 3D objects) 0 <= j < 2 (for 2D objects)

Parameters
offsetthe offset in the MechanicalObject local vector specified by VecId dest. It will be updated to the first scalar value after the ones used by this operation when this method returns.

Implements sofa::core::behavior::BaseMechanicalState.

◆ addFromBaseVectorSameSize() [1/3]

void sofa::component::statecontainer::MechanicalObject< defaulttype::Rigid3Types >::addFromBaseVectorSameSize ( core::VecId  dest,
const linearalgebra::BaseVector src,
unsigned int &  offset 
)
virtual

Perform dest[i][j] += src[offset + i][j] 0<= i < src_entries 0<= j < 3 (for 3D objects) 0 <= j < 2 (for 2D objects)

Parameters
offsetthe offset in the BaseVector where the scalar values will be used. It will be updated to the first scalar value after the ones used by this operation when this method returns

Implements sofa::core::behavior::BaseMechanicalState.

◆ addFromBaseVectorSameSize() [2/3]

SOFA_COMPONENT_STATECONTAINER_API void sofa::component::statecontainer::MechanicalObject< defaulttype::Rigid3Types >::addFromBaseVectorSameSize ( core::VecId  dest,
const linearalgebra::BaseVector src,
unsigned int &  offset 
)
virtual

Perform dest[i][j] += src[offset + i][j] 0<= i < src_entries 0<= j < 3 (for 3D objects) 0 <= j < 2 (for 2D objects)

Parameters
offsetthe offset in the BaseVector where the scalar values will be used. It will be updated to the first scalar value after the ones used by this operation when this method returns

Implements sofa::core::behavior::BaseMechanicalState.

◆ addFromBaseVectorSameSize() [3/3]

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::addFromBaseVectorSameSize ( core::VecId  dest,
const linearalgebra::BaseVector src,
unsigned int &  offset 
)
overridevirtual

src and dest must have the same size. Performs: dest[i][j] += src[offset + i][j] 0<= i < src_entries 0<= j < 3 (for 3D objects) 0 <= j < 2 (for 2D objects)

Parameters
offsetthe offset in the BaseVector where the scalar values will be used. It will be updated to the first scalar value after the ones used by this operation when this method returns

Implements sofa::core::behavior::BaseMechanicalState.

◆ addToBaseVector()

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::addToBaseVector ( linearalgebra::BaseVector dest,
core::ConstVecId  src,
unsigned int &  offset 
)
overridevirtual

Add data to a global BaseVector from the state stored in a local vector

Parameters
offsetthe offset in the BaseVector where the scalar values will be used. It will be updated to the first scalar value after the ones used by this operation when this method returns

Implements sofa::core::behavior::BaseMechanicalState.

◆ applyRotation() [1/4]

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::applyRotation ( const SReal  rx,
const SReal  ry,
const SReal  rz 
)
overridevirtual

Rotation using Euler Angles in degree.

Reimplemented from sofa::core::behavior::BaseMechanicalState.

◆ applyRotation() [2/4]

Rotate the current state.

Implements sofa::core::behavior::BaseMechanicalState.

◆ applyRotation() [3/4]

SOFA_COMPONENT_STATECONTAINER_API void sofa::component::statecontainer::MechanicalObject< defaulttype::Rigid3Types >::applyRotation ( const type::Quat< SReal q)
virtual

Rotate the current state.

Implements sofa::core::behavior::BaseMechanicalState.

◆ applyRotation() [4/4]

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::applyRotation ( const type::Quat< SReal q)
overridevirtual

Rotate the current state.

Implements sofa::core::behavior::BaseMechanicalState.

◆ applyScale()

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::applyScale ( const SReal  SReal,
const SReal  SReal,
const SReal  SReal 
)
overridevirtual

Scale the current state.

Implements sofa::core::behavior::BaseMechanicalState.

◆ applyTranslation()

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::applyTranslation ( const SReal  dx,
const SReal  dy,
const SReal  dz 
)
overridevirtual

Apply translation vector to the position.

Implements sofa::core::behavior::BaseMechanicalState.

◆ beginIntegration()

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::beginIntegration ( SReal  )
overridevirtual

Called at the beginning of each integration step.

Reimplemented from sofa::core::behavior::BaseMechanicalState.

◆ buildIdentityBlocksInJacobian()

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::buildIdentityBlocksInJacobian ( const sofa::type::vector< unsigned int > &  list_n,
core::MatrixDerivId mID 
)
overridevirtual

fill the jacobian matrix (of the constraints) with identity blocks on the provided list of nodes(dofs)

Implements sofa::core::behavior::BaseMechanicalState.

◆ compareVec()

template<class DataTypes >
SReal sofa::component::statecontainer::MechanicalObject< DataTypes >::compareVec ( core::ConstVecId  v,
std::istream &  in 
)
overridevirtual

◆ computeBBox()

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::computeBBox ( const core::ExecParams params,
bool  onlyVisible = false 
)
overridevirtual

Bounding Box computation method.

Reimplemented from sofa::core::objectmodel::BaseObject.

◆ computeWeightedValue()

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::computeWeightedValue ( const sofa::Index  i,
const sofa::type::vector< sofa::Index > &  ancestors,
const sofa::type::vector< double > &  coefs 
)

Replace the value at index by the sum of the ancestors values weithed by the coefs.

Sum of the coefs should usually equal to 1.0

◆ constraintBlocks()

template<class DataTypes >
std::list< core::behavior::BaseMechanicalState::ConstraintBlock > sofa::component::statecontainer::MechanicalObject< DataTypes >::constraintBlocks ( const std::list< unsigned int > &  indices) const
overridevirtual

Express the matrix L in term of block of matrices, using the indices of the lines in the MatrixDeriv container.

Reimplemented from sofa::core::behavior::BaseMechanicalState.

◆ copyFromBaseVector()

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::copyFromBaseVector ( core::VecId  dest,
const linearalgebra::BaseVector src,
unsigned int &  offset 
)
overridevirtual

Copy data to a local vector the state stored in a global BaseVector

Parameters
offsetthe offset in the BaseVector where the scalar values will be used. It will be updated to the first scalar value after the ones used by this operation when this method returns

Implements sofa::core::behavior::BaseMechanicalState.

◆ copyToBaseMatrix()

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::copyToBaseMatrix ( linearalgebra::BaseMatrix dest,
core::ConstMatrixDerivId  src,
unsigned int &  offset 
)
overridevirtual

Copy data to a global BaseMatrix from the state stored in a local vector.

Implements sofa::core::behavior::BaseMechanicalState.

◆ copyToBaseVector()

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::copyToBaseVector ( linearalgebra::BaseVector dest,
core::ConstVecId  src,
unsigned int &  offset 
)
overridevirtual

Copy data to a global BaseVector the state stored in a local vector

Parameters
offsetthe offset in the BaseVector where the scalar values will be used. It will be updated to the first scalar value after the ones used by this operation when this method returns

Implements sofa::core::behavior::BaseMechanicalState.

◆ draw() [1/3]

Render internal data of this object, for debugging purposes.

Reimplemented from sofa::core::objectmodel::BaseObject.

◆ draw() [2/3]

SOFA_COMPONENT_STATECONTAINER_API void sofa::component::statecontainer::MechanicalObject< defaulttype::Rigid3Types >::draw ( const core::visual::VisualParams )
virtual

Render internal data of this object, for debugging purposes.

Reimplemented from sofa::core::objectmodel::BaseObject.

◆ draw() [3/3]

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::draw ( const core::visual::VisualParams )
inlineoverridevirtual

Render internal data of this object, for debugging purposes.

Reimplemented from sofa::core::objectmodel::BaseObject.

◆ drawIndices()

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::drawIndices ( const core::visual::VisualParams vparams)
inlineprotected

Internal function : Draw indices in 3d coordinates.

◆ drawVectors()

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::drawVectors ( const core::visual::VisualParams vparams)
inlineprotected

Internal function : Draw vectors.

◆ endIntegration()

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::endIntegration ( const core::ExecParams params,
SReal   
)
overridevirtual

Called at the end of each integration step.

Reimplemented from sofa::core::behavior::BaseMechanicalState.

◆ exportGnuplot()

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::exportGnuplot ( SReal  time)
overridevirtual

◆ forcePointPosition()

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::forcePointPosition ( const sofa::Index  i,
const sofa::type::vector< double > &  m_x 
)

Force the position of a point (and force its velocity to zero value)

◆ getConstraintJacobian()

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::getConstraintJacobian ( const core::ConstraintParams params,
sofa::linearalgebra::BaseMatrix J,
unsigned int &  off 
)
overridevirtual

build the jacobian of the constraint in a baseMatrix

Implements sofa::core::behavior::BaseMechanicalState.

◆ getConstraintJacobianTimesVecDeriv()

template<class DataTypes >
SReal sofa::component::statecontainer::MechanicalObject< DataTypes >::getConstraintJacobianTimesVecDeriv ( unsigned int  ,
core::ConstVecId   
)
overridevirtual

Compute the error given a state vector and a line of the Jacobian (line in vector C)

Reimplemented from sofa::core::behavior::BaseMechanicalState.

◆ getIndicesInSpace()

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::getIndicesInSpace ( sofa::type::vector< sofa::Index > &  indices,
Real  xmin,
Real  xmax,
Real  ymin,
Real  ymax,
Real  zmin,
Real  zmax 
) const
overridevirtual

Get the indices of the particles located in the given bounding box.

Implements sofa::core::behavior::MechanicalState< DataTypes >.

◆ getPX()

template<class DataTypes >
SReal sofa::component::statecontainer::MechanicalObject< DataTypes >::getPX ( sofa::Index  i) const
inlineoverridevirtual

◆ getPY()

template<class DataTypes >
SReal sofa::component::statecontainer::MechanicalObject< DataTypes >::getPY ( sofa::Index  i) const
inlineoverridevirtual

◆ getPZ()

template<class DataTypes >
SReal sofa::component::statecontainer::MechanicalObject< DataTypes >::getPZ ( sofa::Index  i) const
inlineoverridevirtual

◆ getReadAccessor()

template<class DataTypes >
template<core::VecType vtype>
helper::ReadAccessor< core::objectmodel::Data< core::StateVecType_t< DataTypes, vtype > > > sofa::component::statecontainer::MechanicalObject< DataTypes >::getReadAccessor ( core::ConstVecId  v)
protected

Shortcut to get a read accessor corresponding to the provided VecType from a VecId.

◆ getRotation()

template<class DataTypes >
virtual type::Vec3 sofa::component::statecontainer::MechanicalObject< DataTypes >::getRotation ( ) const
inlinevirtual

◆ getScale()

template<class DataTypes >
type::Vec3 sofa::component::statecontainer::MechanicalObject< DataTypes >::getScale ( ) const
inlineoverridevirtual

◆ getSize()

template<class DataTypes >
Size sofa::component::statecontainer::MechanicalObject< DataTypes >::getSize ( ) const
inlineoverridevirtual

Current size of all stored vectors.

Implements sofa::core::BaseState.

◆ getTranslation()

template<class DataTypes >
virtual type::Vec3 sofa::component::statecontainer::MechanicalObject< DataTypes >::getTranslation ( ) const
inlinevirtual

◆ getVX()

template<class DataTypes >
SReal sofa::component::statecontainer::MechanicalObject< DataTypes >::getVX ( sofa::Index  i) const
inline

◆ getVY()

template<class DataTypes >
SReal sofa::component::statecontainer::MechanicalObject< DataTypes >::getVY ( sofa::Index  i) const
inline

◆ getVZ()

template<class DataTypes >
SReal sofa::component::statecontainer::MechanicalObject< DataTypes >::getVZ ( sofa::Index  i) const
inline

◆ getWriteAccessor()

template<class DataTypes >
template<core::VecType vtype>
helper::WriteAccessor< core::objectmodel::Data< core::StateVecType_t< DataTypes, vtype > > > sofa::component::statecontainer::MechanicalObject< DataTypes >::getWriteAccessor ( core::VecId  v)
protected

Shortcut to get a write accessor corresponding to the provided VecType from a VecId.

◆ getWriteOnlyAccessor()

template<class DataTypes >
template<core::VecType vtype>
helper::WriteOnlyAccessor< core::objectmodel::Data< core::StateVecType_t< DataTypes, vtype > > > sofa::component::statecontainer::MechanicalObject< DataTypes >::getWriteOnlyAccessor ( core::VecId  v)
protected

Shortcut to get a write-only accessor corresponding to the provided VecType from a VecId.

◆ handleStateChange()

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::handleStateChange
overridevirtual

Handle state Changes

Reimplemented from sofa::core::behavior::BaseMechanicalState.

◆ init()

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::init ( void  )
overridevirtual

Initialization method called at graph creation and modification, during top-down traversal.

Reimplemented from sofa::core::objectmodel::BaseObject.

◆ initGnuplot()

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::initGnuplot ( const std::string  path)
overridevirtual

◆ isIndependent()

template<class DataTypes >
bool sofa::component::statecontainer::MechanicalObject< DataTypes >::isIndependent

if this mechanical object stores independent dofs (in opposition to mapped dofs)

◆ operator=()

template<class DataTypes >
MechanicalObject< DataTypes > & sofa::component::statecontainer::MechanicalObject< DataTypes >::operator= ( const MechanicalObject< DataTypes > &  obj)

◆ parse()

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::parse ( core::objectmodel::BaseObjectDescription arg)
overridevirtual

Parse the given description to assign values to this object's fields and potentially other parameters.

Reimplemented from sofa::core::objectmodel::Base.

◆ pickParticles()

template<class DataTypes >
bool sofa::component::statecontainer::MechanicalObject< DataTypes >::pickParticles ( const core::ExecParams params,
double  rayOx,
double  rayOy,
double  rayOz,
double  rayDx,
double  rayDy,
double  rayDz,
double  radius0,
double  dRadius,
std::multimap< double, std::pair< sofa::core::behavior::BaseMechanicalState *, int > > &  particles 
)
overridevirtual

Find mechanical particles hit by the given ray. A mechanical particle is defined as a 2D or 3D, position or rigid DOF Returns false if this object does not support picking

Reimplemented from sofa::core::behavior::BaseMechanicalState.

◆ printDOF()

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::printDOF ( core::ConstVecId  v,
std::ostream &  out = std::cerr,
int  firstIndex = 0,
int  range = -1 
) const
overridevirtual

◆ printDOFWithElapsedTime()

template<class DataTypes >
unsigned sofa::component::statecontainer::MechanicalObject< DataTypes >::printDOFWithElapsedTime ( core::ConstVecId  v,
unsigned  count = 0,
unsigned  time = 0,
std::ostream &  out = std::cerr 
)
overridevirtual

◆ read() [1/3]

template<class DataTypes >
const Data< typename MechanicalObject< DataTypes >::MatrixDeriv > * sofa::component::statecontainer::MechanicalObject< DataTypes >::read ( core::ConstMatrixDerivId  v) const
overridevirtual

◆ read() [2/3]

template<class DataTypes >
const Data< typename MechanicalObject< DataTypes >::VecCoord > * sofa::component::statecontainer::MechanicalObject< DataTypes >::read ( core::ConstVecCoordId  v) const
overridevirtual

◆ read() [3/3]

template<class DataTypes >
const Data< typename MechanicalObject< DataTypes >::VecDeriv > * sofa::component::statecontainer::MechanicalObject< DataTypes >::read ( core::ConstVecDerivId  v) const
overridevirtual

◆ readVec()

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::readVec ( core::VecId  v,
std::istream &  in 
)
overridevirtual

◆ reinit()

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::reinit
overridevirtual

Update method called when variables used in precomputation are modified.

Reimplemented from sofa::core::objectmodel::BaseObject.

◆ renumberValues()

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::renumberValues ( const sofa::type::vector< sofa::Index > &  index)

Reorder values according to parameter.

Result of this method is : newValue[ i ] = oldValue[ index[i] ];

◆ replaceValue()

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::replaceValue ( const sofa::Index  inputIndex,
const sofa::Index  outputIndex 
)

Overwrite values at index outputIndex by the ones at inputIndex.

◆ reserve()

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::reserve ( Size  vsize)
virtual

◆ reset()

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::reset
overridevirtual

Reset to initial state.

Reimplemented from sofa::core::objectmodel::BaseObject.

◆ resetAcc()

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::resetAcc ( const core::ExecParams params,
core::VecDerivId  a = core::vec_id::write_access::dx 
)
overridevirtual

Set Acc =0.

Reimplemented from sofa::core::behavior::BaseMechanicalState.

◆ resetConstraint()

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::resetConstraint ( const core::ConstraintParams params)
overridevirtual

Reset the constraint matrix.

Implements sofa::core::behavior::BaseMechanicalState.

◆ resetForce()

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::resetForce ( const core::ExecParams params,
core::VecDerivId  f = core::vec_id::write_access::force 
)
overridevirtual

Set F = 0.

Reimplemented from sofa::core::behavior::BaseMechanicalState.

◆ resize()

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::resize ( Size  vsize)
overridevirtual

Resize all stored vector.

Implements sofa::core::BaseState.

◆ setRotation()

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::setRotation ( SReal  rx,
SReal  ry,
SReal  rz 
)
inline

◆ setScale()

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::setScale ( SReal  sx,
SReal  sy,
SReal  sz 
)
inline

◆ setTranslation()

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::setTranslation ( SReal  dx,
SReal  dy,
SReal  dz 
)
inline

◆ setVecCoord()

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::setVecCoord ( core::ConstVecCoordId  vecId,
Data< VecCoord > *  v 
)
protected

Inserts VecCoord DOF coordinates vector at index in the vectorsCoord container.

◆ setVecDeriv()

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::setVecDeriv ( core::ConstVecDerivId  vecId,
Data< VecDeriv > *  v 
)
protected

Inserts VecDeriv DOF derivates vector at index in the vectorsDeriv container.

◆ setVecIdProperties()

template<class DataTypes >
template<core::VecType vtype, core::VecAccess vaccess>
void sofa::component::statecontainer::MechanicalObject< DataTypes >::setVecIdProperties ( core::TVecId< vtype, vaccess >  v,
const core::VecIdProperties properties,
core::BaseData vec_d 
)
staticprotected

◆ setVecMatrixDeriv()

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::setVecMatrixDeriv ( core::ConstMatrixDerivId  vecId,
Data< MatrixDeriv > *  m 
)
protected

Inserts MatrixDeriv DOF at index in the MatrixDeriv container.

◆ SOFA_ATTRIBUTE_REPLACED__TYPEMEMBER() [1/2]

template<class DataTypes >
sofa::component::statecontainer::MechanicalObject< DataTypes >::SOFA_ATTRIBUTE_REPLACED__TYPEMEMBER ( Index  ,
sofa::Index   
)

◆ SOFA_ATTRIBUTE_REPLACED__TYPEMEMBER() [2/2]

template<class DataTypes >
sofa::component::statecontainer::MechanicalObject< DataTypes >::SOFA_ATTRIBUTE_REPLACED__TYPEMEMBER ( Vector3  ,
sofa::type::Vec3   
)

◆ SOFA_CLASS()

template<class DataTypes >
sofa::component::statecontainer::MechanicalObject< DataTypes >::SOFA_CLASS ( SOFA_TEMPLATE(MechanicalObject< DataTypes >, DataTypes ,
SOFA_TEMPLATE(sofa::core::behavior::MechanicalState, DataTypes  
)

◆ storeResetState()

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::storeResetState
overridevirtual

Save the initial state for later uses in reset()

Reimplemented from sofa::core::objectmodel::BaseObject.

◆ swapValues()

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::swapValues ( const sofa::Index  idx1,
const sofa::Index  idx2 
)

Exchange values at indices idx1 and idx2.

◆ vAlloc() [1/2]

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::vAlloc ( const core::ExecParams params,
core::VecCoordId  v,
const core::VecIdProperties properties = {} 
)
overridevirtual

Increment the index of the given MatrixDerivId, so that all 'allocated' vectors in this state have a lower index.

Allocate a new temporary vector

Implements sofa::core::behavior::BaseMechanicalState.

◆ vAlloc() [2/2]

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::vAlloc ( const core::ExecParams params,
core::VecDerivId  v,
const core::VecIdProperties properties = {} 
)
overridevirtual

Allocate a new temporary vector.

Implements sofa::core::behavior::BaseMechanicalState.

◆ vAllocImpl()

template<class DataTypes >
template<core::VecType vtype>
void sofa::component::statecontainer::MechanicalObject< DataTypes >::vAllocImpl ( core::TVecId< vtype, core::V_WRITE >  v,
const core::VecIdProperties properties 
)
protected

Generic implementation of the method vAlloc.

◆ vAvail() [1/2]

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::vAvail ( const core::ExecParams params,
core::VecCoordId v 
)
overridevirtual

Increment the index of the given VecCoordId, so that all 'allocated' vectors in this state have a lower index.

Implements sofa::core::behavior::BaseMechanicalState.

◆ vAvail() [2/2]

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::vAvail ( const core::ExecParams params,
core::VecDerivId v 
)
overridevirtual

Increment the index of the given VecDerivId, so that all 'allocated' vectors in this state have a lower index.

Implements sofa::core::behavior::BaseMechanicalState.

◆ vAvailImpl()

template<class DataTypes >
template<core::VecType vtype>
void sofa::component::statecontainer::MechanicalObject< DataTypes >::vAvailImpl ( core::TVecId< vtype, core::V_WRITE > &  v,
sofa::type::vector< Data< core::StateVecType_t< DataTypes, vtype > > * > &  dataContainer 
)
protected

Generic implementation of the method vAvail.

◆ vDot()

template<class DataTypes >
SReal sofa::component::statecontainer::MechanicalObject< DataTypes >::vDot ( const core::ExecParams params,
core::ConstVecId  a,
core::ConstVecId  b 
)
overridevirtual

Compute the scalar products between two vectors.

Implements sofa::core::behavior::BaseMechanicalState.

◆ vFree() [1/2]

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::vFree ( const core::ExecParams params,
core::VecCoordId  v 
)
overridevirtual

Free a temporary vector.

Implements sofa::core::behavior::BaseMechanicalState.

◆ vFree() [2/2]

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::vFree ( const core::ExecParams params,
core::VecDerivId  v 
)
overridevirtual

Free a temporary vector.

Implements sofa::core::behavior::BaseMechanicalState.

◆ vFreeImpl()

template<class DataTypes >
template<core::VecType vtype>
void sofa::component::statecontainer::MechanicalObject< DataTypes >::vFreeImpl ( core::TVecId< vtype, core::V_WRITE >  v)
protected

Generic implementation of the method vFree.

◆ vInit() [1/2]

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::vInit ( const core::ExecParams params,
core::VecCoordId  v,
core::ConstVecCoordId  vSrc 
)
overridevirtual

Free a temporary vector.

Initialize an unset vector

Implements sofa::core::behavior::BaseMechanicalState.

◆ vInit() [2/2]

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::vInit ( const core::ExecParams params,
core::VecDerivId  v,
core::ConstVecDerivId  vSrc 
)
overridevirtual

Initialize an unset vector.

Implements sofa::core::behavior::BaseMechanicalState.

◆ vInitImpl()

template<class DataTypes >
template<core::VecType vtype>
void sofa::component::statecontainer::MechanicalObject< DataTypes >::vInitImpl ( const core::ExecParams params,
core::TVecId< vtype, core::V_WRITE >  vId,
core::TVecId< vtype, core::V_READ >  vSrcId 
)
protected

Generic implementation of the method vInit.

◆ vMax()

template<class DataTypes >
SReal sofa::component::statecontainer::MechanicalObject< DataTypes >::vMax ( const core::ExecParams params,
core::ConstVecId  a 
)
overridevirtual

Maximum of the absolute values of the entries of state vector a. This is used to compute the infinite-norm of the vector.

Implements sofa::core::behavior::BaseMechanicalState.

◆ vMultiOp()

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::vMultiOp ( const core::ExecParams params,
const VMultiOp ops 
)
overridevirtual

Perform a sequence of linear vector accumulation operation $r_i = sum_j (v_j*f_{ij})$.

This is used to compute in on steps operations such as $v = v + a*dt, x = x + v*dt$. Note that if the result vector appears inside the expression, it must be the first operand. By default this method decompose the computation into multiple vOp calls.

Perform a sequence of linear vector accumulation operation $r_i = sum_j (v_j*f_{ij})$

This is used to compute in on steps operations such as $v = v + a*dt, x = x + v*dt$. Note that if the result vector appears inside the expression, it must be the first operand. By default this method decompose the computation into multiple vOp calls.

Reimplemented from sofa::core::behavior::BaseMechanicalState.

◆ vOp()

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::vOp ( const core::ExecParams params,
core::VecId  v,
core::ConstVecId  a = core::ConstVecId::null(),
core::ConstVecId  b = core::ConstVecId::null(),
SReal  f = 1.0 
)
overridevirtual

Initialize an unset vector.

Implements sofa::core::behavior::BaseMechanicalState.

◆ vRealloc() [1/2]

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::vRealloc ( const core::ExecParams params,
core::VecCoordId  v,
const core::VecIdProperties properties = {} 
)
overridevirtual

Allocate a new temporary vector.

Reallocate a new temporary vector

Implements sofa::core::behavior::BaseMechanicalState.

◆ vRealloc() [2/2]

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::vRealloc ( const core::ExecParams params,
core::VecDerivId  v,
const core::VecIdProperties properties = {} 
)
overridevirtual

Reallocate a new temporary vector.

Implements sofa::core::behavior::BaseMechanicalState.

◆ vReallocImpl()

template<class DataTypes >
template<core::VecType vtype>
void sofa::component::statecontainer::MechanicalObject< DataTypes >::vReallocImpl ( core::TVecId< vtype, core::V_WRITE >  v,
const core::VecIdProperties properties 
)
protected

Generic implementation of the method vRealloc.

◆ vSize()

template<class DataTypes >
Size sofa::component::statecontainer::MechanicalObject< DataTypes >::vSize ( const core::ExecParams params,
core::ConstVecId  v 
)
overridevirtual

Get vector size.

Implements sofa::core::behavior::BaseMechanicalState.

◆ vSum()

template<class DataTypes >
SReal sofa::component::statecontainer::MechanicalObject< DataTypes >::vSum ( const core::ExecParams params,
core::ConstVecId  a,
unsigned  l 
)
overridevirtual

Sum of the entries of state vector a at the power of l>0. This is used to compute the l-norm of the vector.

Implements sofa::core::behavior::BaseMechanicalState.

◆ vThreshold()

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::vThreshold ( core::VecId  a,
SReal  threshold 
)
overridevirtual

Apply a threshold (lower bound) to all entries.

Implements sofa::core::behavior::BaseMechanicalState.

◆ write() [1/3]

template<class DataTypes >
Data< typename MechanicalObject< DataTypes >::MatrixDeriv > * sofa::component::statecontainer::MechanicalObject< DataTypes >::write ( core::MatrixDerivId  v)
overridevirtual

◆ write() [2/3]

template<class DataTypes >
Data< typename MechanicalObject< DataTypes >::VecCoord > * sofa::component::statecontainer::MechanicalObject< DataTypes >::write ( core::VecCoordId  v)
overridevirtual

◆ write() [3/3]

template<class DataTypes >
Data< typename MechanicalObject< DataTypes >::VecDeriv > * sofa::component::statecontainer::MechanicalObject< DataTypes >::write ( core::VecDerivId  v)
overridevirtual

◆ writeState()

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::writeState ( std::ostream &  out)
overridevirtual

Write current state to the given output stream.

Reimplemented from sofa::core::behavior::BaseMechanicalState.

◆ writeVec()

template<class DataTypes >
void sofa::component::statecontainer::MechanicalObject< DataTypes >::writeVec ( core::ConstVecId  v,
std::ostream &  out 
)
overridevirtual

Related details

◆ MechanicalObjectInternalData< DataTypes >

template<class DataTypes >
friend class MechanicalObjectInternalData< DataTypes >
friend