mesh.Mesh.split_random#

Mesh.split_random(n, compact=True)#

Split a Mesh in n parts, distributing the elements randomly.

By default, the Meshes are compacted. Compaction may be switched off for efficiency reasons.

Returns#

list of Mesh

A list of n Mesh objects, constituting together the same Mesh as the original. The elements are randomly distributed over the subMeshes.

Examples#

>>> M = Mesh(eltype='quad4').subdivide(4)
>>> M_list = M.split_random(4)
>>> print(len(M_list))
4