Skip to content

inr-kit/McCAD-Library

Repository files navigation

McCAD: a CAD to Monte Carlo conversion library

McCAD is a library for the conversion of CAD solid models into the input syntax of a variety of Monte Carlo codes; from Boundary Representation "BREP" to Constructive Solid Geometry "CSG". The library is written in C++ and consists of two main algorithms:

1- Decompostion:
  • carries out tasks pertinent to the simplification of complex solids by means of decomposition into their primitive convex subsolids.
2- Void generation & Conversion:
  • carries out tasks pertinent to the generation of void cells and conversion of the primitive solids into MCNP input syntax, and later on to other MC codes.

Useful links:

  • [Older version] McCAD-SALOME: McCAD library integrated with the Salome platform:
  • [Older version] McCAD-FreeCAD: an improved McCAD library integrated with the opensource CAD software FreeCAD:
  • csg2csg: a tool for the translation between a variety of Monte Carlo code formats:

Dependencies:

1- CMake (version 3.25.2):
  • the standard build system for McCAD library.
2- Boost C++ Libraries (version 1.81.0):
  • used for multiprocessing.
3- Open CASCADE Technology (version 7.7.0):
  • the geometry engine used for manipulating and decomposing solids.

Installation:

Please refer to the "Installation from Source" section in the manual.

General notes on Usage:

1- The library assumes a clean CAD model, one with no intersections/overlapping.
  • while in theory the library won't report an error with intersections/overlapping as solids are processed individually, it will cause issue for void generation and conversion!
2- There are known bugs with the decomposition algorithm which are currently being investigated.
  • a list of bugs and proposed workaround can be found in the "Known issues" section in the manual.

Reporting issues:

Please don't hesitate to report any issues with running the code or errors in the manual by:

Citation:

Please use the citation below to reference the code in published articles: Harb, M.; Leichtle, D.; Fischer, U. A Novel Algorithm for CAD to CSG Conversion in McCAD. J. Nucl. Eng. 2023, 4, 436-447. https://doi.org/10.3390/jne4020031