Stellarmesh is a meshing library for nuclear workflows. Principally, it supports the creation of DAGMC geometry from CAD models.
Features:
✅ Surface and volume meshing
✅ Gmsh and OpenCASCADE meshing backends
✅ Linear and angular mesh tolerances
✅ Surface boundary conditions
✅ Imprinting and merging of conformal geometry
✅ Mesh refinement
✅ Programmatic manipulation of .h5m tags
✅ Automated testing and integration
Getting Started¶
Example¶
import build123d as bd
import stellarmesh as sm
solids = [bd.Solid.make_torus(1000, 100)]
for _ in range(3):
solids.append(bd.Solid.thicken(solids[-1].faces()[0], 100))
solids = solids[1:]
geometry = sm.Geometry(solids[::-1], material_names=["a", "a", "c"])
mesh = sm.SurfaceMesh.from_geometry(
geometry, sm.GmshSurfaceOptions(min_mesh_size=50, max_mesh_size=200)
)
mesh.write("test.msh")
mesh.render("docs/torus-mesh-reversed.png", rotation_xyz=(90, 0, -90), normals=15)
h5m = sm.DAGMCModel.from_mesh(mesh)
h5m.write("dagmc.h5m")
h5m.write("dagmc.vtk")
Acknowledgements¶
Stellarmesh is originally a project of Thea Energy, who are building the world’s first planar coil stellarator.