Back

PointSetTopologyModifier

sofa::component::topology::container::dynamic::PointSetTopologyModifier
Doc (from source)

Topology modifier dedicated to a point topology. A class that can apply basic topology transformations on a set of points.

Abstract (AI generated)

The `PointSetTopologyModifier` manages basic topology transformations on point sets within a SOFA simulation, including adding, removing, renumbering, and swapping points, with an option to propagate changes to Degrees Of Freedom (DOFs).

Metadata
module
Sofa.Component.Topology.Container.Dynamic
namespace
sofa::component::topology::container::dynamic
include
sofa/component/topology/container/dynamic/PointSetTopologyModifier.h
description

The PointSetTopologyModifier is a component in the SOFA framework designed to perform basic topology transformations on sets of points. These operations include adding, removing, renumbering, and swapping points within the simulation domain. This class interacts with the PointSetTopologyContainer, which manages the point topology information, and can propagate changes to mechanical objects' Degrees Of Freedom (DOFs) if desired. The component does not directly implement governing equations or operators like mass matrices, stiffness matrices, internal forces, residuals, etc., but rather focuses on manipulating the underlying topological structure of points.

Governing Equations and Operators:

The PointSetTopologyModifier does not directly contribute to the governing equations such as the mass matrix $M$, stiffness matrix $K$, internal force vector $f_{int}$, or residual vector $R$. Instead, it operates at a more fundamental level by modifying the set of points that form the basis for constructing these operators in subsequent stages.

Constitutive and Kinematic Laws:

The component does not involve constitutive laws (strain measures, stress tensors, hyperelastic potentials) or kinematic laws directly. It is primarily focused on topological changes rather than mechanical properties or behaviors of the material. The modifications to points are purely structural and can influence subsequent operations in the FEM pipeline.

Role in Global FEM Pipeline:

In the broader context of the finite element method (FEM) simulation pipeline, PointSetTopologyModifier plays a crucial role during the mesh generation phase or any stage where topological changes are required. The component can be used to:
- Add new points with various methods such as addPoints, which allows for the dynamic insertion of nodes into the domain.
- Remove existing points using removePoints, effectively deleting nodes from the domain and potentially altering the connectivity between elements.
- Swap points with swapPoints to rearrange node indices, which can be useful in specific scenarios like remeshing or reordering.
- Renumber points through renumberPoints, changing the indexing of nodes within the simulation. This operation might also propagate changes to DOFs if specified via the d_propagateToDOF flag.

Numerical Methods and Discretization Choices:

The component itself does not involve discretization or numerical methods directly related to solving partial differential equations (PDEs) using FEM. However, its operations can indirectly influence these aspects by changing the underlying mesh topology. For instance, adding or removing points can affect the number of degrees of freedom and thus modify the size and structure of matrices like $M$, $K$.

Variational / Lagrangian Mechanics Framework:

In terms of fitting into the broader variational or Lagrangian mechanics framework, PointSetTopologyModifier primarily operates at a structural level. The changes it makes to point sets can influence subsequent steps in the simulation pipeline, such as spatial discretization (FEM) and time integration schemes. For example, adding points might lead to refining elements for more accurate spatial discretization, while removing points could simplify the mesh and potentially reduce computational cost.

Summary:

The PointSetTopologyModifier is a topological transformation tool that manipulates point sets within the simulation domain. It does not directly contribute to governing equations or constitutive laws but plays an essential role in modifying the underlying mesh topology, which can influence subsequent steps in the FEM pipeline such as spatial discretization and time integration.

