UpdateContextVisitor
The `UpdateContextVisitor` traverses the SOFA scene graph to update contexts for each node, ensuring consistency across different parts of the simulation.
- module
- Sofa.framework.Simulation.Core
- namespace
- sofa::simulation
- include
- sofa/simulation/UpdateContextVisitor.h
- inherits
-
- Visitor
- description
The UpdateContextVisitor is not directly involved in the mathematical or physical formulation of FEM simulations. It primarily serves as a utility component within the SOFA framework to ensure that the context (simulation or visual) is appropriately updated for each node within the scene graph, excluding the starting node. This visitor ensures consistency and proper state management during simulation updates.
The UpdateContextVisitor does not contribute directly to any specific governing equations such as mass matrix $M$, stiffness matrix $K$, internal force $f_{int}$, residual $R$, or other operators related to FEM simulations. Instead, its role is more about traversing and managing the scene graph's state.
The component interacts with other SOFA components through virtual methods like processNodeTopDown, which processes a given node in a top-down traversal manner. This method ensures that each node (except for the starting node) calls an appropriate update function (updateContext for general context, updateSimulationContext for simulation-specific contexts, and updateVisualContext for visual contexts).
In summary, while UpdateContextVisitor is crucial for maintaining the consistency of the simulation state within SOFA's scene graph architecture, it does not play a direct role in solving FEM equations or implementing specific physical laws.
Methods
Result
processNodeTopDown
(simulation::Node * node)
virtual
const char *
getCategoryName
()
virtual
bool
isThreadSafe
()
virtual
{
"name": "UpdateContextVisitor",
"namespace": "sofa::simulation",
"module": "Sofa.framework.Simulation.Core",
"include": "sofa/simulation/UpdateContextVisitor.h",
"doc": "",
"inherits": [
"Visitor"
],
"templates": [],
"data_fields": [],
"links": [],
"methods": [
{
"name": "processNodeTopDown",
"return_type": "Result",
"params": [
{
"name": "node",
"type": "simulation::Node *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getCategoryName",
"return_type": "const char *",
"params": [],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "isThreadSafe",
"return_type": "bool",
"params": [],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
}
],
"description": "The `UpdateContextVisitor` is part of the SOFA framework's `Sofa.framework.Simulation.Core` module and inherits from the `Visitor` class. Its primary role is to traverse the scene graph and update the context for each node, excluding the starting node. This visitor ensures that the simulation's state is appropriately updated across different nodes within the graph.\n\nThe component interacts with other SOFA components through its virtual methods such as `processNodeTopDown`, which processes a given node in a top-down traversal manner. It also provides methods to determine if it is thread-safe (`isThreadSafe`) and returns a category name for debugging purposes (`getCategoryName`).\n\nPractical usage involves utilizing this visitor to ensure that the context of each node is updated, particularly useful during simulation updates or when new nodes are added to the scene graph. This ensures consistency across different parts of the simulation.\n\nThe `UpdateContextVisitor` has three subclasses: `UpdateSimulationContextVisitor`, which specifically updates the simulation context; and `UpdateVisualContextVisitor`, which handles visual contexts using `sofa::core::visual::VisualParams`. Each subclass overrides the `processNodeTopDown` method to perform specific context updates.",
"maths": "The `UpdateContextVisitor` is not directly involved in the mathematical or physical formulation of FEM simulations. It primarily serves as a utility component within the SOFA framework to ensure that the context (simulation or visual) is appropriately updated for each node within the scene graph, excluding the starting node. This visitor ensures consistency and proper state management during simulation updates.\n\nThe `UpdateContextVisitor` does not contribute directly to any specific governing equations such as mass matrix $M$, stiffness matrix $K$, internal force $f_{int}$, residual $R$, or other operators related to FEM simulations. Instead, its role is more about traversing and managing the scene graph's state.\n\nThe component interacts with other SOFA components through virtual methods like `processNodeTopDown`, which processes a given node in a top-down traversal manner. This method ensures that each node (except for the starting node) calls an appropriate update function (`updateContext` for general context, `updateSimulationContext` for simulation-specific contexts, and `updateVisualContext` for visual contexts).\n\nIn summary, while `UpdateContextVisitor` is crucial for maintaining the consistency of the simulation state within SOFA's scene graph architecture, it does not play a direct role in solving FEM equations or implementing specific physical laws.",
"abstract": "The `UpdateContextVisitor` traverses the SOFA scene graph to update contexts for each node, ensuring consistency across different parts of the simulation.",
"sheet": "# UpdateContextVisitor\n\n## Overview\n\nThe `UpdateContextVisitor` is a utility component in the SOFA framework that inherits from the `Visitor` class. Its primary role is to traverse the scene graph and update the context for each node, excluding the starting node. This ensures consistency across different parts of the simulation.\n\n## Dependencies and Connections\n\nThis visitor interacts with other components through its virtual methods such as `processNodeTopDown`, which processes a given node in a top-down traversal manner. It also provides methods to determine if it is thread-safe (`isThreadSafe`) and returns a category name for debugging purposes (`getCategoryName`). The component ensures that the context of each node (simulation or visual) is appropriately updated, particularly useful during simulation updates or when new nodes are added to the scene graph."
}