SOFA API  b3f2f2a4
Open source framework for multi-physics simuation
sofa::simulation::mechanicalvisitor::MechanicalVReallocVisitor< vtype > Class Template Reference

#include <MechanicalVReallocVisitor.h>

Inheritance diagram for sofa::simulation::mechanicalvisitor::MechanicalVReallocVisitor< vtype >:

Detailed Description

template<sofa::core::VecType vtype>
class sofa::simulation::mechanicalvisitor::MechanicalVReallocVisitor< vtype >

Reserve an auxiliary vector identified by a symbolic constant.

Public Attributes

DestMultiVecIdv
 
bool m_propagate
 
bool m_interactionForceField
 
const core::VecIdPropertiesm_properties
 
- 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

 MechanicalVReallocVisitor (const sofa::core::ExecParams *params, DestMultiVecId *v, bool interactionForceField=false, bool propagate=false, const core::VecIdProperties &properties={})
 
bool stopAtMechanicalMapping (simulation::Node *, sofa::core::BaseMapping *) override
 
Result fwdMechanicalState (simulation::Node *node, sofa::core::behavior::BaseMechanicalState *mm) override
 Process the BaseMechanicalState if it is not mapped from the parent level. More...
 
Result fwdMappedMechanicalState (simulation::Node *node, sofa::core::behavior::BaseMechanicalState *mm) override
 Process the BaseMechanicalState if it is mapped from the parent level. More...
 
Result fwdInteractionForceField (simulation::Node *node, sofa::core::behavior::BaseInteractionForceField *ff) override
 Process all the InteractionForceField. More...
 
const chargetClassName () const override
 
std::string getInfos () const override
 
bool isThreadSafe () const override
 Specify whether this action can be parallelized. More...
 
- Public Member Functions inherited from sofa::simulation::BaseMechanicalVisitor
 BaseMechanicalVisitor (const sofa::core::ExecParams *params)
 
virtual bool readNodeData () const =delete
 
virtual bool writeNodeData () const =delete
 
virtual void setNodeData (simulation::Node *, SReal *, const SReal *)=delete
 
virtual void addNodeData (simulation::Node *, SReal *, const SReal *)=delete
 
const chargetCategoryName () 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...
 
virtual Result processNodeTopDown (simulation::Node *node, LocalStorage *stack) override=delete
 
virtual Result fwdOdeSolver (simulation::Node *, sofa::core::behavior::OdeSolver *)
 Process the OdeSolver. More...
 
virtual Result fwdOdeSolver (VisitorContext *ctx, sofa::core::behavior::OdeSolver *solver)
 Process the OdeSolver. More...
 
virtual Result fwdConstraintSolver (simulation::Node *, sofa::core::behavior::ConstraintSolver *)
 Process the ConstraintSolver. More...
 
virtual Result fwdConstraintSolver (VisitorContext *ctx, sofa::core::behavior::ConstraintSolver *solver)
 Process the ConstraintSolver. More...
 
virtual Result fwdMechanicalMapping (simulation::Node *, sofa::core::BaseMapping *)
 Process the BaseMechanicalMapping. More...
 
virtual Result fwdMechanicalMapping (VisitorContext *ctx, sofa::core::BaseMapping *map)
 Process the BaseMechanicalMapping. More...
 
virtual Result fwdMappedMechanicalState (VisitorContext *ctx, sofa::core::behavior::BaseMechanicalState *mm)
 Process the BaseMechanicalState if it is mapped from the parent level. More...
 
virtual Result fwdMechanicalState (VisitorContext *ctx, sofa::core::behavior::BaseMechanicalState *mm)
 Process the BaseMechanicalState if it is not mapped from the parent level. More...
 
virtual Result fwdMass (simulation::Node *, sofa::core::behavior::BaseMass *)
 Process the BaseMass. More...
 
virtual Result fwdMass (VisitorContext *ctx, sofa::core::behavior::BaseMass *mass)
 Process the BaseMass. More...
 
