CAD to DAGMC

CAD to DAGMC#

A package that converts CAD geometry to DAGMC h5m files, unstructured mesh files (VTK), and Gmsh (msh) files ready for use in neutronics simulations.

Workflow#

CAD geometry is given a material tag per volume, meshed by one of three backends, then written out. The DAGMC h5m file is written by the h5py or pymoab writer, while the unstructured mesh vtk and GMSH msh files are written by the meshing backend itself. A GMSH mesh is already meshed, so it converts straight to a DAGMC h5m file.

export_dagmc_h5m_file() can write the DAGMC h5m file on its own, or write it together with a conformal unstructured mesh vtk file from a single meshing call. Pass unstructured_volumes on the gmsh backend, or tet_volumes and target_edge_length on the cad-to-dagmc-mesher backend, and it returns both filenames. See Conformal Meshes.

CadQuery objects and STEP files are given material tags, then meshed by the cad-to-dagmc-mesher, gmsh or cadquery backend. All three write DAGMC h5m files through the h5py or pymoab writer. The cad-to-dagmc-mesher and gmsh backends also write tetrahedra to unstructured mesh vtk files, and gmsh also writes GMSH msh files. The DAGMC geometry output names both files export_dagmc_h5m_file can write, the dagmc.h5m on its own or with a conformal umesh.vtk. A GMSH mesh input skips the meshing stage and goes straight to an h5m writer. CadQuery objects and STEP files are given material tags, then meshed by the cad-to-dagmc-mesher, gmsh or cadquery backend. All three write DAGMC h5m files through the h5py or pymoab writer. The cad-to-dagmc-mesher and gmsh backends also write tetrahedra to unstructured mesh vtk files, and gmsh also writes GMSH msh files. The DAGMC geometry output names both files export_dagmc_h5m_file can write, the dagmc.h5m on its own or with a conformal umesh.vtk. A GMSH mesh input skips the meshing stage and goes straight to an h5m writer.

Key Features#

Multiple Input Formats

Flexible Material Tagging

- CadQuery objects
- STEP files
- GMSH mesh files

- Manual tags
- Assembly names
- CadQuery Materials
- GMSH physical groups

Three Meshing Backends

Multiple Output Formats

- GMSH (full control, volume meshing)
- CadQuery (simpler, direct)
- cad-to-dagmc-mesher (surface and volume meshing)

- DAGMC h5m (surface mesh)
- Unstructured VTK (volume mesh)
- GMSH files

Two H5M Backends

Advanced Options

- h5py (default, no MOAB needed)
- pymoab (official MOAB)

- Per-volume mesh sizing
- Geometry scaling
- Parallel meshing