AssembleGlobalVectorFromLocalVectorVisitor
The `AssembleGlobalVectorFromLocalVectorVisitor` is a visitor in the SOFA framework that copies vectors stored in a `BaseMechanicalState` into a global vector of type `BaseVector`. This copying operation relies on a predefined `MappingGraph` to determine where each local vector should be placed within the global vector. It inherits from `BaseMechanicalVisitor`, indicating its role as part of SOFA's mechanical processing pipeline. ### Interactions with Other Components: The visitor interacts primarily with `BaseMechanicalState` through the `fwdMechanicalState` method, which is overridden to perform the copying operation. The `MappingGraph` plays a critical role in determining how and where local vectors are assembled into the global vector. ### Practical Usage Guidance: The component does not have user-configurable data fields or links provided directly within its metadata. Its functionality is tightly coupled with other SOFA components, particularly those involved in mechanical state management and linear systems. Users typically do not need to interact with this visitor directly but rely on it as part of the internal mechanics of larger simulations.
- abstract
- The `AssembleGlobalVectorFromLocalVectorVisitor` assembles local vectors from individual mechanical states into a global vector using mappings defined by the `MappingGraph`, ensuring accurate aggregation for finite element analysis.
- sheet
- # AssembleGlobalVectorFromLocalVectorVisitor ## Overview The `AssembleGlobalVectorFromLocalVectorVisitor` is a visitor component in SOFA that assembles local vectors from individual mechanical states (`BaseMechanicalState`) into a global vector of type `BaseVector`. This operation relies on the predefined mappings provided by the `MappingGraph` to determine where each local vector should be placed within the global vector. ## Mathematical Model The process of assembling local vectors into the global vector can be described mathematically as follows: Let \(\mathbf{v}_i\) represent a local vector associated with mechanical state `mm` at node `i`, where `i` is an index in the `MappingGraph`. The goal is to assemble these local vectors into a global vector \(\bar{V}\). The position of each local vector within the global vector is determined by the `MappingGraph`. Suppose the position of the local vector \(\mathbf{v}_i\) in the global vector is given by an index set \(\Omega_i\). Then, the assembly operation can be described as: \[\bar{V}_{\text{global}} = \sum_{i} \bar{V}_i, \quad \text{where } \bar{V}_i = (0, 0, ..., \mathbf{v}_i, ..., 0)\] Here, \(\mathbf{v}_i\) is the local vector inserted into its correct position within the global vector \(\bar{V}_{\text{global}}\). ## Dependencies and Connections The visitor interacts primarily with `BaseMechanicalState` through the `fwdMechanicalState` method, which is overridden to perform the copying operation. The `MappingGraph` plays a critical role in determining how and where local vectors are assembled into the global vector.
- description
- The `AssembleGlobalVectorFromLocalVectorVisitor` is a visitor in the SOFA framework that copies vectors stored in a `BaseMechanicalState` into a global vector of type `BaseVector`. This copying operation relies on a predefined `MappingGraph` to determine where each local vector should be placed within the global vector. It inherits from `BaseMechanicalVisitor`, indicating its role as part of SOFA's mechanical processing pipeline. ### Interactions with Other Components: The visitor interacts primarily with `BaseMechanicalState` through the `fwdMechanicalState` method, which is overridden to perform the copying operation. The `MappingGraph` plays a critical role in determining how and where local vectors are assembled into the global vector. ### Practical Usage Guidance: The component does not have user-configurable data fields or links provided directly within its metadata. Its functionality is tightly coupled with other SOFA components, particularly those involved in mechanical state management and linear systems. Users typically do not need to interact with this visitor directly but rely on it as part of the internal mechanics of larger simulations.
- maths
- The `AssembleGlobalVectorFromLocalVectorVisitor` is a critical component in SOFA's mechanical processing pipeline, specifically designed to assemble local vectors into a global vector using information from the `MappingGraph`. This visitor plays a key role during the assembly phase of finite element analysis (FEA) and linear system management. ### Role in Global FEM Pipeline: The `AssembleGlobalVectorFromLocalVectorVisitor` is responsible for taking vectors from individual mechanical states (`BaseMechanicalState`) and assembling them into a global vector. This step is essential during the assembly phase, where local contributions (e.g., forces, displacements) are aggregated to form the global system matrix and right-hand side vectors. ### Mathematical Description: The process of assembling local vectors into the global vector can be described mathematically as follows: Let \(\mathbf{v}_i\) represent a local vector associated with mechanical state `mm` at node `i`, where `i` is an index in the `MappingGraph`. The goal is to assemble these local vectors into a global vector \(m{ar{V}}\). The position of each local vector within the global vector is determined by the `MappingGraph`. Suppose the position of the local vector \(\mathbf{v}_i\) in the global vector is given by an index set \(\Omega_i\). Then, the assembly operation can be described as: egin{equation} m{ar{V}}_{ ext{global}} = \sum_{i} m{ar{V}}_i, \quad \text{where } m{ar{V}}_i = (0, 0, ..., m{ar{v}_i}, ..., 0) \end{equation} Here, \(m{ar{v}_i}\) is the local vector inserted into its correct position within the global vector \(m{ar{V}}_{ ext{global}}\). ### Numerical Methods and Discretization Choices: The assembly process involves sparse matrix operations due to the sparsity of finite element matrices. The `MappingGraph` ensures that each local contribution is placed correctly, avoiding overlapping or incorrect placement. ### Variational / Lagrangian Mechanics Framework: In the context of variational mechanics, the global vector \(m{ar{V}}_{ ext{global}}\) could represent a set of forces, displacements, or other state variables. The assembly process ensures that these local contributions are correctly combined into a single system-wide representation, which is essential for solving the equations of motion in finite element analysis. ### Summary: The `AssembleGlobalVectorFromLocalVectorVisitor` component efficiently handles the critical task of assembling local vectors into a global vector using the predefined mappings provided by the `MappingGraph`. This step is foundational to ensuring that all local contributions are accurately aggregated, leading to a well-formed global system matrix or right-hand side vector for further processing in SOFA's mechanical simulation framework.
{
"name": "AssembleGlobalVectorFromLocalVectorVisitor",
"main": {
"name": "AssembleGlobalVectorFromLocalVectorVisitor",
"namespace": "sofa::component::linearsystem",
"module": "Sofa.Component.LinearSystem",
"include": "sofa/component/linearsystem/visitors/AssembleGlobalVectorFromLocalVectorVisitor.h",
"doc": "Copy a vector stored in a BaseMechanicalState into a global vector of type BaseVector.\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 `AssembleGlobalVectorFromLocalVectorVisitor` is a visitor in the SOFA framework that copies vectors stored in a `BaseMechanicalState` into a global vector of type `BaseVector`. This copying operation relies on a predefined `MappingGraph` to determine where each local vector should be placed within the global vector. It inherits from `BaseMechanicalVisitor`, indicating its role as part of SOFA's mechanical processing pipeline.\n\n### Interactions with Other Components:\nThe visitor interacts primarily with `BaseMechanicalState` through the `fwdMechanicalState` method, which is overridden to perform the copying operation. The `MappingGraph` plays a critical role in determining how and where local vectors are assembled into the global vector.\n\n### Practical Usage Guidance:\nThe component does not have user-configurable data fields or links provided directly within its metadata. Its functionality is tightly coupled with other SOFA components, particularly those involved in mechanical state management and linear systems. Users typically do not need to interact with this visitor directly but rely on it as part of the internal mechanics of larger simulations."
},
"maths": {
"maths": "The `AssembleGlobalVectorFromLocalVectorVisitor` is a critical component in SOFA's mechanical processing pipeline, specifically designed to assemble local vectors into a global vector using information from the `MappingGraph`. This visitor plays a key role during the assembly phase of finite element analysis (FEA) and linear system management.\n\n### Role in Global FEM Pipeline:\nThe `AssembleGlobalVectorFromLocalVectorVisitor` is responsible for taking vectors from individual mechanical states (`BaseMechanicalState`) and assembling them into a global vector. This step is essential during the assembly phase, where local contributions (e.g., forces, displacements) are aggregated to form the global system matrix and right-hand side vectors.\n\n### Mathematical Description:\nThe process of assembling local vectors into the global vector can be described mathematically as follows:\n\nLet \\(\\mathbf{v}_i\\) represent a local vector associated with mechanical state `mm` at node `i`, where `i` is an index in the `MappingGraph`. The goal is to assemble these local vectors into a global vector \\(\bm{\bar{V}}\\).\n\nThe position of each local vector within the global vector is determined by the `MappingGraph`. Suppose the position of the local vector \\(\\mathbf{v}_i\\) in the global vector is given by an index set \\(\\Omega_i\\). Then, the assembly operation can be described as:\n\n\begin{equation}\n \bm{\bar{V}}_{\text{global}} = \\sum_{i} \bm{\bar{V}}_i, \\quad \\text{where } \bm{\bar{V}}_i = (0, 0, ..., \bm{\bar{v}_i}, ..., 0)\n\\end{equation}\n\nHere, \\(\bm{\bar{v}_i}\\) is the local vector inserted into its correct position within the global vector \\(\bm{\bar{V}}_{\text{global}}\\).\n\n### Numerical Methods and Discretization Choices:\nThe assembly process involves sparse matrix operations due to the sparsity of finite element matrices. The `MappingGraph` ensures that each local contribution is placed correctly, avoiding overlapping or incorrect placement.\n\n### Variational / Lagrangian Mechanics Framework:\nIn the context of variational mechanics, the global vector \\(\bm{\bar{V}}_{\text{global}}\\) could represent a set of forces, displacements, or other state variables. The assembly process ensures that these local contributions are correctly combined into a single system-wide representation, which is essential for solving the equations of motion in finite element analysis.\n\n### Summary:\nThe `AssembleGlobalVectorFromLocalVectorVisitor` component efficiently handles the critical task of assembling local vectors into a global vector using the predefined mappings provided by the `MappingGraph`. This step is foundational to ensuring that all local contributions are accurately aggregated, leading to a well-formed global system matrix or right-hand side vector for further processing in SOFA's mechanical simulation framework."
},
"summary": {
"abstract": "The `AssembleGlobalVectorFromLocalVectorVisitor` assembles local vectors from individual mechanical states into a global vector using mappings defined by the `MappingGraph`, ensuring accurate aggregation for finite element analysis.",
"sheet": "# AssembleGlobalVectorFromLocalVectorVisitor\n\n## Overview\nThe `AssembleGlobalVectorFromLocalVectorVisitor` is a visitor component in SOFA that assembles local vectors from individual mechanical states (`BaseMechanicalState`) into a global vector of type `BaseVector`. This operation relies on the predefined mappings provided by the `MappingGraph` to determine where each local vector should be placed within the global vector.\n\n## Mathematical Model\nThe process of assembling local vectors into the global vector can be described mathematically as follows:\n\nLet \\(\\mathbf{v}_i\\) represent a local vector associated with mechanical state `mm` at node `i`, where `i` is an index in the `MappingGraph`. The goal is to assemble these local vectors into a global vector \\(\\bar{V}\\).\n\nThe position of each local vector within the global vector is determined by the `MappingGraph`. Suppose the position of the local vector \\(\\mathbf{v}_i\\) in the global vector is given by an index set \\(\\Omega_i\\). Then, the assembly operation can be described as:\n\n\\[\\bar{V}_{\\text{global}} = \\sum_{i} \\bar{V}_i, \\quad \\text{where } \\bar{V}_i = (0, 0, ..., \\mathbf{v}_i, ..., 0)\\]\n\nHere, \\(\\mathbf{v}_i\\) is the local vector inserted into its correct position within the global vector \\(\\bar{V}_{\\text{global}}\\).\n\n## Dependencies and Connections\nThe visitor interacts primarily with `BaseMechanicalState` through the `fwdMechanicalState` method, which is overridden to perform the copying operation. The `MappingGraph` plays a critical role in determining how and where local vectors are assembled into the global vector.\n"
}
}