mesh.Mesh.to_lines#

Mesh.to_lines()#

Convert a Mesh to a line2 Mesh.

All Meshes of level 1 or higher can be converted to a line2 Mesh. For level 2 and 3 Meshes, first the edge_mesh() is taken. The level 1 Mesh is then converted to ‘line2’ elements.

Returns#

Mesh

A Mesh of eltype ‘line2’ containing all the linearized edges of the input Mesh.

Raises#

ValueError

If the input Mesh has level < 1.

Examples#

>>> M = Mesh(eltype='quad4')
>>> print(M.to_lines())
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