Back

ValuesFromIndices

sofa::component::engine::select::ValuesFromIndices
DataEngine
Doc (from source)

Find the values given a list of indices. This class returns the values given a list of indices.

Abstract (AI generated)

Retrieves values from input arrays based on specified indices, serving as a utility for data selection within SOFA simulations.

Metadata
module
Sofa.Component.Engine.Select
namespace
sofa::component::engine::select
include
sofa/component/engine/select/ValuesFromIndices.h
inherits
  • DataEngine
templates
  • SReal
  • int
  • type::Vec2
  • type::Vec3
  • type::Vec4
  • type::Vec6
  • unsigned int
description

The ValuesFromIndices component is primarily a data processing engine that retrieves specific values from an input array based on provided indices. This functionality is not directly involved in the core mathematical and physical formulations of Finite Element Method (FEM) simulations, such as mass matrix ($M"]), stiffness matrix (\(K"]), internal forces (\(f_{int}")), residual (\(R")), or constitutive laws like strain measures and stress tensors. Instead, it serves a utility role in the simulation pipeline by facilitating data selection and manipulation. ### Governing Equations and Operators The component does not implement any governing equations specific to FEM simulations. Its operation is based on straightforward indexing and value retrieval from input arrays, which can be mathematically represented as follows: - **Input Values**: \ where each element \\(v_i\$ is a value in the array.

  • Indices: \$$ I = [i_1, i_2, ..., i_m] \$$
    where each index \$i_k\$ specifies which value from the input array to retrieve.

  • Output Values: \$$ \mathbf{u} = [v_{i_1}, v_{i_2}, ..., v_{i_m}] \$$
    where each element in \$\mathbf{u}$ corresponds to a value from the input array at the specified index.

Constitutive or Kinematic Laws

This component does not directly handle constitutive laws or kinematic relationships. It is more of a data manipulation tool and can be used with various types of data, including scalars, vectors, and rigid body transformations. However, it does not perform any material-specific computations.

Role in the FEM Pipeline

In the context of the broader FEM simulation pipeline, ValuesFromIndices is primarily involved in data selection and preparation rather than core simulation steps such as assembly, time integration, nonlinear solve, linear solve, constraint handling, or mapping. It might be used to extract specific nodal values for further processing or visualization.

Numerical Methods and Discretization Choices

The component does not involve any numerical methods or discretization choices typical of FEM simulations. Its operation is based on basic indexing operations which are deterministic and do not require iterative solvers, integration schemes, or other advanced numerical techniques.

Variational / Lagrangian Mechanics Framework

This component does not directly contribute to the variational formulation or Lagrangian mechanics framework used in FEM simulations. It serves as a utility for data manipulation within the simulation environment but is not involved in formulating or solving the equations of motion or constitutive relations.

Conclusion

The ValuesFromIndices component plays a supporting role in the SOFA simulation framework by enabling efficient retrieval and selection of values based on specified indices. It does not contribute to the core mathematical or physical formulations of FEM simulations but is useful for preparing and manipulating data within the broader simulation pipeline.

