MechanicalVReallocVisitor
Reserve an auxiliary vector identified by a symbolic constant.
The `MechanicalVReallocVisitor` manages auxiliary vector allocation within mechanical states in SOFA simulations. It ensures proper resizing and initialization of vectors used in FEM operations.
- module
- Sofa.framework.Simulation.Core
- namespace
- sofa::simulation::mechanicalvisitor
- include
- sofa/simulation/mechanicalvisitor/MechanicalVReallocVisitor.h
- inherits
-
- BaseMechanicalVisitor
- templates
-
- sofa::core::V_COORD
- sofa::core::V_DERIV
- description
The MechanicalVReallocVisitor is a component within the SOFA framework that does not directly implement or contribute to governing equations, constitutive laws, kinematic laws, or numerical methods specific to FEM simulation. Instead, it serves a more infrastructural role in managing auxiliary vectors used in the broader FEM pipeline.
Role in the Global FEM Pipeline
The MechanicalVReallocVisitor is responsible for reserving and reallocating auxiliary vectors within mechanical states. These vectors can represent coordinates (V_COORD) or derivatives (V_DERIV). The component interacts with various parts of the SOFA simulation graph, including:
- BaseMechanicalState: Represents the state of a mechanical system, which may include displacement vectors u.
- BaseInteractionForceField: Links multiple mechanical states and handles interaction forces between them.
Numerical Methods or Discretization Choices
The component does not directly encode numerical methods or discretization choices. Its primary function is to ensure that the auxiliary vectors are properly allocated, which indirectly supports various numerical operations in FEM simulations. The vRealloc method ensures that the necessary storage for these vectors is available and appropriately sized.
Mathematical Content
Since this component does not directly implement mathematical or physical models, it does not contribute equations such as mass matrix $M$, stiffness matrix $K$, internal force $f_{\text{int}}$, residual $R$, etc. Instead, its role is to manage the storage for vectors that might be used in these matrices and forces.
Constraint Handling and Mapping
The component manages vector allocation across mechanical states (BaseMechanicalState), mapped states (through fwdMappedMechanicalState method), and interaction force fields (through fwdInteractionForceField). This supports the broader mechanics framework by ensuring that all necessary vectors are correctly initialized for use in subsequent calculations.
Thread Safety and Propagation
The component ensures thread safety (isThreadSafe) to support parallel processing within SOFA. The flags m_propagate and m_interactionForceField control how vector initialization propagates through the simulation graph, ensuring that all relevant states have the necessary auxiliary vectors initialized.
Summary
The MechanicalVReallocVisitor is a utility component in the SOFA framework responsible for managing auxiliary vectors within mechanical states. It ensures proper allocation and resizing of these vectors to support various FEM operations without directly contributing to the mathematical or physical models themselves.
Methods
bool
stopAtMechanicalMapping
(simulation::Node * , sofa::core::BaseMapping * )
virtual
Result
fwdMechanicalState
(simulation::Node * node, sofa::core::behavior::BaseMechanicalState * mm)
virtual
Result
fwdMappedMechanicalState
(simulation::Node * node, sofa::core::behavior::BaseMechanicalState * mm)
virtual
Result
fwdInteractionForceField
(simulation::Node * node, sofa::core::behavior::BaseInteractionForceField * ff)
virtual
int
getInfos
()
bool
isThreadSafe
()
virtual
MyVecId
getId
(sofa::core::behavior::BaseMechanicalState * mm)
{
"name": "MechanicalVReallocVisitor",
"namespace": "sofa::simulation::mechanicalvisitor",
"module": "Sofa.framework.Simulation.Core",
"include": "sofa/simulation/mechanicalvisitor/MechanicalVReallocVisitor.h",
"doc": "Reserve an auxiliary vector identified by a symbolic constant.",
"inherits": [
"BaseMechanicalVisitor"
],
"templates": [
"sofa::core::V_COORD",
"sofa::core::V_DERIV"
],
"data_fields": [],
"links": [],
"methods": [
{
"name": "stopAtMechanicalMapping",
"return_type": "bool",
"params": [
{
"name": "",
"type": "simulation::Node *"
},
{
"name": "",
"type": "sofa::core::BaseMapping *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "fwdMechanicalState",
"return_type": "Result",
"params": [
{
"name": "node",
"type": "simulation::Node *"
},
{
"name": "mm",
"type": "sofa::core::behavior::BaseMechanicalState *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "fwdMappedMechanicalState",
"return_type": "Result",
"params": [
{
"name": "node",
"type": "simulation::Node *"
},
{
"name": "mm",
"type": "sofa::core::behavior::BaseMechanicalState *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "fwdInteractionForceField",
"return_type": "Result",
"params": [
{
"name": "node",
"type": "simulation::Node *"
},
{
"name": "ff",
"type": "sofa::core::behavior::BaseInteractionForceField *"
}
],
"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"
},
{
"name": "getId",
"return_type": "MyVecId",
"params": [
{
"name": "mm",
"type": "sofa::core::behavior::BaseMechanicalState *"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "protected"
}
],
"description": "The `MechanicalVReallocVisitor` is a component in the SOFA framework designed to reserve an auxiliary vector identified by a symbolic constant within a mechanical state. This visitor template class, part of the `sofa::simulation::mechanicalvisitor` namespace and included in `Sofa.framework.Simulation.Core`, is derived from `BaseMechanicalVisitor`. It operates on vectors representing coordinates (`V_COORD`) or derivatives (`V_DERIV`).\n\nIt interacts with various SOFA components through methods like `fwdMechanicalState`, `fwdMappedMechanicalState`, and `fwdInteractionForceField` to manage vector allocation across mechanical states, mapped states, and interaction force fields. The component ensures thread safety and can propagate vector initialization to mapped states or external states linked by an interaction force field.\n\nThe class handles auxiliary vector management by calling `vRealloc` on the appropriate mechanical state objects based on provided flags (`m_propagate`, `m_interactionForceField`). It also checks if the vector is already allocated using `getId`. Practical usage involves creating instances of this visitor with specific parameters and invoking its methods within a simulation context.",
"maths": "The `MechanicalVReallocVisitor` is a component within the SOFA framework that does not directly implement or contribute to governing equations, constitutive laws, kinematic laws, or numerical methods specific to FEM simulation. Instead, it serves a more infrastructural role in managing auxiliary vectors used in the broader FEM pipeline.\n\n### Role in the Global FEM Pipeline\nThe `MechanicalVReallocVisitor` is responsible for reserving and reallocating auxiliary vectors within mechanical states. These vectors can represent coordinates (`V_COORD`) or derivatives (`V_DERIV`). The component interacts with various parts of the SOFA simulation graph, including:\n- **BaseMechanicalState**: Represents the state of a mechanical system, which may include displacement vectors `u`.\n- **BaseInteractionForceField**: Links multiple mechanical states and handles interaction forces between them.\n\n### Numerical Methods or Discretization Choices\nThe component does not directly encode numerical methods or discretization choices. Its primary function is to ensure that the auxiliary vectors are properly allocated, which indirectly supports various numerical operations in FEM simulations. The `vRealloc` method ensures that the necessary storage for these vectors is available and appropriately sized.\n\n### Mathematical Content\nSince this component does not directly implement mathematical or physical models, it does not contribute equations such as mass matrix $M$, stiffness matrix $K$, internal force $f_{\\text{int}}$, residual $R$, etc. Instead, its role is to manage the storage for vectors that might be used in these matrices and forces.\n\n### Constraint Handling and Mapping\nThe component manages vector allocation across mechanical states (`BaseMechanicalState`), mapped states (through `fwdMappedMechanicalState` method), and interaction force fields (through `fwdInteractionForceField`). This supports the broader mechanics framework by ensuring that all necessary vectors are correctly initialized for use in subsequent calculations.\n\n### Thread Safety and Propagation\nThe component ensures thread safety (`isThreadSafe`) to support parallel processing within SOFA. The flags `m_propagate` and `m_interactionForceField` control how vector initialization propagates through the simulation graph, ensuring that all relevant states have the necessary auxiliary vectors initialized.\n\n### Summary\nThe `MechanicalVReallocVisitor` is a utility component in the SOFA framework responsible for managing auxiliary vectors within mechanical states. It ensures proper allocation and resizing of these vectors to support various FEM operations without directly contributing to the mathematical or physical models themselves.",
"abstract": "The `MechanicalVReallocVisitor` manages auxiliary vector allocation within mechanical states in SOFA simulations. It ensures proper resizing and initialization of vectors used in FEM operations.",
"sheet": "# MechanicalVReallocVisitor\n\n## Overview\n\nThe `MechanicalVReallocVisitor` is a utility component derived from `BaseMechanicalVisitor`. Its primary role is to manage auxiliary vector allocation within mechanical states, ensuring that these vectors are properly resized and initialized for use in FEM operations. This visitor operates on vectors representing coordinates (`V_COORD`) or derivatives (`V_DERIV`).\n\n## Dependencies and Connections\n\nThe component interacts with various SOFA components through methods such as `fwdMechanicalState`, `fwdMappedMechanicalState`, and `fwdInteractionForceField`. These methods manage vector allocation across mechanical states, mapped states, and interaction force fields. The visitor ensures that auxiliary vectors are correctly initialized for use in subsequent calculations within the simulation graph."
}