virtual Result fwdForceField (simulation::Node *, sofa::core::behavior::BaseForceField *)
 Process all the BaseForceField. More...
 
virtual Result fwdForceField (VisitorContext *ctx, sofa::core::behavior::BaseForceField *ff)
 Process all the BaseForceField. More...
 
virtual Result fwdInteractionForceField (VisitorContext *ctx, sofa::core::behavior::BaseInteractionForceField *ff)
 Process all the InteractionForceField. More...
 
virtual Result fwdProjectiveConstraintSet (simulation::Node *, sofa::core::behavior::BaseProjectiveConstraintSet *)
 Process all the BaseProjectiveConstraintSet. More...
 
virtual Result fwdConstraintSet (simulation::Node *, sofa::core::behavior::BaseConstraintSet *)
 Process all the BaseConstraintSet. More...
 
virtual Result fwdProjectiveConstraintSet (VisitorContext *ctx, sofa::core::behavior::BaseProjectiveConstraintSet *c)
 Process all the BaseProjectiveConstraintSet. More...
 
virtual Result fwdConstraintSet (VisitorContext *ctx, sofa::core::behavior::BaseConstraintSet *c)
 Process all the BaseConstraintSet. More...
 
virtual Result fwdInteractionProjectiveConstraintSet (simulation::Node *, sofa::core::behavior::BaseInteractionProjectiveConstraintSet *)
 Process all the InteractionConstraint. More...
 
virtual Result fwdInteractionConstraint (simulation::Node *, sofa::core::behavior::BaseInteractionConstraint *)
 Process all the InteractionConstraint. More...
 
virtual Result fwdInteractionProjectiveConstraintSet (VisitorContext *ctx, sofa::core::behavior::BaseInteractionProjectiveConstraintSet *c)
 Process all the InteractionConstraint. More...
 
virtual Result fwdInteractionConstraint (VisitorContext *ctx, sofa::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...
 
virtual void processNodeBottomUp (simulation::Node *node, LocalStorage *stack) override=delete
 
virtual void bwdMechanicalState (simulation::Node *, sofa::core::behavior::BaseMechanicalState *)
 Process the BaseMechanicalState when it is not mapped from parent level. More...
 
virtual void bwdMechanicalState (VisitorContext *ctx, sofa::core::behavior::BaseMechanicalState *mm)
 Process the BaseMechanicalState when it is not mapped from parent level. More...
 
virtual void bwdMappedMechanicalState (simulation::Node *, sofa::core::behavior::BaseMechanicalState *)
 Process the BaseMechanicalState when it is mapped from parent level. More...
 
virtual void bwdMappedMechanicalState (VisitorContext *ctx, sofa::core::behavior::BaseMechanicalState *mm)
 Process the BaseMechanicalState when it is mapped from parent level. More...
 
virtual void bwdMechanicalMapping (simulation::Node *, sofa::core::BaseMapping *)
 Process the BaseMechanicalMapping. More...
 
virtual void bwdMechanicalMapping (VisitorContext *ctx, sofa::core::BaseMapping *map)
 Process the BaseMechanicalMapping. More...
 
virtual void bwdOdeSolver (simulation::Node *, sofa::core::behavior::OdeSolver *)
 Process the OdeSolver. More...
 
virtual void bwdOdeSolver (VisitorContext *ctx, sofa::core::behavior::OdeSolver *solver)
 Process the OdeSolver. More...
 
virtual void bwdConstraintSolver (simulation::Node *, sofa::core::behavior::ConstraintSolver *)
 Process the ConstraintSolver. More...
 
virtual void bwdConstraintSolver (VisitorContext *ctx, sofa::core::behavior::ConstraintSolver *solver)
 Process the ConstraintSolver. More...
 
virtual void bwdProjectiveConstraintSet (simulation::Node *, sofa::core::behavior::BaseProjectiveConstraintSet *)
 Process all the BaseProjectiveConstraintSet. More...
 
virtual void bwdConstraintSet (simulation::Node *, sofa::core::behavior::BaseConstraintSet *)
 Process all the BaseConstraintSet. More...
 
virtual void bwdProjectiveConstraintSet (VisitorContext *ctx, sofa::core::behavior::BaseProjectiveConstraintSet *c)
 Process all the BaseProjectiveConstraintSet. More...
 
virtual void bwdConstraintSet (VisitorContext *ctx, sofa::core::behavior::BaseConstraintSet *c)
 Process all the BaseConstraintSet. More...
 
- Public Member Functions inherited from sofa::simulation::Visitor
 Visitor (const sofa::core::ExecParams *params)
 
virtual ~Visitor ()
 
const sofa::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)
 
