Function classify_capture

Source
pub fn classify_capture<T: CoordsFloat>(
    cmap: &CMap2<T>,
) -> Result<(), ClassificationError>
Expand description

Classify all entities of a mesh on a default geometry.

This function classifies all i-cells of a mesh using a basic traversal algorithm. It expects the map passed as argument to already have a set of vertices linked to nodes.

The algorithm uses a first oriented traversal starting from anchored vertices to classifies boundaries as curves. It also checks for curves that are not linked to anchored vertices (e.g. a hole inside of the geometry).

Once curves are classified, the remaining unclassified cells are associated to surfaces, which are identified using a BFS-like algorithm stopping on already marked edges, to correctly discriminate surfaces.

§Errors

This function may fail and return an error if:

  • one of the attribute used to classify entities is missing (e.g. VertexAnchor),
  • The structure of the mesh is incorrect / unsupported (e.g. an open geometry).

§Panics

In debug mode, we use assertions to check every single i-cell of the mesh has been classified. If that is not the case, the function fill panic.