#include <SolveVisitor.h>
Used by the animation loop: send the solve signal to the others solvers This visitor is able to run the solvers sequentially or concurrently.
Protected Attributes | |
SReal | dt |
sofa::core::MultiVecCoordId | x |
sofa::core::MultiVecDerivId | v |
bool | m_parallelSolve {false } |
bool | m_computeForceIsolatedInteractionForceFields { false } |
std::list< SolveVisitorTask > | m_tasks |
Container for the parallel tasks. More... | |
sofa::simulation::CpuTask::Status | m_status |
Status for the parallel tasks. More... | |
![]() | |
const sofa::core::ExecParams * | params |
Public Member Functions | |
SolveVisitor (const sofa::core::ExecParams *params, SReal _dt, sofa::core::MultiVecCoordId X=sofa::core::vec_id::write_access::position, sofa::core::MultiVecDerivId V=sofa::core::vec_id::write_access::velocity, bool _parallelSolve=false, bool computeForceIsolatedInteractionForceFields=false) | |
SolveVisitor (const sofa::core::ExecParams *params, SReal _dt, bool free, bool _parallelSolve=false, bool computeForceIsolatedInteractionForceFields=false) | |
virtual void | processSolver (simulation::Node *node, sofa::core::behavior::OdeSolver *b) |
void | fwdInteractionForceField (Node *node, core::behavior::BaseInteractionForceField *forceField) |
Result | processNodeTopDown (simulation::Node *node) override |
Callback method called when descending to a new node. Recursion will stop if this method returns RESULT_PRUNE. More... | |
void | processNodeBottomUp (simulation::Node *) override |
Callback method called after child node have been processed and before going back to the parent node. More... | |
bool | isThreadSafe () const override |
Specify whether this action can be parallelized. More... | |
const char * | getCategoryName () const override |
const char * | getClassName () const override |
void | setDt (SReal _dt) |
SReal | getDt () const |
![]() | |
Visitor (const sofa::core::ExecParams *params) | |
virtual | ~Visitor () |
const sofa::core::ExecParams * | execParams () const |
virtual bool | childOrderReversed (simulation::Node *) |
Return true to reverse the order of traversal of child nodes. More... | |
virtual bool | treeTraversal (TreeTraversalRepetition &repeat) |
virtual std::string | getInfos () const |
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) |
Visitor & | setTags (const TagSet &t) |
Visitor & | addTag (Tag t) |
Visitor & | removeTag (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 | |
void | sequentialSolve (simulation::Node *node) |
Function called if the solvers run sequentially. More... | |
void | parallelSolve (simulation::Node *node) |
void | initializeTaskScheduler () |
Initialize the task scheduler if it is not done already. More... | |
![]() | |
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 | |
![]() | |
TagSet | subsetsToManage |
list of the subsets More... | |
bool | canAccessSleepingNode |
Can the visitor access sleeping nodes? More... | |
|
protected |
|
protected |
|
protected |
|
protected |
Status for the parallel tasks.
|
protected |
Container for the parallel tasks.
|
protected |
|
protected |
sofa::simulation::SolveVisitor::SolveVisitor | ( | const sofa::core::ExecParams * | params, |
SReal | _dt, | ||
sofa::core::MultiVecCoordId | X = sofa::core::vec_id::write_access::position , |
||
sofa::core::MultiVecDerivId | V = sofa::core::vec_id::write_access::velocity , |
||
bool | _parallelSolve = false , |
||
bool | computeForceIsolatedInteractionForceFields = false |
||
) |
sofa::simulation::SolveVisitor::SolveVisitor | ( | const sofa::core::ExecParams * | params, |
SReal | _dt, | ||
bool | free, | ||
bool | _parallelSolve = false , |
||
bool | computeForceIsolatedInteractionForceFields = false |
||
) |
void sofa::simulation::SolveVisitor::fwdInteractionForceField | ( | Node * | node, |
core::behavior::BaseInteractionForceField * | forceField | ||
) |
|
inlineoverridevirtual |
Return a category name for this action. Only used for debugging / profiling purposes
Reimplemented from sofa::simulation::Visitor.
|
inlineoverridevirtual |
Return a class name for this visitor Only used for debugging / profiling purposes
Reimplemented from sofa::simulation::Visitor.
SReal sofa::simulation::SolveVisitor::getDt | ( | ) | const |
|
protected |
Initialize the task scheduler if it is not done already.
|
inlineoverridevirtual |
Specify whether this action can be parallelized.
Reimplemented from sofa::simulation::Visitor.
|
protected |
Function called if the solvers run concurrently Solving tasks are added to the list of tasks and start to run. However, there is no check that the tasks finished. This is done later, once all nodes have been traversed.
|
overridevirtual |
Callback method called after child node have been processed and before going back to the parent node.
Reimplemented from sofa::simulation::Visitor.
|
overridevirtual |
Callback method called when descending to a new node. Recursion will stop if this method returns RESULT_PRUNE.
Reimplemented from sofa::simulation::Visitor.
|
virtual |
|
protected |
Function called if the solvers run sequentially.
void sofa::simulation::SolveVisitor::setDt | ( | SReal | _dt | ) |