Back

ROIValueMapper

sofa::component::engine::transform::ROIValueMapper
DataEngine
Doc (from source)

Generate a list of values from value-indices pairs. This class returns a list of values from value-indices pairs

Abstract (AI generated)

The `ROIValueMapper` generates a list of values from index-value pairs for specified regions of interest (ROIs). It supports default values for indices outside defined ROIs.

Metadata
module
Sofa.Component.Engine.Transform
namespace
sofa::component::engine::transform
include
sofa/component/engine/transform/ROIValueMapper.h
inherits
  • DataEngine
description

Mathematical and Physical Description of Quad2TriangleTopologicalMapping


1. Governing Equations or Operators:
1. Governing Equations or Operators:
  • Mass Matrix (M): The Quad2TriangleTopologicalMapping does not directly contribute to the mass matrix, as it is a topological mapping component rather than a physics-based one.
  • Stiffness Matrix (K): Similarly, this component does not contribute to the stiffness matrix. It solely focuses on transforming the quad elements into triangles without altering mechanical properties or forces.
  • Internal Force ( extbf{f}_{int}): No contribution to internal force calculation; it remains a topological operation.
  • Residual (R): The residual related to nonlinear solves is unaffected by this component, as its role is purely topological and does not involve solving PDEs or variational problems directly.

  • Assembly Phase: During assembly, this component is responsible for converting quads to triangles in the input topology before any other mechanical components assemble their contributions (mass matrix, stiffness matrix, etc.). This ensures that all subsequent steps operate on a consistently triangulated mesh.


  • Time Integration: No direct role; it only affects the initial setup of the mesh.
  • Nonlinear Solve and Linear Solve: Since this component does not contribute to any mechanical operators, its impact is limited to setting up the topology correctly before solving begins.
  • Constraint Handling: It does not handle constraints directly but ensures that the underlying connectivity is correct for constraint imposition by other components.

