Back

DispatchFromGlobalVectorToLocalVectorVisitor

The `DispatchFromGlobalVectorToLocalVectorVisitor` is a component in the SOFA framework under the namespace `sofa::component::linearsystem`. This visitor is part of the Sofa.Component.LinearSystem module and is responsible for copying values from a global vector to local vectors stored within each `BaseMechanicalState`. The location of these copies is determined by a built MappingGraph. This component inherits from `BaseMechanicalVisitor`, indicating its role in visiting mechanical states during simulation steps. It provides the `fwdMechanicalState` method, which processes each `BaseMechanicalState` to copy values based on the given global vector and mapping graph. The practical usage of this visitor involves setting up a MappingGraph that defines where local vectors are located within the global vector. During its operation, it iterates over mechanical states and updates their local vectors with data from the global vector using the defined mappings.

abstract
The `DispatchFromGlobalVectorToLocalVectorVisitor` distributes values from a global vector to local vectors in each `BaseMechanicalState`, guided by a predefined MappingGraph.
sheet
# DispatchFromGlobalVectorToLocalVectorVisitor **Overview:** The `DispatchFromGlobalVectorToLocalVectorVisitor` is responsible for distributing values from a global vector to the local vectors within each `BaseMechanicalState`. This distribution is based on a predefined `MappingGraph`, which specifies how elements in the global vector map to individual local vectors. The component inherits from `BaseMechanicalVisitor`, indicating its role in visiting and processing mechanical states during simulation steps. **Dependencies and Connections:** The visitor requires access to a `MappingGraph` that defines the mapping between the global vector and each local vector within `BaseMechanicalState`. It interacts with `BaseMechanicalState` instances, updating their local vectors based on the provided mappings. The component is typically used in conjunction with other components involved in assembling and distributing system states. **Practical Notes:** The visitor operates sequentially, iterating over all `BaseMechanicalState` instances to ensure that each receives its relevant portion of the global vector. Proper setup of the `MappingGraph` is crucial for accurate distribution. Misconfiguration can lead to incorrect state updates, affecting subsequent simulation steps.
description
The `DispatchFromGlobalVectorToLocalVectorVisitor` is a component in the SOFA framework under the namespace `sofa::component::linearsystem`. This visitor is part of the Sofa.Component.LinearSystem module and is responsible for copying values from a global vector to local vectors stored within each `BaseMechanicalState`. The location of these copies is determined by a built MappingGraph. This component inherits from `BaseMechanicalVisitor`, indicating its role in visiting mechanical states during simulation steps. It provides the `fwdMechanicalState` method, which processes each `BaseMechanicalState` to copy values based on the given global vector and mapping graph. The practical usage of this visitor involves setting up a MappingGraph that defines where local vectors are located within the global vector. During its operation, it iterates over mechanical states and updates their local vectors with data from the global vector using the defined mappings.
maths
The `DispatchFromGlobalVectorToLocalVectorVisitor` is a visitor component in the SOFA framework, specifically within the namespace `sofa::component::linearsystem`. This component is designed to handle the distribution and allocation of values from a global vector into local vectors associated with each mechanical state (`BaseMechanicalState`). The process is guided by a predefined structure called `MappingGraph`, which specifies how the data in the global vector should be mapped to individual local vectors. ### Role in the FEM Pipeline: This visitor plays an essential role during the assembly phase, particularly when dealing with distributed or multi-state systems. It ensures that each mechanical state receives the relevant part of the global solution vector (e.g., displacements, velocities) necessary for subsequent computations such as time integration and nonlinear solving. ### Mathematical Content: - **Global Vector**: Denoted by \(\mathbf{v}_{ ext{global}}\), this is a concatenated vector that contains values (such as displacements or forces) aggregated from all the mechanical states in the system. The size of this vector is determined by the total degrees of freedom across all local systems. - **Local Vectors**: Each `BaseMechanicalState` maintains its own local vectors, typically representing state variables for individual subcomponents. These are denoted as \(\mathbf{v}_{ ext{local}}^i\), where \(i\) indexes the mechanical states. ### Mapping Process: The core functionality is the mapping of the global vector to each local vector based on the `MappingGraph`. The `MappingGraph` provides a structured representation (often as a set of indices or ranges) that identifies which elements in the global vector correspond to specific locations within individual local vectors. This process can be described mathematically: \[ \mathbf{v}_{ ext{local}}^i = \mathbf{P}^i imes \mathbf{v}_{ ext{global}} \] where \(\mathbf{P}^i\) is a projection matrix derived from the `MappingGraph` that extracts relevant entries from the global vector for each mechanical state. ### Numerical Methods: The visitor operates in a sequential manner, iterating over all `BaseMechanicalState` instances and using the provided `MappingGraph` to determine which portion of the global vector should be copied into each local vector. This ensures consistency between global and local representations of the system state during the simulation. ### Integration with Variational/Lagrangian Mechanics: The visitor is part of a broader framework that enforces the variational principles underlying FEM simulations. By ensuring correct distribution of values from the global solution, it supports consistent application of kinematic constraints and constitutive laws across different mechanical states. In summary, `DispatchFromGlobalVectorToLocalVectorVisitor` ensures seamless integration between global and local representations by leveraging predefined mappings to distribute solution data appropriately among all participating mechanical states.
{
  "name": "DispatchFromGlobalVectorToLocalVectorVisitor",
  "main": {
    "name": "DispatchFromGlobalVectorToLocalVectorVisitor",
    "namespace": "sofa::component::linearsystem",
    "module": "Sofa.Component.LinearSystem",
    "include": "sofa/component/linearsystem/visitors/DispatchFromGlobalVectorToLocalVectorVisitor.h",
    "doc": "Copy the values stored in a global vector to the local vectors stored in teach BaseMechanicalState\nThe copy location is based on a built MappingGraph.",
    "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"
      }
    ]
  },
  "desc": {
    "description": "The `DispatchFromGlobalVectorToLocalVectorVisitor` is a component in the SOFA framework under the namespace `sofa::component::linearsystem`. This visitor is part of the Sofa.Component.LinearSystem module and is responsible for copying values from a global vector to local vectors stored within each `BaseMechanicalState`. The location of these copies is determined by a built MappingGraph. \n\nThis component inherits from `BaseMechanicalVisitor`, indicating its role in visiting mechanical states during simulation steps. It provides the `fwdMechanicalState` method, which processes each `BaseMechanicalState` to copy values based on the given global vector and mapping graph.\n\nThe practical usage of this visitor involves setting up a MappingGraph that defines where local vectors are located within the global vector. During its operation, it iterates over mechanical states and updates their local vectors with data from the global vector using the defined mappings."
  },
  "maths": {
    "maths": "The `DispatchFromGlobalVectorToLocalVectorVisitor` is a visitor component in the SOFA framework, specifically within the namespace `sofa::component::linearsystem`. This component is designed to handle the distribution and allocation of values from a global vector into local vectors associated with each mechanical state (`BaseMechanicalState`). The process is guided by a predefined structure called `MappingGraph`, which specifies how the data in the global vector should be mapped to individual local vectors.\n\n### Role in the FEM Pipeline:\nThis visitor plays an essential role during the assembly phase, particularly when dealing with distributed or multi-state systems. It ensures that each mechanical state receives the relevant part of the global solution vector (e.g., displacements, velocities) necessary for subsequent computations such as time integration and nonlinear solving.\n\n### Mathematical Content:\n- **Global Vector**: Denoted by \\(\\mathbf{v}_{\text{global}}\\), this is a concatenated vector that contains values (such as displacements or forces) aggregated from all the mechanical states in the system. The size of this vector is determined by the total degrees of freedom across all local systems.\n- **Local Vectors**: Each `BaseMechanicalState` maintains its own local vectors, typically representing state variables for individual subcomponents. These are denoted as \\(\\mathbf{v}_{\text{local}}^i\\), where \\(i\\) indexes the mechanical states.\n\n### Mapping Process:\nThe core functionality is the mapping of the global vector to each local vector based on the `MappingGraph`. The `MappingGraph` provides a structured representation (often as a set of indices or ranges) that identifies which elements in the global vector correspond to specific locations within individual local vectors. This process can be described mathematically:\n\n\\[\n  \\mathbf{v}_{\text{local}}^i = \\mathbf{P}^i \times \\mathbf{v}_{\text{global}}\n\\]\nwhere \\(\\mathbf{P}^i\\) is a projection matrix derived from the `MappingGraph` that extracts relevant entries from the global vector for each mechanical state.\n\n### Numerical Methods:\nThe visitor operates in a sequential manner, iterating over all `BaseMechanicalState` instances and using the provided `MappingGraph` to determine which portion of the global vector should be copied into each local vector. This ensures consistency between global and local representations of the system state during the simulation.\n\n### Integration with Variational/Lagrangian Mechanics:\nThe visitor is part of a broader framework that enforces the variational principles underlying FEM simulations. By ensuring correct distribution of values from the global solution, it supports consistent application of kinematic constraints and constitutive laws across different mechanical states.\n\nIn summary, `DispatchFromGlobalVectorToLocalVectorVisitor` ensures seamless integration between global and local representations by leveraging predefined mappings to distribute solution data appropriately among all participating mechanical states."
  },
  "summary": {
    "abstract": "The `DispatchFromGlobalVectorToLocalVectorVisitor` distributes values from a global vector to local vectors in each `BaseMechanicalState`, guided by a predefined MappingGraph.",
    "sheet": "\n# DispatchFromGlobalVectorToLocalVectorVisitor\n\n**Overview:**\nThe `DispatchFromGlobalVectorToLocalVectorVisitor` is responsible for distributing values from a global vector to the local vectors within each `BaseMechanicalState`. This distribution is based on a predefined `MappingGraph`, which specifies how elements in the global vector map to individual local vectors. The component inherits from `BaseMechanicalVisitor`, indicating its role in visiting and processing mechanical states during simulation steps.\n\n**Dependencies and Connections:**\nThe visitor requires access to a `MappingGraph` that defines the mapping between the global vector and each local vector within `BaseMechanicalState`. It interacts with `BaseMechanicalState` instances, updating their local vectors based on the provided mappings. The component is typically used in conjunction with other components involved in assembling and distributing system states.\n\n**Practical Notes:**\nThe visitor operates sequentially, iterating over all `BaseMechanicalState` instances to ensure that each receives its relevant portion of the global vector. Proper setup of the `MappingGraph` is crucial for accurate distribution. Misconfiguration can lead to incorrect state updates, affecting subsequent simulation steps."
  }
}