mesh.Mesh.match_centroids#
- Mesh.match_centroids(mesh, **kargs)#
Match elements of Mesh with elements of self.
Elements are matched by their centroids.
Parameters#
- mesh: Mesh object
This Mesh object should have the same eltype as self
Returns#
- 1-dim int array
The array has a length of mesh.n_elems(). For each element in Mesh, it holds the index of an element in self.elems coinciding with it, or a value -1 if there is no matching elements.
Examples#
>>> M1 = Mesh(eltype='quad4').subdivide(2,2) >>> M2 = M1.translate([0.5,0.0,0.0]) >>> print(M1.match_centroids(M2)) [ 1 -1 3 -1]