mesh.Mesh.length#

Mesh.length()#

Return the total length of a Mesh.

Returns#

float

For a level 1 Mesh, the sum of all element lengths(); for a level 2 Mesh, the length of the border_mesh(); 0.0 if lengths() returned None.

Examples#

>>> Mesh(eltype='line2').subdivide(4).length()
1.0

For a level 2 Mesh, note the difference between these three: the length of the border, the length of all edges (includes non-border edges), the sum of all element perimeters (includes edges multiple times).

>>> M = Mesh(eltype='quad4').subdivide(2,1)
>>> M.length(), M.edge_mesh().length(), M.lengths().sum()
(4.0, 5.0, 6.0)