Mesh¶
Stellarmesh supports surface meshing with both OCC and Gmsh backends.
Backends¶
OCC¶
The OpenCASCADE (OCC) meshing backend is the preferred backend when linear or angular mesh tolerances are required.
Gmsh¶
The Gmsh meshing backend offers a number of meshing algorithms for both surface and volume meshes. For more detailed documentation, see gmsh.info.
Specifying Mesh Options¶
The SurfaceMesh.from_geometry() constructor takes either an OCCSurfaceOptions or GmshSurfaceOptions options class as a parameter. Use this parameter to select the meshing backend and specify meshing options.
- from_geometry(geometry: Geometry, options: GmshSurfaceOptions | OCCSurfaceOptions) SurfaceMesh
Mesh geometry.
- Parameters:
geometry – Geometry to be meshed.
options – Meshing options.
Mesh Refinement¶
Note
Given CAD geometry, Gmsh often produces high-quality meshes that do not benefit from remeshing.
Stellarmesh supports mesh refinement using the mmg library. Refine a mesh with:
refined_mesh = mesh.refine(
...
)
and consult the SurfaceMesh.refine() and
mmgs
documentations for parameter values.
The refined mesh has more triangles in regions with high curvature thanks to the hausdorff parameter.¶
Many thanks to Erik B. Knudsen for his work on remeshing for CAD-to-OpenMC.
API¶
|
A Gmsh mesh. |
|
A surface mesh. |
|
Volume Mesh. |
|
OCC surface meshing options. |
|
OCC surface meshing algorithm. |
|
Gmsh surface meshing options. |
|
Algorithm used by Gmsh for surface meshing. |
|
Gmsh volume meshing options. |
|
Algorithm used by Gmsh for volume meshing. |