mymesh.improvement.TetSplit#
- mymesh.improvement.TetSplit(M, h, verbose=True, labels=None, sizing=None, QualitySizing=False)[source]#
Edge splitting of tetrahedral meshes. Edges with length greater than the specified edge length (h) will be split by placing a new node at the midpoint of the edge. Tetrahedral edge splitting is inherently interface and feature preserving as nodes are only added, not removed or moved.
This method is inspired by [FTB16] and [HZG+18].
- Parameters:
M (mymesh.mesh) – Tetrahedral mesh to be contracted
h (float) – Edge length above which will be split. Using 4/3 of the target edge length is often recommended.
verbose (bool, optional) – If true, will display progress, by default True
labels (str or array_like, optional) – Element labels used to identify separate regions (e.g. materials) within a mesh, by default None. If provided as a string, the string must refer to an entry in M.ElemData, otherwise must be an array_like with the number of entries equal to the number of elements (M.NElem). Providing labels will preserve the interface and interface features between regions of differening labels. The labels of the new mesh will be stored in the ElemData of the returned mesh, either in ElemData[‘labels’] (if labels were provided as an array), or the entry matching the original ElemData entry (if labels were provided as a string).
sizing (str, float, callable, or None) –
Option for non-uniform element sizing.
float - Specify a second target edge length (hi) to be used for edges far from the boundary. This will be used following Faraj et al. [FTB16] to generate an adaptive sizing field h_node = (hi-h)*D(node)+h, where D is a distance field from boundaries/interface evaluated at each node. The target edge length is then taken as the average of it’s two nodes
’auto’ - Uses hi = 2*h as the second target edge length and is used as described above for floats.
callable - Uses a callable, vectorized function of three inputs (f(x,y,z)) where x, y, z can be either scalar or vector coordinates and specifies the target edge length for each node and takes the average for an edge
None - Uniform sizing
- Returns:
Mnew – Tetrahedral mesh after edge splitting
- Return type: