This page was generated from docs\source\examples/cube.ipynb.

Creating a compound cube#

[1]:
from sigmaepsilon.mesh import PolyData, PointData, grid
from sigmaepsilon.mesh.space import StandardFrame
from sigmaepsilon.mesh.cells import H27

size = Lx, Ly, Lz = 100, 100, 100
shape = nx, ny, nz = 10, 10, 10
coords, topo = grid(size=size, shape=shape, eshape="H27")

GlobalFrame = StandardFrame(dim=3)

pd = PointData(coords=coords, frame=GlobalFrame)
mesh = PolyData(pd, frame=GlobalFrame)

part1 = H27(topo=topo[:10], frames=GlobalFrame)
part2 = H27(topo=topo[10:-10], frames=GlobalFrame)
part3 = H27(topo=topo[-10:], frames=GlobalFrame)

mesh["A", "Part1"] = PolyData(cd=part1)
mesh["A", "Part2"] = PolyData(cd=part2)
mesh["A", "Part3"] = PolyData(cd=part3)

mesh.plot(notebook=True, jupyter_backend="static", theme="document")
../_images/examples_cube_1_0.png