MechanicalSetPositionAndVelocityVisitor
Visitor class used to set positions and velocities of the top level MechanicalStates of the hierarchy.
Sets positions and velocities for top-level MechanicalStates in the simulation hierarchy, ensuring consistent initialization or modification of state variables.
- module
- Sofa.framework.Simulation.Core
- namespace
- sofa::simulation::mechanicalvisitor
- include
- sofa/simulation/mechanicalvisitor/MechanicalSetPositionAndVelocityVisitor.h
- inherits
-
- MechanicalVisitor
- description
The MechanicalSetPositionAndVelocityVisitor is a visitor class within the SOFA framework designed to set positions and velocities for top-level MechanicalStates in the simulation hierarchy. This component plays a role in setting the initial conditions or modifying states during the simulation, but does not contribute directly to any governing equations or operators such as mass matrix $ M $, stiffness matrix $ K $, internal force $ f_{int} $, residual $ R $, etc. It is primarily responsible for initializing or updating state variables in a consistent manner within the SOFA simulation framework.
Mathematical and Physical Description:
- State Variables:
-
The component sets positions $ oldsymbol{x} $ and velocities $ oldsymbol{v} $. These are fundamental state variables used throughout FEM simulations to define the configuration of the deformable body at any given time step.
-
Role in the Global FEM Pipeline:
-
This component fits into the broader simulation pipeline by ensuring that positions and velocities are correctly set for the top-level MechanicalStates, which may affect subsequent steps such as assembly, time integration, nonlinear solve, linear solve, constraint handling, and mapping.
-
Numerical Methods or Discretization Choices:
-
The component itself does not encode any specific numerical methods or discretization choices. Its primary function is to set the state variables at the top level of the simulation hierarchy, which can be used as inputs for further numerical computations within the SOFA framework.
-
Integration into Variational / Lagrangian Mechanics Framework:
- While
MechanicalSetPositionAndVelocityVisitordoes not directly implement variational or Lagrangian mechanics equations, it is part of a larger system where these principles are applied. By setting positions and velocities, this visitor ensures that the initial conditions or state updates align with the overall simulation framework.
In summary, the MechanicalSetPositionAndVelocityVisitor is crucial for initializing or modifying state variables in the SOFA framework but does not contribute to the core mathematical operators typically involved in FEM simulations.
Methods
Result
fwdMechanicalState
(simulation::Node * , sofa::core::behavior::BaseMechanicalState * mm)
virtual
int
getInfos
()
bool
isThreadSafe
()
virtual
{
"name": "MechanicalSetPositionAndVelocityVisitor",
"namespace": "sofa::simulation::mechanicalvisitor",
"module": "Sofa.framework.Simulation.Core",
"include": "sofa/simulation/mechanicalvisitor/MechanicalSetPositionAndVelocityVisitor.h",
"doc": "Visitor class used to set positions and velocities of the top level MechanicalStates of the hierarchy.",
"inherits": [
"MechanicalVisitor"
],
"templates": [],
"data_fields": [],
"links": [],
"methods": [
{
"name": "fwdMechanicalState",
"return_type": "Result",
"params": [
{
"name": "",
"type": "simulation::Node *"
},
{
"name": "mm",
"type": "sofa::core::behavior::BaseMechanicalState *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getInfos",
"return_type": "int",
"params": [],
"is_virtual": false,
"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 `MechanicalSetPositionAndVelocityVisitor` is a visitor class within the SOFA framework, specifically designed to set positions and velocities for top-level MechanicalStates in the simulation hierarchy. It inherits from `MechanicalVisitor`, facilitating its integration into the mechanical simulation process.\n\nThis component interacts with other SOFA components through its API methods such as `fwdMechanicalState` which is responsible for forwarding the mechanical state, and `isThreadSafe` to indicate whether this visitor can be safely used in parallelized contexts. The `getInfos` method provides information about the vectors it operates on.\n\nPractical usage involves creating an instance of `MechanicalSetPositionAndVelocityVisitor`, specifying time, position (`x`), and velocity (`v`) identifiers for setting mechanical states. This component is essential for initializing or modifying positions and velocities within a SOFA simulation, ensuring that these properties are correctly propagated through the simulation hierarchy.",
"maths": "The `MechanicalSetPositionAndVelocityVisitor` is a visitor class within the SOFA framework designed to set positions and velocities for top-level MechanicalStates in the simulation hierarchy. This component plays a role in setting the initial conditions or modifying states during the simulation, but does not contribute directly to any governing equations or operators such as mass matrix \\( M \\), stiffness matrix \\( K \\), internal force \\( f_{int} \\), residual \\( R \\), etc. It is primarily responsible for initializing or updating state variables in a consistent manner within the SOFA simulation framework.\n\n### Mathematical and Physical Description:\n\n1. **State Variables**:\n - The component sets positions \\( \boldsymbol{x} \\) and velocities \\( \boldsymbol{v} \\). These are fundamental state variables used throughout FEM simulations to define the configuration of the deformable body at any given time step.\n\n2. **Role in the Global FEM Pipeline**:\n - This component fits into the broader simulation pipeline by ensuring that positions and velocities are correctly set for the top-level MechanicalStates, which may affect subsequent steps such as assembly, time integration, nonlinear solve, linear solve, constraint handling, and mapping.\n\n3. **Numerical Methods or Discretization Choices**:\n - The component itself does not encode any specific numerical methods or discretization choices. Its primary function is to set the state variables at the top level of the simulation hierarchy, which can be used as inputs for further numerical computations within the SOFA framework.\n\n4. **Integration into Variational / Lagrangian Mechanics Framework**:\n - While `MechanicalSetPositionAndVelocityVisitor` does not directly implement variational or Lagrangian mechanics equations, it is part of a larger system where these principles are applied. By setting positions and velocities, this visitor ensures that the initial conditions or state updates align with the overall simulation framework.\n\nIn summary, the `MechanicalSetPositionAndVelocityVisitor` is crucial for initializing or modifying state variables in the SOFA framework but does not contribute to the core mathematical operators typically involved in FEM simulations.",
"abstract": "Sets positions and velocities for top-level MechanicalStates in the simulation hierarchy, ensuring consistent initialization or modification of state variables.",
"sheet": "# MechanicalSetPositionAndVelocityVisitor\n\n## Overview\nThe `MechanicalSetPositionAndVelocityVisitor` is a visitor class within the SOFA framework designed to set positions and velocities for top-level MechanicalStates. It inherits from `MechanicalVisitor`, facilitating its integration into the mechanical simulation process.\n\n## Dependencies and Connections\nThis component typically requires interaction with other components such as nodes and mechanical states (`BaseMechanicalState`). It fits into the scene graph by ensuring that positions and velocities are correctly set for the top-level MechanicalStates, which can affect subsequent steps in the simulation pipeline."
}