Back

HexahedronSetTopologyContainer

The Hexahedron Topology Container in SOFA (Simulation Open Framework Architecture) is designed to manage and manipulate hexahedral mesh topologies, which are commonly used for volumetric simulations due to their cubic structure. This container extends the functionality of a general quad topology container by providing specific data structures and methods tailored for hexahedra, which consist of eight vertices each forming a cube-like shape.

abstract
The `HexahedronSetTopologyContainer` manages hexahedral mesh topologies by providing data structures and methods to represent connectivity between vertices, edges, quads, and hexahedra in SOFA simulations.
sheet
# HexahedronSetTopologyContainer ## Overview The `HexahedronSetTopologyContainer` is a core topology container within the SOFA simulation framework that manages and manipulates hexahedral mesh topologies. It extends the functionality of a general quad topology container by providing specific data structures and methods tailored to hexahedra, which consist of eight vertices each forming a cube-like shape. ## Parameters and Data - **createQuadArray**: `bool` (default: `false`). Force the creation of a set of quads associated with the hexahedra. ## Dependencies and Connections This component typically requires connections to other components that handle vertex positions, forces, and constraints. It fits into the scene graph by providing connectivity information necessary for assembling global matrices and computing internal forces in finite element simulations. ## Practical Notes - Ensure that the topology is consistent using methods like `checkTopology` before performing any simulation operations. - The method `computeCrossElementBuffers` initializes all necessary buffers, which should be called after modifying the mesh topology.
title
Hexahedron Topology Container
description
The Hexahedron Topology Container in SOFA (Simulation Open Framework Architecture) is designed to manage and manipulate hexahedral mesh topologies, which are commonly used for volumetric simulations due to their cubic structure. This container extends the functionality of a general quad topology container by providing specific data structures and methods tailored for hexahedra, which consist of eight vertices each forming a cube-like shape.
parameters
  • {'name': 'd_createQuadArray', 'description': 'A boolean flag indicating whether to force the creation of quad arrays. This can be useful when the simulation requires explicit definition of quads within the hexahedral structure.', 'type': 'Data<bool>'}
  • {'name': 'd_hexahedron', 'description': 'This data field stores a vector of hexahedra, where each hexahedron is represented as an array of eight vertex indices. This forms the core topology data for the container.', 'type': 'Data<sofa::type::vector<Hexahedron>>'}
methods
  • {'name': 'createHexahedronSetArray', 'description': 'Creates or initializes the hexahedron set array, which is essential when managing a collection of hexahedral elements.', 'returnType': 'void', 'accessLevel': 'protected', 'parameters': []}
  • {'name': 'getHexahedraAroundVertexForModification', 'description': 'Returns a non-const list of hexahedron indices around a given vertex for modification. This method allows the direct manipulation of the connectivity information related to a specific vertex.', 'returnType': 'HexahedraAroundVertex&', 'accessLevel': 'protected', 'parameters': [{'name': 'vertexIndex', 'description': 'The index of the vertex around which hexahedral connectivity is being modified.', 'type': 'const PointID'}]}
  • {'name': 'getConnectedElement', 'description': 'Returns the set of element indices connected to an input one, meaning elements that can be reached through topological links. Useful for analyzing mesh connexity and traversal.', 'returnType': 'VecHexaID', 'accessLevel': 'public', 'parameters': [{'name': 'elem', 'description': 'The index of the element whose connected elements are sought.', 'type': 'HexaID'}]}
  • {'name': 'checkConnexity', 'description': 'Checks if the topology has only one connected component, returning true if there is a single connex component. Useful for validating mesh integrity and ensuring proper simulation setup.', 'returnType': 'bool', 'accessLevel': 'public', 'parameters': []}
responsibilities
  • {'name': 'Topology Management', 'description': 'Manages the creation, modification, and maintenance of hexahedral topology data structures.'}
  • {'name': 'Connectivity Information', 'description': 'Provides methods to access and modify connectivity information around vertices, edges, and quads.'}
  • {'name': 'Data Integrity Validation', 'description': 'Includes functionality for checking the integrity and connexity of the mesh topology.'}
