magnet.aggmodels.kmeans.KMEANS#
- class magnet.aggmodels.kmeans.KMEANS#
Bases:
AgglomerationModel
Kmeans algorithm applied to mesh agglomeration.
Constructor
- __init__()#
Methods
direct_k_way
(mesh, k)Bisect the mesh recursively a set number of times.
- direct_k_way(mesh: Mesh, k: int) List[ndarray[int]] #
Bisect the mesh recursively a set number of times.
The agglomearated mesh will have (at most) 2^`Nref` agglomerated elements.
- Parameters:
mesh (Mesh) – Mesh to be bisected.
Nref (int) – Number of times to recursively bisect the mesh.
- Returns:
A list of arrays, each containing the indices of the elements corresponding to one of the agglomerated elements.
- Return type:
Classlist
Inherited Methods
__init__
()agglomerate
(mesh[, mode, nref, mult_factor])Agglomerate a mesh.
agglomerate_dataset
(dataset, **kwargs)Agglomerate all meshes in a dataset.
bisect
(mesh)Bisect the mesh once.
bisection_Nref
(mesh, Nref[, warm_start])Bisect the mesh recursively a set number of times.
bisection_mult_factor
(mesh, mult_factor[, ...])Bisect a mesh until the agglomerated elements are small enough.
bisection_segregated
(mesh, mult_factor[, subset])Bisect heterogeneous mesh until elements are small enough.
coarsen
(mesh, subset[, mode, nref, mult_factor])Coarsen a subregion of the mesh.
multilevel_bisection
(mesh[, refiner, ...])