mesh.Mesh.get_free_entities_mesh#

Mesh.get_free_entities_mesh(level=-1, compact=True)#

Return a Mesh with lower entities.

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.

compact: bool

If True (default), the returned Mesh will be compacted. If False, the returned Mesh will contain all the nodes present in the input Mesh.

Returns#

Mesh

A Mesh containing the free lower entities of the specified level. Free entities are entities that are only connected to a single element. If the Mesh has property numbers, the lower entities inherit the property of the element to which they belong.

See Also#

Examples#

>>> M = Mesh(eltype='quad4').convert('tri3')
>>> M = M.set_prop([0, 1])
>>> 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]]
>>> M2 = M.get_free_entities_mesh(1)
>>> print(M2.report(full=True))
Mesh: n_nodes: 4, n_elems: 4, plexitude: 2, level: 1, eltype: line2
  BBox: [0. 0. 0.], [1. 1. 0.]
  Size: [1. 1. 0.]
  Length: 4.0
  Coords: [[0. 0. 0.]
           [1. 0. 0.]
           [1. 1. 0.]
           [0. 1. 0.]]
  Elems: [[0 1]
          [3 0]
          [1 2]
          [2 3]]
>>> print(M2.prop)
[0 1 0 1]