mesh.Mesh.subdivide#

Mesh.subdivide(*ndiv, fuse=True)#

Subdivide the elements of a Mesh.

Parameters#

*ndiv: sequence

A sequence of divisor specifications for the parametric directions of the element. There can not be more divisor specifications than the number of parametric directions (self.eltype.ndim). If there are less specifications, the last one is repeated up to the elements ndim. Each divisor specification should be either

  • an int, specifying the number of equidistant partitions of the parameter space along that direction, or

  • an ordered list of float values specifying the partitioning points in the parametric range (normally 0..1). In order to completely fill the element, the first and last values in the list should be the start and end of the parameter range.

fuse: bool, optional

If True (default), the resulting Mesh is completely fused. If False, the Mesh is only fused over each individual element of the original Mesh.

Returns#

Mesh

A Mesh where each element is replaced by a number of smaller elements of the same type.

Notes#

Some element types can not be subdivided: the non-dimensional Point and the complex structures Octa and Icosa.

Examples#

>>> M = Mesh(eltype='quad4').subdivide(3,2)
>>> print(M)
Mesh: n_nodes: 12, n_elems: 6, plexitude: 4, level: 2, eltype: quad4
  BBox: [0.  0.  0.], [1.  1.  0.]
  Size: [1.  1.  0.]
  Length: 4.0  Area: 1.0
>>> print(M.coords)
[[0.     0.     0.    ]
 [0.3333 0.     0.    ]
 [0.6667 0.     0.    ]
 [1.     0.     0.    ]
 [0.     0.5    0.    ]
 [0.3333 0.5    0.    ]
 [0.6667 0.5    0.    ]
 [1.     0.5    0.    ]
 [0.     1.     0.    ]
 [0.3333 1.     0.    ]
 [0.6667 1.     0.    ]
 [1.     1.     0.    ]]
>>> print(M.elems)
[[ 0  1  5  4]
 [ 1  2  6  5]
 [ 2  3  7  6]
 [ 4  5  9  8]
 [ 5  6 10  9]
 [ 6  7 11 10]]
>>> M = Mesh(eltype='hex8').subdivide(2,1,1)
>>> print(M)
Mesh: n_nodes: 12, n_elems: 2, plexitude: 8, level: 3, eltype: hex8
  BBox: [0. 0. 0.], [1. 1. 1.]
  Size: [1. 1. 1.]
  Area: 6.0  Volume: 1.0
>>> print(M.coords)
[[0.  0.  0. ]
 [0.5 0.  0. ]
 [1.  0.  0. ]
 [0.  1.  0. ]
 [0.5 1.  0. ]
 [1.  1.  0. ]
 [0.  0.  1. ]
 [0.5 0.  1. ]
 [1.  0.  1. ]
 [0.  1.  1. ]
 [0.5 1.  1. ]
 [1.  1.  1. ]]
>>> print(M.elems)
[[ 0  1  4  3  6  7 10  9]
 [ 1  2  5  4  7  8 11 10]]