maths
### Mathematical and Physical Description of the HexahedronSetTopologyContainer Component in SOFA #### Overview The `HexahedronSetTopologyContainer` is a core topology container within the SOFA simulation framework that manages and manipulates hexahedral mesh topologies. A hexahedral element, often referred to as an 'hexa', consists of 8 vertices, forming a cube-like shape. The primary function of this component is to provide the necessary data structures and methods for representing and querying these hexahedra within a simulation context. #### Geometric Representation Each hexahedron in the `HexahedronSetTopologyContainer` is defined by 8 vertices, which are connected through edges and faces. The specific ordering of vertices follows the following convention: \[ \begin{array}{c} Y \\ \uparrow / \\ /| \\ / | \\ Z-7----6---|--1--X \\ | 0------5 \\ |/|/ \\ 4----5 \\ / \end{array} \\ Y-3-2 \\ / / \\ /Z \] The hexahedra are also represented in terms of their associated quads, edges, and vertices. The quads (faces) are ordered as \(BACK, FRONT, BOTTOM, RIGHT, TOP, LEFT\). #### Data Structures 1. **Hexahedron**: A collection of 8 vertex indices representing the hexahedral element. 2. **EdgesInHexahedron**: Stores the index set of edges forming each hexahedron (there are 12 edges per hexahedron). 3. **QuadsInHexahedron**: Stores the index set of quads forming each hexahedron (6 quads per hexahedron). 4. **HexahedraAroundVertex**: For each vertex, stores the indices of all hexahedra that share this vertex. 5. **HexahedraAroundEdge**: For each edge, stores the indices of all hexahedra that contain this edge. 6. **HexahedraAroundQuad**: For each quad (face), stores the indices of all hexahedra containing this quad. #### Methods and Operations 1. **addHexa**: Adds a new hexahedron to the topology by specifying its 8 vertices. 2. **getHexahedra**: Retrieves the array of hexahedra. 3. **getEdgesInHexahedron**: Provides the indices of edges forming each hexahedron. 4. **getQuadsInHexahedron**: Provides the indices of quads (faces) forming each hexahedron. 5. **getHexahedraAroundVertex/Edge/Quad**: Retrieves lists of adjacent hexahedra around a vertex, edge, or quad. 6. **createEdgesInHexahedronArray** and **createQuadsInHexahedronArray**: Generate edge and face index sets for each hexahedron, respectively. 7. **computeCrossElementBuffers**: Initializes all the necessary buffers (edges, quads, etc.) based on the current topology. 8. **checkTopology**: Ensures that the stored topology is coherent and consistent. 9. **clearHexahedra/EdgesInHexahedron/QuadsInHexahedron/HexahedraAroundVertex/Edge/Quad**: Clears different parts of the stored data structures to reset or update the topology. 10. **getNextAdjacentQuad**: Given a hexahedron, a quad within it, and an edge, retrieves the index of another adjacent quad that shares this edge. #### Role in the Global FEM Pipeline The `HexahedronSetTopologyContainer` serves as the foundational data structure for representing and managing the mesh topology during finite element simulation. It plays a key role by providing the connectivity information needed to assemble global matrices (mass matrix, stiffness matrix) and forces associated with each hexahedral element. The method **computeCrossElementBuffers** ensures that all necessary topological information is available and consistent, which facilitates subsequent operations such as assembling element contributions into the global system of equations. #### Numerical Methods and Discretization Choices The component primarily handles the spatial discretization aspect by organizing the mesh topology into a structured form suitable for FEM calculations. The method **createEdgesInHexahedronArray** ensures that edges are correctly identified within each hexahedron, which is crucial for defining strain measures (e.g., \(\varepsilon\)) and computing internal forces \((f_{int})\) in the weak form of the governing equations. The method **createQuadsInHexahedronArray** ensures proper face identification, useful for surface-related computations such as contact force evaluation. #### Constraint Handling The component provides methods to handle constraints by querying and modifying adjacency lists (e.g., `getHexahedraAroundVertex/Edge/Quad`). This information is critical when imposing boundary conditions or managing topological changes during a simulation. In summary, the `HexahedronSetTopologyContainer` in SOFA plays an essential role in representing hexahedral mesh topology and providing necessary data structures for performing finite element computations. It ensures that all elements are consistently connected and enables efficient querying of connectivity information, which is vital for assembling and solving the system equations during a simulation.
{
  "name": "HexahedronSetTopologyContainer",
  "main": {
    "name": "HexahedronSetTopologyContainer",
    "namespace": "sofa::component::topology::container::dynamic",
    "module": "Sofa.Component.Topology.Container.Dynamic",
    "include": "sofa/component/topology/container/dynamic/HexahedronSetTopologyContainer.h",
    "doc": "Topology container dedicated to an hexahedral topology.\n\na class that stores a set of hexahedra and provides access with adjacent quads, edges and vertices */",
    "inherits": [
      "QuadSetTopologyContainer"
    ],
    "templates": [],
    "data_fields": [
      {
        "name": "d_createQuadArray",
        "type": "bool",
        "xmlname": "createQuadArray",
        "help": "Force the creation of a set of quads associated with the hexahedra"
      }
    ],
    "links": [],
    "methods": [
      {
        "name": "init",
        "return_type": "void",
        "params": [],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "clear",
        "return_type": "void",
        "params": [],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "addHexa",
        "return_type": "void",
        "params": [
          {
            "name": "a",
            "type": "Index"
          },
          {
            "name": "b",
            "type": "Index"
          },
          {
            "name": "c",
            "type": "Index"
          },
          {
            "name": "d",
            "type": "Index"
          },
          {
            "name": "e",
            "type": "Index"
          },
          {
            "name": "f",
            "type": "Index"
          },
          {
            "name": "g",
            "type": "Index"
          },
          {
            "name": "h",
            "type": "Index"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getHexahedra",
        "return_type": "const SeqHexahedra &",
        "params": [],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getHexahedron",
        "return_type": "const Hexahedron",
        "params": [
          {
            "name": "i",
            "type": "HexaID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getLocalIndexFromBinaryIndex",
        "return_type": "unsigned int",
        "params": [
          {
            "name": "bi",
            "type": "const HexahedronBinaryIndex"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getBinaryIndexFromLocalIndex",
        "return_type": "HexahedronBinaryIndex",
        "params": [
          {
            "name": "li",
            "type": "const unsigned int"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getHexahedronIndex",
        "return_type": "HexahedronID",
        "params": [
          {
            "name": "v1",
            "type": "PointID"
          },
          {
            "name": "v2",
            "type": "PointID"
          },
          {
            "name": "v3",
            "type": "PointID"
          },
          {
            "name": "v4",
            "type": "PointID"
          },
          {
            "name": "v5",
            "type": "PointID"
          },
          {
            "name": "v6",
            "type": "PointID"
          },
          {
            "name": "v7",
            "type": "PointID"
          },
          {
            "name": "v8",
            "type": "PointID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getEdgesInHexahedron",
        "return_type": "const EdgesInHexahedron &",
        "params": [
          {
            "name": "id",
            "type": "HexaID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getQuadsInHexahedron",
        "return_type": "const QuadsInHexahedron &",
        "params": [
          {
            "name": "id",
            "type": "HexaID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getHexahedraAroundVertex",
        "return_type": "const HexahedraAroundVertex &",
        "params": [
          {
            "name": "id",
            "type": "PointID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getHexahedraAroundEdge",
        "return_type": "const HexahedraAroundEdge &",
        "params": [
          {
            "name": "id",
            "type": "EdgeID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getHexahedraAroundQuad",
        "return_type": "const HexahedraAroundQuad &",
        "params": [
          {
            "name": "id",
            "type": "QuadID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getVertexIndexInHexahedron",
        "return_type": "int",
        "params": [
          {
            "name": "t",
            "type": "const Hexahedron &"
          },
          {
            "name": "vertexIndex",
            "type": "PointID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getEdgeIndexInHexahedron",
        "return_type": "int",
        "params": [
          {
            "name": "t",
            "type": "const EdgesInHexahedron &"
          },
          {
            "name": "edgeIndex",
            "type": "EdgeID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getQuadIndexInHexahedron",
        "return_type": "int",
        "params": [
          {
            "name": "t",
            "type": "const QuadsInHexahedron &"
          },
          {
            "name": "quadIndex",
            "type": "QuadID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getLocalEdgesInHexahedron",
        "return_type": "Edge",
        "params": [
          {
            "name": "i",
            "type": "const EdgeID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getLocalQuadsInHexahedron",
        "return_type": "Quad",
        "params": [
          {
            "name": "i",
            "type": "const QuadID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getNextAdjacentQuad",
        "return_type": "QuadID",
        "params": [
          {
            "name": "_hexaID",
            "type": "const HexaID"
          },
          {
            "name": "_quadID",
            "type": "const QuadID"
          },
          {
            "name": "_edgeID",
            "type": "const EdgeID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "computeCrossElementBuffers",
        "return_type": "void",
        "params": [],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "checkTopology",
        "return_type": "bool",
        "params": [],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "checkConnexity",
        "return_type": "bool",
        "params": [],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getNumberOfConnectedComponent",
        "return_type": "int",
        "params": [],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getConnectedElement",
        "return_type": "const VecHexaID",
        "params": [
          {
            "name": "elem",
            "type": "HexaID"
          }
        ],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getElementAroundElement",
        "return_type": "const VecHexaID",
        "params": [
          {
            "name": "elem",
            "type": "HexaID"
          }
        ],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getElementAroundElements",
        "return_type": "const VecHexaID",
        "params": [
          {
            "name": "elems",
            "type": "VecHexaID"
          }
        ],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getNumberOfHexahedra",
        "return_type": "int",
        "params": [],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getNumberOfElements",
        "return_type": "int",
        "params": [],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getHexahedronArray",
        "return_type": "const int &",
        "params": [],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getEdgesInHexahedronArray",
        "return_type": "const int &",
        "params": [],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getQuadsInHexahedronArray",
        "return_type": "const int &",
        "params": [],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getHexahedraAroundVertexArray",
        "return_type": "const int &",
        "params": [],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getHexahedraAroundEdgeArray",
        "return_type": "const int &",
        "params": [],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getHexahedraAroundQuadArray",
        "return_type": "const int &",
        "params": [],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "hasHexahedra",
        "return_type": "bool",
        "params": [],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "hasEdgesInHexahedron",
        "return_type": "bool",
        "params": [],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "hasQuadsInHexahedron",
        "return_type": "bool",
        "params": [],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "hasHexahedraAroundVertex",
        "return_type": "bool",
        "params": [],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "hasHexahedraAroundEdge",
        "return_type": "bool",
        "params": [],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "hasHexahedraAroundQuad",
        "return_type": "bool",
        "params": [],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getTopologyType",
        "return_type": "sofa::geometry::ElementType",
        "params": [],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "linkTopologyHandlerToData",
        "return_type": "bool",
        "params": [
          {
            "name": "topologyHandler",
            "type": "core::topology::TopologyHandler *"
          },
          {
            "name": "elementType",
            "type": "sofa::geometry::ElementType"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "unlinkTopologyHandlerToData",
        "return_type": "bool",
        "params": [
          {
            "name": "topologyHandler",
            "type": "core::topology::TopologyHandler *"
          },
          {
            "name": "elementType",
            "type": "sofa::geometry::ElementType"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "createEdgeSetArray",
        "return_type": "void",
        "params": [],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "protected"
      },
      {
        "name": "createQuadSetArray",
        "return_type": "void",
        "params": [],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "protected"
      },
      {
        "name": "createHexahedronSetArray",
        "return_type": "void",
        "params": [],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "protected"
      },
      {
        "name": "createEdgesInHexahedronArray",
        "return_type": "void",
        "params": [],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "protected"
      },
      {
        "name": "createQuadsInHexahedronArray",
        "return_type": "void",
        "params": [],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "protected"
      },
      {
        "name": "createHexahedraAroundVertexArray",
        "return_type": "void",
        "params": [],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "protected"
      },
      {
        "name": "createHexahedraAroundEdgeArray",
        "return_type": "void",
        "params": [],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "protected"
      },
      {
        "name": "createHexahedraAroundQuadArray",
        "return_type": "void",
        "params": [],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "protected"
      },
      {
        "name": "clearHexahedra",
        "return_type": "void",
        "params": [],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "protected"
      },
      {
        "name": "clearEdgesInHexahedron",
        "return_type": "void",
        "params": [],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "protected"
      },
      {
        "name": "clearQuadsInHexahedron",
        "return_type": "void",
        "params": [],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "protected"
      },
      {
        "name": "clearHexahedraAroundVertex",
        "return_type": "void",
        "params": [],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "protected"
      },
      {
        "name": "clearHexahedraAroundEdge",
        "return_type": "void",
        "params": [],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "protected"
      },
      {
        "name": "clearHexahedraAroundQuad",
        "return_type": "void",
        "params": [],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "protected"
      },
      {
        "name": "getHexahedraAroundVertexForModification",
        "return_type": "HexahedraAroundVertex &",
        "params": [
          {
            "name": "vertexIndex",
            "type": "const PointID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "protected"
      },
      {
        "name": "getHexahedraAroundEdgeForModification",
        "return_type": "HexahedraAroundEdge &",
        "params": [
          {
            "name": "edgeIndex",
            "type": "const EdgeID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "protected"
      },
      {
        "name": "getHexahedraAroundQuadForModification",
        "return_type": "HexahedraAroundQuad &",
        "params": [
          {
            "name": "quadIndex",
            "type": "const QuadID"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "protected"
      },
      {
        "name": "setHexahedronTopologyToDirty",
        "return_type": "void",
        "params": [],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "protected"
      },
      {
        "name": "cleanHexahedronTopologyFromDirty",
        "return_type": "void",
        "params": [],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "protected"
      },
      {
        "name": "isHexahedronTopologyDirty",
        "return_type": "const bool &",
        "params": [],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "protected"
      }
    ]
  },
  "desc": {
    "title": "Hexahedron Topology Container",
    "description": "The Hexahedron Topology Container in SOFA (Simulation Open Framework Architecture) is designed to manage and manipulate hexahedral mesh topologies, which are commonly used for volumetric simulations due to their cubic structure. This container extends the functionality of a general quad topology container by providing specific data structures and methods tailored for hexahedra, which consist of eight vertices each forming a cube-like shape.",
    "parameters": [
      {
        "name": "d_createQuadArray",
        "description": "A boolean flag indicating whether to force the creation of quad arrays. This can be useful when the simulation requires explicit definition of quads within the hexahedral structure.",
        "type": "Data<bool>"
      },
      {
        "name": "d_hexahedron",
        "description": "This data field stores a vector of hexahedra, where each hexahedron is represented as an array of eight vertex indices. This forms the core topology data for the container.",
        "type": "Data<sofa::type::vector<Hexahedron>>"
      }
    ],
    "methods": [
      {
        "name": "createHexahedronSetArray",
        "description": "Creates or initializes the hexahedron set array, which is essential when managing a collection of hexahedral elements.",
        "returnType": "void",
        "accessLevel": "protected",
        "parameters": []
      },
      {
        "name": "getHexahedraAroundVertexForModification",
        "description": "Returns a non-const list of hexahedron indices around a given vertex for modification. This method allows the direct manipulation of the connectivity information related to a specific vertex.",
        "returnType": "HexahedraAroundVertex&",
        "accessLevel": "protected",
        "parameters": [
          {
            "name": "vertexIndex",
            "description": "The index of the vertex around which hexahedral connectivity is being modified.",
            "type": "const PointID"
          }
        ]
      },
      {
        "name": "getConnectedElement",
        "description": "Returns the set of element indices connected to an input one, meaning elements that can be reached through topological links. Useful for analyzing mesh connexity and traversal.",
        "returnType": "VecHexaID",
        "accessLevel": "public",
        "parameters": [
          {
            "name": "elem",
            "description": "The index of the element whose connected elements are sought.",
            "type": "HexaID"
          }
        ]
      },
      {
        "name": "checkConnexity",
        "description": "Checks if the topology has only one connected component, returning true if there is a single connex component. Useful for validating mesh integrity and ensuring proper simulation setup.",
        "returnType": "bool",
        "accessLevel": "public",
        "parameters": []
      }
    ],
    "responsibilities": [
      {
        "name": "Topology Management",
        "description": "Manages the creation, modification, and maintenance of hexahedral topology data structures."
      },
      {
        "name": "Connectivity Information",
        "description": "Provides methods to access and modify connectivity information around vertices, edges, and quads."
      },
      {
        "name": "Data Integrity Validation",
        "description": "Includes functionality for checking the integrity and connexity of the mesh topology."
      }
    ]
  },
  "maths": {
    "maths": "### Mathematical and Physical Description of the HexahedronSetTopologyContainer Component in SOFA\n\n#### Overview\nThe `HexahedronSetTopologyContainer` is a core topology container within the SOFA simulation framework that manages and manipulates hexahedral mesh topologies. A hexahedral element, often referred to as an 'hexa', consists of 8 vertices, forming a cube-like shape. The primary function of this component is to provide the necessary data structures and methods for representing and querying these hexahedra within a simulation context.\n\n#### Geometric Representation\nEach hexahedron in the `HexahedronSetTopologyContainer` is defined by 8 vertices, which are connected through edges and faces. The specific ordering of vertices follows the following convention:\n\n\\[\n\\begin{array}{c}\nY \\\\ \\uparrow / \\\\ /| \\\\ / | \\\\ Z-7----6---|--1--X \\\\ | 0------5 \\\\ |/|/ \\\\ 4----5 \\\\ /\n\\end{array} \\\\ Y-3-2 \\\\ / / \\\\ /Z\n\\]\n\nThe hexahedra are also represented in terms of their associated quads, edges, and vertices. The quads (faces) are ordered as \\(BACK, FRONT, BOTTOM, RIGHT, TOP, LEFT\\).\n\n#### Data Structures\n1. **Hexahedron**: A collection of 8 vertex indices representing the hexahedral element.\n2. **EdgesInHexahedron**: Stores the index set of edges forming each hexahedron (there are 12 edges per hexahedron).\n3. **QuadsInHexahedron**: Stores the index set of quads forming each hexahedron (6 quads per hexahedron).\n4. **HexahedraAroundVertex**: For each vertex, stores the indices of all hexahedra that share this vertex.\n5. **HexahedraAroundEdge**: For each edge, stores the indices of all hexahedra that contain this edge.\n6. **HexahedraAroundQuad**: For each quad (face), stores the indices of all hexahedra containing this quad.\n\n#### Methods and Operations\n1. **addHexa**: Adds a new hexahedron to the topology by specifying its 8 vertices.\n2. **getHexahedra**: Retrieves the array of hexahedra.\n3. **getEdgesInHexahedron**: Provides the indices of edges forming each hexahedron.\n4. **getQuadsInHexahedron**: Provides the indices of quads (faces) forming each hexahedron.\n5. **getHexahedraAroundVertex/Edge/Quad**: Retrieves lists of adjacent hexahedra around a vertex, edge, or quad.\n6. **createEdgesInHexahedronArray** and **createQuadsInHexahedronArray**: Generate edge and face index sets for each hexahedron, respectively.\n7. **computeCrossElementBuffers**: Initializes all the necessary buffers (edges, quads, etc.) based on the current topology.\n8. **checkTopology**: Ensures that the stored topology is coherent and consistent.\n9. **clearHexahedra/EdgesInHexahedron/QuadsInHexahedron/HexahedraAroundVertex/Edge/Quad**: Clears different parts of the stored data structures to reset or update the topology.\n10. **getNextAdjacentQuad**: Given a hexahedron, a quad within it, and an edge, retrieves the index of another adjacent quad that shares this edge.\n\n#### Role in the Global FEM Pipeline\nThe `HexahedronSetTopologyContainer` serves as the foundational data structure for representing and managing the mesh topology during finite element simulation. It plays a key role by providing the connectivity information needed to assemble global matrices (mass matrix, stiffness matrix) and forces associated with each hexahedral element. The method **computeCrossElementBuffers** ensures that all necessary topological information is available and consistent, which facilitates subsequent operations such as assembling element contributions into the global system of equations.\n\n#### Numerical Methods and Discretization Choices\nThe component primarily handles the spatial discretization aspect by organizing the mesh topology into a structured form suitable for FEM calculations. The method **createEdgesInHexahedronArray** ensures that edges are correctly identified within each hexahedron, which is crucial for defining strain measures (e.g., \\(\\varepsilon\\)) and computing internal forces \\((f_{int})\\) in the weak form of the governing equations. The method **createQuadsInHexahedronArray** ensures proper face identification, useful for surface-related computations such as contact force evaluation.\n\n#### Constraint Handling\nThe component provides methods to handle constraints by querying and modifying adjacency lists (e.g., `getHexahedraAroundVertex/Edge/Quad`). This information is critical when imposing boundary conditions or managing topological changes during a simulation.\n\nIn summary, the `HexahedronSetTopologyContainer` in SOFA plays an essential role in representing hexahedral mesh topology and providing necessary data structures for performing finite element computations. It ensures that all elements are consistently connected and enables efficient querying of connectivity information, which is vital for assembling and solving the system equations during a simulation."
  },
  "summary": {
    "abstract": "The `HexahedronSetTopologyContainer` manages hexahedral mesh topologies by providing data structures and methods to represent connectivity between vertices, edges, quads, and hexahedra in SOFA simulations.",
    "sheet": "# HexahedronSetTopologyContainer\n\n## Overview\nThe `HexahedronSetTopologyContainer` is a core topology container within the SOFA simulation framework that manages and manipulates hexahedral mesh topologies. It extends the functionality of a general quad topology container by providing specific data structures and methods tailored to hexahedra, which consist of eight vertices each forming a cube-like shape.\n\n## Parameters and Data\n- **createQuadArray**: `bool` (default: `false`). Force the creation of a set of quads associated with the hexahedra.\n\n## Dependencies and Connections\nThis component typically requires connections to other components that handle vertex positions, forces, and constraints. It fits into the scene graph by providing connectivity information necessary for assembling global matrices and computing internal forces in finite element simulations.\n\n## Practical Notes\n- Ensure that the topology is consistent using methods like `checkTopology` before performing any simulation operations.\n- The method `computeCrossElementBuffers` initializes all necessary buffers, which should be called after modifying the mesh topology."
  }
}