mesh.Mesh.get_free_entities#

Mesh.get_free_entities(level=-1, return_indices=False)#

Return the free entities of the specified level.

Free entities are entities that are only connected to a single element.

Parameters#

level: int

The level of the entities to return. If negative, it is a value relative to the level of the caller. If non-negative, it specifies the absolute level.

return_indices: bool

If True, also returns an index array (nentities,2) for inverse lookup of the higher entity (column 0) and its local lower entity number (column 1).

Returns#

Elems

A connectivity table with the free entities of the specified level of the Mesh.

See Also#

Examples#

>>> M = Mesh(eltype='quad4').convert('tri3')
>>> print(M.report(full=True))
Mesh: n_nodes: 4, n_elems: 2, plexitude: 3, level: 2, eltype: tri3
BBox: [0. 0. 0.], [1. 1. 0.]
Size: [1. 1. 0.]
Length: 4.0  Area: 1.0
Coords: [[0. 0. 0.]
        [1. 0. 0.]
        [1. 1. 0.]
        [0. 1. 0.]]
Elems: [[0 1 2]
        [2 3 0]]
>>> M.get_free_entities(1)
Elems([[0, 1],
       [3, 0],
       [1, 2],
       [2, 3]]..., eltype=Line2)
>>> M.get_free_entities(1,True)[1]
array([[0, 0],
       [1, 1],
       [0, 1],
       [1, 0]])