Back

MechanicalMultiVectorPeqBaseVectorVisitor

sofa::simulation::mechanicalvisitor::MechanicalMultiVectorPeqBaseVectorVisitor
BaseMechanicalVisitor
Abstract (AI generated)

The `MechanicalMultiVectorPeqBaseVectorVisitor` facilitates the addition of values from a source vector into a destination multi-vector at specified offsets derived from a global matrix accessor. It plays a critical role in updating mechanical states during simulation iterations.

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

The MechanicalMultiVectorPeqBaseVectorVisitor is a visitor class in the SOFA framework designed to process mechanical states during simulation steps. This component primarily handles operations on multi-vectors, particularly adding values from one vector (src) into another multi-vector (dest). The key role of this component within the FEM pipeline includes mapping and updating vectors based on specific offsets derived from a global matrix (matrix).

Governing Equations or Operators

  • Multi-Vector Addition: The primary operation performed by MechanicalMultiVectorPeqBaseVectorVisitor is the addition of values from one vector (source) to another multi-vector (destination). This can be described mathematically as:
    $$ \mathbf{v}_{dest}(i) = \mathbf{v}_{src}(j) + \mathbf{v}_{dest}(i) $$

where $\mathbf{v}_{src}$ and $\mathbf{v}_{dest}$ are the source and destination vectors, respectively. The index $j$ is determined by an offset derived from the global matrix accessor (matrix).

Constitutive or Kinematic Laws Involved

  • Offset Determination: The component uses a MultiMatrixAccessor to determine the global offset for each mechanical state. This involves mapping indices between different vectors based on their global positions in the simulation.

Role in the Global FEM Pipeline

  1. Assembly Phase: During assembly, this visitor contributes by ensuring that the multi-vectors are correctly updated with values from another vector at specified offsets.
  2. State Update: The fwdMechanicalState method is called during state updates to add contributions from the source vector into the destination vector, effectively updating the mechanical states.

Numerical Methods or Discretization Choices Encoded

  • The visitor operates on discrete vectors and applies operations in a manner consistent with the overall discretized FEM formulation. Specifically, it uses offsets derived from matrix accessor methods to map between different vectors accurately.

Fit into Broader Variational / Lagrangian Mechanics Framework

The MechanicalMultiVectorPeqBaseVectorVisitor plays a critical role in updating mechanical states during simulation iterations by correctly mapping and adding contributions from one vector to another. This ensures that the global state of the system, represented through multi-vectors, is accurately updated, preserving the overall consistency and correctness of the FEM simulation.

Summary

The MechanicalMultiVectorPeqBaseVectorVisitor facilitates the addition of values from a source vector into a destination multi-vector at specified offsets. This operation ensures that mechanical states are correctly updated during simulation iterations, maintaining the integrity and accuracy of the FEM-based system representation.

