#include <BaseMechanicalState.h>


Integration related methods | |
| typedef helper::vector < std::pair< VecId, helper::vector< std::pair < VecId, double > > > > | VMultiOp |
| Data structure describing a set of linear operation on vectors. | |
| virtual void | beginIntegration (double) |
| Called at the beginning of each integration step. | |
| virtual void | endIntegration (double) |
| Called at the end of each iteration step. | |
| virtual void | resetForce ()=0 |
| Set F = 0. | |
| virtual void | resetConstraint ()=0 |
| Reset the constraint matrix. | |
| virtual void | accumulateForce () |
| Add stored external forces to F. | |
| virtual void | accumulateDf () |
| Add external forces derivatives to F. | |
| virtual void | applyTranslation (const double dx, const double dy, const double dz)=0 |
| Translate the current state. | |
| virtual void | applyRotation (const double, const double, const double) |
| Rotate the current state This method is optional, it is used when the user want to interactively change the position of an object using Euler angles. | |
| virtual void | applyRotation (const defaulttype::Quat q)=0 |
| Rotate the current state. | |
| virtual void | applyScale (const double s)=0 |
| Scale the current state. | |
| virtual void | writeX (std::ostream &out)=0 |
| virtual void | readX (std::istream &in)=0 |
| virtual double | compareX (std::istream &in)=0 |
| virtual void | writeV (std::ostream &out)=0 |
| virtual void | readV (std::istream &in)=0 |
| virtual double | compareV (std::istream &in)=0 |
| virtual bool | addBBox (double *, double *) |
| virtual void | vAvail (VecId &v)=0 |
| Increment the index of the given VecId, so that all 'allocated' vectors in this state have a lower index. | |
| virtual void | vAlloc (VecId v)=0 |
| Allocate a new temporary vector. | |
| virtual void | vFree (VecId v)=0 |
| Free a temporary vector. | |
| virtual void | vOp (VecId v, VecId a=VecId::null(), VecId b=VecId::null(), double f=1.0)=0 |
| Compute a linear operation on vectors : v = a + b * f. | |
| virtual void | vMultiOp (const VMultiOp &ops) |
| Perform a sequence of linear vector accumulation operation $r_i = sum_j (v_j*f_{ij})$. | |
| virtual double | vDot (VecId a, VecId b)=0 |
| Compute the scalar products between two vectors. | |
| virtual void | vThreshold (VecId a, double threshold)=0 |
| Apply a threshold to all entries. | |
| virtual void | setX (VecId v)=0 |
| Make the position vector point to the identified vector. | |
| virtual void | setXfree (VecId v)=0 |
| Make the free-motion position vector point to the identified vector. | |
| virtual void | setVfree (VecId v)=0 |
| Make the free-motion velocity vector point to the identified vector. | |
| virtual void | setV (VecId v)=0 |
| Make the velocity vector point to the identified vector. | |
| virtual void | setF (VecId v)=0 |
| Make the force vector point to the identified vector. | |
| virtual void | setDx (VecId v)=0 |
| Make the displacement vector point to the identified vector. | |
| virtual void | setC (VecId v)=0 |
| Make the holonomic constraint system matrix point to either holonomic Constraints or nonHolonomic Constraints. | |
| virtual void | getCompliance (double **) |
| new : get compliance on the constraints | |
| virtual void | applyContactForce (double *) |
| apply contact force AND compute the subsequent dX | |
| virtual void | resetContactForce (void) |
| virtual void | addDxToCollisionModel (void)=0 |
| virtual void | contributeToMatrixDimension (unsigned int *const, unsigned int *const)=0 |
| Add the Mechanical State Dimension [DOF number * DOF dimension] to the global matrix dimension. | |
| virtual void | loadInBaseVector (defaulttype::BaseVector *, VecId, unsigned int &)=0 |
| Load local mechanical data stored in the state in a global BaseVector basically stored in solvers. | |
| virtual void | addBaseVectorToState (VecId, defaulttype::BaseVector *, unsigned int &)=0 |
| Add data stored in a BaseVector to a local mechanical vector of the MechanicalState. | |
| virtual void | setOffset (unsigned int &)=0 |
| Update offset index during the subgraph traversal. | |
Data Structures | |
| class | VecId |
| Identify one vector stored in MechanicalState. More... | |
Public Member Functions | |
| BaseMechanicalState () | |
| virtual | ~BaseMechanicalState () |
| virtual void | resize (int vsize)=0 |
| Resize all stored vector. | |
| virtual int | getSize () const |
| functions that allows to have access to the geometry without a template class : not efficient | |
| virtual double | getPX (int) const |
| virtual double | getPY (int) const |
| virtual double | getPZ (int) const |
Data output | |
| virtual void | printDOF (VecId, std::ostream &=std::cerr)=0 |
| virtual void | initGnuplot (const std::string) |
| virtual void | exportGnuplot (double) |
| virtual unsigned | printDOFWithElapsedTime (VecId, unsigned=0, unsigned=0, std::ostream &=std::cerr) |
This class only contains the data of the body and not any of its active computations, which are handled by the Mass, ForceField, and Constraint components.
Two types of vectors are used :
VecCoord
VecDeriv
position
velocity
dx
In addition to state vectors, the current constraint system matrix is also stored, containing the coefficient of each constraint defined over the DOFs in this body.
Definition at line 79 of file BaseMechanicalState.h.
| typedef helper::vector< std::pair< VecId, helper::vector< std::pair< VecId, double > > > > sofa::core::componentmodel::behavior::BaseMechanicalState::VMultiOp |
Data structure describing a set of linear operation on vectors.
Reimplemented in sofa::component::MechanicalObject< DataTypes >, sofa::component::MechanicalObject< sofa::defaulttype::StdVectorTypes >, sofa::component::MechanicalObject< Rigid3Types >, and sofa::component::MechanicalObject< TDataTypes >.
Definition at line 201 of file BaseMechanicalState.h.
| sofa::core::componentmodel::behavior::BaseMechanicalState::BaseMechanicalState | ( | ) | [inline] |
Definition at line 82 of file BaseMechanicalState.h.
| virtual sofa::core::componentmodel::behavior::BaseMechanicalState::~BaseMechanicalState | ( | ) | [inline, virtual] |
Definition at line 84 of file BaseMechanicalState.h.
| virtual void sofa::core::componentmodel::behavior::BaseMechanicalState::accumulateDf | ( | ) | [inline, virtual] |
Add external forces derivatives to F.
Definition at line 115 of file BaseMechanicalState.h.
Referenced by sofa::simulation::MechanicalAddMBKdxVisitor::fwdMappedMechanicalState(), sofa::simulation::MechanicalComputeDfVisitor::fwdMappedMechanicalState(), sofa::simulation::MechanicalAddMBKdxVisitor::fwdMechanicalState(), and sofa::simulation::MechanicalComputeDfVisitor::fwdMechanicalState().
| virtual void sofa::core::componentmodel::behavior::BaseMechanicalState::accumulateForce | ( | ) | [inline, virtual] |
Add stored external forces to F.
Reimplemented in sofa::component::MechanicalObject< DataTypes >, sofa::component::MechanicalObject< sofa::defaulttype::StdVectorTypes >, sofa::component::MechanicalObject< Rigid3Types >, and sofa::component::MechanicalObject< TDataTypes >.
Definition at line 112 of file BaseMechanicalState.h.
Referenced by sofa::simulation::MechanicalComputeContactForceVisitor::fwdMappedMechanicalState(), sofa::simulation::MechanicalComputeForceVisitor::fwdMappedMechanicalState(), sofa::simulation::MechanicalComputeContactForceVisitor::fwdMechanicalState(), and sofa::simulation::MechanicalComputeForceVisitor::fwdMechanicalState().
| virtual void sofa::core::componentmodel::behavior::BaseMechanicalState::addBaseVectorToState | ( | VecId | , | |
| defaulttype::BaseVector * | , | |||
| unsigned int & | ||||
| ) | [pure virtual] |
Add data stored in a BaseVector to a local mechanical vector of the MechanicalState.
Implemented in sofa::component::MechanicalObject< DataTypes >, sofa::component::MechanicalObject< sofa::defaulttype::StdVectorTypes >, sofa::component::MechanicalObject< Rigid3Types >, and sofa::component::MechanicalObject< TDataTypes >.
Referenced by sofa::simulation::MechanicalMultiVectorPeqBaseVectorVisitor::fwdMechanicalState().
| virtual bool sofa::core::componentmodel::behavior::BaseMechanicalState::addBBox | ( | double * | , | |
| double * | ||||
| ) | [inline, virtual] |
Reimplemented in sofa::component::MechanicalObject< DataTypes >, sofa::component::MechanicalObject< sofa::defaulttype::StdVectorTypes >, sofa::component::MechanicalObject< Rigid3Types >, sofa::component::MechanicalObject< TDataTypes >, sofa::component::MechanicalObject< DataTypes >, sofa::component::MechanicalObject< DataTypes >, sofa::component::MechanicalObject< DataTypes >, and sofa::component::MechanicalObject< DataTypes >.
Definition at line 140 of file BaseMechanicalState.h.
Referenced by sofa::simulation::VisualComputeBBoxVisitor::processMechanicalState().
| virtual void sofa::core::componentmodel::behavior::BaseMechanicalState::addDxToCollisionModel | ( | void | ) | [pure virtual] |
Implemented in sofa::component::MechanicalObject< DataTypes >, sofa::component::MechanicalObject< sofa::defaulttype::StdVectorTypes >, sofa::component::MechanicalObject< Rigid3Types >, and sofa::component::MechanicalObject< TDataTypes >.
Referenced by sofa::simulation::MechanicalPropagateAndAddDxVisitor::fwdMappedMechanicalState().
| virtual void sofa::core::componentmodel::behavior::BaseMechanicalState::applyContactForce | ( | double * | ) | [inline, virtual] |
apply contact force AND compute the subsequent dX
Definition at line 292 of file BaseMechanicalState.h.
Referenced by sofa::component::odesolver::MechanicalApplyContactForceVisitor::fwdMappedMechanicalState(), and sofa::component::odesolver::MechanicalApplyContactForceVisitor::fwdMechanicalState().
| virtual void sofa::core::componentmodel::behavior::BaseMechanicalState::applyRotation | ( | const defaulttype::Quat | q | ) | [pure virtual] |
Rotate the current state.
Implemented in sofa::component::MechanicalObject< DataTypes >, sofa::component::MechanicalObject< sofa::defaulttype::StdVectorTypes >, sofa::component::MechanicalObject< Rigid3Types >, sofa::component::MechanicalObject< TDataTypes >, sofa::component::MechanicalObject< DataTypes >, sofa::component::MechanicalObject< DataTypes >, sofa::component::MechanicalObject< DataTypes >, and sofa::component::MechanicalObject< DataTypes >.
| virtual void sofa::core::componentmodel::behavior::BaseMechanicalState::applyRotation | ( | const | double, | |
| const | double, | |||
| const | double | |||
| ) | [inline, virtual] |
Rotate the current state This method is optional, it is used when the user want to interactively change the position of an object using Euler angles.
Reimplemented in sofa::component::MechanicalObject< DataTypes >, sofa::component::MechanicalObject< sofa::defaulttype::StdVectorTypes >, sofa::component::MechanicalObject< Rigid3Types >, and sofa::component::MechanicalObject< TDataTypes >.
Definition at line 123 of file BaseMechanicalState.h.
Referenced by sofa::simulation::TransformationVisitor::processMechanicalState().
| virtual void sofa::core::componentmodel::behavior::BaseMechanicalState::applyScale | ( | const double | s | ) | [pure virtual] |
Scale the current state.
Implemented in sofa::component::collision::TSphereModel< TDataTypes >, sofa::component::collision::SphereTreeModel, sofa::component::MechanicalObject< DataTypes >, sofa::component::MechanicalObject< sofa::defaulttype::StdVectorTypes >, sofa::component::MechanicalObject< Rigid3Types >, and sofa::component::MechanicalObject< TDataTypes >.
Referenced by sofa::simulation::TransformationVisitor::processMechanicalState().
| virtual void sofa::core::componentmodel::behavior::BaseMechanicalState::applyTranslation | ( | const double | dx, | |
| const double | dy, | |||
| const double | dz | |||
| ) | [pure virtual] |
Translate the current state.
Implemented in sofa::component::collision::RayModel, sofa::component::MechanicalObject< DataTypes >, sofa::component::MechanicalObject< sofa::defaulttype::StdVectorTypes >, sofa::component::MechanicalObject< Rigid3Types >, and sofa::component::MechanicalObject< TDataTypes >.
Referenced by sofa::simulation::TransformationVisitor::processMechanicalState().
| virtual void sofa::core::componentmodel::behavior::BaseMechanicalState::beginIntegration | ( | double | ) | [inline, virtual] |
Called at the beginning of each integration step.
Definition at line 100 of file BaseMechanicalState.h.
Referenced by sofa::simulation::MechanicalBeginIntegrationVisitor::fwdMappedMechanicalState(), and sofa::simulation::MechanicalBeginIntegrationVisitor::fwdMechanicalState().
| virtual double sofa::core::componentmodel::behavior::BaseMechanicalState::compareV | ( | std::istream & | in | ) | [pure virtual] |
Implemented in sofa::component::MechanicalObject< DataTypes >, sofa::component::MechanicalObject< sofa::defaulttype::StdVectorTypes >, sofa::component::MechanicalObject< Rigid3Types >, and sofa::component::MechanicalObject< TDataTypes >.
Referenced by sofa::component::misc::CompareState::processCompareState().
| virtual double sofa::core::componentmodel::behavior::BaseMechanicalState::compareX | ( | std::istream & | in | ) | [pure virtual] |
Implemented in sofa::component::MechanicalObject< DataTypes >, sofa::component::MechanicalObject< sofa::defaulttype::StdVectorTypes >, sofa::component::MechanicalObject< Rigid3Types >, and sofa::component::MechanicalObject< TDataTypes >.
Referenced by sofa::component::misc::CompareState::processCompareState().
| virtual void sofa::core::componentmodel::behavior::BaseMechanicalState::contributeToMatrixDimension | ( | unsigned int * | const, | |
| unsigned int * | const | |||
| ) | [pure virtual] |
Add the Mechanical State Dimension [DOF number * DOF dimension] to the global matrix dimension.
Implemented in sofa::component::MechanicalObject< DataTypes >, sofa::component::MechanicalObject< sofa::defaulttype::StdVectorTypes >, sofa::component::MechanicalObject< Rigid3Types >, and sofa::component::MechanicalObject< TDataTypes >.
Referenced by sofa::simulation::MechanicalGetMatrixDimensionVisitor::fwdMechanicalState().
| virtual void sofa::core::componentmodel::behavior::BaseMechanicalState::endIntegration | ( | double | ) | [inline, virtual] |
Called at the end of each iteration step.
Definition at line 103 of file BaseMechanicalState.h.
Referenced by sofa::simulation::MechanicalEndIntegrationVisitor::fwdMappedMechanicalState(), and sofa::simulation::MechanicalEndIntegrationVisitor::fwdMechanicalState().
| virtual void sofa::core::componentmodel::behavior::BaseMechanicalState::exportGnuplot | ( | double | ) | [inline, virtual] |
Definition at line 316 of file BaseMechanicalState.h.
| virtual void sofa::core::componentmodel::behavior::BaseMechanicalState::getCompliance | ( | double ** | ) | [inline, virtual] |
new : get compliance on the constraints
Definition at line 290 of file BaseMechanicalState.h.
Referenced by sofa::simulation::MechanicalComputeComplianceVisitor::fwdMappedMechanicalState(), and sofa::simulation::MechanicalComputeComplianceVisitor::fwdMechanicalState().
| virtual double sofa::core::componentmodel::behavior::BaseMechanicalState::getPX | ( | int | ) | const [inline, virtual] |
Reimplemented in sofa::component::MechanicalObject< DataTypes >, sofa::component::MechanicalObject< sofa::defaulttype::StdVectorTypes >, sofa::component::MechanicalObject< Rigid3Types >, and sofa::component::MechanicalObject< TDataTypes >.
Definition at line 92 of file BaseMechanicalState.h.
Referenced by sofa::component::visualmodel::VisualModelImpl::computeMesh().
| virtual double sofa::core::componentmodel::behavior::BaseMechanicalState::getPY | ( | int | ) | const [inline, virtual] |
Reimplemented in sofa::component::MechanicalObject< DataTypes >, sofa::component::MechanicalObject< sofa::defaulttype::StdVectorTypes >, sofa::component::MechanicalObject< Rigid3Types >, and sofa::component::MechanicalObject< TDataTypes >.
Definition at line 93 of file BaseMechanicalState.h.
Referenced by sofa::component::visualmodel::VisualModelImpl::computeMesh().
| virtual double sofa::core::componentmodel::behavior::BaseMechanicalState::getPZ | ( | int | ) | const [inline, virtual] |
Reimplemented in sofa::component::MechanicalObject< DataTypes >, sofa::component::MechanicalObject< sofa::defaulttype::StdVectorTypes >, sofa::component::MechanicalObject< Rigid3Types >, and sofa::component::MechanicalObject< TDataTypes >.
Definition at line 94 of file BaseMechanicalState.h.
Referenced by sofa::component::visualmodel::VisualModelImpl::computeMesh().
| virtual int sofa::core::componentmodel::behavior::BaseMechanicalState::getSize | ( | ) | const [inline, virtual] |
functions that allows to have access to the geometry without a template class : not efficient
Reimplemented in sofa::component::collision::TSphereModel< TDataTypes >, sofa::component::collision::SphereTreeModel, sofa::component::MechanicalObject< DataTypes >, sofa::component::MechanicalObject< sofa::defaulttype::StdVectorTypes >, sofa::component::MechanicalObject< Rigid3Types >, and sofa::component::MechanicalObject< TDataTypes >.
Definition at line 91 of file BaseMechanicalState.h.
Referenced by sofa::component::mass::UniformMass< DataTypes, MassType >::addMToMatrix(), sofa::component::mapping::ArticulatedSystemMapping< BasicMapping >::apply(), sofa::component::constraint::LinearSolverConstraintCorrection< TDataTypes >::applyContactForce(), sofa::component::visualmodel::VisualModelImpl::computeMesh(), sofa::component::constraint::LinearSolverConstraintCorrection< TDataTypes >::getCompliance(), sofa::component::ParticleSource< TDataTypes >::handleTopologyChange(), sofa::component::ParticleSink< TDataTypes >::handleTopologyChange(), sofa::component::forcefield::VectorSpringForceField< DataTypes >::init(), sofa::component::constraint::LinearSolverConstraintCorrection< TDataTypes >::init(), sofa::component::mass::DiagonalMass< DataTypes, MassType >::reinit(), sofa::component::forcefield::BeamFEMForceField< DataTypes >::reinit(), and sofa::component::forcefield::BeamFEMForceField< DataTypes >::reinitBeam().
| virtual void sofa::core::componentmodel::behavior::BaseMechanicalState::initGnuplot | ( | const std::string | ) | [inline, virtual] |
| virtual void sofa::core::componentmodel::behavior::BaseMechanicalState::loadInBaseVector | ( | defaulttype::BaseVector * | , | |
| VecId | , | |||
| unsigned int & | ||||
| ) | [pure virtual] |
Load local mechanical data stored in the state in a global BaseVector basically stored in solvers.
Implemented in sofa::component::MechanicalObject< DataTypes >, sofa::component::MechanicalObject< sofa::defaulttype::StdVectorTypes >, sofa::component::MechanicalObject< Rigid3Types >, and sofa::component::MechanicalObject< TDataTypes >.
Referenced by sofa::simulation::MechanicalMultiVector2BaseVectorVisitor::fwdMechanicalState().
| virtual void sofa::core::componentmodel::behavior::BaseMechanicalState::printDOF | ( | VecId | , | |
| std::ostream & | = std::cerr | |||
| ) | [pure virtual] |
| virtual unsigned sofa::core::componentmodel::behavior::BaseMechanicalState::printDOFWithElapsedTime | ( | VecId | , | |
| unsigned | = 0, |
|||
| unsigned | = 0, |
|||
| std::ostream & | = std::cerr | |||
| ) | [inline, virtual] |
| virtual void sofa::core::componentmodel::behavior::BaseMechanicalState::readV | ( | std::istream & | in | ) | [pure virtual] |
Implemented in sofa::component::MechanicalObject< DataTypes >, sofa::component::MechanicalObject< sofa::defaulttype::StdVectorTypes >, sofa::component::MechanicalObject< Rigid3Types >, and sofa::component::MechanicalObject< TDataTypes >.
Referenced by sofa::component::misc::ReadState::processReadState().
| virtual void sofa::core::componentmodel::behavior::BaseMechanicalState::readX | ( | std::istream & | in | ) | [pure virtual] |
Implemented in sofa::component::MechanicalObject< DataTypes >, sofa::component::MechanicalObject< sofa::defaulttype::StdVectorTypes >, sofa::component::MechanicalObject< Rigid3Types >, and sofa::component::MechanicalObject< TDataTypes >.
Referenced by sofa::component::misc::ReadState::processReadState().
| virtual void sofa::core::componentmodel::behavior::BaseMechanicalState::resetConstraint | ( | ) | [pure virtual] |
Reset the constraint matrix.
Implemented in sofa::component::MechanicalObject< DataTypes >, sofa::component::MechanicalObject< sofa::defaulttype::StdVectorTypes >, sofa::component::MechanicalObject< Rigid3Types >, and sofa::component::MechanicalObject< TDataTypes >.
Referenced by sofa::simulation::MechanicalResetConstraintVisitor::fwdMappedMechanicalState(), and sofa::simulation::MechanicalResetConstraintVisitor::fwdMechanicalState().
| virtual void sofa::core::componentmodel::behavior::BaseMechanicalState::resetContactForce | ( | void | ) | [inline, virtual] |
Definition at line 294 of file BaseMechanicalState.h.
Referenced by sofa::component::odesolver::MechanicalResetContactForceVisitor::fwdMechanicalState().
| virtual void sofa::core::componentmodel::behavior::BaseMechanicalState::resetForce | ( | ) | [pure virtual] |
Set F = 0.
Implemented in sofa::component::MechanicalObject< DataTypes >, sofa::component::MechanicalObject< sofa::defaulttype::StdVectorTypes >, sofa::component::MechanicalObject< Rigid3Types >, and sofa::component::MechanicalObject< TDataTypes >.
Referenced by sofa::simulation::MechanicalAddMDxVisitor::fwdMappedMechanicalState(), sofa::simulation::MechanicalResetForceVisitor::fwdMappedMechanicalState(), sofa::simulation::MechanicalPropagateDxAndResetForceVisitor::fwdMappedMechanicalState(), sofa::component::odesolver::MechanicalResetContactForceVisitor::fwdMappedMechanicalState(), sofa::simulation::MechanicalResetForceVisitor::fwdMechanicalState(), and sofa::simulation::MechanicalPropagateDxAndResetForceVisitor::fwdMechanicalState().
| virtual void sofa::core::componentmodel::behavior::BaseMechanicalState::resize | ( | int | vsize | ) | [pure virtual] |
Resize all stored vector.
Implemented in sofa::component::collision::RayModel, sofa::component::collision::TSphereModel< TDataTypes >, sofa::component::collision::SphereTreeModel, sofa::component::MechanicalObject< DataTypes >, sofa::component::MechanicalObject< sofa::defaulttype::StdVectorTypes >, sofa::component::MechanicalObject< Rigid3Types >, and sofa::component::MechanicalObject< TDataTypes >.
Referenced by sofa::component::collision::SubsetContactMapper< sofa::component::collision::TSphereModel, DataTypes >::addPoint(), sofa::component::collision::RigidContactMapper< sofa::gpu::cuda::CudaRigidDistanceGridCollisionModel, DataTypes >::addPoint(), sofa::component::ParticleSource< TDataTypes >::animateBegin(), sofa::component::ParticleSink< TDataTypes >::animateBegin(), sofa::filemanager::pml::PMLStiffSpringForceField::createMechanicalState(), sofa::filemanager::pml::PMLMappedBody::createMechanicalState(), sofa::filemanager::pml::PMLFemForceField::createMechanicalState(), sofa::filemanager::pml::PMLRigidBody::createVisualModel(), SofaFlowVR::FlowVRInputMesh::flowvrBeginIteration(), sofa::filemanager::pml::PMLStiffSpringForceField::FusionBody(), sofa::filemanager::pml::PMLFemForceField::FusionBody(), sofa::component::ParticleSource< TDataTypes >::reset(), sofa::component::collision::SubsetContactMapper< sofa::component::collision::TSphereModel, DataTypes >::resize(), and sofa::component::collision::RigidContactMapper< sofa::gpu::cuda::CudaRigidDistanceGridCollisionModel, DataTypes >::resize().
| virtual void sofa::core::componentmodel::behavior::BaseMechanicalState::setC | ( | VecId | v | ) | [pure virtual] |
Make the holonomic constraint system matrix point to either holonomic Constraints or nonHolonomic Constraints.
To reset it to the default storage or to make it point to holonomicConstraints use
To make it point to nonNolonomicConstraints usesetC(VecId::NonHolonomicC())
Implemented in sofa::component::MechanicalObject< DataTypes >, sofa::component::MechanicalObject< sofa::defaulttype::StdVectorTypes >, sofa::component::MechanicalObject< Rigid3Types >, and sofa::component::MechanicalObject< TDataTypes >.
| virtual void sofa::core::componentmodel::behavior::BaseMechanicalState::setDx | ( | VecId | v | ) | [pure virtual] |
Make the displacement vector point to the identified vector.
To reset it to the default storage use
Implemented in sofa::component::MechanicalObject< DataTypes >, sofa::component::MechanicalObject< sofa::defaulttype::StdVectorTypes >, sofa::component::MechanicalObject< Rigid3Types >, and sofa::component::MechanicalObject< TDataTypes >.
Referenced by sofa::component::constraint::LinearSolverConstraintCorrection< TDataTypes >::applyContactForce(), sofa::simulation::MechanicalApplyConstraintsVisitor::fwdMechanicalState(), sofa::simulation::MechanicalAccFromFVisitor::fwdMechanicalState(), sofa::simulation::MechanicalAddMDxVisitor::fwdMechanicalState(), sofa::simulation::MechanicalPropagateDxAndResetForceVisitor::fwdMechanicalState(), and sofa::simulation::MechanicalPropagateDxVisitor::fwdMechanicalState().
| virtual void sofa::core::componentmodel::behavior::BaseMechanicalState::setF | ( | VecId | v | ) | [pure virtual] |
Make the force vector point to the identified vector.
To reset it to the default storage use
setF(VecId::force())
Implemented in sofa::component::MechanicalObject< DataTypes >, sofa::component::MechanicalObject< sofa::defaulttype::StdVectorTypes >, sofa::component::MechanicalObject< Rigid3Types >, and sofa::component::MechanicalObject< TDataTypes >.
Referenced by sofa::simulation::MechanicalComputeContactForceVisitor::fwdMechanicalState(), sofa::simulation::MechanicalAddMBKdxVisitor::fwdMechanicalState(), sofa::simulation::MechanicalComputeDfVisitor::fwdMechanicalState(), sofa::simulation::MechanicalComputeForceVisitor::fwdMechanicalState(), sofa::simulation::MechanicalResetForceVisitor::fwdMechanicalState(), sofa::simulation::MechanicalAccFromFVisitor::fwdMechanicalState(), sofa::simulation::MechanicalAddMDxVisitor::fwdMechanicalState(), and sofa::simulation::MechanicalPropagateDxAndResetForceVisitor::fwdMechanicalState().
| virtual void sofa::core::componentmodel::behavior::BaseMechanicalState::setOffset | ( | unsigned int & | ) | [pure virtual] |
Update offset index during the subgraph traversal.
Implemented in sofa::component::MechanicalObject< DataTypes >, sofa::component::MechanicalObject< sofa::defaulttype::StdVectorTypes >, sofa::component::MechanicalObject< Rigid3Types >, and sofa::component::MechanicalObject< TDataTypes >.
Referenced by sofa::simulation::MechanicalAddMBK_ToMatrixVisitor::fwdMechanicalState().
| virtual void sofa::core::componentmodel::behavior::BaseMechanicalState::setV | ( | VecId | v | ) | [pure virtual] |
Make the velocity vector point to the identified vector.
To reset it to the default storage use
Implemented in sofa::component::MechanicalObject< DataTypes >, sofa::component::MechanicalObject< sofa::defaulttype::StdVectorTypes >, sofa::component::MechanicalObject< Rigid3Types >, and sofa::component::MechanicalObject< TDataTypes >.
Referenced by sofa::simulation::MechanicalPropagatePositionAndVelocityVisitor::fwdMechanicalState().
| virtual void sofa::core::componentmodel::behavior::BaseMechanicalState::setVfree | ( | VecId | v | ) | [pure virtual] |
Make the free-motion velocity vector point to the identified vector.
To reset it to the default storage use
Implemented in sofa::component::MechanicalObject< DataTypes >, sofa::component::MechanicalObject< sofa::defaulttype::StdVectorTypes >, sofa::component::MechanicalObject< Rigid3Types >, and sofa::component::MechanicalObject< TDataTypes >.
Referenced by sofa::simulation::MechanicalPropagateFreePositionVisitor::fwdMechanicalState().
| virtual void sofa::core::componentmodel::behavior::BaseMechanicalState::setX | ( | VecId | v | ) | [pure virtual] |
Make the position vector point to the identified vector.
To reset it to the default storage use
Implemented in sofa::component::MechanicalObject< DataTypes >, sofa::component::MechanicalObject< sofa::defaulttype::StdVectorTypes >, sofa::component::MechanicalObject< Rigid3Types >, and sofa::component::MechanicalObject< TDataTypes >.
Referenced by sofa::simulation::MechanicalPropagatePositionAndVelocityVisitor::fwdMechanicalState().
| virtual void sofa::core::componentmodel::behavior::BaseMechanicalState::setXfree | ( | VecId | v | ) | [pure virtual] |
Make the free-motion position vector point to the identified vector.
To reset it to the default storage use
Implemented in sofa::component::MechanicalObject< DataTypes >, sofa::component::MechanicalObject< sofa::defaulttype::StdVectorTypes >, sofa::component::MechanicalObject< Rigid3Types >, and sofa::component::MechanicalObject< TDataTypes >.
Referenced by sofa::simulation::MechanicalPropagateFreePositionVisitor::fwdMechanicalState().
| virtual void sofa::core::componentmodel::behavior::BaseMechanicalState::vAlloc | ( | VecId | v | ) | [pure virtual] |
Allocate a new temporary vector.
Implemented in sofa::component::MechanicalObject< DataTypes >, sofa::component::MechanicalObject< sofa::defaulttype::StdVectorTypes >, sofa::component::MechanicalObject< Rigid3Types >, and sofa::component::MechanicalObject< TDataTypes >.
Referenced by sofa::core::componentmodel::behavior::PairInteractionForceField< TDataTypes >::addDForce(), sofa::component::constraint::LinearSolverConstraintCorrection< TDataTypes >::applyContactForce(), and sofa::simulation::MechanicalVAllocVisitor::fwdMechanicalState().
| virtual void sofa::core::componentmodel::behavior::BaseMechanicalState::vAvail | ( | VecId & | v | ) | [pure virtual] |
Increment the index of the given VecId, so that all 'allocated' vectors in this state have a lower index.
Implemented in sofa::component::MechanicalObject< DataTypes >, sofa::component::MechanicalObject< sofa::defaulttype::StdVectorTypes >, sofa::component::MechanicalObject< Rigid3Types >, and sofa::component::MechanicalObject< TDataTypes >.
Referenced by sofa::core::componentmodel::behavior::PairInteractionForceField< TDataTypes >::addDForce(), and sofa::simulation::MechanicalVAvailVisitor::fwdMechanicalState().
| virtual double sofa::core::componentmodel::behavior::BaseMechanicalState::vDot | ( | VecId | a, | |
| VecId | b | |||
| ) | [pure virtual] |
Compute the scalar products between two vectors.
Implemented in sofa::component::MechanicalObject< DataTypes >, sofa::component::MechanicalObject< sofa::defaulttype::StdVectorTypes >, sofa::component::MechanicalObject< Rigid3Types >, and sofa::component::MechanicalObject< TDataTypes >.
Referenced by sofa::simulation::MechanicalVDotVisitor::fwdMechanicalState(), and sofa::simulation::MechanicalVDotVisitor::processNodeTopDown().
| virtual void sofa::core::componentmodel::behavior::BaseMechanicalState::vFree | ( | VecId | v | ) | [pure virtual] |
Free a temporary vector.
Implemented in sofa::component::MechanicalObject< DataTypes >, sofa::component::MechanicalObject< sofa::defaulttype::StdVectorTypes >, sofa::component::MechanicalObject< Rigid3Types >, and sofa::component::MechanicalObject< TDataTypes >.
Referenced by sofa::core::componentmodel::behavior::PairInteractionForceField< TDataTypes >::addDForce(), sofa::component::constraint::LinearSolverConstraintCorrection< TDataTypes >::applyContactForce(), and sofa::simulation::MechanicalVFreeVisitor::fwdMechanicalState().
| virtual void sofa::core::componentmodel::behavior::BaseMechanicalState::vMultiOp | ( | const VMultiOp & | ops | ) | [inline, virtual] |
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 in sofa::component::MechanicalObject< DataTypes >, sofa::component::MechanicalObject< sofa::defaulttype::StdVectorTypes >, sofa::component::MechanicalObject< Rigid3Types >, and sofa::component::MechanicalObject< TDataTypes >.
Definition at line 208 of file BaseMechanicalState.h.
References sofa::core::componentmodel::behavior::BaseMechanicalState::VecId::null(), and vOp().
Referenced by sofa::simulation::MechanicalVMultiOpVisitor::fwdMechanicalState(), and sofa::component::MechanicalObject< DataTypes >::vMultiOp().
| virtual void sofa::core::componentmodel::behavior::BaseMechanicalState::vOp | ( | VecId | v, | |
| VecId | a = VecId::null(), |
|||
| VecId | b = VecId::null(), |
|||
| double | f = 1.0 | |||
| ) | [pure virtual] |
Compute a linear operation on vectors : v = a + b * f.
This generic operation can be used for many simpler cases :
Implemented in sofa::component::MechanicalObject< DataTypes >, sofa::component::MechanicalObject< sofa::defaulttype::StdVectorTypes >, sofa::component::MechanicalObject< Rigid3Types >, and sofa::component::MechanicalObject< TDataTypes >.
Referenced by sofa::core::componentmodel::behavior::PairInteractionForceField< TDataTypes >::addDForce(), sofa::component::constraint::LinearSolverConstraintCorrection< TDataTypes >::applyContactForce(), sofa::simulation::MechanicalVOpVisitor::fwdMechanicalState(), and vMultiOp().
| virtual void sofa::core::componentmodel::behavior::BaseMechanicalState::vThreshold | ( | VecId | a, | |
| double | threshold | |||
| ) | [pure virtual] |
Apply a threshold to all entries.
Implemented in sofa::component::MechanicalObject< DataTypes >, sofa::component::MechanicalObject< sofa::defaulttype::StdVectorTypes >, sofa::component::MechanicalObject< Rigid3Types >, and sofa::component::MechanicalObject< TDataTypes >.
| virtual void sofa::core::componentmodel::behavior::BaseMechanicalState::writeV | ( | std::ostream & | out | ) | [pure virtual] |
Implemented in sofa::component::MechanicalObject< DataTypes >, sofa::component::MechanicalObject< sofa::defaulttype::StdVectorTypes >, sofa::component::MechanicalObject< Rigid3Types >, and sofa::component::MechanicalObject< TDataTypes >.
Referenced by sofa::component::misc::WriteState::handleEvent().
| virtual void sofa::core::componentmodel::behavior::BaseMechanicalState::writeX | ( | std::ostream & | out | ) | [pure virtual] |
Implemented in sofa::component::MechanicalObject< DataTypes >, sofa::component::MechanicalObject< sofa::defaulttype::StdVectorTypes >, sofa::component::MechanicalObject< Rigid3Types >, and sofa::component::MechanicalObject< TDataTypes >.
Referenced by sofa::component::misc::WriteState::handleEvent().
1.5.7.1