Back

QuadSetTopologyContainer

sofa::component::topology::container::dynamic::QuadSetTopologyContainer
EdgeSetTopologyContainer
Doc (from source)

Topology container dedicated to a quad topology. Object that stores a set of quads and provides access to each quad and its edges and vertices */

Abstract (AI generated)

The `QuadSetTopologyContainer` manages sets of quadrilateral elements in SOFA simulations, providing methods for adding, retrieving, and manipulating quads along with their topological relationships.

Metadata
module
Sofa.Component.Topology.Container.Dynamic
namespace
sofa::component::topology::container::dynamic
include
sofa/component/topology/container/dynamic/QuadSetTopologyContainer.h
inherits
  • EdgeSetTopologyContainer
description

The QuadSetTopologyContainer is designed to manage sets of quadrilateral (quad) elements within the SOFA simulation framework. It inherits from EdgeSetTopologyContainer, extending its functionality specifically for quad topology structures. This container facilitates the creation, storage, and manipulation of quad-based geometries while providing essential topological information required by other components in a simulation pipeline.

Governing Equations and Operators

This component primarily deals with topology management rather than direct contributions to governing equations like mass matrix $M$ , stiffness matrix $K$ , internal force $f_{int}$ , or residual $R$. Instead, it focuses on maintaining the connectivity information of quadrilateral elements which is essential for assembling these matrices and forces during FEM computations. The component ensures that all topological relationships between vertices, edges, and quads are consistently maintained.

Constitutive or Kinematic Laws Involved

No specific constitutive or kinematic laws are implemented within this component as it does not directly handle material properties or deformation measures. Instead, the QuadSetTopologyContainer provides the necessary topological data structures (e.g., adjacency information) that other components (such as force fields and solvers) use to define strain measures, stress tensors, and constitutive models.

Role in the Global FEM Pipeline

The component plays a critical role in the assembly phase of the FEM pipeline:
- It stores quadrilateral elements (d_quad) and their associated topological data such as edges within quads (m_edgesInQuad), vertices around quads (m_quadsAroundVertex), and edges around quads (m_quadsAroundEdge).
- Provides methods to add, retrieve, and manipulate these elements.

Numerical Methods or Discretization Choices

The component implements the following discretization choices:
- Stores topological information as arrays of indices representing vertices, edges, and quads.
- Uses methods like getEdgesInQuad, getQuadsAroundVertex, and getQuadsAroundEdge to efficiently query adjacency relationships.

Fitting into the Variational / Lagrangian Mechanics Framework

While not directly contributing to variational formulations or Lagrangian mechanics, the QuadSetTopologyContainer is a foundational component that supports these principles by ensuring topological consistency. It provides the necessary connectivity data required for constructing weak forms and deriving element operators during spatial discretization.

Example Usage Methods:

  • addQuad(a, b, c, d): Adds a quad defined by vertices $a$, $b$, $c$, and $d$.
  • getQuadsAroundVertex(id): Retrieves all quads adjacent to vertex with index $id$.
  • computeCrossElementBuffers(): Ensures that cross-element buffers (adjacency lists) are up-to-date.

Conclusion

The QuadSetTopologyContainer is a crucial component for managing quadrilateral elements in SOFA simulations, providing the topological data structures and methods necessary to support higher-level operations such as assembling element operators and ensuring numerical stability during FEM computations.