Methods
Result fwdMechanicalState (simulation::Node * , core::behavior::BaseMechanicalState * mm) virtual
{
  "name": "MechanicalMultiVectorPeqBaseVectorVisitor",
  "namespace": "sofa::simulation::mechanicalvisitor",
  "module": "Sofa.framework.Simulation.Core",
  "include": "sofa/simulation/mechanicalvisitor/MechanicalMultiVectorPeqBaseVectorVisitor.h",
  "doc": "",
  "inherits": [
    "BaseMechanicalVisitor"
  ],
  "templates": [],
  "data_fields": [],
  "links": [],
  "methods": [
    {
      "name": "fwdMechanicalState",
      "return_type": "Result",
      "params": [
        {
          "name": "",
          "type": "simulation::Node *"
        },
        {
          "name": "mm",
          "type": "core::behavior::BaseMechanicalState *"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    }
  ],
  "description": "The `MechanicalMultiVectorPeqBaseVectorVisitor` is a class in the SOFA framework, specifically part of the `sofa::simulation::mechanicalvisitor` namespace within the `Sofa.framework.Simulation.Core` module. It inherits from `BaseMechanicalVisitor`, which suggests it plays a role in visiting and processing mechanical states during simulation steps.\n\nThis component is designed to handle operations on multi-vectors, particularly adding values from one vector (`src`) into another multi-vector (`dest`). The operation involves applying offsets based on the global matrix provided by the `matrix` accessor. The method `fwdMechanicalState` is overridden from its base class and manages the addition of values from a source vector to the destination vector at specified offsets.\n\nThe component interacts with other SOFA components through the API, specifically with nodes (`simulation::Node`) and mechanical states (`core::behavior::BaseMechanicalState`). It operates within the simulation's visitor pattern, allowing it to traverse and process data in a structured way during simulation iterations. This makes it suitable for tasks such as applying forces or displacements from one vector representation to another.\n\nUsage guidance: The `MechanicalMultiVectorPeqBaseVectorVisitor` is used internally by the SOFA framework to facilitate mechanical state updates, particularly where multi-vectors and matrix-based offsets are involved. Users should not typically need to interact with this class directly; rather, it forms part of the underlying mechanics of SOFA's simulation pipeline.",
  "maths": "The `MechanicalMultiVectorPeqBaseVectorVisitor` is a visitor class in the SOFA framework designed to process mechanical states during simulation steps. This component primarily handles operations on multi-vectors, particularly adding values from one vector (`src`) into another multi-vector (`dest`). The key role of this component within the FEM pipeline includes mapping and updating vectors based on specific offsets derived from a global matrix (`matrix`).\n\n### Governing Equations or Operators\n- **Multi-Vector Addition**: The primary operation performed by `MechanicalMultiVectorPeqBaseVectorVisitor` is the addition of values from one vector (source) to another multi-vector (destination). This can be described mathematically as:\n  \\[ \\mathbf{v}_{dest}(i) = \\mathbf{v}_{src}(j) + \\mathbf{v}_{dest}(i) \\]\n  where \\(\\mathbf{v}_{src}\\) and \\(\\mathbf{v}_{dest}\\) are the source and destination vectors, respectively. The index \\(j\\) is determined by an offset derived from the global matrix accessor (`matrix`).\n\n### Constitutive or Kinematic Laws Involved\n- **Offset Determination**: The component uses a `MultiMatrixAccessor` to determine the global offset for each mechanical state. This involves mapping indices between different vectors based on their global positions in the simulation.\n\n### Role in the Global FEM Pipeline\n1. **Assembly Phase**: During assembly, this visitor contributes by ensuring that the multi-vectors are correctly updated with values from another vector at specified offsets.\n2. **State Update**: The `fwdMechanicalState` method is called during state updates to add contributions from the source vector into the destination vector, effectively updating the mechanical states.\n\n### Numerical Methods or Discretization Choices Encoded\n- The visitor operates on discrete vectors and applies operations in a manner consistent with the overall discretized FEM formulation. Specifically, it uses offsets derived from matrix accessor methods to map between different vectors accurately.\n\n### Fit into Broader Variational / Lagrangian Mechanics Framework\nThe `MechanicalMultiVectorPeqBaseVectorVisitor` plays a critical role in updating mechanical states during simulation iterations by correctly mapping and adding contributions from one vector to another. This ensures that the global state of the system, represented through multi-vectors, is accurately updated, preserving the overall consistency and correctness of the FEM simulation.\n\n### Summary\nThe `MechanicalMultiVectorPeqBaseVectorVisitor` facilitates the addition of values from a source vector into a destination multi-vector at specified offsets. This operation ensures that mechanical states are correctly updated during simulation iterations, maintaining the integrity and accuracy of the FEM-based system representation.",
  "abstract": "The `MechanicalMultiVectorPeqBaseVectorVisitor` facilitates the addition of values from a source vector into a destination multi-vector at specified offsets derived from a global matrix accessor. It plays a critical role in updating mechanical states during simulation iterations.",
  "sheet": "# MechanicalMultiVectorPeqBaseVectorVisitor\n\n## Overview\nThe `MechanicalMultiVectorPeqBaseVectorVisitor` is part of the SOFA framework, specifically within the `sofa::simulation::mechanicalvisitor` namespace. It inherits from `BaseMechanicalVisitor`, indicating its role in visiting and processing mechanical states during simulation steps. This component handles operations on multi-vectors by adding values from a source vector into a destination multi-vector at specified offsets derived from a global matrix accessor.\n\n## Mathematical Model\nThe primary operation performed by this visitor is the addition of values from one vector (source) to another multi-vector (destination). Mathematically, this can be described as:\n\\[ \\mathbf{v}_{dest}(i) = \\mathbf{v}_{src}(j) + \\mathbf{v}_{dest}(i) \\]\nwhere \\(\\mathbf{v}_{src}\\) and \\(\\mathbf{v}_{dest}\\) are the source and destination vectors, respectively. The index \\(j\\) is determined by an offset derived from the global matrix accessor (`matrix`).\n\n## Parameters and Data\nThis component does not expose any significant data fields or parameters.\n\n## Dependencies and Connections\nThe `MechanicalMultiVectorPeqBaseVectorVisitor` interacts with other SOFA components through its API, specifically with nodes (`simulation::Node`) and mechanical states (`core::behavior::BaseMechanicalState`). It operates within the simulation's visitor pattern to traverse and process data during simulation iterations.\n\n## Practical Notes\nThis component is used internally by the SOFA framework to facilitate mechanical state updates. Users typically do not need to interact with this class directly; it forms part of the underlying mechanics of SOFA's simulation pipeline."
}