DataEngine
The `DataEngine` is an abstract class in the SOFA framework, designed to compute sets of Data outputs based on given Data inputs. It inherits from `BaseObject`, indicating that it integrates into the overall scene graph architecture. The primary role of a `DataEngine` is to process data transformations and computations as part of the simulation pipeline. In terms of interactions with other components: - **Inputs/Outputs**: Inputs are added via `addInput()`, and outputs through `addOutput()` methods. These methods help manage dependencies within the Data Dependency Graph (DDG). - **Updates**: The `update()` method triggers all input updates, calls `doUpdate()` for data processing, and cleans up dirty flags using DDG mechanisms. Practical usage guidance includes: - Implementing an engine involves overriding the `init()`, `reinit()`, and `doUpdate()` methods to specify inputs, outputs, and data processing logic respectively. The `addInput` and `addOutput` methods are used during initialization to declare dependencies between data. - Usage is intended for developers who need to create custom data processors or engines within a SOFA simulation.
- abstract
- `DataEngine` manages data transformations and computations in SOFA simulations by adding inputs and outputs, updating based on changes, and ensuring consistent computation within the simulation pipeline.
- sheet
- # DataEngine ## Overview The `DataEngine` is an abstract class that integrates into the SOFA framework to manage data transformations and computations. It handles dependencies between different pieces of Data through methods like `addInput()` and `addOutput()`, ensuring that inputs are updated and outputs are recomputed based on these changes. ## Parameters and Data The significant parameters exposed by the component include: - **Inputs**: Managed via the `addInput()` method, which adds input Data objects to be tracked in a dependency graph mechanism. Each input can be associated with specific groups for organizational purposes. - **Outputs**: Managed via the `addOutput()` method, which adds output Data objects and tracks their dependencies similarly. Outputs are organized into groups if necessary. The component does not have any default parameters or fields beyond these methods.
- description
- The `DataEngine` is an abstract class in the SOFA framework, designed to compute sets of Data outputs based on given Data inputs. It inherits from `BaseObject`, indicating that it integrates into the overall scene graph architecture. The primary role of a `DataEngine` is to process data transformations and computations as part of the simulation pipeline. In terms of interactions with other components: - **Inputs/Outputs**: Inputs are added via `addInput()`, and outputs through `addOutput()` methods. These methods help manage dependencies within the Data Dependency Graph (DDG). - **Updates**: The `update()` method triggers all input updates, calls `doUpdate()` for data processing, and cleans up dirty flags using DDG mechanisms. Practical usage guidance includes: - Implementing an engine involves overriding the `init()`, `reinit()`, and `doUpdate()` methods to specify inputs, outputs, and data processing logic respectively. The `addInput` and `addOutput` methods are used during initialization to declare dependencies between data. - Usage is intended for developers who need to create custom data processors or engines within a SOFA simulation.
- maths
- The `DataEngine` is an abstract class in the SOFA framework, designed to manage data transformations and computations. It plays a crucial role in processing inputs and generating outputs within the simulation pipeline. The primary mathematical content involves the management of data dependencies rather than direct physical or constitutive laws. Here are key aspects of its functionality: - **Inputs/Outputs Management**: The `addInput` method is used to add input Data objects, which are tracked via a dependency graph mechanism. Each input can be associated with specific groups for organizational purposes. Similarly, the `addOutput` method adds output Data objects, also tracking their dependencies and organizing them into groups if necessary. - **Data Processing**: The core data processing occurs in the `doUpdate()` method. This virtual function must be overridden by derived classes to define how input Data is transformed or processed to generate outputs. The transformation itself can involve various mathematical operations depending on the specific engine implementation, but it does not directly implement governing physical equations like those for mass matrix $M$, stiffness matrix $K$, internal forces $f_{int}$, or residuals $R$. - **Dependency Management**: The `updateAllInputs()` method ensures that all input Data objects are updated if they have changed. This is crucial for maintaining consistency in the dependency graph and ensuring that outputs are recomputed based on the latest inputs. The `update()` method orchestrates these steps, calling `updateAllInputs()`, cleaning dirty flags via DDG mechanisms, and invoking the `doUpdate()` function. - **Integration into FEM Pipeline**: The `DataEngine` does not directly contribute to mass matrices, stiffness matrices, or internal forces. Instead, it manages the data flow and transformation processes that can be part of a broader simulation pipeline. It ensures that any necessary computations based on input Data are performed correctly and efficiently. - **Numerical Methods**: The component itself does not encode specific numerical methods or discretization choices beyond managing dependencies between different pieces of Data. The actual mathematical operations for physical simulations (e.g., solving nonlinear systems, time integration schemes) would be implemented in other components like `MechanicalState`, `ForceField`, and `Solver`. - **Lagrangian Mechanics Framework**: The `DataEngine` supports the broader framework by ensuring that data dependencies are correctly managed. This allows for consistent and coherent computation of outputs based on inputs, which is essential for maintaining physical consistency within variational or Lagrangian mechanics formulations. It facilitates the integration of custom engines into the SOFA simulation pipeline without directly contributing to the underlying physics equations. In summary, while `DataEngine` itself does not contain direct mathematical content related to FEM operators or constitutive laws, it is a critical component for managing data dependencies and ensuring that simulations are performed with up-to-date information. It integrates into the broader variational / Lagrangian mechanics framework by facilitating consistent data processing within the simulation pipeline.
{
"name": "DataEngine",
"main": {
"name": "DataEngine",
"namespace": "sofa::core",
"module": "Sofa.framework.Core",
"include": "sofa/core/DataEngine.h",
"doc": "from a set of Data inputs computes a set of Data outputs\nImplementation good rules:\nvoid init()\n{\n addInput // indicate all inputs\n addOutput // indicate all outputs\n}\n// optional (called each time a data is modified in the gui)\n// it is not always desired\nvoid reinit()\n{\n update();\n}\nvoid doUpdate() override\n{\n access your inputs, set your outputs...\n}",
"inherits": [
"BaseObject"
],
"templates": [],
"data_fields": [],
"links": [],
"methods": [
{
"name": "toDataEngine",
"return_type": "const DataEngine *",
"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": true,
"is_static": false,
"access": "protected"
},
{
"name": "doInternalUpdate",
"return_type": "void",
"params": [],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "protected"
},
{
"name": "update",
"return_type": "void",
"params": [],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "addInput",
"return_type": "void",
"params": [
{
"name": "data",
"type": "sofa::core::objectmodel::BaseData *"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "addOutput",
"return_type": "void",
"params": [
{
"name": "n",
"type": "objectmodel::BaseData *"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
}
]
},
"desc": {
"description": "The `DataEngine` is an abstract class in the SOFA framework, designed to compute sets of Data outputs based on given Data inputs. It inherits from `BaseObject`, indicating that it integrates into the overall scene graph architecture. The primary role of a `DataEngine` is to process data transformations and computations as part of the simulation pipeline.\n\nIn terms of interactions with other components:\n- **Inputs/Outputs**: Inputs are added via `addInput()`, and outputs through `addOutput()` methods. These methods help manage dependencies within the Data Dependency Graph (DDG).\n- **Updates**: The `update()` method triggers all input updates, calls `doUpdate()` for data processing, and cleans up dirty flags using DDG mechanisms.\n\nPractical usage guidance includes:\n- Implementing an engine involves overriding the `init()`, `reinit()`, and `doUpdate()` methods to specify inputs, outputs, and data processing logic respectively. The `addInput` and `addOutput` methods are used during initialization to declare dependencies between data.\n- Usage is intended for developers who need to create custom data processors or engines within a SOFA simulation."
},
"maths": {
"maths": "The `DataEngine` is an abstract class in the SOFA framework, designed to manage data transformations and computations. It plays a crucial role in processing inputs and generating outputs within the simulation pipeline. The primary mathematical content involves the management of data dependencies rather than direct physical or constitutive laws. Here are key aspects of its functionality:\n\n- **Inputs/Outputs Management**: \nThe `addInput` method is used to add input Data objects, which are tracked via a dependency graph mechanism. Each input can be associated with specific groups for organizational purposes. Similarly, the `addOutput` method adds output Data objects, also tracking their dependencies and organizing them into groups if necessary.\n\n- **Data Processing**: \nThe core data processing occurs in the `doUpdate()` method. This virtual function must be overridden by derived classes to define how input Data is transformed or processed to generate outputs. The transformation itself can involve various mathematical operations depending on the specific engine implementation, but it does not directly implement governing physical equations like those for mass matrix $M$, stiffness matrix $K$, internal forces $f_{int}$, or residuals $R$.\n\n- **Dependency Management**: \nThe `updateAllInputs()` method ensures that all input Data objects are updated if they have changed. This is crucial for maintaining consistency in the dependency graph and ensuring that outputs are recomputed based on the latest inputs. The `update()` method orchestrates these steps, calling `updateAllInputs()`, cleaning dirty flags via DDG mechanisms, and invoking the `doUpdate()` function.\n\n- **Integration into FEM Pipeline**: \nThe `DataEngine` does not directly contribute to mass matrices, stiffness matrices, or internal forces. Instead, it manages the data flow and transformation processes that can be part of a broader simulation pipeline. It ensures that any necessary computations based on input Data are performed correctly and efficiently.\n\n- **Numerical Methods**: \nThe component itself does not encode specific numerical methods or discretization choices beyond managing dependencies between different pieces of Data. The actual mathematical operations for physical simulations (e.g., solving nonlinear systems, time integration schemes) would be implemented in other components like `MechanicalState`, `ForceField`, and `Solver`.\n\n- **Lagrangian Mechanics Framework**: \nThe `DataEngine` supports the broader framework by ensuring that data dependencies are correctly managed. This allows for consistent and coherent computation of outputs based on inputs, which is essential for maintaining physical consistency within variational or Lagrangian mechanics formulations. It facilitates the integration of custom engines into the SOFA simulation pipeline without directly contributing to the underlying physics equations.\n\nIn summary, while `DataEngine` itself does not contain direct mathematical content related to FEM operators or constitutive laws, it is a critical component for managing data dependencies and ensuring that simulations are performed with up-to-date information. It integrates into the broader variational / Lagrangian mechanics framework by facilitating consistent data processing within the simulation pipeline."
},
"summary": {
"abstract": "`DataEngine` manages data transformations and computations in SOFA simulations by adding inputs and outputs, updating based on changes, and ensuring consistent computation within the simulation pipeline.",
"sheet": "# DataEngine\n\n## Overview\nThe `DataEngine` is an abstract class that integrates into the SOFA framework to manage data transformations and computations. It handles dependencies between different pieces of Data through methods like `addInput()` and `addOutput()`, ensuring that inputs are updated and outputs are recomputed based on these changes.\n\n## Parameters and Data\nThe significant parameters exposed by the component include:\n- **Inputs**: Managed via the `addInput()` method, which adds input Data objects to be tracked in a dependency graph mechanism. Each input can be associated with specific groups for organizational purposes.\n- **Outputs**: Managed via the `addOutput()` method, which adds output Data objects and tracks their dependencies similarly. Outputs are organized into groups if necessary.\n\nThe component does not have any default parameters or fields beyond these methods."
}
}