mesh.Mesh.fuse#

Mesh.fuse(parts=None, nodes=None, **kargs)#

Fuse the nodes of a Mesh.

Nodes that are within the tolerance limits of each other are merged into a single node.

Parameters#

parts: int array_like, optional

If provided, it is an int array with length equal to the number of elements that will be used to split the Mesh into parts (see split_prop()) and the fuse operation will be executed per part. Elements for which the value of nparts is negative will not be involved in the fuse operations.

nodes: int array_like, optional

A list of node numbers. If provided, only these nodes will be involved in the fuse operation. This option can not be used together with the parts option.

**kargs:

Extra arguments for tuning the fuse operation are passed to the coords.Coords.fuse() method.

Examples#

>>> coords = Coords([[0.0, 0.0, 0.0],
...                  [1.0, 0.0, 0.0],
...                  [1.0, 0.0, 0.0],
...                  [2.0, 0.0, 0.0],
...                  [3.0, 0.0, 0.0],
...                  [2.0, 0.0, 0.0]])
>>> elems = [[0,1],[2,3],[5,4]]
>>> M = Mesh(coords,elems,eltype='line2')
>>> print(M.fuse())
Mesh: n_nodes: 4, n_elems: 3, plexitude: 2, level: 1, eltype: line2
  BBox: [0. 0. 0.], [3. 0. 0.]
  Size: [3. 0. 0.]
  Length: 3.0
>>> print(M.fuse(nodes=[1,2]).coords)
[[0. 0. 0.]
 [2. 0. 0.]
 [3. 0. 0.]
 [2. 0. 0.]
 [1. 0. 0.]]
>>> print(M.fuse(parts=[0,1,1]).coords)
[[0. 0. 0.]
 [1. 0. 0.]
 [1. 0. 0.]
 [2. 0. 0.]
 [3. 0. 0.]]