Methods
void init () virtual
void clear () virtual
void addQuad (Index a, Index b, Index c, Index d) virtual
const SeqQuads & getQuads ()
const Quad getQuad (QuadID id) virtual
QuadID getQuadIndex (PointID v1, PointID v2, PointID v3, PointID v4) virtual
const EdgesInQuad & getEdgesInQuad (QuadID id) virtual
const QuadsAroundVertex & getQuadsAroundVertex (PointID id) virtual
const QuadsAroundEdge & getQuadsAroundEdge (EdgeID id) virtual
int getVertexIndexInQuad (const Quad & t, PointID vertexIndex) virtual
int getEdgeIndexInQuad (const EdgesInQuad & t, EdgeID edheIndex) virtual
void computeCrossElementBuffers () virtual
bool checkTopology () virtual
bool checkConnexity () virtual
int getNumberOfConnectedComponent ()
const VecQuadID getConnectedElement (QuadID elem)
const VecQuadID getElementAroundElement (QuadID elem)
const VecQuadID getElementAroundElements (VecQuadID elems)
int getNumberOfQuads ()
int getNumberOfElements ()
const int & getQuadArray ()
const int & getEdgesInQuadArray ()
const int & getQuadsAroundVertexArray ()
const int & getQuadsAroundEdgeArray ()
bool hasQuads ()
bool hasEdgesInQuad ()
bool hasQuadsAroundVertex ()
bool hasQuadsAroundEdge ()
sofa::geometry::ElementType getTopologyType () virtual
bool linkTopologyHandlerToData (core::topology::TopologyHandler * topologyHandler, sofa::geometry::ElementType elementType) virtual
bool unlinkTopologyHandlerToData (core::topology::TopologyHandler * topologyHandler, sofa::geometry::ElementType elementType) virtual
void createQuadSetArray () virtual
void createEdgeSetArray () virtual
void createEdgesInQuadArray () virtual
void createQuadsAroundVertexArray () virtual
void createQuadsAroundEdgeArray () virtual
void clearQuads ()
void clearEdgesInQuad ()
void clearQuadsAroundVertex ()
void clearQuadsAroundEdge ()
QuadsAroundVertex & getQuadsAroundVertexForModification (const PointID vertexIndex) virtual
QuadsAroundEdge & getQuadsAroundEdgeForModification (const EdgeID edgeIndex) virtual
void setQuadTopologyToDirty ()
void cleanQuadTopologyFromDirty ()
const bool & isQuadTopologyDirty ()
{
  "name": "QuadSetTopologyContainer",
  "namespace": "sofa::component::topology::container::dynamic",
  "module": "Sofa.Component.Topology.Container.Dynamic",
  "include": "sofa/component/topology/container/dynamic/QuadSetTopologyContainer.h",
  "doc": "Topology container dedicated to a quad topology.\n\nObject that stores a set of quads and provides access\nto each quad and its edges and vertices */",
  "inherits": [
    "EdgeSetTopologyContainer"
  ],
  "templates": [],
  "data_fields": [],
  "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": "addQuad",
      "return_type": "void",
      "params": [
        {
          "name": "a",
          "type": "Index"
        },
        {
          "name": "b",
          "type": "Index"
        },
        {
          "name": "c",
          "type": "Index"
        },
        {
          "name": "d",
          "type": "Index"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "getQuads",
      "return_type": "const SeqQuads &",
      "params": [],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "getQuad",
      "return_type": "const Quad",
      "params": [
        {
          "name": "id",
          "type": "QuadID"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "getQuadIndex",
      "return_type": "QuadID",
      "params": [
        {
          "name": "v1",
          "type": "PointID"
        },
        {
          "name": "v2",
          "type": "PointID"
        },
        {
          "name": "v3",
          "type": "PointID"
        },
        {
          "name": "v4",
          "type": "PointID"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "getEdgesInQuad",
      "return_type": "const EdgesInQuad &",
      "params": [
        {
          "name": "id",
          "type": "QuadID"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "getQuadsAroundVertex",
      "return_type": "const QuadsAroundVertex &",
      "params": [
        {
          "name": "id",
          "type": "PointID"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "getQuadsAroundEdge",
      "return_type": "const QuadsAroundEdge &",
      "params": [
        {
          "name": "id",
          "type": "EdgeID"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "getVertexIndexInQuad",
      "return_type": "int",
      "params": [
        {
          "name": "t",
          "type": "const Quad &"
        },
        {
          "name": "vertexIndex",
          "type": "PointID"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "getEdgeIndexInQuad",
      "return_type": "int",
      "params": [
        {
          "name": "t",
          "type": "const EdgesInQuad &"
        },
        {
          "name": "edheIndex",
          "type": "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 VecQuadID",
      "params": [
        {
          "name": "elem",
          "type": "QuadID"
        }
      ],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "getElementAroundElement",
      "return_type": "const VecQuadID",
      "params": [
        {
          "name": "elem",
          "type": "QuadID"
        }
      ],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "getElementAroundElements",
      "return_type": "const VecQuadID",
      "params": [
        {
          "name": "elems",
          "type": "VecQuadID"
        }
      ],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "getNumberOfQuads",
      "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": "getQuadArray",
      "return_type": "const int &",
      "params": [],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "getEdgesInQuadArray",
      "return_type": "const int &",
      "params": [],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "getQuadsAroundVertexArray",
      "return_type": "const int &",
      "params": [],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "getQuadsAroundEdgeArray",
      "return_type": "const int &",
      "params": [],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "hasQuads",
      "return_type": "bool",
      "params": [],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "hasEdgesInQuad",
      "return_type": "bool",
      "params": [],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "hasQuadsAroundVertex",
      "return_type": "bool",
      "params": [],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "hasQuadsAroundEdge",
      "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": "createQuadSetArray",
      "return_type": "void",
      "params": [],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "protected"
    },
    {
      "name": "createEdgeSetArray",
      "return_type": "void",
      "params": [],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "protected"
    },
    {
      "name": "createEdgesInQuadArray",
      "return_type": "void",
      "params": [],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "protected"
    },
    {
      "name": "createQuadsAroundVertexArray",
      "return_type": "void",
      "params": [],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "protected"
    },
    {
      "name": "createQuadsAroundEdgeArray",
      "return_type": "void",
      "params": [],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "protected"
    },
    {
      "name": "clearQuads",
      "return_type": "void",
      "params": [],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "protected"
    },
    {
      "name": "clearEdgesInQuad",
      "return_type": "void",
      "params": [],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "protected"
    },
    {
      "name": "clearQuadsAroundVertex",
      "return_type": "void",
      "params": [],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "protected"
    },
    {
      "name": "clearQuadsAroundEdge",
      "return_type": "void",
      "params": [],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "protected"
    },
    {
      "name": "getQuadsAroundVertexForModification",
      "return_type": "QuadsAroundVertex &",
      "params": [
        {
          "name": "vertexIndex",
          "type": "const PointID"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "protected"
    },
    {
      "name": "getQuadsAroundEdgeForModification",
      "return_type": "QuadsAroundEdge &",
      "params": [
        {
          "name": "edgeIndex",
          "type": "const EdgeID"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "protected"
    },
    {
      "name": "setQuadTopologyToDirty",
      "return_type": "void",
      "params": [],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "protected"
    },
    {
      "name": "cleanQuadTopologyFromDirty",
      "return_type": "void",
      "params": [],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "protected"
    },
    {
      "name": "isQuadTopologyDirty",
      "return_type": "const bool &",
      "params": [],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "protected"
    }
  ],
  "description": "The `QuadSetTopologyContainer` is a SOFA component designed to store and manage sets of quadrilateral (quad) elements within the simulation framework. It inherits from `EdgeSetTopologyContainer`, extending its functionality specifically for quad topology structures. This container provides methods to initialize, clear, add quads, access specific quads, edges within quads, vertices around quads, and check the connectivity and coherency of the stored topology data.\n\nThe component interacts with other SOFA components via its API by providing essential topological information and facilitating the creation and management of quad-based geometries. Its methods allow for procedural modifications (e.g., adding quads) as well as dynamic queries regarding the relationships between quads, edges, and vertices.\n\nPractical usage involves initializing a `QuadSetTopologyContainer` instance to store quadrilateral elements and their associated topological data such as edges in quad, quads around vertices or edges, etc. Methods like `addQuad`, `getQuadsAroundVertex`, `checkConnexity`, and `computeCrossElementBuffers` are commonly used to manipulate the stored geometry and ensure its consistency within the simulation.\n\nThe component internally maintains data structures such as arrays of quad indices (`d_quad`), edge indices in quads, and adjacency information for vertices and edges. These data fields allow for efficient retrieval and modification of topological relationships during a simulation run.",
  "maths": "The `QuadSetTopologyContainer` is designed to manage sets of quadrilateral (quad) elements within the SOFA simulation framework. It inherits from `EdgeSetTopologyContainer`, extending its functionality specifically for quad topology structures. This container facilitates the creation, storage, and manipulation of quad-based geometries while providing essential topological information required by other components in a simulation pipeline.\n\n### Governing Equations and Operators\n\nThis component primarily deals with **topology management** rather than direct contributions to governing equations like mass matrix \\(M\\), stiffness matrix \\(K\\), internal force \\(f_{int}\\), or residual \\(R\\). Instead, it focuses on maintaining the connectivity information of quadrilateral elements which is essential for assembling these matrices and forces during FEM computations. The component ensures that all topological relationships between vertices, edges, and quads are consistently maintained.\n\n### Constitutive or Kinematic Laws Involved\n\nNo specific constitutive or kinematic laws are implemented within this component as it does not directly handle material properties or deformation measures. Instead, the `QuadSetTopologyContainer` provides the necessary topological data structures (e.g., adjacency information) that other components (such as force fields and solvers) use to define strain measures, stress tensors, and constitutive models.\n\n### Role in the Global FEM Pipeline\n\nThe component plays a critical role in the **assembly phase** of the FEM pipeline:\n- It stores quadrilateral elements (`d_quad`) and their associated topological data such as edges within quads (`m_edgesInQuad`), vertices around quads (`m_quadsAroundVertex`), and edges around quads (`m_quadsAroundEdge`).\n- Provides methods to add, retrieve, and manipulate these elements.\n\n### Numerical Methods or Discretization Choices\n\nThe component implements the following discretization choices:\n- Stores topological information as arrays of indices representing vertices, edges, and quads.\n- Uses methods like `getEdgesInQuad`, `getQuadsAroundVertex`, and `getQuadsAroundEdge` to efficiently query adjacency relationships.\n\n### Fitting into the Variational / Lagrangian Mechanics Framework\n\nWhile not directly contributing to variational formulations or Lagrangian mechanics, the `QuadSetTopologyContainer` is a foundational component that supports these principles by ensuring topological consistency. It provides the necessary connectivity data required for constructing weak forms and deriving element operators during spatial discretization.\n\n### Example Usage Methods:\n- `addQuad(a, b, c, d)`: Adds a quad defined by vertices \\(a\\), \\(b\\), \\(c\\), and \\(d\\).\n- `getQuadsAroundVertex(id)`: Retrieves all quads adjacent to vertex with index \\(id\\).\n- `computeCrossElementBuffers()`: Ensures that cross-element buffers (adjacency lists) are up-to-date.\n\n### Conclusion\nThe `QuadSetTopologyContainer` is a crucial component for managing quadrilateral elements in SOFA simulations, providing the topological data structures and methods necessary to support higher-level operations such as assembling element operators and ensuring numerical stability during FEM computations.",
  "abstract": "The `QuadSetTopologyContainer` manages sets of quadrilateral elements in SOFA simulations, providing methods for adding, retrieving, and manipulating quads along with their topological relationships.",
  "sheet": "# QuadSetTopologyContainer\n\n## Overview\nThe `QuadSetTopologyContainer` is a topology container component that stores and manages sets of quadrilateral (quad) elements within the SOFA simulation framework. It inherits from `EdgeSetTopologyContainer`, extending its functionality specifically for quad-based geometries. This component provides methods to initialize, clear, add quads, access specific quads, edges within quads, vertices around quads, and check connectivity.\n\n## Parameters and Data\nThe `QuadSetTopologyContainer` does not expose any significant data fields directly; it primarily relies on its inherited functionality from `EdgeSetTopologyContainer`. However, it provides methods to manage the topological relationships between quadrilateral elements. These include:\n- **addQuad(a, b, c, d)**: Adds a quad defined by vertices \\(a\\), \\(b\\), \\(c\\), and \\(d\\).\n- **getQuadsAroundVertex(id)**: Retrieves all quads adjacent to vertex with index \\(id\\).\n- **computeCrossElementBuffers()**: Ensures that cross-element buffers (adjacency lists) are up-to-date.\n\nThese methods facilitate the creation, storage, and manipulation of quad-based geometries while providing essential topological information required by other components in a simulation pipeline."
}