Back

MechanicalMultiVectorToBaseVectorVisitor

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

The `MechanicalMultiVectorToBaseVectorVisitor` transfers data from multi-vector structures to base vectors, ensuring consistency between different representations of physical quantities during simulations.

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

The MechanicalMultiVectorToBaseVectorVisitor component in the SOFA framework is designed to facilitate data transfer between different vector representations used in simulations. Specifically, it converts data from a multi-vector structure (typically representing multiple degrees of freedom) into a single base vector. This operation is essential for maintaining consistency and facilitating operations that require a unified representation of physical quantities.

Governing Equations or Operators

  • Multi-Vector to Base Vector Conversion:
    The component implements the following conversion process:
    $$ \text{vect}[o:o + N] = \text{src}[\text{mm}] $$

where \$\text{src}\$ is a multi-vector structure, \$\text{mm}\$ represents the mechanical state, and \$\text{vect}\$ is the target base vector. The offset \$o\$ ensures that data from \$\text{src}[\text{mm}]\$ is copied to the correct position in \$\text{vect}\$.

Constitutive or Kinematic Laws Involved

  • No Direct Involvement:
    The MechanicalMultiVectorToBaseVectorVisitor does not directly involve any constitutive or kinematic laws. Its primary role is to manage data transfer between different vector representations, ensuring that the physical quantities are consistently represented throughout the simulation.

Role in the Global FEM Pipeline

  • Data Transfer:
    In the context of the global FEM pipeline, this component plays a crucial role during the assembly and state update phases. It ensures that data from multi-vector structures (which might be used for representing different parts or resolutions of the simulation) is properly consolidated into base vectors that can be processed by various solvers and mappings.

Numerical Methods or Discretization Choices

  • No Direct Discretization:
    The MechanicalMultiVectorToBaseVectorVisitor does not encode any numerical methods or discretization choices directly. Its purpose is to facilitate the transfer of data between different representations, which are often used in conjunction with various FEM discretizations and solvers.

Integration into Variational / Lagrangian Mechanics Framework

  • Data Consistency:
    While this component does not directly contribute to the variational or Lagrangian mechanics framework through governing equations or constitutive laws, it plays a critical role in ensuring that the data used in these frameworks remains consistent. This consistency is essential for maintaining numerical stability and physical accuracy throughout the simulation.

Summary

  • The MechanicalMultiVectorToBaseVectorVisitor component is responsible for transferring data from multi-vector structures to base vectors, facilitating operations such as copying between different representations of physical quantities. Although it does not directly involve constitutive laws or discretization methods, its role in maintaining consistency and facilitating data transfer makes it an important part of the FEM simulation pipeline.
