MechanicalGetConstraintResolutionVisitor
The `MechanicalGetConstraintResolutionVisitor` collects constraint resolutions from `BaseConstraintSet` objects within a SOFA simulation node, facilitating the nonlinear resolution phase of FEM simulations.
- module
- Sofa.Component.Constraint.Lagrangian.Solver
- namespace
- sofa::component::constraint::lagrangian::solver
- include
- sofa/component/constraint/lagrangian/solver/visitors/MechanicalGetConstraintResolutionVisitor.h
- inherits
-
- BaseMechanicalVisitor
- description
The MechanicalGetConstraintResolutionVisitor is part of the SOFA framework's Lagrangian constraint solver components, specifically designed to handle and collect constraint resolutions during mechanical computations. This visitor does not explicitly implement any governing equations or operators such as mass matrix $M$, stiffness matrix $K$, internal force $f_{ ext{int}}$, residual $R$, etc., but rather plays a role in processing constraints defined by the BaseConstraintSet objects.
Role in the FEM Pipeline:
The component operates within the nonlinear resolution phase of the global FEM pipeline. Specifically, it facilitates constraint handling and projection during the assembly of the system's equations. The visitor traverses the simulation graph to retrieve and process constraint resolutions from each BaseConstraintSet. These constraints can include both holonomic (position-based) and non-holonomic (velocity-based) constraints.
Constitutive/Kinematic Laws:
The component itself does not define any constitutive or kinematic laws. Instead, it relies on the getConstraintResolution() method of each BaseConstraintSet to populate a vector with constraint resolution data. These resolutions typically depend on the specific type of constraints defined within the simulation and can involve various physical principles such as contact forces, boundary conditions, or coupling constraints between different mechanical objects.
Numerical Methods and Discretization Choices:
The visitor does not implement any numerical methods or discretization choices directly. Instead, it serves to facilitate constraint resolution, which is part of the overall nonlinear solution process in the FEM pipeline. Constraint handling often involves solving a system of linear equations that may use iterative solvers such as Krylov subspace methods (e.g., Conjugate Gradient) or direct solvers like LU factorization.
Variational / Lagrangian Mechanics Framework:
The visitor operates within the broader variational mechanics framework by processing constraints, which are an integral part of ensuring that the simulated system adheres to specified physical laws and boundary conditions. Constraints ensure that the mechanical state satisfies certain invariants or restrictions, contributing to the overall consistency and stability of the simulation.
Summary:
The MechanicalGetConstraintResolutionVisitor is a visitor component designed to collect and process constraint resolutions from BaseConstraintSet objects within a SOFA simulation. It facilitates constraint handling during the nonlinear resolution phase of FEM simulations but does not itself implement any governing equations or numerical methods.
Methods
Result
fwdConstraintSet
(simulation::Node * node, core::behavior::BaseConstraintSet * cSet)
virtual
bool
isThreadSafe
()
virtual
bool
stopAtMechanicalMapping
(simulation::Node * node, core::BaseMapping * map)
virtual
{
"name": "MechanicalGetConstraintResolutionVisitor",
"namespace": "sofa::component::constraint::lagrangian::solver",
"module": "Sofa.Component.Constraint.Lagrangian.Solver",
"include": "sofa/component/constraint/lagrangian/solver/visitors/MechanicalGetConstraintResolutionVisitor.h",
"doc": "",
"inherits": [
"BaseMechanicalVisitor"
],
"templates": [],
"data_fields": [],
"links": [],
"methods": [
{
"name": "fwdConstraintSet",
"return_type": "Result",
"params": [
{
"name": "node",
"type": "simulation::Node *"
},
{
"name": "cSet",
"type": "core::behavior::BaseConstraintSet *"
}
],
"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"
},
{
"name": "stopAtMechanicalMapping",
"return_type": "bool",
"params": [
{
"name": "node",
"type": "simulation::Node *"
},
{
"name": "map",
"type": "core::BaseMapping *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
}
],
"description": "The `MechanicalGetConstraintResolutionVisitor` is part of the SOFA framework and is located within the `sofa::component::constraint::lagrangian::solver` namespace. This visitor inherits from `BaseMechanicalVisitor`, indicating its role in visiting and processing mechanical constraints in the simulation. It does not have any explicit data fields or links, but it interacts with other components through virtual methods that are part of the SOFA API.\n\n### Role and Purpose:\nThe primary purpose of this component is to collect constraint resolutions from `BaseConstraintSet` objects within a given node during mechanical computations. It processes constraints by calling their `getConstraintResolution()` method, which populates a vector with constraint resolution data.\n\n### Interactions with Other Components:\n- **fwdConstraintSet**: This method is invoked for each `BaseConstraintSet`, enabling the visitor to retrieve and process constraint resolutions. \n- **isThreadSafe**: Determines if the visitor can safely be used in multithreaded environments, returning `false`.\n- **stopAtMechanicalMapping**: Indicates whether the visitor should stop at mechanical mappings. This method returns `false`, meaning the visitor will proceed through all mechanical mappings regardless of their settings.\n\n### Practical Usage Guidance:\nThe component is designed for use within the SOFA simulation framework to handle constraint resolution computations, particularly in scenarios involving Lagrangian constraints. It does not provide direct user configuration but works internally as part of larger simulations and solver workflows.",
"maths": "The `MechanicalGetConstraintResolutionVisitor` is part of the SOFA framework's Lagrangian constraint solver components, specifically designed to handle and collect constraint resolutions during mechanical computations. This visitor does not explicitly implement any governing equations or operators such as mass matrix $M$, stiffness matrix $K$, internal force $f_{\text{int}}$, residual $R$, etc., but rather plays a role in processing constraints defined by the `BaseConstraintSet` objects.\n\n### Role in the FEM Pipeline:\nThe component operates within the nonlinear resolution phase of the global FEM pipeline. Specifically, it facilitates constraint handling and projection during the assembly of the system's equations. The visitor traverses the simulation graph to retrieve and process constraint resolutions from each `BaseConstraintSet`. These constraints can include both holonomic (position-based) and non-holonomic (velocity-based) constraints.\n\n### Constitutive/Kinematic Laws:\nThe component itself does not define any constitutive or kinematic laws. Instead, it relies on the `getConstraintResolution()` method of each `BaseConstraintSet` to populate a vector with constraint resolution data. These resolutions typically depend on the specific type of constraints defined within the simulation and can involve various physical principles such as contact forces, boundary conditions, or coupling constraints between different mechanical objects.\n\n### Numerical Methods and Discretization Choices:\nThe visitor does not implement any numerical methods or discretization choices directly. Instead, it serves to facilitate constraint resolution, which is part of the overall nonlinear solution process in the FEM pipeline. Constraint handling often involves solving a system of linear equations that may use iterative solvers such as Krylov subspace methods (e.g., Conjugate Gradient) or direct solvers like LU factorization.\n\n### Variational / Lagrangian Mechanics Framework:\nThe visitor operates within the broader variational mechanics framework by processing constraints, which are an integral part of ensuring that the simulated system adheres to specified physical laws and boundary conditions. Constraints ensure that the mechanical state satisfies certain invariants or restrictions, contributing to the overall consistency and stability of the simulation.\n\n### Summary:\nThe `MechanicalGetConstraintResolutionVisitor` is a visitor component designed to collect and process constraint resolutions from `BaseConstraintSet` objects within a SOFA simulation. It facilitates constraint handling during the nonlinear resolution phase of FEM simulations but does not itself implement any governing equations or numerical methods.",
"abstract": "The `MechanicalGetConstraintResolutionVisitor` collects constraint resolutions from `BaseConstraintSet` objects within a SOFA simulation node, facilitating the nonlinear resolution phase of FEM simulations.",
"sheet": "# MechanicalGetConstraintResolutionVisitor\n\n**Overview:**\nThe `MechanicalGetConstraintResolutionVisitor` is part of the SOFA framework's Lagrangian constraint solver components. It inherits from `BaseMechanicalVisitor` and is designed to collect and process constraint resolutions during mechanical computations, specifically by calling the `getConstraintResolution()` method on each `BaseConstraintSet`. This component facilitates constraint handling within the nonlinear resolution phase of FEM simulations.\n\n**Dependencies and Connections:**\nThe visitor interacts with other components through its virtual methods. It processes constraints defined in `BaseConstraintSet` objects within a given node during mechanical computations. The `fwdConstraintSet()` method is invoked for each `BaseConstraintSet`, enabling the visitor to retrieve constraint resolutions. Additionally, it does not stop at mechanical mappings (`stopAtMechanicalMapping()` returns `false`)."
}