bool testTags (sofa::core::objectmodel::BaseObject *obj)
 
virtual void execute (sofa::core::objectmodel::BaseContext *node, bool precomputedOrder=false)
 Alias for context->executeVisitor(this) More...
 
virtual ctime_t begin (simulation::Node *node, sofa::core::objectmodel::BaseObject *obj, const std::string &typeInfo=std::string("type"))
 
virtual void end (simulation::Node *node, sofa::core::objectmodel::BaseObject *obj, ctime_t t0)
 
virtual ctime_t begin (simulation::Visitor::VisitorContext *node, sofa::core::objectmodel::BaseObject *obj, const std::string &typeInfo=std::string("type"))
 
virtual void end (simulation::Visitor::VisitorContext *node, sofa::core::objectmodel::BaseObject *obj, ctime_t t0)
 
VisitorsetTags (const TagSet &t)
 
VisitoraddTag (Tag t)
 
VisitorremoveTag (Tag t)
 
template<class VisitorType , class VContext , class Container , typename PointedType >
void for_each (VisitorType *visitor, VContext *ctx, const Container &list, void(VisitorType::*task)(VContext *, PointedType *), const std::string &typeInfo)
 
template<class VisitorType , class VContext , class Container , typename PointedType >
Visitor::Result for_each (VisitorType *visitor, VContext *ctx, const Container &list, Visitor::Result(VisitorType::*task)(VContext *, PointedType *), const std::string &typeInfo)
 

Protected Member Functions

MyVecId getId (sofa::core::behavior::BaseMechanicalState *mm)
 
- Protected Member Functions inherited from sofa::simulation::BaseMechanicalVisitor
virtual Result processNodeTopDown (simulation::Node *node, VisitorContext *ctx)
 
virtual void processNodeBottomUp (simulation::Node *node, VisitorContext *ctx)
 
- Protected Member Functions inherited from sofa::simulation::Visitor
void debug_write_state_before (sofa::core::objectmodel::BaseObject *obj)
 
void debug_write_state_after (sofa::core::objectmodel::BaseObject *obj)
 
template<class VisitorType , class VContext , class ObjectType >
void runVisitorTask (VisitorType *visitor, VContext *ctx, void(VisitorType::*task)(VContext *, ObjectType *), ObjectType *ptr, const std::string &typeInfo=std::string("type"))
 
template<class VisitorType , class VContext , class ObjectType >
Result runVisitorTask (VisitorType *visitor, VContext *ctx, Result(VisitorType::*task)(VContext *, ObjectType *), ObjectType *ptr, const std::string &typeInfo=std::string("type"))
 
template<class Visit , class VContext , class Container , typename PointedType = typename Container::pointed_type>
void for_each (Visit *visitor, VContext *ctx, const Container &list, void(Visit::*task)(VContext *, PointedType *), const std::string &typeInfo=std::string("type"))
 
template<class Visit , class VContext , class Container , typename PointedType = typename Container::pointed_type>
Visitor::Result for_each (Visit *visitor, VContext *ctx, const Container &list, Visitor::Result(Visit::*task)(VContext *, PointedType *), const std::string &typeInfo=std::string("type"))
 

Additional Inherited Members

- Protected Attributes inherited from sofa::simulation::BaseMechanicalVisitor
simulation::Noderoot
 root node from which the visitor was executed More...
 
