SOFA API  6a688117
Open source framework for multi-physics simuation
sofa::simulation::MechanicalPropagateOnlyPositionAndVelocityVisitor Class Reference

#include <MechanicalVisitor.h>

Inheritance diagram for sofa::simulation::MechanicalPropagateOnlyPositionAndVelocityVisitor:

Detailed Description

Propagate positions and velocities to all the levels of the hierarchy. At each level, the mappings form the parent to the child is applied. After the execution of this action, all the (mapped) degrees of freedom are consistent with the independent degrees of freedom. This action is typically applied after time integration of the independent degrees of freedom.

Note that this visitor only propagate through the mappings, and does not apply projective constraints as was previously done by MechanicalPropagatePositionAndVelocityVisitor. Use MechanicalProjectPositionAndVelocityVisitor before this visitor if projection is needed.

Public Attributes

SReal currentTime
 
sofa::core::MultiVecCoordId x
 
sofa::core::MultiVecDerivId v
 
bool ignoreMask
 
- Public Attributes inherited from sofa::simulation::Visitor
TagSet subsetsToManage
 list of the subsets More...
 
bool canAccessSleepingNode
 Can the visitor access sleeping nodes? More...
 

Public Member Functions

 MechanicalPropagateOnlyPositionAndVelocityVisitor (const sofa::core::MechanicalParams *mparams, SReal time=0, sofa::core::MultiVecCoordId x=sofa::core::VecId::position(), sofa::core::MultiVecDerivId v=sofa::core::VecId::velocity(), bool m=true)
 
Result fwdMechanicalState (simulation::Node *, core::behavior::BaseMechanicalState *mm) override
 Process the BaseMechanicalState if it is not mapped from the parent level. More...
 
Result fwdMechanicalMapping (simulation::Node *, core::BaseMapping *map) override
 Process the BaseMechanicalMapping. More...
 
void bwdMechanicalState (simulation::Node *, core::behavior::BaseMechanicalState *mm) override
 Process the BaseMechanicalState when it is not mapped from parent level. More...
 
bool stopAtMechanicalMapping (simulation::Node *, core::BaseMapping *) override
 
const char * getClassName () const override
 
virtual std::string getInfos () const override
 
bool isThreadSafe () const override
 Specify whether this action can be parallelized. More...
 
- Public Member Functions inherited from sofa::simulation::MechanicalVisitor
 MechanicalVisitor (const core::MechanicalParams *m_mparams)
 
- Public Member Functions inherited from sofa::simulation::BaseMechanicalVisitor
 BaseMechanicalVisitor (const core::ExecParams *params)
 
virtual bool readNodeData () const
 Return true if this visitor need to read the node-specific data if given. More...
 
virtual bool writeNodeData () const
 Return true if this visitor need to write to the node-specific data if given. More...
 
virtual void setNodeData (simulation::Node *, SReal *nodeData, const SReal *parentData)
 
virtual void addNodeData (simulation::Node *, SReal *parentData, const SReal *nodeData)
 
const char * getCategoryName () const override
 
Result processNodeTopDown (simulation::Node *node) override
 This method calls the fwd* methods during the forward traversal. You typically do not overload it. More...
 
Result processNodeTopDown (simulation::Node *node, LocalStorage *stack) override
 
virtual Result fwdOdeSolver (simulation::Node *, core::behavior::OdeSolver *)
 Process the OdeSolver. More...
 
virtual Result fwdOdeSolver (VisitorContext *ctx, core::behavior::OdeSolver *solver)
 Process the OdeSolver. More...
 
virtual Result fwdConstraintSolver (simulation::Node *, core::behavior::ConstraintSolver *)
 Process the ConstraintSolver. More...
 
virtual Result fwdConstraintSolver (VisitorContext *ctx, core::behavior::ConstraintSolver *solver)
 Process the ConstraintSolver. More...
 
virtual Result fwdMechanicalMapping (VisitorContext *ctx, core::BaseMapping *map)
 Process the BaseMechanicalMapping. More...
 
virtual Result fwdMappedMechanicalState (simulation::Node *, core::behavior::BaseMechanicalState *)
 Process the BaseMechanicalState if it is mapped from the parent level. More...
 
virtual Result fwdMappedMechanicalState (VisitorContext *ctx, core::behavior::BaseMechanicalState *mm)
 Process the BaseMechanicalState if it is mapped from the parent level. More...
 
virtual Result fwdMechanicalState (VisitorContext *ctx, core::behavior::BaseMechanicalState *mm)
 Process the BaseMechanicalState if it is not mapped from the parent level. More...
 
virtual Result fwdMass (simulation::Node *, core::behavior::BaseMass *)
 Process the BaseMass. More...
 
virtual Result fwdMass (VisitorContext *ctx, core::behavior::BaseMass *mass)
 Process the BaseMass. More...
 
virtual Result fwdForceField (simulation::Node *, core::behavior::BaseForceField *)
 Process all the BaseForceField. More...
 
virtual Result fwdForceField (VisitorContext *ctx, core::behavior::BaseForceField *ff)
 Process all the BaseForceField. More...
 
