Back

IndicesFromValues

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

Engine finding the indices of a list of values within a larger set of values. This class returns the indices given a list of values.

Abstract (AI generated)

The `IndicesFromValues` engine finds and returns the indices of specified values within a larger set of global values.

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

The IndicesFromValues component in the Sofa framework is an engine designed to find and return the indices of specified values within a larger set of global values. It does not directly contribute to the governing equations or operators such as mass matrix $M$, stiffness matrix $K$, internal force $f_{int}$, or residual $R$. Instead, it serves a supporting role in the overall FEM simulation pipeline by providing index information for specific values within a dataset.

Role and Purpose:

The primary role of IndicesFromValues is to locate specific values in a dataset and output their corresponding indices. This can be useful for various operations where locating the position or index of certain values within a larger set is necessary, such as filtering, indexing, or mapping values in simulations.

Data Fields:

  • f_values: The input list of values to search for within the global dataset.
    $$ f_{values} = [v_1, v_2, ext{...}, v_n] $$

  • f_global: The larger set of global values where the specified f_values are searched.
    $$ f_{global} = [g_1, g_2, ext{...}, g_m] $$

  • f_indices: Output indices corresponding to the positions of f_values in f_global. These are computed by the component during its update process.
    $$ f_{indices} = [i_1, i_2, ext{...}, i_n] $$

where each $i_k$ is such that $f_{global}[i_k] == v_k$.

  • f_otherIndices: Indices of elements in f_global that do not match any value in f_values, useful for identifying non-matching elements.
    $$ f_{otherIndices} = [j_1, j_2, ext{...}, j_m] $$

where each $j_k$ is such that $g_{j_k}$ does not appear in $f_{values}$.

  • f_recursiveSearch: A boolean flag to control whether to perform a recursive search (true) or a single pass search (false). In recursive mode, it returns indices of all matching values in f_global. Otherwise, it only returns the first match for each value in f_values.
    $$ f_{recursiveSearch} = ext{bool} $$

Numerical Methods and Discretization Choices:

The component does not perform any numerical integration or discretization of partial differential equations. It simply performs a search operation to locate the indices of specified values within a dataset, which is an algorithmic task rather than a mathematical one.

Interaction with Other Components:

As an engine within the Sofa framework, IndicesFromValues interacts primarily with other components that provide or require index information. For example, it can be used to filter vertices in a mesh based on specific criteria, or to identify the positions of certain features within a dataset.

Summary:

The IndicesFromValues component does not directly contribute to the governing equations or operators used in finite element simulations. Instead, it serves as a utility that provides index information for specific values within a dataset, which can be useful for various operations such as filtering and indexing.

