mesh.Mesh.generate_quad_mesh#

Mesh.generate_quad_mesh()#

Generate a quad surface mesh inside a closed line2 mesh.

The current mesh must be a closed, unbranched line2 loop. The input mesh defines the boundary of the resulting quad mesh.

Important

An additional node is inserted at the midpoint of every boundary element. Consequently, the boundary of the resulting quad mesh will contain twice as many edges as the input line2 mesh.

For curved boundaries, inserting midpoint nodes on boundary elements may lead to a geometric approximation error.

If more control over the boundary discretization is important, consider using generate_quad_mesh_multi() instead.

Returns#

Mesh

Quad surface mesh (quad4) filling the area inside this mesh.

See Also#

generate_quad_mesh_multi()

Examples#

Midpoint insertion on boundary edges:

>>> cir = shapes.circle(div=8) # 8 elements
>>> quad = cir.generate_quad_mesh()
>>> print(quad.border_mesh().n_elems())
16