SumEngine
sofa::component::engine::analyze::SumEngine
DataEngine
Doc (from source)
Computing the sum between two vector of dofs. Computing the Sum between two vector of dofs output = input - substractor
Abstract (AI generated)
The SumEngine computes the sum of elements in an input vector, outputting the result as a single degree-of-freedom value.
Metadata
- module
- Sofa.Component.Engine.Analyze
- namespace
- sofa::component::engine::analyze
- include
- sofa/component/engine/analyze/SumEngine.h
- inherits
-
- DataEngine
- templates
-
- Vec1
- Vec3
- description
The SumEngine is a component within the SOFA framework designed to compute the sum of elements in an input vector. This operation can be mathematically described as follows:
Given an input vector $\mathbf{v} = [v_1, v_2, \\ldots, v_n]$, where each $v_i$ is a degree-of-freedom (DOF), the SumEngine computes the sum of its elements. The output $s$ is given by:
egin{equation}
s = \sum_{i=1}^n v_i
ag{1}
d_output = s.
ag{2}
d_input = [v_1, v_2, \ldots, v_n].
ag{3}
\end{equation}
Role in the Global FEM Pipeline:
- Data Processing: The SumEngine acts as a data processing component within the SOFA framework. It is not directly involved in the core FEM operations such as mass matrix $M$, stiffness matrix $K$, or internal force $f_{int}$ computation, but rather provides utility for analyzing the state of DOFs.
- Initialization and Update: The component initializes its input and output data fields. During each update step (via
doUpdatemethod), it computes the sum of elements in the input vector and stores the result in the output field.
Numerical Methods or Discretization Choices:
- The operation performed by the SumEngine is a straightforward summation using the standard library function
std::accumulate. No specific numerical methods or discretizations are involved, as this component focuses on simple data aggregation rather than FEM-specific operations.
Integration with Variational / Lagrangian Mechanics Framework:
- The SumEngine does not directly contribute to variational formulations or the Euler-Lagrange equations. It serves more as a utility for post-processing or analysis within the SOFA framework, providing flexibility in handling different types of input vectors (e.g., $Vec1$ and $Vec3$).
Constitutive Laws and Kinematic Laws:
- The SumEngine does not involve any constitutive or kinematic laws. It is purely a computational tool for summing elements in a vector, which may be used in various contexts within the simulation pipeline.
Data Fields
| Name | Type | Default | Help |
|---|---|---|---|
d_input |
VecData | |
input vector |
d_output |
DataType | |
output sum |
Methods
void
init
()
virtual
void
reinit
()
virtual
void
doUpdate
()
virtual
{
"name": "SumEngine",
"namespace": "sofa::component::engine::analyze",
"module": "Sofa.Component.Engine.Analyze",
"include": "sofa/component/engine/analyze/SumEngine.h",
"doc": "Computing the sum between two vector of dofs.\n\nComputing the Sum between two vector of dofs\noutput = input - substractor",
"inherits": [
"DataEngine"
],
"templates": [
"Vec1",
"Vec3"
],
"data_fields": [
{
"name": "d_input",
"type": "VecData",
"xmlname": "input",
"help": "input vector"
},
{
"name": "d_output",
"type": "DataType",
"xmlname": "output",
"help": "output sum"
}
],
"links": [],
"methods": [
{
"name": "init",
"return_type": "void",
"params": [],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "reinit",
"return_type": "void",
"params": [],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "doUpdate",
"return_type": "void",
"params": [],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
}
],
"description": "The **SumEngine** is a component within the SOFA framework designed to compute the sum between two vectors of degrees-of-freedom (DOFs). It operates by taking an input vector and computing its sum, outputting the result as another DOF vector.\n\n### Role in SOFA Ecosystem:\n- The **SumEngine** inherits from `DataEngine`, a core engine component within SOFA. This implies it processes data related to mechanical states or other simulation aspects, contributing to the overall analysis pipeline.\n- It operates on generic types (e.g., `Vec1` and `Vec3`) to provide flexibility in handling different dimensions of input vectors.\n\n### Interactions with Other Components:\n- **DataEngine Inheritance**: As a derived class from `DataEngine`, it integrates into the SOFA scene graph architecture, enabling interaction with other engines and components through the standard initialization (`init`), reinitialization (`reinit`), and update (`doUpdate`) methods.\n\n### Practical Usage Guidance:\n- **Input Field** (`input`): This field expects a vector of degrees-of-freedom. The input can be from another SOFA component or directly specified in the XML scene description file.\n- **Output Field** (`output sum`): The output of the engine is the computed sum of the input vector elements, stored as a single degree-of-freedom value (either `Vec1` or `Vec3`).\n\n### Data Fields:\n- **d_input**: Represents the input vector for which the sum needs to be calculated.\n- **d_output**: Holds the result after computing the sum of the elements in the input vector.",
"maths": "The **SumEngine** is a component within the SOFA framework designed to compute the sum of elements in an input vector. This operation can be mathematically described as follows:\n\nGiven an input vector \\(\\mathbf{v} = [v_1, v_2, \\\\ldots, v_n]\\), where each \\(v_i\\) is a degree-of-freedom (DOF), the **SumEngine** computes the sum of its elements. The output \\(s\\) is given by:\n\n\begin{equation}\n s = \\sum_{i=1}^n v_i\n\tag{1}\n\nd_output = s.\n\tag{2}\n\nd_input = [v_1, v_2, \\\\ldots, v_n].\n\tag{3}\n\\end{equation}\n\n### Role in the Global FEM Pipeline:\n- **Data Processing**: The **SumEngine** acts as a data processing component within the SOFA framework. It is not directly involved in the core FEM operations such as mass matrix \\(M\\), stiffness matrix \\(K\\), or internal force \\(f_{int}\\) computation, but rather provides utility for analyzing the state of DOFs.\n- **Initialization and Update**: The component initializes its input and output data fields. During each update step (via `doUpdate` method), it computes the sum of elements in the input vector and stores the result in the output field.\n\n### Numerical Methods or Discretization Choices:\n- The operation performed by the **SumEngine** is a straightforward summation using the standard library function `std::accumulate`. No specific numerical methods or discretizations are involved, as this component focuses on simple data aggregation rather than FEM-specific operations.\n\n### Integration with Variational / Lagrangian Mechanics Framework:\n- The **SumEngine** does not directly contribute to variational formulations or the Euler-Lagrange equations. It serves more as a utility for post-processing or analysis within the SOFA framework, providing flexibility in handling different types of input vectors (e.g., \\(Vec1\\) and \\(Vec3\\)).\n\n### Constitutive Laws and Kinematic Laws:\n- The **SumEngine** does not involve any constitutive or kinematic laws. It is purely a computational tool for summing elements in a vector, which may be used in various contexts within the simulation pipeline.",
"abstract": "The SumEngine computes the sum of elements in an input vector, outputting the result as a single degree-of-freedom value.",
"sheet": "# SumEngine\n\n## Overview\nSumEngine inherits from `DataEngine` and computes the sum of elements in an input vector. It processes data related to mechanical states or other simulation aspects.\n\n## Mathematical Model\nGiven an input vector \\(\\mathbf{v} = [v_1, v_2, \\ldots, v_n]\\), where each \\(v_i\\) is a degree-of-freedom (DOF), the SumEngine computes the sum of its elements. The output \\(s\\) is given by:\n\n\\[ s = \\sum_{i=1}^n v_i \\]\n\nThe result is stored in the `d_output` field.\n\n## Parameters and Data\n- **d_input**: Represents the input vector for which the sum needs to be calculated. Type: VecData.\n- **d_output**: Holds the computed sum of the elements in the input vector. Type: DataType."
}