virtual Result fwdInteractionForceField (simulation::Node *node, core::behavior::BaseInteractionForceField *ff)
 Process all the InteractionForceField. More...
 
virtual Result fwdInteractionForceField (VisitorContext *ctx, core::behavior::BaseInteractionForceField *ff)
 Process all the InteractionForceField. More...
 
virtual Result fwdProjectiveConstraintSet (simulation::Node *, core::behavior::BaseProjectiveConstraintSet *)
 Process all the BaseProjectiveConstraintSet. More...
 
virtual Result fwdConstraintSet (simulation::Node *, core::behavior::BaseConstraintSet *)
 Process all the BaseConstraintSet. More...
 
virtual Result fwdProjectiveConstraintSet (VisitorContext *ctx, core::behavior::BaseProjectiveConstraintSet *c)
 Process all the BaseProjectiveConstraintSet. More...
 
virtual Result fwdConstraintSet (VisitorContext *ctx, core::behavior::BaseConstraintSet *c)
 Process all the BaseConstraintSet. More...
 
virtual Result fwdInteractionProjectiveConstraintSet (simulation::Node *, core::behavior::BaseInteractionProjectiveConstraintSet *)
 Process all the InteractionConstraint. More...
 
virtual Result fwdInteractionConstraint (simulation::Node *, core::behavior::BaseInteractionConstraint *)
 Process all the InteractionConstraint. More...
 
virtual Result fwdInteractionProjectiveConstraintSet (VisitorContext *ctx, core::behavior::BaseInteractionProjectiveConstraintSet *c)
 Process all the InteractionConstraint. More...
 
virtual Result fwdInteractionConstraint (VisitorContext *ctx, core::behavior::BaseInteractionConstraint *c)
 Process all the InteractionConstraint. More...
 
void processNodeBottomUp (simulation::Node *node) override
 This method calls the bwd* methods during the backward traversal. You typically do not overload it. More...
 
void processNodeBottomUp (simulation::Node *, LocalStorage *stack) override
 
virtual void bwdMechanicalState (VisitorContext *ctx, core::behavior::BaseMechanicalState *mm)
 Process the BaseMechanicalState when it is not mapped from parent level. More...
 
virtual void bwdMappedMechanicalState (simulation::Node *, core::behavior::BaseMechanicalState *)
 Process the BaseMechanicalState when it is mapped from parent level. More...
 
virtual void bwdMappedMechanicalState (VisitorContext *ctx, core::behavior::BaseMechanicalState *mm)
 Process the BaseMechanicalState when it is mapped from parent level. More...
 
virtual void bwdMechanicalMapping (simulation::Node *, core::BaseMapping *)
 Process the BaseMechanicalMapping. More...
 
virtual void bwdMechanicalMapping (VisitorContext *ctx, core::BaseMapping *map)
 Process the BaseMechanicalMapping. More...
 
virtual void bwdOdeSolver (simulation::Node *, core::behavior::OdeSolver *)
 Process the OdeSolver. More...
 
virtual void bwdOdeSolver (VisitorContext *ctx, core::behavior::OdeSolver *solver)
 Process the OdeSolver. More...
 
virtual void bwdConstraintSolver (simulation::Node *, core::behavior::ConstraintSolver *)
 Process the ConstraintSolver. More...
 
virtual void bwdConstraintSolver (VisitorContext *ctx, core::behavior::ConstraintSolver *solver)
 Process the ConstraintSolver. More...
 
virtual void bwdProjectiveConstraintSet (simulation::Node *, core::behavior::BaseProjectiveConstraintSet *)
 Process all the BaseProjectiveConstraintSet. More...
 
virtual void bwdConstraintSet (simulation::Node *, core::behavior::BaseConstraintSet *)
 Process all the BaseConstraintSet. More...
 
virtual void bwdProjectiveConstraintSet (VisitorContext *ctx, core::behavior::BaseProjectiveConstraintSet *c)
 Process all the BaseProjectiveConstraintSet. More...
 
virtual void bwdConstraintSet (VisitorContext *ctx, core::behavior::BaseConstraintSet *c)
 Process all the BaseConstraintSet. More...
 
- Public Member Functions inherited from sofa::simulation::Visitor
 Visitor (const core::ExecParams *params)
 
virtual ~Visitor ()
 
const core::ExecParamsexecParams () const
 
virtual bool childOrderReversed (simulation::Node *)
 Return true to reverse the order of traversal of child nodes. More...
 
virtual bool treeTraversal (TreeTraversalRepetition &repeat)
 
void debug_write_state_before (core::objectmodel::BaseObject *)
 
void debug_write_state_after (core::objectmodel::BaseObject *)
 
template<class Visit , class VContext , class Container , class Object >
void for_each (Visit *visitor, VContext *ctx, const Container &list, void(Visit::*fn)(VContext *, Object *))
 Helper method to enumerate objects in the given list. The callback gets the pointer to node. More...
 
