TetrahedronSetTopologyModifier
Topology modifier dedicated to a tetrahedral topology. A class that modifies the topology by adding and removing tetrahedra
The `TetrahedronSetTopologyModifier` modifies tetrahedral topology by adding or removing tetrahedra within a mesh, ensuring consistency in related elements such as vertices, edges, and triangles.
- module
- Sofa.Component.Topology.Container.Dynamic
- namespace
- sofa::component::topology::container::dynamic
- include
- sofa/component/topology/container/dynamic/TetrahedronSetTopologyModifier.h
- inherits
-
- TriangleSetTopologyModifier
- description
The TetrahedronSetTopologyModifier is a crucial component in the SOFA framework that facilitates dynamic modifications to tetrahedral meshes, which are essential for simulating deformable objects and handling topological changes during runtime. This modifier extends functionality inherited from TriangleSetTopologyModifier, focusing specifically on operations related to tetrahedra within a mesh.
Role and Mathematical Description:
1. Adding Tetrahedra
- The method
addTetrahedrais used to add new tetrahedra to the existing mesh. This process involves updating several data structures to maintain consistency in the topology. - Given an array of vertex indices that define a set of new tetrahedra, the modifier adds these elements to the mesh and updates cross-referencing buffers (e.g.,
m_tetrahedraAroundVertex,m_edgesInTetrahedron,m_trianglesInTetrahedron). - The method ensures that new triangles are created if necessary and handles ancestor and barycentric coordinate information for each added tetrahedron.
2. Removing Tetrahedra
- The method
removeTetrahedrais used to remove specified tetrahedra from the mesh. This operation involves several steps:- Removing isolated vertices, edges, and triangles if necessary.
- Updating cross-referencing buffers (e.g.,
m_tetrahedraAroundVertex,m_edgesInTetrahedron,m_trianglesInTetrahedron) to reflect the removal of tetrahedra. - Propagating topological changes through the simulation environment to ensure consistency in other components that rely on mesh topology.
3. Handling Topology Events
- The component uses methods like
addTetrahedraWarningandremoveTetrahedraWarningto issue warnings about topological changes, which are then processed bypropagateTopologicalEngineChanges. This ensures that all relevant components in the simulation environment are notified of these changes.
Interactions with Other Components:
- The component interacts closely with a
TetrahedronSetTopologyContainer, which manages the tetrahedral data structure. The modifier accesses and modifies this container to add or remove tetrahedra while maintaining consistency across related elements (vertices, edges, triangles). - Topological changes are communicated via topology event handling mechanisms, ensuring that all components in the simulation environment remain synchronized with the mesh modifications.
Physical Interpretation:
- In the context of FEM simulations within SOFA, the
TetrahedronSetTopologyModifierplays a critical role in dynamic mesh management. It allows for realistic and efficient handling of topological changes that might occur during simulations (e.g., cutting operations, material separation).
Mathematical Notation:
- Let $ T \$ denote the set of tetrahedra in the mesh.
- Adding a new tetrahedron involves updating $ T \$, and ensuring that related elements (vertices, edges, triangles) are consistent with this addition. Mathematically, if a tetrahedron $ t_i = [v_1, v_2, v_3, v_4] $ is added, then:
$$ T' = T \\cup \{t_i\} $$ - Removing a tetrahedron involves the inverse operation. If $ t_j \in T $, then removing it results in:
$$ T'' = T - \{t_j\} $$
In summary, the TetrahedronSetTopologyModifier facilitates dynamic modifications to the mesh topology while ensuring that all related elements are updated consistently. This is essential for maintaining the integrity of FEM simulations and enabling real-time or high-fidelity topological changes.
Data Fields
| Name | Type | Default | Help |
|---|---|---|---|
removeIsolated |
bool | |
Methods
void
init
()
virtual
void
reinit
()
virtual
void
addTetrahedra
(const int & tetrahedra)
virtual
void
addTetrahedra
(const int & tetrahedra, const int & ancestors, const int & baryCoefs)
virtual
void
addTetrahedronProcess
(Tetrahedron e)
void
removeTetrahedra
(const int & tetrahedraIds, const bool removeIsolatedItems)
virtual
void
removeItems
(const int & items)
void
RemoveTetraBall
(TetrahedronID ind_ta, TetrahedronID ind_tb)
void
addTetrahedraWarning
(const int nTetrahedra, const int & tetrahedraList, const int & tetrahedraIndexList)
void
addTetrahedraWarning
(const int nTetrahedra, const int & tetrahedraList, const int & tetrahedraIndexList, const int & ancestors, const int & baryCoefs)
void
addTetrahedraProcess
(const int & tetrahedra)
virtual
void
removeTetrahedraWarning
(int & tetrahedra)
void
removeTetrahedraProcess
(const int & indices, const bool removeIsolatedItems)
virtual
void
addTrianglesProcess
(const int & triangles)
void
removeTrianglesProcess
(const int & indices, const bool removeIsolatedEdges, const bool removeIsolatedPoints)
void
addEdgesProcess
(const int & edges)
void
removeEdgesProcess
(const int & indices, const bool removeIsolatedItems)
void
addPointsProcess
(const int nPoints)
void
removePointsProcess
(const int & indices, const bool removeDOF)
void
renumberPointsProcess
(const int & index, const int & , const bool renumberDOF)
void
propagateTopologicalEngineChanges
()
virtual
{
"name": "TetrahedronSetTopologyModifier",
"namespace": "sofa::component::topology::container::dynamic",
"module": "Sofa.Component.Topology.Container.Dynamic",
"include": "sofa/component/topology/container/dynamic/TetrahedronSetTopologyModifier.h",
"doc": "Topology modifier dedicated to a tetrahedral topology.\n\nA class that modifies the topology by adding and removing tetrahedra",
"inherits": [
"TriangleSetTopologyModifier"
],
"templates": [],
"data_fields": [
{
"name": "removeIsolated",
"type": "bool"
}
],
"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": "addTetrahedra",
"return_type": "void",
"params": [
{
"name": "tetrahedra",
"type": "const int &"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "addTetrahedra",
"return_type": "void",
"params": [
{
"name": "tetrahedra",
"type": "const int &"
},
{
"name": "ancestors",
"type": "const int &"
},
{
"name": "baryCoefs",
"type": "const int &"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "addTetrahedronProcess",
"return_type": "void",
"params": [
{
"name": "e",
"type": "Tetrahedron"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "removeTetrahedra",
"return_type": "void",
"params": [
{
"name": "tetrahedraIds",
"type": "const int &"
},
{
"name": "removeIsolatedItems",
"type": "const bool"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "removeItems",
"return_type": "void",
"params": [
{
"name": "items",
"type": "const int &"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "RemoveTetraBall",
"return_type": "void",
"params": [
{
"name": "ind_ta",
"type": "TetrahedronID"
},
{
"name": "ind_tb",
"type": "TetrahedronID"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "addTetrahedraWarning",
"return_type": "void",
"params": [
{
"name": "nTetrahedra",
"type": "const int"
},
{
"name": "tetrahedraList",
"type": "const int &"
},
{
"name": "tetrahedraIndexList",
"type": "const int &"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "protected"
},
{
"name": "addTetrahedraWarning",
"return_type": "void",
"params": [
{
"name": "nTetrahedra",
"type": "const int"
},
{
"name": "tetrahedraList",
"type": "const int &"
},
{
"name": "tetrahedraIndexList",
"type": "const int &"
},
{
"name": "ancestors",
"type": "const int &"
},
{
"name": "baryCoefs",
"type": "const int &"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "protected"
},
{
"name": "addTetrahedraProcess",
"return_type": "void",
"params": [
{
"name": "tetrahedra",
"type": "const int &"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "protected"
},
{
"name": "removeTetrahedraWarning",
"return_type": "void",
"params": [
{
"name": "tetrahedra",
"type": "int &"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "protected"
},
{
"name": "removeTetrahedraProcess",
"return_type": "void",
"params": [
{
"name": "indices",
"type": "const int &"
},
{
"name": "removeIsolatedItems",
"type": "const bool"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "protected"
},
{
"name": "addTrianglesProcess",
"return_type": "void",
"params": [
{
"name": "triangles",
"type": "const int &"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "protected"
},
{
"name": "removeTrianglesProcess",
"return_type": "void",
"params": [
{
"name": "indices",
"type": "const int &"
},
{
"name": "removeIsolatedEdges",
"type": "const bool"
},
{
"name": "removeIsolatedPoints",
"type": "const bool"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "protected"
},
{
"name": "addEdgesProcess",
"return_type": "void",
"params": [
{
"name": "edges",
"type": "const int &"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "protected"
},
{
"name": "removeEdgesProcess",
"return_type": "void",
"params": [
{
"name": "indices",
"type": "const int &"
},
{
"name": "removeIsolatedItems",
"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": 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": 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": false,
"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 `TetrahedronSetTopologyModifier` is a component in the SOFA framework that modifies tetrahedral topology by adding or removing tetrahedra within a mesh. It inherits from `TriangleSetTopologyModifier`, extending functionality to handle operations specific to tetrahedra.\n\n### Role and Purpose:\nThe primary role of this modifier is to dynamically update the mesh structure of tetrahedra, which can be crucial for simulations where topological changes are necessary during runtime (e.g., surgery simulation or material deformation). It provides methods for adding new tetrahedra (`addTetrahedra`, `addTetrahedronProcess`) and removing existing ones (`removeTetrahedra`, `removeItems`). Additionally, it handles related elements like vertices, edges, and triangles to maintain consistency within the mesh.\n\n### Interactions with Other Components:\nThe component interacts closely with a `TetrahedronSetTopologyContainer` through which it accesses and modifies the tetrahedral data. It also ensures that topological changes are communicated to other components via topology event handling mechanisms (e.g., `propagateTopologicalEngineChanges`, `addTrianglesWarning`). The modifier operates within the broader SOFA ecosystem, supporting scenarios where dynamic mesh modifications are required.\n\n### Practical Usage and Data Fields:\nThe component includes a boolean data field named `removeIsolated` to determine whether isolated degrees of freedom (DOFs) should be removed when tetrahedra are deleted. Users can utilize methods like `addTetrahedra`, which takes arrays of vertex indices defining new tetrahedra, and `removeTetrahedra`, which accepts a list of tetrahedron IDs to delete.\n\nExample usage involves initializing the modifier, calling `addTetrahedra` to introduce new elements into the mesh, or using `removeTetrahedra` to eliminate existing ones. The component ensures that all modifications are processed correctly and propagated throughout the simulation.",
"maths": "The `TetrahedronSetTopologyModifier` is a crucial component in the SOFA framework that facilitates dynamic modifications to tetrahedral meshes, which are essential for simulating deformable objects and handling topological changes during runtime. This modifier extends functionality inherited from `TriangleSetTopologyModifier`, focusing specifically on operations related to tetrahedra within a mesh.\n\n### Role and Mathematical Description:\n\n#### 1. **Adding Tetrahedra**\n- The method `addTetrahedra` is used to add new tetrahedra to the existing mesh. This process involves updating several data structures to maintain consistency in the topology.\n- Given an array of vertex indices that define a set of new tetrahedra, the modifier adds these elements to the mesh and updates cross-referencing buffers (e.g., `m_tetrahedraAroundVertex`, `m_edgesInTetrahedron`, `m_trianglesInTetrahedron`).\n- The method ensures that new triangles are created if necessary and handles ancestor and barycentric coordinate information for each added tetrahedron.\n\n#### 2. **Removing Tetrahedra**\n- The method `removeTetrahedra` is used to remove specified tetrahedra from the mesh. This operation involves several steps:\n - Removing isolated vertices, edges, and triangles if necessary.\n - Updating cross-referencing buffers (e.g., `m_tetrahedraAroundVertex`, `m_edgesInTetrahedron`, `m_trianglesInTetrahedron`) to reflect the removal of tetrahedra.\n - Propagating topological changes through the simulation environment to ensure consistency in other components that rely on mesh topology.\n\n#### 3. **Handling Topology Events**\n- The component uses methods like `addTetrahedraWarning` and `removeTetrahedraWarning` to issue warnings about topological changes, which are then processed by `propagateTopologicalEngineChanges`. This ensures that all relevant components in the simulation environment are notified of these changes.\n\n### Interactions with Other Components:\n- The component interacts closely with a `TetrahedronSetTopologyContainer`, which manages the tetrahedral data structure. The modifier accesses and modifies this container to add or remove tetrahedra while maintaining consistency across related elements (vertices, edges, triangles).\n- Topological changes are communicated via topology event handling mechanisms, ensuring that all components in the simulation environment remain synchronized with the mesh modifications.\n\n### Physical Interpretation:\n- In the context of FEM simulations within SOFA, the `TetrahedronSetTopologyModifier` plays a critical role in dynamic mesh management. It allows for realistic and efficient handling of topological changes that might occur during simulations (e.g., cutting operations, material separation).\n\n### Mathematical Notation:\n- Let \\( T \\\\) denote the set of tetrahedra in the mesh.\n- Adding a new tetrahedron involves updating \\( T \\\\), and ensuring that related elements (vertices, edges, triangles) are consistent with this addition. Mathematically, if a tetrahedron \\( t_i = [v_1, v_2, v_3, v_4] \\) is added, then:\n \\[ T' = T \\\\cup \\{t_i\\} \\]\n- Removing a tetrahedron involves the inverse operation. If \\( t_j \\in T \\), then removing it results in:\n \\[ T'' = T - \\{t_j\\} \\]\n\nIn summary, the `TetrahedronSetTopologyModifier` facilitates dynamic modifications to the mesh topology while ensuring that all related elements are updated consistently. This is essential for maintaining the integrity of FEM simulations and enabling real-time or high-fidelity topological changes.",
"abstract": "The `TetrahedronSetTopologyModifier` modifies tetrahedral topology by adding or removing tetrahedra within a mesh, ensuring consistency in related elements such as vertices, edges, and triangles.",
"sheet": "# TetrahedronSetTopologyModifier\n\n## Overview\nThe `TetrahedronSetTopologyModifier` is a component that extends the functionality of `TriangleSetTopologyModifier` to handle dynamic modifications of tetrahedral topology. It provides methods for adding and removing tetrahedra within a mesh, ensuring consistency in related elements such as vertices, edges, and triangles.\n\n## Parameters and Data\n- **removeIsolated**: A boolean parameter that determines whether isolated degrees of freedom (DOFs) should be removed when tetrahedra are deleted. Default value is `false`.\n\n## Dependencies and Connections\nThe component interacts closely with a `TetrahedronSetTopologyContainer`, which manages the tetrahedral data structure. It ensures that topological changes are communicated to other components via topology event handling mechanisms, such as `propagateTopologicalEngineChanges`. This interaction is crucial for maintaining consistency across the simulation environment.\n\n## Practical Notes\n- The component provides methods like `addTetrahedra` and `removeTetrahedra`, which take arrays of vertex indices or tetrahedron IDs to modify the mesh structure dynamically.\n- Ensure that topological changes are handled carefully, as incorrect modifications can lead to inconsistencies in the simulation environment."
}