This page was generated from
docs/source/examples/grids3d.ipynb.
Grid generation in 3d#
[1]:
from polymesh.grid import gridH8 as grid
from polymesh import PolyData, PointData, CartesianFrame
from polymesh.cells import H8 as CellData
# create a grid of 30 x 15 cells, with 2 x 2 nodes per cell
gridparams = {
"size": (1200, 600, 100),
"shape": (30, 15, 4),
}
coords, topo = grid(**gridparams)
frame = CartesianFrame(dim=3)
pd = PointData(coords=coords, frame=frame)
cd = CellData(topo=topo, frames=frame)
mesh = PolyData(pd, cd)
mesh.plot(notebook=True, jupyter_backend="static", theme="document")