2. Constitutive or Kinematic Laws Involved:
The Quad2TriangleTopologicalMapping does not implement any constitutive or kinematic laws related to material behavior or deformation measures. Instead, it focuses on the conversion of quad elements into triangles while preserving the underlying geometry and connectivity of the mesh.
3. Role in the Global FEM Pipeline:
4. Numerical Methods or Discretization Choices Encoded:*
This component uses a straightforward geometric transformation:
- Each quad element in the input topology is split into two triangular elements, ensuring continuity and consistency of the mesh structure.
- The conversion process ensures that all topological changes (e.g., point removals, additions) are reflected correctly in the output triangulated topology.
5. Fit into the Broader Variational / Lagrangian Mechanics Framework:**
While Quad2TriangleTopologicalMapping does not directly contribute to the variational formulation or mechanical aspects of the simulation, it plays a crucial role by ensuring that the mesh used in subsequent steps is consistent and suitable for finite element analysis. The conversion from quads to triangles ensures that any weak form derived from Lagrangian mechanics can be properly discretized using linear triangular elements, which are commonly supported across various FEM formulations.
Data Fields
NameTypeDefaultHelp
nbROIs unsigned int
f_value SReal
p_defaultValue SReal
Methods
void init () virtual
void reinit () virtual
void parse (sofa::core::objectmodel::BaseObjectDescription * arg) virtual
void parseFields (const int & str)
void doUpdate () virtual
{
  "name": "ROIValueMapper",
  "namespace": "sofa::component::engine::transform",
  "module": "Sofa.Component.Engine.Transform",
  "include": "sofa/component/engine/transform/ROIValueMapper.h",
  "doc": "Generate a list of values from value-indices pairs.\n\nThis class returns a list of values from value-indices pairs",
  "inherits": [
    "DataEngine"
  ],
  "templates": [],
  "data_fields": [
    {
      "name": "nbROIs",
      "type": "unsigned int"
    },
    {
      "name": "f_value",
      "type": "SReal"
    },
    {
      "name": "p_defaultValue",
      "type": "SReal"
    }
  ],
  "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": "parse",
      "return_type": "void",
      "params": [
        {
          "name": "arg",
          "type": "sofa::core::objectmodel::BaseObjectDescription *"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "parseFields",
      "return_type": "void",
      "params": [
        {
          "name": "str",
          "type": "const int &"
        }
      ],
      "is_virtual": false,
      "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": "protected"
    }
  ],
  "description": "The `ROIValueMapper` is a component in the SOFA framework, specifically within the `sofa::component::engine::transform` namespace. It inherits from `DataEngine`, which indicates it processes and generates data based on input parameters. The primary purpose of this component is to generate a list of values from value-index pairs. This class is particularly useful for scenarios where indexed regions (ROIs) need to be mapped to specific values, with the ability to handle default values outside these regions.\n\n**Interactions with Other Components:**\nThe `ROIValueMapper` interacts with other SOFA components primarily through its input and output data fields. It takes in parameters such as the number of ROIs (`nbROIs`), indices for each ROI (`f_indices`), and corresponding values (`f_value`). The component processes these inputs to generate an output list of values, stored in `f_outputValues`. Additionally, it supports a default value (`p_defaultValue`) that is used for indices outside the specified ROIs. This mechanism facilitates data transformation tasks within the SOFA simulation pipeline.\n\n**Practical Usage Guidance:**\nThe component's main method, `doUpdate`, processes the input data to generate the output values based on the given index-value pairs and default value settings. The initialization methods (`init` and `reinit`) ensure that the component is correctly sized and prepared for processing. Users should provide appropriate configurations for `nbROIs`, `f_indices`, and `f_value` to achieve desired mappings.\n\n**Data Fields:**\n- **nbROIs**: Specifies the size of indices/value vectors (unsigned int).\n- **f_value**: Stores the values associated with each ROI (SReal type).\n- **p_defaultValue**: Sets a default value for indices outside the defined ROIs (SReal type).",
  "maths": "The `ROIValueMapper` component in the SOFA framework is primarily designed to generate a list of values based on index-value pairs for specified regions of interest (ROIs). This component does not directly contribute to the governing equations or operators such as mass matrix \\(M\\), stiffness matrix \\(K\\), internal force vector \\(f_{int}\\), or residual \\(R\\) that are typical in finite element methods (FEM). Instead, it focuses on data processing and transformation tasks within the broader simulation pipeline. The component's role is more related to pre-processing steps where indexed regions need to be mapped to specific values, possibly for use as input in further physical simulations or post-processing stages.\n\n### Governing Equations/Operators:\n- **None**: The `ROIValueMapper` does not implement any governing equations or operators directly relevant to the FEM simulation. It is a data processing component and does not contribute to mass matrix \\(M\\), stiffness matrix \\(K\\), internal force vector \\(f_{int}\\), or residual \\(R\\).\n\n### Constitutive/Kinematic Laws:\n- **None**: The `ROIValueMapper` does not involve any constitutive laws, kinematic relations, strain measures, stress tensors, hyperelastic potentials, damping models, constraint Jacobians, or other mechanical relationships. It is purely focused on data manipulation.\n\n### Role in the Global FEM Pipeline:\n- **Data Transformation**: The component processes input index-value pairs and generates an output list of values for each index. This can be seen as a pre-processing step where it prepares indexed data for potential use in subsequent simulation steps, such as setting boundary conditions or material parameters.\n\n### Numerical Methods/Discretization Choices:\n- **Index-Based Mapping**: The component uses a straightforward method to map indices to values based on predefined ROIs and default values. It does not involve any advanced numerical methods specific to FEM discretization.\n\n### Variational/Lagrangian Mechanics Framework Fit:\n- **None Direct Contribution**: As it is a data processing component, the `ROIValueMapper` does not directly fit into the variational or Lagrangian mechanics framework. However, its output can be used as input in parts of the simulation pipeline that are grounded in these frameworks.\n\n**Data Fields Summary:*\n- **nbROIs**: Defines the size of indices/value vectors (unsigned int).\n- **f_value**: Stores values associated with each ROI (SReal type).\n- **p_defaultValue**: Default value for indices outside defined ROIs (SReal type).",
  "abstract": "The `ROIValueMapper` generates a list of values from index-value pairs for specified regions of interest (ROIs). It supports default values for indices outside defined ROIs.",
  "sheet": "\n# ROIValueMapper\n\n## Overview\n\nThe `ROIValueMapper` is a component in the SOFA framework that processes and generates data based on input parameters. Specifically, it maps index-value pairs to generate an output list of values for each index within specified regions of interest (ROIs). It inherits from `DataEngine`, indicating its role in data processing tasks.\n\n## Parameters and Data\n\nThe significant Data fields exposed by the component are:\n\n- **nbROIs**: Specifies the size of indices/value vectors. Type: unsigned int.\n- **f_value**: Stores values associated with each ROI. Type: SReal.\n- **p_defaultValue**: Sets a default value for indices outside defined ROIs. Type: SReal.\n\n## Dependencies and Connections\n\nThe `ROIValueMapper` interacts primarily through its input and output data fields, such as the number of ROIs (`nbROIs`), indices for each ROI (`f_indices`), and corresponding values (`f_value`). It processes these inputs to generate an output list of values, stored in `f_outputValues`. Additionally, it supports a default value (`p_defaultValue`) that is used for indices outside the specified ROIs. This mechanism facilitates data transformation tasks within the SOFA simulation pipeline."
}