Data Fields
NameTypeDefaultHelp
d_propagateToDOF bool
Methods
void init () virtual
void swapPoints (const Index i1, const Index i2) virtual
void renumberPoints (const int & index, const int & inv_index, const bool renumberDOF) virtual
void addPoints (const int nPoints, const bool addDOF) virtual
void addPoints (const int nPoints, const int & ancestors, const int & coefs, const bool addDOF) virtual
void addPoints (const int nPoints, const int & ancestorElems, const bool addDOF) virtual
void removePoints (int & indices, const bool removeDOF) virtual
void propagateStateChanges () virtual
void notifyEndingEvent () virtual
void removeItems (const int & )
void addPointsWarning (const int nPoints, const bool addDOF)
void addPointsWarning (const int nPoints, const int & ancestors, const int & coefs, const bool addDOF)
void addPointsWarning (const int nPoints, const int & ancestorElems, const bool addDOF)
void addPointsProcess (const int nPoints) virtual
void removePointsWarning (int & indices, const bool removeDOF)
void removePointsProcess (const int & indices, const bool removeDOF) virtual
void movePointsProcess (const int & id, const int & ancestors, const int & coefs, const bool moveDOF) virtual
void renumberPointsWarning (const int & index, const int & inv_index, const bool renumberDOF)
void renumberPointsProcess (const int & index, const int & , const bool renumberDOF) virtual
void propagateTopologicalChanges () virtual
void propagateTopologicalEngineChanges () virtual
{
  "name": "PointSetTopologyModifier",
  "namespace": "sofa::component::topology::container::dynamic",
  "module": "Sofa.Component.Topology.Container.Dynamic",
  "include": "sofa/component/topology/container/dynamic/PointSetTopologyModifier.h",
  "doc": "Topology modifier dedicated to a point topology.\n\nA class that can apply basic topology transformations on a set of points.",
  "inherits": [],
  "templates": [],
  "data_fields": [
    {
      "name": "d_propagateToDOF",
      "type": "bool"
    }
  ],
  "links": [],
  "methods": [
    {
      "name": "init",
      "return_type": "void",
      "params": [],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "swapPoints",
      "return_type": "void",
      "params": [
        {
          "name": "i1",
          "type": "const Index"
        },
        {
          "name": "i2",
          "type": "const Index"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "renumberPoints",
      "return_type": "void",
      "params": [
        {
          "name": "index",
          "type": "const int &"
        },
        {
          "name": "inv_index",
          "type": "const int &"
        },
        {
          "name": "renumberDOF",
          "type": "const bool"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "addPoints",
      "return_type": "void",
      "params": [
        {
          "name": "nPoints",
          "type": "const int"
        },
        {
          "name": "addDOF",
          "type": "const bool"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "addPoints",
      "return_type": "void",
      "params": [
        {
          "name": "nPoints",
          "type": "const int"
        },
        {
          "name": "ancestors",
          "type": "const int &"
        },
        {
          "name": "coefs",
          "type": "const int &"
        },
        {
          "name": "addDOF",
          "type": "const bool"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "addPoints",
      "return_type": "void",
      "params": [
        {
          "name": "nPoints",
          "type": "const int"
        },
        {
          "name": "ancestorElems",
          "type": "const int &"
        },
        {
          "name": "addDOF",
          "type": "const bool"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "removePoints",
      "return_type": "void",
      "params": [
        {
          "name": "indices",
          "type": "int &"
        },
        {
          "name": "removeDOF",
          "type": "const bool"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "propagateStateChanges",
      "return_type": "void",
      "params": [],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "notifyEndingEvent",
      "return_type": "void",
      "params": [],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "removeItems",
      "return_type": "void",
      "params": [
        {
          "name": "",
          "type": "const int &"
        }
      ],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "addPointsWarning",
      "return_type": "void",
      "params": [
        {
          "name": "nPoints",
          "type": "const int"
        },
        {
          "name": "addDOF",
          "type": "const bool"
        }
      ],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "protected"
    },
    {
      "name": "addPointsWarning",
      "return_type": "void",
      "params": [
        {
          "name": "nPoints",
          "type": "const int"
        },
        {
          "name": "ancestors",
          "type": "const int &"
        },
        {
          "name": "coefs",
          "type": "const int &"
        },
        {
          "name": "addDOF",
          "type": "const bool"
        }
      ],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "protected"
    },
    {
      "name": "addPointsWarning",
      "return_type": "void",
      "params": [
        {
          "name": "nPoints",
          "type": "const int"
        },
        {
          "name": "ancestorElems",
          "type": "const int &"
        },
        {
          "name": "addDOF",
          "type": "const bool"
        }
      ],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "protected"
    },
    {
      "name": "addPointsProcess",
      "return_type": "void",
      "params": [
        {
          "name": "nPoints",
          "type": "const int"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "protected"
    },
    {
      "name": "removePointsWarning",
      "return_type": "void",
      "params": [
        {
          "name": "indices",
          "type": "int &"
        },
        {
          "name": "removeDOF",
          "type": "const bool"
        }
      ],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "protected"
    },
    {
      "name": "removePointsProcess",
      "return_type": "void",
      "params": [
        {
          "name": "indices",
          "type": "const int &"
        },
        {
          "name": "removeDOF",
          "type": "const bool"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "protected"
    },
    {
      "name": "movePointsProcess",
      "return_type": "void",
      "params": [
        {
          "name": "id",
          "type": "const int &"
        },
        {
          "name": "ancestors",
          "type": "const int &"
        },
        {
          "name": "coefs",
          "type": "const int &"
        },
        {
          "name": "moveDOF",
          "type": "const bool"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "protected"
    },
    {
      "name": "renumberPointsWarning",
      "return_type": "void",
      "params": [
        {
          "name": "index",
          "type": "const int &"
        },
        {
          "name": "inv_index",
          "type": "const int &"
        },
        {
          "name": "renumberDOF",
          "type": "const bool"
        }
      ],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "protected"
    },
    {
      "name": "renumberPointsProcess",
      "return_type": "void",
      "params": [
        {
          "name": "index",
          "type": "const int &"
        },
        {
          "name": "",
          "type": "const int &"
        },
        {
          "name": "renumberDOF",
          "type": "const bool"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "protected"
    },
    {
      "name": "propagateTopologicalChanges",
      "return_type": "void",
      "params": [],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "protected"
    },
    {
      "name": "propagateTopologicalEngineChanges",
      "return_type": "void",
      "params": [],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "protected"
    }
  ],
  "description": "The `PointSetTopologyModifier` is a SOFA component dedicated to applying basic topology transformations on sets of points within a simulation. This class allows operations such as adding, removing, renumbering, and swapping points, with the ability to propagate changes to mechanical objects' Degrees Of Freedom (DOFs) if desired.\n\n**Interactions with other components:**\n- The component interacts closely with `PointSetTopologyContainer` for managing point topology information.\n- It can also interact with various `MechanicalObject` components and other topological elements through events that propagate state changes, such as adding or removing points.\n\n**Usage Guidance:**\n- Use this modifier to manipulate point sets within the simulation. For example:\n  - Add new points using `addPoints` methods.\n  - Remove existing points with `removePoints`.\n  - Swap two points with `swapPoints`.\n  - Renumber points and their corresponding DOFs via `renumberPoints`.\n- The `d_propagateToDOF` data field can be set to control whether changes are propagated to the mechanical object's DOFs. Set it to true (default) if you want the changes reflected in the DOFs as well.",
  "maths": "The `PointSetTopologyModifier` is a component in the SOFA framework designed to perform basic topology transformations on sets of points. These operations include adding, removing, renumbering, and swapping points within the simulation domain. This class interacts with the `PointSetTopologyContainer`, which manages the point topology information, and can propagate changes to mechanical objects' Degrees Of Freedom (DOFs) if desired. The component does not directly implement governing equations or operators like mass matrices, stiffness matrices, internal forces, residuals, etc., but rather focuses on manipulating the underlying topological structure of points.\n\n**Governing Equations and Operators:**\n\nThe `PointSetTopologyModifier` does not directly contribute to the governing equations such as the mass matrix \\(M\\), stiffness matrix \\(K\\), internal force vector \\(f_{int}\\), or residual vector \\(R\\). Instead, it operates at a more fundamental level by modifying the set of points that form the basis for constructing these operators in subsequent stages.\n\n**Constitutive and Kinematic Laws:**\n\nThe component does not involve constitutive laws (strain measures, stress tensors, hyperelastic potentials) or kinematic laws directly. It is primarily focused on topological changes rather than mechanical properties or behaviors of the material. The modifications to points are purely structural and can influence subsequent operations in the FEM pipeline.\n\n**Role in Global FEM Pipeline:**\n\nIn the broader context of the finite element method (FEM) simulation pipeline, `PointSetTopologyModifier` plays a crucial role during the mesh generation phase or any stage where topological changes are required. The component can be used to:\n- Add new points with various methods such as `addPoints`, which allows for the dynamic insertion of nodes into the domain.\n- Remove existing points using `removePoints`, effectively deleting nodes from the domain and potentially altering the connectivity between elements.\n- Swap points with `swapPoints` to rearrange node indices, which can be useful in specific scenarios like remeshing or reordering.\n- Renumber points through `renumberPoints`, changing the indexing of nodes within the simulation. This operation might also propagate changes to DOFs if specified via the `d_propagateToDOF` flag.\n\n**Numerical Methods and Discretization Choices:**\n\nThe component itself does not involve discretization or numerical methods directly related to solving partial differential equations (PDEs) using FEM. However, its operations can indirectly influence these aspects by changing the underlying mesh topology. For instance, adding or removing points can affect the number of degrees of freedom and thus modify the size and structure of matrices like \\(M\\), \\(K\\).\n\n**Variational / Lagrangian Mechanics Framework:**\n\nIn terms of fitting into the broader variational or Lagrangian mechanics framework, `PointSetTopologyModifier` primarily operates at a structural level. The changes it makes to point sets can influence subsequent steps in the simulation pipeline, such as spatial discretization (FEM) and time integration schemes. For example, adding points might lead to refining elements for more accurate spatial discretization, while removing points could simplify the mesh and potentially reduce computational cost.\n\n**Summary:**\n\nThe `PointSetTopologyModifier` is a topological transformation tool that manipulates point sets within the simulation domain. It does not directly contribute to governing equations or constitutive laws but plays an essential role in modifying the underlying mesh topology, which can influence subsequent steps in the FEM pipeline such as spatial discretization and time integration.",
  "abstract": "The `PointSetTopologyModifier` manages basic topology transformations on point sets within a SOFA simulation, including adding, removing, renumbering, and swapping points, with an option to propagate changes to Degrees Of Freedom (DOFs).",
  "sheet": "# PointSetTopologyModifier\n\n## Overview\nThe `PointSetTopologyModifier` is a component dedicated to applying basic topology transformations on sets of points within a SOFA simulation. It allows operations such as adding, removing, renumbering, and swapping points, with the ability to propagate changes to mechanical objects' Degrees Of Freedom (DOFs) if desired.\n\n## Parameters and Data\n- **d_propagateToDOF**: A boolean flag that controls whether topological changes are propagated to DOFs. Default is `true`.\n\n## Practical Notes\n- Use this modifier to dynamically manipulate point sets within the simulation domain.\n- Ensure proper configuration of `d_propagateToDOF` based on whether you want changes to be reflected in the mechanical object's DOFs."
}