template<class Visit , class VContext , class Container , class Object >
Visitor::Result for_each_r (Visit *visitor, VContext *ctx, const Container &list, Visitor::Result(Visit::*fn)(VContext *, Object *))
 Helper method to enumerate objects in the given list. The callback gets the pointer to node. More...
 
bool testTags (core::objectmodel::BaseObject *obj)
 
virtual void execute (core::objectmodel::BaseContext *node, bool precomputedOrder=false)
 Alias for context->executeVisitor(this) More...
 
virtual ctime_t begin (simulation::Node *node, core::objectmodel::BaseObject *obj, const std::string &typeInfo=std::string("type"))
 
virtual void end (simulation::Node *node, core::objectmodel::BaseObject *obj, ctime_t t0)
 
ctime_t begin (simulation::Visitor::VisitorContext *node, core::objectmodel::BaseObject *obj, const std::string &typeInfo=std::string("type"))
 
void end (simulation::Visitor::VisitorContext *node, core::objectmodel::BaseObject *obj, ctime_t t0)
 
VisitorsetTags (const TagSet &t)
 
VisitoraddTag (Tag t)
 
VisitorremoveTag (Tag t)
 

Additional Inherited Members

- Protected Attributes inherited from sofa::simulation::MechanicalVisitor
const core::MechanicalParamsmparams
 
- Protected Attributes inherited from sofa::simulation::BaseMechanicalVisitor
simulation::Noderoot
 root node from which the visitor was executed More...
 
SReal * rootData
 data for root node More...
 
- Protected Attributes inherited from sofa::simulation::Visitor
const core::ExecParamsparams
 
- Static Public Member Functions inherited from sofa::simulation::BaseMechanicalVisitor
static void ForceMaskActivate (const helper::vector< core::behavior::BaseMechanicalState * > &v)
 
static void ForceMaskDeactivate (const helper::vector< core::behavior::BaseMechanicalState * > &v)
 
- Protected Member Functions inherited from sofa::simulation::BaseMechanicalVisitor
virtual Result processNodeTopDown (simulation::Node *node, VisitorContext *ctx)
 
virtual void processNodeBottomUp (simulation::Node *node, VisitorContext *ctx)
 

Attribute details

SReal sofa::simulation::MechanicalPropagateOnlyPositionAndVelocityVisitor::currentTime
bool sofa::simulation::MechanicalPropagateOnlyPositionAndVelocityVisitor::ignoreMask
sofa::core::MultiVecDerivId sofa::simulation::MechanicalPropagateOnlyPositionAndVelocityVisitor::v
sofa::core::MultiVecCoordId sofa::simulation::MechanicalPropagateOnlyPositionAndVelocityVisitor::x

Constructor details

sofa::simulation::MechanicalPropagateOnlyPositionAndVelocityVisitor::MechanicalPropagateOnlyPositionAndVelocityVisitor ( const sofa::core::MechanicalParams mparams,
SReal  time = 0,
sofa::core::MultiVecCoordId  x = sofa::core::VecId::position(),
sofa::core::MultiVecDerivId  v = sofa::core::VecId::velocity(),
bool  m = true 
)

Function details

void sofa::simulation::MechanicalPropagateOnlyPositionAndVelocityVisitor::bwdMechanicalState ( simulation::Node ,
core::behavior::BaseMechanicalState  
)
overridevirtual

Process the BaseMechanicalState when it is not mapped from parent level.

Reimplemented from sofa::simulation::BaseMechanicalVisitor.

Visitor::Result sofa::simulation::MechanicalPropagateOnlyPositionAndVelocityVisitor::fwdMechanicalMapping ( simulation::Node ,
core::BaseMapping  
)
overridevirtual

Process the BaseMechanicalMapping.

Reimplemented from sofa::simulation::BaseMechanicalVisitor.

Visitor::Result sofa::simulation::MechanicalPropagateOnlyPositionAndVelocityVisitor::fwdMechanicalState ( simulation::Node ,
core::behavior::BaseMechanicalState  
)
overridevirtual

Process the BaseMechanicalState if it is not mapped from the parent level.

Reimplemented from sofa::simulation::BaseMechanicalVisitor.

const char* sofa::simulation::MechanicalPropagateOnlyPositionAndVelocityVisitor::getClassName ( ) const
inlineoverridevirtual

Return a class name for this visitor Only used for debugging / profiling purposes

Reimplemented from sofa::simulation::BaseMechanicalVisitor.

virtual std::string sofa::simulation::MechanicalPropagateOnlyPositionAndVelocityVisitor::getInfos ( ) const
inlineoverridevirtual

Return eventual information on the behavior of the visitor Only used for debugging / profiling purposes

Reimplemented from sofa::simulation::Visitor.

bool sofa::simulation::MechanicalPropagateOnlyPositionAndVelocityVisitor::isThreadSafe ( ) const
inlineoverridevirtual

Specify whether this action can be parallelized.

Reimplemented from sofa::simulation::Visitor.

bool sofa::simulation::MechanicalPropagateOnlyPositionAndVelocityVisitor::stopAtMechanicalMapping ( simulation::Node ,
core::BaseMapping  
)
inlineoverridevirtual