Methods
Result fwdMechanicalState (simulation::Node * , core::behavior::BaseMechanicalState * mm) virtual
{
  "name": "MechanicalMultiVectorToBaseVectorVisitor",
  "namespace": "sofa::simulation::mechanicalvisitor",
  "module": "Sofa.framework.Simulation.Core",
  "include": "sofa/simulation/mechanicalvisitor/MechanicalMultiVectorToBaseVectorVisitor.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 `MechanicalMultiVectorToBaseVectorVisitor` is a visitor class in the SOFA framework, specifically within the `sofa::simulation::mechanicalvisitor` namespace. It inherits from `BaseMechanicalVisitor`, which indicates that it processes mechanical states in simulations by visiting nodes and applying specific operations on them.\n\nThis component’s primary role is to transfer data from a multi-vector structure (typically used for representing multiple degrees of freedom) into a single vector, facilitating operations such as copying data between different representations. It operates through the method `fwdMechanicalState`, which is called when visiting a node and its associated mechanical state (`BaseMechanicalState`).\n\nThe visitor has several attributes including `src` (source multi-vector identifier), `vect` (target base vector), `matrix` (accessor for matrices related to the multi-vectors), and `offset` (an offset used in the data transfer process).\n\nInteractions with other components are primarily through the mechanical state (`BaseMechanicalState`) where it performs the actual copying operation. This interaction is crucial for maintaining consistency between different representations of the same physical quantities, particularly important during simulations involving complex multi-resolution models or heterogeneous solvers.\n\nFor practical usage, users need to instantiate `MechanicalMultiVectorToBaseVectorVisitor` with appropriate parameters (source multi-vector identifier, target base vector, and optional matrix accessor) before visiting nodes in their simulation graph. The component does not expose any data fields directly.",
  "maths": "The `MechanicalMultiVectorToBaseVectorVisitor` component in the SOFA framework is designed to facilitate data transfer between different vector representations used in simulations. Specifically, it converts data from a multi-vector structure (typically representing multiple degrees of freedom) into a single base vector. This operation is essential for maintaining consistency and facilitating operations that require a unified representation of physical quantities.\n\n### Governing Equations or Operators\n- **Multi-Vector to Base Vector Conversion**:\n  The component implements the following conversion process:\n  \\[\n  \\text{vect}[o:o + N] = \\text{src}[\\text{mm}]\n  \\]\n  where \\\\(\\text{src}\\\\) is a multi-vector structure, \\\\(\\text{mm}\\\\) represents the mechanical state, and \\\\(\\text{vect}\\\\) is the target base vector. The offset \\\\(o\\\\) ensures that data from \\\\(\\text{src}[\\text{mm}]\\\\) is copied to the correct position in \\\\(\\text{vect}\\\\).\n\n### Constitutive or Kinematic Laws Involved\n- **No Direct Involvement**:\n  The `MechanicalMultiVectorToBaseVectorVisitor` does not directly involve any constitutive or kinematic laws. Its primary role is to manage data transfer between different vector representations, ensuring that the physical quantities are consistently represented throughout the simulation.\n\n### Role in the Global FEM Pipeline\n- **Data Transfer**:\n  In the context of the global FEM pipeline, this component plays a crucial role during the assembly and state update phases. It ensures that data from multi-vector structures (which might be used for representing different parts or resolutions of the simulation) is properly consolidated into base vectors that can be processed by various solvers and mappings.\n\n### Numerical Methods or Discretization Choices\n- **No Direct Discretization**:\n  The `MechanicalMultiVectorToBaseVectorVisitor` does not encode any numerical methods or discretization choices directly. Its purpose is to facilitate the transfer of data between different representations, which are often used in conjunction with various FEM discretizations and solvers.\n\n### Integration into Variational / Lagrangian Mechanics Framework\n- **Data Consistency**:\n  While this component does not directly contribute to the variational or Lagrangian mechanics framework through governing equations or constitutive laws, it plays a critical role in ensuring that the data used in these frameworks remains consistent. This consistency is essential for maintaining numerical stability and physical accuracy throughout the simulation.\n\n### Summary\n- The `MechanicalMultiVectorToBaseVectorVisitor` component is responsible for transferring data from multi-vector structures to base vectors, facilitating operations such as copying between different representations of physical quantities. Although it does not directly involve constitutive laws or discretization methods, its role in maintaining consistency and facilitating data transfer makes it an important part of the FEM simulation pipeline.",
  "abstract": "The `MechanicalMultiVectorToBaseVectorVisitor` transfers data from multi-vector structures to base vectors, ensuring consistency between different representations of physical quantities during simulations.",
  "sheet": "# MechanicalMultiVectorToBaseVectorVisitor\n\n## Overview\nThe `MechanicalMultiVectorToBaseVectorVisitor` is a visitor component in the SOFA framework that facilitates the transfer of data from multi-vector structures (representing multiple degrees of freedom) to single base vectors. This ensures consistency and enables operations such as copying between different representations of physical quantities.\n\n## Dependencies and Connections\nThis component primarily interacts with `BaseMechanicalState` through its method `fwdMechanicalState`. It is crucial for maintaining data consistency in simulations involving complex multi-resolution models or heterogeneous solvers."
}