This page was generated from docs\source\notebooks/trafo_topo.ipynb.

Topological transformations#

The library supports utilities to perform topological transformations. The functions can be found in the namespace sigmaepsilon.mesh.utils.topology.tr.

Create a grid of VTK compliant bilinear quadrilaterals (Q4):

[1]:
from sigmaepsilon.mesh.grid import grid

gridparams = {
    "size": (1200, 600),
    "shape": (30, 15),
    "eshape": (2, 2),
    "path": [0, 2, 3, 1]
}
coords, topo = grid(**gridparams)

Transform the topology of the resulting mesh to 6-noded triangles:

[2]:
from sigmaepsilon.mesh.utils.topology.tr import Q4_to_Q9, Q9_to_T6

coords, topo = Q9_to_T6(*Q4_to_Q9(coords, topo))

To get the full list of transformation functions:

[3]:
import sigmaepsilon.mesh.utils.topology.tr as topo_tr

topo_tr.__all__
[3]:
['transform_topology',
 'compose_trmap',
 'L2_to_L3',
 'T3_to_T6',
 'T3_to_L2',
 'T6_to_T3',
 'Q4_to_Q8',
 'Q4_to_Q9',
 'Q9_to_Q4',
 'Q8_to_T3',
 'Q9_to_T6',
 'Q4_to_T3',
 'H8_to_L2',
 'H8_to_Q4',
 'H8_to_H27',
 'H8_to_TET4',
 'H27_to_H8',
 'H27_to_TET10',
 'TET4_to_L2',
 'TET4_to_TET10',
 'W6_to_W18',
 'W6_to_TET4',
 'W18_to_W6']