Back

MechanicalVisitor

sofa::simulation::MechanicalVisitor
BaseMechanicalVisitor
Abstract (AI generated)

`MechanicalVisitor` facilitates traversal and processing of mechanical properties across the SOFA scene graph, ensuring consistent propagation of forces, constraints, and parameters during simulation phases such as assembly, time integration, nonlinear solve, and linear solve.

Metadata
module
Sofa.framework.Simulation.Core
namespace
sofa::simulation
include
sofa/simulation/MechanicalVisitor.h
inherits
  • BaseMechanicalVisitor
description

The MechanicalVisitor is a core component within the SOFA framework designed to facilitate traversal and processing of mechanical properties across the scene graph. It inherits from BaseMechanicalVisitor, which defines a common interface for visiting and manipulating various aspects of mechanical models. The primary role of MechanicalVisitor is to propagate and manipulate mechanical data such as forces, internal forces, constraints, and other mechanical parameters within the simulation framework.

Governing Equations / Operators

The MechanicalVisitor does not directly implement any specific governing equations or operators itself, but it plays a crucial role in the overall FEM pipeline by facilitating the propagation of mechanical data. This includes contributions to:
- Mass Matrix ( extbf{M})
- Stiffness Matrix ( extbf{K})
- Internal Force Vector ( extbf{f_int})
- Residual Vector ( extbf{R})

These operators are computed and manipulated by other components within the scene graph, and MechanicalVisitor ensures that these contributions are correctly propagated across different nodes.

Constitutive / Kinematic Laws Involved

The component itself does not involve specific constitutive or kinematic laws. Instead, it relies on mechanical parameters stored in the sofa::core::MechanicalParams structure, which may include information such as:
- Strain measures and stress tensors
- Hyperelastic potentials (e.g., St-Venant–Kirchhoff, Neo-Hookean)
- Damping models
- Constraint Jacobians

Role in the Global FEM Pipeline

Within the global FEM pipeline, MechanicalVisitor plays a crucial role during several phases:
- Assembly Phase: The visitor is used to traverse nodes and collect contributions to global matrices and vectors (e.g., mass matrix extbf{M}, stiffness matrix extbf{K}, internal force vector extbf{f_int}).
- Time Integration: It ensures that mechanical parameters are correctly propagated during the time integration step, such as in implicit Euler schemes.
- Nonlinear Solve: During nonlinear resolution, MechanicalVisitor helps in aggregating contributions from different nodes to build the residual vector extbf{R} and Jacobian matrix $J$.
- Linear Solve: It supports iterative solvers by propagating constraints and mapping forces between nodes.

Numerical Methods / Discretization Choices

While MechanicalVisitor itself does not encode specific numerical methods or discretization choices, it facilitates the overall process by ensuring consistent propagation of mechanical data across different parts of the scene graph. This includes support for various FEM formulations (e.g., linear and nonlinear elasticity, corotational and large-deformation formulations).

Fit into Variational / Lagrangian Mechanics Framework

The MechanicalVisitor fits into the broader variational and Lagrangian mechanics framework by ensuring that mechanical properties are consistently processed across different nodes. It supports the propagation of contributions to the weak form and operators derived from this formulation, enabling accurate and consistent simulation of deformable bodies.

In summary, while MechanicalVisitor itself does not implement specific equations or laws, it is a crucial component in the SOFA framework that ensures consistency and correctness in the handling of mechanical data throughout the FEM pipeline.

No API data.
{
  "name": "MechanicalVisitor",
  "namespace": "sofa::simulation",
  "module": "Sofa.framework.Simulation.Core",
  "include": "sofa/simulation/MechanicalVisitor.h",
  "doc": "",
  "inherits": [
    "BaseMechanicalVisitor"
  ],
  "templates": [],
  "data_fields": [],
  "links": [],
  "methods": [],
  "description": "The `MechanicalVisitor` is part of the SOFA framework's simulation module, inheriting from `BaseMechanicalVisitor`. It is designed to traverse and process mechanical properties within the scene graph, specifically using `sofa::core::MechanicalParams` for storing and passing mechanical parameters. This component plays a role in the visitor pattern used by SOFA to efficiently execute operations on mechanical models across different simulation nodes or components.\n\n### Role and Purpose\nThe `MechanicalVisitor` facilitates the propagation and manipulation of mechanical data, such as forces and constraints, within the SOFA simulation framework. It interacts with other SOFA components through its inheritance from `BaseMechanicalVisitor`, which defines a common interface for visiting and processing mechanical aspects of the scene graph.\n\n### Interactions with Other Components\nThe `MechanicalVisitor` is used in conjunction with nodes and mappings to apply mechanical operations across different parts of the simulation. It relies on the `sofa::core::MechanicalParams` structure, which encapsulates various parameters needed for mechanical computations, ensuring consistent handling of mechanical data throughout the simulation.\n\n### Practical Usage Guidance\nUsage of `MechanicalVisitor` typically involves creating instances with specific `MechanicalParams`, and then employing these visitors to perform operations like force application or constraint resolution across multiple nodes in the scene graph. No explicit data fields are required for this component, as it primarily focuses on processing mechanical parameters passed via its constructor.",
  "maths": "The `MechanicalVisitor` is a core component within the SOFA framework designed to facilitate traversal and processing of mechanical properties across the scene graph. It inherits from `BaseMechanicalVisitor`, which defines a common interface for visiting and manipulating various aspects of mechanical models. The primary role of `MechanicalVisitor` is to propagate and manipulate mechanical data such as forces, internal forces, constraints, and other mechanical parameters within the simulation framework.\n\n### Governing Equations / Operators\nThe `MechanicalVisitor` does not directly implement any specific governing equations or operators itself, but it plays a crucial role in the overall FEM pipeline by facilitating the propagation of mechanical data. This includes contributions to:\n- **Mass Matrix** (\textbf{M})\n- **Stiffness Matrix** (\textbf{K})\n- **Internal Force Vector** (\textbf{f_int})\n- **Residual Vector** (\textbf{R})\n\nThese operators are computed and manipulated by other components within the scene graph, and `MechanicalVisitor` ensures that these contributions are correctly propagated across different nodes.\n\n### Constitutive / Kinematic Laws Involved\nThe component itself does not involve specific constitutive or kinematic laws. Instead, it relies on mechanical parameters stored in the `sofa::core::MechanicalParams` structure, which may include information such as:\n- Strain measures and stress tensors\n- Hyperelastic potentials (e.g., St-Venant–Kirchhoff, Neo-Hookean)\n- Damping models\n- Constraint Jacobians\n\n### Role in the Global FEM Pipeline\nWithin the global FEM pipeline, `MechanicalVisitor` plays a crucial role during several phases:\n- **Assembly Phase**: The visitor is used to traverse nodes and collect contributions to global matrices and vectors (e.g., mass matrix \textbf{M}, stiffness matrix \textbf{K}, internal force vector \textbf{f_int}).\n- **Time Integration**: It ensures that mechanical parameters are correctly propagated during the time integration step, such as in implicit Euler schemes.\n- **Nonlinear Solve**: During nonlinear resolution, `MechanicalVisitor` helps in aggregating contributions from different nodes to build the residual vector \textbf{R} and Jacobian matrix \\(J\\).\n- **Linear Solve**: It supports iterative solvers by propagating constraints and mapping forces between nodes.\n\n### Numerical Methods / Discretization Choices\nWhile `MechanicalVisitor` itself does not encode specific numerical methods or discretization choices, it facilitates the overall process by ensuring consistent propagation of mechanical data across different parts of the scene graph. This includes support for various FEM formulations (e.g., linear and nonlinear elasticity, corotational and large-deformation formulations).\n\n### Fit into Variational / Lagrangian Mechanics Framework\nThe `MechanicalVisitor` fits into the broader variational and Lagrangian mechanics framework by ensuring that mechanical properties are consistently processed across different nodes. It supports the propagation of contributions to the weak form and operators derived from this formulation, enabling accurate and consistent simulation of deformable bodies.\n\nIn summary, while `MechanicalVisitor` itself does not implement specific equations or laws, it is a crucial component in the SOFA framework that ensures consistency and correctness in the handling of mechanical data throughout the FEM pipeline.",
  "abstract": "`MechanicalVisitor` facilitates traversal and processing of mechanical properties across the SOFA scene graph, ensuring consistent propagation of forces, constraints, and parameters during simulation phases such as assembly, time integration, nonlinear solve, and linear solve.",
  "sheet": "# MechanicalVisitor\n\n## Overview\nThe `MechanicalVisitor` is a core component in the SOFA framework's simulation module that facilitates traversal and processing of mechanical properties across the scene graph. It inherits from `BaseMechanicalVisitor`, which defines a common interface for visiting and manipulating various aspects of mechanical models. The primary role of `MechanicalVisitor` is to propagate and manipulate mechanical data such as forces, internal forces, constraints, and other parameters within the simulation framework.\n\n## Dependencies and Connections\nThe `MechanicalVisitor` relies on the `sofa::core::MechanicalParams` structure for storing and passing mechanical parameters. It interacts with nodes and mappings to apply mechanical operations across different parts of the scene graph. Its inheritance from `BaseMechanicalVisitor` ensures consistent handling of mechanical data throughout the simulation.\n\n## Practical Notes\nUsage of `MechanicalVisitor` typically involves creating instances with specific `MechanicalParams`, and then employing these visitors to perform operations like force application or constraint resolution across multiple nodes in the scene graph. No explicit data fields are required for this component, as it primarily focuses on processing mechanical parameters passed via its constructor."
}