Data Fields
NameTypeDefaultHelp
f_in VecValue input values
f_indices VecIndex Indices of the values
f_out VecValue Output values corresponding to the indices
Methods
void init () virtual
void reinit () virtual
void doUpdate () virtual
{
  "name": "ValuesFromIndices",
  "namespace": "sofa::component::engine::select",
  "module": "Sofa.Component.Engine.Select",
  "include": "sofa/component/engine/select/ValuesFromIndices.h",
  "doc": "Find the values given a list of indices.\n\nThis class returns the values given a list of indices.",
  "inherits": [
    "DataEngine"
  ],
  "templates": [
    "SReal",
    "int",
    "type::Vec2",
    "type::Vec3",
    "type::Vec4",
    "type::Vec6",
    "unsigned int"
  ],
  "data_fields": [
    {
      "name": "f_in",
      "type": "VecValue",
      "xmlname": "in",
      "help": "input values"
    },
    {
      "name": "f_indices",
      "type": "VecIndex",
      "xmlname": "indices",
      "help": "Indices of the values"
    },
    {
      "name": "f_out",
      "type": "VecValue",
      "xmlname": "out",
      "help": "Output values corresponding to the indices"
    }
  ],
  "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 `ValuesFromIndices` component is part of the SOFA framework and belongs to the Sofa.Component.Engine.Select module. It serves as an engine for retrieving values from a given list of indices, acting on various data types including real numbers, integers, vectors, and rigid types. This class inherits from `DataEngine`, indicating its role in processing data within the simulation pipeline.\n\nThe component interacts with other SOFA components through its API fields:\n- **f_in**: Input values (VecValue)\n- **f_indices**: Indices of the values to be selected (VecIndex)\n- **f_out**: Output values corresponding to the provided indices (VecValue)\n\nAdditionally, it provides a string representation of the output values (`f_outStr`). The component overrides methods such as `init`, `reinit`, and `doUpdate` for its operation. These methods ensure that the component initializes correctly, reinitializes on demand, and updates its outputs based on the provided indices.\n\nPractical usage involves setting up input data (values) and specifying which indices are to be selected. The output will then contain the values corresponding to these indices.",
  "maths": "The `ValuesFromIndices` component is primarily a data processing engine that retrieves specific values from an input array based on provided indices. This functionality is not directly involved in the core mathematical and physical formulations of Finite Element Method (FEM) simulations, such as mass matrix (\\(M\"]), stiffness matrix (\\(K\"]), internal forces (\\(f_{int}\")), residual (\\(R\")), or constitutive laws like strain measures and stress tensors. Instead, it serves a utility role in the simulation pipeline by facilitating data selection and manipulation.\n\n### Governing Equations and Operators\nThe component does not implement any governing equations specific to FEM simulations. Its operation is based on straightforward indexing and value retrieval from input arrays, which can be mathematically represented as follows:\n\n- **Input Values**: \\\\[ \\mathbf{v} = [v_1, v_2, ..., v_n] \\\\]\n  where each element \\\\(v_i\\\\) is a value in the array.\n\n- **Indices**: \\\\[ I = [i_1, i_2, ..., i_m] \\\\]\n  where each index \\\\(i_k\\\\) specifies which value from the input array to retrieve.\n\n- **Output Values**: \\\\[ \\mathbf{u} = [v_{i_1}, v_{i_2}, ..., v_{i_m}] \\\\]\n  where each element in \\\\(\\mathbf{u}\\) corresponds to a value from the input array at the specified index.\n\n### Constitutive or Kinematic Laws\nThis component does not directly handle constitutive laws or kinematic relationships. It is more of a data manipulation tool and can be used with various types of data, including scalars, vectors, and rigid body transformations. However, it does not perform any material-specific computations.\n\n### Role in the FEM Pipeline\nIn the context of the broader FEM simulation pipeline, `ValuesFromIndices` is primarily involved in data selection and preparation rather than core simulation steps such as assembly, time integration, nonlinear solve, linear solve, constraint handling, or mapping. It might be used to extract specific nodal values for further processing or visualization.\n\n### Numerical Methods and Discretization Choices\nThe component does not involve any numerical methods or discretization choices typical of FEM simulations. Its operation is based on basic indexing operations which are deterministic and do not require iterative solvers, integration schemes, or other advanced numerical techniques.\n\n### Variational / Lagrangian Mechanics Framework\nThis component does not directly contribute to the variational formulation or Lagrangian mechanics framework used in FEM simulations. It serves as a utility for data manipulation within the simulation environment but is not involved in formulating or solving the equations of motion or constitutive relations.\n\n### Conclusion\nThe `ValuesFromIndices` component plays a supporting role in the SOFA simulation framework by enabling efficient retrieval and selection of values based on specified indices. It does not contribute to the core mathematical or physical formulations of FEM simulations but is useful for preparing and manipulating data within the broader simulation pipeline.",
  "abstract": "Retrieves values from input arrays based on specified indices, serving as a utility for data selection within SOFA simulations.",
  "sheet": "<h1>ValuesFromIndices</h1>\n\n<h2>Overview</h2>\n<p>The `ValuesFromIndices` component is an engine that retrieves specific values from an input array based on provided indices. It inherits from the `DataEngine` class and serves as a utility for data selection within SOFA simulations.</p>\n\n<h2>Parameters and Data</h2>\n<ul>\n<li><strong>f_in (VecValue)</strong>: Input values to be selected from.</li>\n<li><strong>f_indices (VecIndex)</strong>: Indices of the values to be retrieved. Each index specifies which value from the input array should be selected.</li>\n<li><strong>f_out (VecValue)</strong>: Output values corresponding to the provided indices. The component retrieves and outputs these values based on the specified indices.</li>\n</ul>"
}