#include <MechanicalObject.h>
This class can be overridden if needed for additional storage within template specializations. More...
This class can be overridden if needed for additional storage within template specializations.
MechanicalObject class.
Public Attributes | |
Data< VecCoord > | x |
position coordinates of the degrees of freedom More... | |
Data< VecDeriv > | v |
velocity coordinates of the degrees of freedom More... | |
Data< VecDeriv > | f |
force vector of the degrees of freedom More... | |
Data< VecCoord > | x0 |
rest position coordinates of the degrees of freedom More... | |
Data< VecDeriv > | externalForces |
externalForces vector of the degrees of freedom More... | |
Data< VecDeriv > | dx |
dx vector of the degrees of freedom More... | |
Data< VecCoord > | xfree |
free position coordinates of the degrees of freedom More... | |
Data< VecDeriv > | vfree |
free velocity coordinates of the degrees of freedom More... | |
Data< MatrixDeriv > | c |
constraints applied to the degrees of freedom More... | |
Data< MatrixDeriv > | m |
mappingJacobian applied to the degrees of freedom More... | |
Data< VecCoord > | reset_position |
reset position coordinates of the degrees of freedom More... | |
Data< VecDeriv > | reset_velocity |
reset velocity coordinates of the degrees of freedom More... | |
defaulttype::MapMapSparseMatrix< Deriv > | c2 |
Data< SReal > | restScale |
optional scaling of rest position coordinates (to simulated pre-existing internal tension).(default = 1.0) More... | |
Data< bool > | d_useTopology |
Shall this object rely on any active topology to initialize its size and positions. More... | |
Data< bool > | showObject |
Show objects. (default=false) More... | |
Data< float > | showObjectScale |
Scale for object display. (default=0.1) More... | |
Data< bool > | showIndices |
Show indices. (default=false) More... | |
Data< float > | showIndicesScale |
Scale for indices display. (default=0.02) More... | |
Data< bool > | showVectors |
Show velocity. (default=false) More... | |
Data< float > | showVectorsScale |
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::RGBAColor > | d_color |
Color for object display. (default=[1 1 1 1]) More... | |
Public Attributes inherited from sofa::core::objectmodel::BaseObject | |
Data< bool > | f_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< bool > | f_printLog |
if true, emits extra messages at runtime. More... | |
Data< sofa::core::objectmodel::TagSet > | f_tags |
list of the subsets the object belongs to More... | |
Data< sofa::type::BoundingBox > | f_bbox |
this object bounding box More... | |
Data< sofa::core::objectmodel::ComponentState > | d_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_STOREPATH > | l_topology |
Data< int > | f_reserve |
Size to reserve when creating vectors. (default=0) More... | |
bool | m_initialized |
MechanicalObjectInternalData< DataTypes > | data |
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::Vec3 > | translation |
Translation of the DOFs. More... | |
Data< type::Vec3 > | rotation |
Rotation of the DOFs. More... | |
Data< type::Vec3 > | scale |
Scale of the DOFs in 3 dimensions. More... | |
Data< type::Vec3 > | translation2 |
Translation of the DOFs, applied after the rest position has been computed. More... | |
Data< type::Vec3 > | rotation2 |
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_DOUBLELINK > | l_context |
LinkSlaves | l_slaves |
SingleLink< BaseObject, BaseObject, BaseLink::FLAG_DOUBLELINK > | l_master |
Protected Attributes inherited from sofa::core::objectmodel::Base | |
std::map< std::string, sofa::core::DataTrackerCallback > | m_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) | |
MechanicalObject & | operator= (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< ConstraintBlock > | constraintBlocks (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) |
Base * | findLinkDestClass (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 BaseContext * | getContext () const |
BaseContext * | getContext () |
const BaseObject * | getMaster () const |
BaseObject * | getMaster () |
const VecSlaves & | getSlaves () const |
BaseObject * | getSlave (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 BaseClass * | getClass () 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::TagSet & | getTags () 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=" ") |
BaseData * | findData (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... | |
BaseLink * | findLink (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 VecData & | getDataFields () const |
Accessor to the vector containing all the fields of this object. More... | |
const MapData & | getDataAliases () const |
Accessor to the map containing all the aliases of this object. More... | |
const VecLink & | getLinks () const |
Accessor to the vector containing all the fields of this object. More... | |
const MapLink & | getLinkAliases () 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< Real > | computeBBox () const |
Compute the bounding box independently from the visibility parameters. More... | |
void | computeBBox (const core::ExecParams *params, bool onlyVisible=false) override |
objectmodel::BaseData * | baseWrite (VecId v) override |
const objectmodel::BaseData * | baseRead (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 BaseClass * | GetClass () |
template<class T > | |
static std::string | shortName (const T *ptr=nullptr, BaseObjectDescription *=nullptr) |
Data< MatrixDeriv > sofa::component::statecontainer::MechanicalObject< DataTypes >::c |
constraints applied to the degrees of freedom
defaulttype::MapMapSparseMatrix< Deriv > sofa::component::statecontainer::MechanicalObject< DataTypes >::c2 |
Data< type::RGBAColor > sofa::component::statecontainer::MechanicalObject< DataTypes >::d_color |
Color for object display. (default=[1 1 1 1])
|
protected |
Size of the vectors.
Data< bool > sofa::component::statecontainer::MechanicalObject< DataTypes >::d_useTopology |
Shall this object rely on any active topology to initialize its size and positions.
|
protected |
Given the number of a constraint Equation, find the index in the MatrixDeriv C, where the constraint is actually stored.
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)
Data< VecDeriv > sofa::component::statecontainer::MechanicalObject< DataTypes >::dx |
dx vector of the degrees of freedom
Data< VecDeriv > sofa::component::statecontainer::MechanicalObject< DataTypes >::externalForces |
externalForces vector of the degrees of freedom
Data< VecDeriv > sofa::component::statecontainer::MechanicalObject< DataTypes >::f |
force vector of the degrees of freedom
|
protected |
Size to reserve when creating vectors. (default=0)
Data< MatrixDeriv > sofa::component::statecontainer::MechanicalObject< DataTypes >::m |
mappingJacobian applied to the degrees of freedom
|
protected |
|
protected |
|
protected |
Data< VecCoord > sofa::component::statecontainer::MechanicalObject< DataTypes >::reset_position |
reset position coordinates of the degrees of freedom
Data< VecDeriv > sofa::component::statecontainer::MechanicalObject< DataTypes >::reset_velocity |
reset velocity coordinates of the degrees of freedom
Data< SReal > sofa::component::statecontainer::MechanicalObject< DataTypes >::restScale |
optional scaling of rest position coordinates (to simulated pre-existing internal tension).(default = 1.0)
|
protected |
Rotation of the DOFs.
|
protected |
Rotation of the DOFs, applied the after the rest position has been computed.
|
protected |
Scale of the DOFs in 3 dimensions.
Data< bool > sofa::component::statecontainer::MechanicalObject< DataTypes >::showIndices |
Show indices. (default=false)
Data< float > sofa::component::statecontainer::MechanicalObject< DataTypes >::showIndicesScale |
Scale for indices display. (default=0.02)
Data< bool > sofa::component::statecontainer::MechanicalObject< DataTypes >::showObject |
Show objects. (default=false)
Data< float > sofa::component::statecontainer::MechanicalObject< DataTypes >::showObjectScale |
Scale for object display. (default=0.1)
Data< bool > sofa::component::statecontainer::MechanicalObject< DataTypes >::showVectors |
Show velocity. (default=false)
Data< float > sofa::component::statecontainer::MechanicalObject< DataTypes >::showVectorsScale |
Scale for vectors display. (default=0.0001)
|
protected |
Translation of the DOFs.
|
protected |
Translation of the DOFs, applied after the rest position has been computed.
Data< VecDeriv > sofa::component::statecontainer::MechanicalObject< DataTypes >::v |
velocity coordinates of the degrees of freedom
|
protected |
Coordinates DOFs vectors table (static and dynamic allocated)
|
protected |
Derivates DOFs vectors table (static and dynamic allocated)
|
protected |
Constraint vectors table.
Data< VecDeriv > sofa::component::statecontainer::MechanicalObject< DataTypes >::vfree |
free velocity coordinates of the degrees of freedom
Data< VecCoord > sofa::component::statecontainer::MechanicalObject< DataTypes >::x |
position coordinates of the degrees of freedom
Data< VecCoord > sofa::component::statecontainer::MechanicalObject< DataTypes >::x0 |
rest position coordinates of the degrees of freedom
Data< VecCoord > sofa::component::statecontainer::MechanicalObject< DataTypes >::xfree |
free position coordinates of the degrees of freedom
|
protected |
|
protectedvirtual |
|
overridevirtual |
Add stored external forces to F.
Reimplemented from sofa::core::behavior::BaseMechanicalState.
|
overridevirtual |
update the given bounding box, to include this
Reimplemented from sofa::core::behavior::BaseMechanicalState.
|
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)
offset | the 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.
|
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)
offset | the 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.
|
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)
offset | the 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.
|
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)
offset | the 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.
|
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)
offset | the 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.
|
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)
offset | the 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.
|
overridevirtual |
Add data to a global BaseVector from the state stored in a local vector
offset | the 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.
|
overridevirtual |
Rotation using Euler Angles in degree.
Reimplemented from sofa::core::behavior::BaseMechanicalState.
|
virtual |
Rotate the current state.
Implements sofa::core::behavior::BaseMechanicalState.
|
virtual |
Rotate the current state.
Implements sofa::core::behavior::BaseMechanicalState.
|
overridevirtual |
Rotate the current state.
Implements sofa::core::behavior::BaseMechanicalState.
|
overridevirtual |
Scale the current state.
Implements sofa::core::behavior::BaseMechanicalState.
|
overridevirtual |
Apply translation vector to the position.
Implements sofa::core::behavior::BaseMechanicalState.
|
overridevirtual |
Called at the beginning of each integration step.
Reimplemented from sofa::core::behavior::BaseMechanicalState.
|
overridevirtual |
fill the jacobian matrix (of the constraints) with identity blocks on the provided list of nodes(dofs)
Implements sofa::core::behavior::BaseMechanicalState.
|
overridevirtual |
Implements sofa::core::behavior::BaseMechanicalState.
|
overridevirtual |
Bounding Box computation method.
Reimplemented from sofa::core::objectmodel::BaseObject.
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
|
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.
|
overridevirtual |
Copy data to a local vector the state stored in a global BaseVector
offset | the 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.
|
overridevirtual |
Copy data to a global BaseMatrix from the state stored in a local vector.
Implements sofa::core::behavior::BaseMechanicalState.
|
overridevirtual |
Copy data to a global BaseVector the state stored in a local vector
offset | the 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.
|
virtual |
Render internal data of this object, for debugging purposes.
Reimplemented from sofa::core::objectmodel::BaseObject.
|
virtual |
Render internal data of this object, for debugging purposes.
Reimplemented from sofa::core::objectmodel::BaseObject.
|
inlineoverridevirtual |
Render internal data of this object, for debugging purposes.
Reimplemented from sofa::core::objectmodel::BaseObject.
|
inlineprotected |
Internal function : Draw indices in 3d coordinates.
|
inlineprotected |
Internal function : Draw vectors.
|
overridevirtual |
Called at the end of each integration step.
Reimplemented from sofa::core::behavior::BaseMechanicalState.
|
overridevirtual |
Reimplemented from sofa::core::behavior::BaseMechanicalState.
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)
|
overridevirtual |
build the jacobian of the constraint in a baseMatrix
Implements sofa::core::behavior::BaseMechanicalState.
|
overridevirtual |
Compute the error given a state vector and a line of the Jacobian (line in vector C)
Reimplemented from sofa::core::behavior::BaseMechanicalState.
|
overridevirtual |
Get the indices of the particles located in the given bounding box.
Implements sofa::core::behavior::MechanicalState< DataTypes >.
|
inlineoverridevirtual |
Reimplemented from sofa::core::behavior::BaseMechanicalState.
|
inlineoverridevirtual |
Reimplemented from sofa::core::behavior::BaseMechanicalState.
|
inlineoverridevirtual |
Reimplemented from sofa::core::behavior::BaseMechanicalState.
|
protected |
Shortcut to get a read accessor corresponding to the provided VecType from a VecId.
|
inlinevirtual |
|
inlineoverridevirtual |
Reimplemented from sofa::core::behavior::BaseMechanicalState.
|
inlineoverridevirtual |
Current size of all stored vectors.
Implements sofa::core::BaseState.
|
inlinevirtual |
|
inline |
|
inline |
|
inline |
|
protected |
Shortcut to get a write accessor corresponding to the provided VecType from a VecId.
|
protected |
Shortcut to get a write-only accessor corresponding to the provided VecType from a VecId.
|
overridevirtual |
Handle state Changes
Reimplemented from sofa::core::behavior::BaseMechanicalState.
|
overridevirtual |
Initialization method called at graph creation and modification, during top-down traversal.
Reimplemented from sofa::core::objectmodel::BaseObject.
|
overridevirtual |
Reimplemented from sofa::core::behavior::BaseMechanicalState.
bool sofa::component::statecontainer::MechanicalObject< DataTypes >::isIndependent |
if this mechanical object stores independent dofs (in opposition to mapped dofs)
MechanicalObject< DataTypes > & sofa::component::statecontainer::MechanicalObject< DataTypes >::operator= | ( | const MechanicalObject< DataTypes > & | obj | ) |
|
overridevirtual |
Parse the given description to assign values to this object's fields and potentially other parameters.
Reimplemented from sofa::core::objectmodel::Base.
|
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.
|
overridevirtual |
Implements sofa::core::behavior::BaseMechanicalState.
|
overridevirtual |
Reimplemented from sofa::core::behavior::BaseMechanicalState.
|
overridevirtual |
Implements sofa::core::State< DataTypes >.
|
overridevirtual |
Implements sofa::core::State< DataTypes >.
|
overridevirtual |
Implements sofa::core::State< DataTypes >.
|
overridevirtual |
Implements sofa::core::behavior::BaseMechanicalState.
|
overridevirtual |
Update method called when variables used in precomputation are modified.
Reimplemented from sofa::core::objectmodel::BaseObject.
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] ];
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.
|
virtual |
|
overridevirtual |
Reset to initial state.
Reimplemented from sofa::core::objectmodel::BaseObject.
|
overridevirtual |
Set Acc =0.
Reimplemented from sofa::core::behavior::BaseMechanicalState.
|
overridevirtual |
Reset the constraint matrix.
Implements sofa::core::behavior::BaseMechanicalState.
|
overridevirtual |
Set F = 0.
Reimplemented from sofa::core::behavior::BaseMechanicalState.
|
overridevirtual |
Resize all stored vector.
Implements sofa::core::BaseState.
|
inline |
|
inline |
|
inline |
|
protected |
Inserts VecCoord DOF coordinates vector at index in the vectorsCoord container.
|
protected |
Inserts VecDeriv DOF derivates vector at index in the vectorsDeriv container.
|
staticprotected |
|
protected |
Inserts MatrixDeriv DOF at index in the MatrixDeriv container.
sofa::component::statecontainer::MechanicalObject< DataTypes >::SOFA_ATTRIBUTE_REPLACED__TYPEMEMBER | ( | Index | , |
sofa::Index | |||
) |
sofa::component::statecontainer::MechanicalObject< DataTypes >::SOFA_ATTRIBUTE_REPLACED__TYPEMEMBER | ( | Vector3 | , |
sofa::type::Vec3 | |||
) |
sofa::component::statecontainer::MechanicalObject< DataTypes >::SOFA_CLASS | ( | SOFA_TEMPLATE(MechanicalObject< DataTypes >, DataTypes) | , |
SOFA_TEMPLATE(sofa::core::behavior::MechanicalState, DataTypes) | |||
) |
|
overridevirtual |
Save the initial state for later uses in reset()
Reimplemented from sofa::core::objectmodel::BaseObject.
void sofa::component::statecontainer::MechanicalObject< DataTypes >::swapValues | ( | const sofa::Index | idx1, |
const sofa::Index | idx2 | ||
) |
Exchange values at indices idx1 and idx2.
|
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.
|
overridevirtual |
Allocate a new temporary vector.
Implements sofa::core::behavior::BaseMechanicalState.
|
protected |
Generic implementation of the method vAlloc.
|
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.
|
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.
|
protected |
Generic implementation of the method vAvail.
|
overridevirtual |
Compute the scalar products between two vectors.
Implements sofa::core::behavior::BaseMechanicalState.
|
overridevirtual |
Free a temporary vector.
Implements sofa::core::behavior::BaseMechanicalState.
|
overridevirtual |
Free a temporary vector.
Implements sofa::core::behavior::BaseMechanicalState.
|
protected |
Generic implementation of the method vFree.
|
overridevirtual |
Free a temporary vector.
Initialize an unset vector
Implements sofa::core::behavior::BaseMechanicalState.
|
overridevirtual |
Initialize an unset vector.
Implements sofa::core::behavior::BaseMechanicalState.
|
protected |
Generic implementation of the method vInit.
|
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.
|
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.
|
overridevirtual |
Initialize an unset vector.
Implements sofa::core::behavior::BaseMechanicalState.
|
overridevirtual |
Allocate a new temporary vector.
Reallocate a new temporary vector
Implements sofa::core::behavior::BaseMechanicalState.
|
overridevirtual |
Reallocate a new temporary vector.
Implements sofa::core::behavior::BaseMechanicalState.
|
protected |
Generic implementation of the method vRealloc.
|
overridevirtual |
Get vector size.
Implements sofa::core::behavior::BaseMechanicalState.
|
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.
|
overridevirtual |
Apply a threshold (lower bound) to all entries.
Implements sofa::core::behavior::BaseMechanicalState.
|
overridevirtual |
Implements sofa::core::State< DataTypes >.
|
overridevirtual |
Implements sofa::core::State< DataTypes >.
|
overridevirtual |
Implements sofa::core::State< DataTypes >.
|
overridevirtual |
Write current state to the given output stream.
Reimplemented from sofa::core::behavior::BaseMechanicalState.
|
overridevirtual |
Implements sofa::core::behavior::BaseMechanicalState.
|
friend |