SReal * rootData { nullptr }
 data for root node More...
 
- Protected Attributes inherited from sofa::simulation::Visitor
const sofa::core::ExecParamsparams
 

Attribute details

◆ m_interactionForceField

template<sofa::core::VecType vtype>
bool sofa::simulation::mechanicalvisitor::MechanicalVReallocVisitor< vtype >::m_interactionForceField

◆ m_propagate

template<sofa::core::VecType vtype>
bool sofa::simulation::mechanicalvisitor::MechanicalVReallocVisitor< vtype >::m_propagate

◆ m_properties

template<sofa::core::VecType vtype>
const core::VecIdProperties& sofa::simulation::mechanicalvisitor::MechanicalVReallocVisitor< vtype >::m_properties

◆ v

template<sofa::core::VecType vtype>
DestMultiVecId* sofa::simulation::mechanicalvisitor::MechanicalVReallocVisitor< vtype >::v

Constructor details

◆ MechanicalVReallocVisitor()

template<sofa::core::VecType vtype>
sofa::simulation::mechanicalvisitor::MechanicalVReallocVisitor< vtype >::MechanicalVReallocVisitor ( const sofa::core::ExecParams params,
DestMultiVecId v,
bool  interactionForceField = false,
bool  propagate = false,
const core::VecIdProperties properties = {} 
)
inline

Default constructor

Parameters
voutput vector
propagatesets to true propagates vector initialization to mapped mechanical states
interactionForceFieldsets to true also initializes external mechanical states linked by an interaction force field

Function details

◆ fwdInteractionForceField()

template<sofa::core::VecType vtype>
Visitor::Result sofa::simulation::mechanicalvisitor::MechanicalVReallocVisitor< vtype >::fwdInteractionForceField ( simulation::Node node,
sofa::core::behavior::BaseInteractionForceField ff 
)
overridevirtual

Process all the InteractionForceField.

Reimplemented from sofa::simulation::BaseMechanicalVisitor.

◆ fwdMappedMechanicalState()

template<sofa::core::VecType vtype>
Visitor::Result sofa::simulation::mechanicalvisitor::MechanicalVReallocVisitor< vtype >::fwdMappedMechanicalState ( simulation::Node ,
sofa::core::behavior::BaseMechanicalState  
)
overridevirtual

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

Reimplemented from sofa::simulation::BaseMechanicalVisitor.

◆ fwdMechanicalState()

template<sofa::core::VecType vtype>
Visitor::Result sofa::simulation::mechanicalvisitor::MechanicalVReallocVisitor< vtype >::fwdMechanicalState ( simulation::Node ,
sofa::core::behavior::BaseMechanicalState  
)
overridevirtual

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

Reimplemented from sofa::simulation::BaseMechanicalVisitor.

◆ getClassName()

template<sofa::core::VecType vtype>
const char* sofa::simulation::mechanicalvisitor::MechanicalVReallocVisitor< vtype >::getClassName ( ) const
inlineoverridevirtual

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

Reimplemented from sofa::simulation::BaseMechanicalVisitor.

◆ getId()

◆ getInfos()

template<sofa::core::VecType vtype>
std::string sofa::simulation::mechanicalvisitor::MechanicalVReallocVisitor< vtype >::getInfos
overridevirtual

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

Reimplemented from sofa::simulation::Visitor.

◆ isThreadSafe()

template<sofa::core::VecType vtype>
bool sofa::simulation::mechanicalvisitor::MechanicalVReallocVisitor< vtype >::isThreadSafe ( ) const
inlineoverridevirtual

Specify whether this action can be parallelized.

Reimplemented from sofa::simulation::Visitor.

◆ stopAtMechanicalMapping()

template<sofa::core::VecType vtype>
bool sofa::simulation::mechanicalvisitor::MechanicalVReallocVisitor< vtype >::stopAtMechanicalMapping ( simulation::Node ,
sofa::core::BaseMapping  
)
inlineoverridevirtual