Data Fields
NameTypeDefaultHelp
f_values VecValue input values
f_global VecValue Global values, in which the input values are searched
f_indices VecIndex Output indices of the given values, searched in global
f_otherIndices VecIndex Output indices of the other values, (NOT the given ones) searched in global
f_recursiveSearch bool if set to true, output are indices of the \"global\" data matching with one of the values
Methods
void init () virtual
void reinit () virtual
void doUpdate () virtual
{
  "name": "IndicesFromValues",
  "namespace": "sofa::component::engine::select",
  "module": "Sofa.Component.Engine.Select",
  "include": "sofa/component/engine/select/IndicesFromValues.h",
  "doc": "Engine finding the indices of a list of values within a larger set of values.\n\nThis class returns the indices given a list of values.",
  "inherits": [
    "DataEngine"
  ],
  "templates": [
    "SReal",
    "int",
    "type::Vec2",
    "type::Vec3",
    "unsigned int"
  ],
  "data_fields": [
    {
      "name": "f_values",
      "type": "VecValue",
      "xmlname": "values",
      "help": "input values"
    },
    {
      "name": "f_global",
      "type": "VecValue",
      "xmlname": "global",
      "help": "Global values, in which the input values are searched"
    },
    {
      "name": "f_indices",
      "type": "VecIndex",
      "xmlname": "indices",
      "help": "Output indices of the given values, searched in global"
    },
    {
      "name": "f_otherIndices",
      "type": "VecIndex",
      "xmlname": "otherIndices",
      "help": "Output indices of the other values, (NOT the given ones) searched in global"
    },
    {
      "name": "f_recursiveSearch",
      "type": "bool",
      "xmlname": "recursiveSearch",
      "help": "if set to true, output are indices of the \\\"global\\\" data matching with one of the values"
    }
  ],
  "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 `IndicesFromValues` component in the Sofa framework is an engine designed to find and return the indices of specified values within a larger set of global values. It inherits from `DataEngine`, indicating that it processes data and computes outputs based on input data fields.\n\n### Role and Purpose:\nThe primary role of `IndicesFromValues` is to locate specific values in a dataset and output their corresponding indices. This can be useful for various operations where locating the position or index of certain values within a larger set is necessary, such as filtering, indexing, or mapping values in simulations.\n\n### Data Fields:\n- **f_values**: The input list of values to search for within the global dataset.\n- **f_global**: The larger set of global values where the specified `f_values` are searched.\n- **f_indices**: Output indices corresponding to the positions of `f_values` in `f_global`. These are computed by the component during its update process.\n- **f_otherIndices**: Indices of elements in `f_global` that do not match any value in `f_values`, useful for identifying non-matching elements.\n- **f_recursiveSearch**: A boolean flag to control whether to perform a recursive search (true) or a single pass search (false). In recursive mode, it returns indices of all matching values in `f_global`. Otherwise, it only returns the first match for each value in `f_values`.\n\n### Usage:\nThe component can be used in scenarios where precise index information is required to manipulate data or extract specific elements from a dataset. It supports various template types such as integers, floating-point numbers, vectors (`Vec2`, `Vec3`), and arrays of different sizes.\n\n### Interaction with Other Components:\nAs an engine within the Sofa framework, `IndicesFromValues` interacts primarily with other components that provide or require index information. For example, it can be used to filter vertices in a mesh based on specific criteria, or to identify the positions of certain features within a dataset.",
  "maths": "The `IndicesFromValues` component in the Sofa framework is an engine designed to find and return the indices of specified values within a larger set of global values. It does not directly contribute to the governing equations or operators such as mass matrix $M$, stiffness matrix $K$, internal force $f_{int}$, or residual $R$. Instead, it serves a supporting role in the overall FEM simulation pipeline by providing index information for specific values within a dataset.\n\n### Role and Purpose:\nThe primary role of `IndicesFromValues` is to locate specific values in a dataset and output their corresponding indices. This can be useful for various operations where locating the position or index of certain values within a larger set is necessary, such as filtering, indexing, or mapping values in simulations.\n\n### Data Fields:\n- **f_values**: The input list of values to search for within the global dataset.\n  \\[ f_{values} = [v_1, v_2, \text{...}, v_n] \\]\n\n- **f_global**: The larger set of global values where the specified `f_values` are searched.\n  \\[ f_{global} = [g_1, g_2, \text{...}, g_m] \\]\n\n- **f_indices**: Output indices corresponding to the positions of `f_values` in `f_global`. These are computed by the component during its update process.\n  \\[ f_{indices} = [i_1, i_2, \text{...}, i_n] \\]\n  where each $i_k$ is such that $f_{global}[i_k] == v_k$.\n\n- **f_otherIndices**: Indices of elements in `f_global` that do not match any value in `f_values`, useful for identifying non-matching elements.\n  \\[ f_{otherIndices} = [j_1, j_2, \text{...}, j_m] \\]\n  where each $j_k$ is such that $g_{j_k}$ does not appear in $f_{values}$.\n\n- **f_recursiveSearch**: A boolean flag to control whether to perform a recursive search (true) or a single pass search (false). In recursive mode, it returns indices of all matching values in `f_global`. Otherwise, it only returns the first match for each value in `f_values`.\n  \\[ f_{recursiveSearch} = \text{bool} \\]\n\n### Numerical Methods and Discretization Choices:\nThe component does not perform any numerical integration or discretization of partial differential equations. It simply performs a search operation to locate the indices of specified values within a dataset, which is an algorithmic task rather than a mathematical one.\n\n### Interaction with Other Components:\nAs an engine within the Sofa framework, `IndicesFromValues` interacts primarily with other components that provide or require index information. For example, it can be used to filter vertices in a mesh based on specific criteria, or to identify the positions of certain features within a dataset.\n\n### Summary:\nThe `IndicesFromValues` component does not directly contribute to the governing equations or operators used in finite element simulations. Instead, it serves as a utility that provides index information for specific values within a dataset, which can be useful for various operations such as filtering and indexing.",
  "abstract": "The `IndicesFromValues` engine finds and returns the indices of specified values within a larger set of global values.",
  "sheet": "\n# IndicesFromValues\n\n## Overview\n\nThe `IndicesFromValues` component is an engine that locates specific values in a dataset and outputs their corresponding indices. It inherits from `DataEngine`, indicating its role in processing data to compute output indices based on input value lists.\n\n## Parameters and Data\n\n- **f_values**: The input list of values to search for within the global dataset.\n  \\\\[ f_{values} = [v_1, v_2, \\dots, v_n] \\\\]\n\n- **f_global**: The larger set of global values where the specified `f_values` are searched.\n  \\\\[ f_{global} = [g_1, g_2, \\dots, g_m] \\\\]\n\n- **f_indices**: Output indices corresponding to the positions of `f_values` in `f_global`. These are computed by the component during its update process.\n  \\\\[ f_{indices} = [i_1, i_2, \\dots, i_n] \\\\]\n  where each $i_k$ is such that $f_{global}[i_k] == v_k$.\n\n- **f_otherIndices**: Indices of elements in `f_global` that do not match any value in `f_values`, useful for identifying non-matching elements.\n  \\\\[ f_{otherIndices} = [j_1, j_2, \\dots, j_m] \\\\]\n  where each $j_k$ is such that $g_{j_k}$ does not appear in $f_{values}$.\n\n- **f_recursiveSearch**: A boolean flag to control whether to perform a recursive search (true) or a single pass search (false). In recursive mode, it returns indices of all matching values in `f_global`. Otherwise, it only returns the first match for each value in `f_values`.\n  \\\\[ f_{recursiveSearch} = \\text{bool} \\\\]"
}