OpenCG Compatibility¶
-
openmc.opencg_compatible.
get_compatible_opencg_cells
(opencg_cell, opencg_surface, halfspace)[source]¶ Generate OpenCG cells that are compatible with OpenMC equivalent to an OpenCG cell that is not compatible.
Parameters: - opencg_cell (opencg.Cell) – OpenCG cell
- opencg_surface (opencg.Surface) – OpenCG surface that causes the incompatibility, e.g. an instance of XSquarePrism
- halfspace ({-1, 1}) – Which halfspace defined by the surface is contained in the cell
Returns: compatible_cells – Collection of cells equivalent to the original one but compatible with OpenMC
Return type: list of opencg.Cell
-
openmc.opencg_compatible.
get_compatible_opencg_surfaces
(opencg_surface)[source]¶ Generate OpenCG surfaces that are compatible with OpenMC equivalent to an OpenCG surface that is not compatible. For example, this method may be used to convert a ZSquarePrism OpenCG surface into a collection of equivalent XPlane and YPlane OpenCG surfaces.
Parameters: opencg_surface (opencg.Surface) – OpenCG surface that is incompatible with OpenMC Returns: surfaces – Collection of surfaces equivalent to the original one but compatible with OpenMC Return type: list of opencg.Surface
-
openmc.opencg_compatible.
get_opencg_cell
(openmc_cell)[source]¶ Return an OpenCG cell corresponding to an OpenMC cell.
Parameters: openmc_cell (openmc.universe.Cell) – OpenMC cell Returns: opencg_cell – Equivalent OpenCG cell Return type: opencg.Cell
-
openmc.opencg_compatible.
get_opencg_geometry
(openmc_geometry)[source]¶ Return an OpenCG geometry corresponding to an OpenMC geometry.
Parameters: openmc_geometry (openmc.universe.Geometry) – OpenMC geometry Returns: opencg_geometry – Equivalent OpenCG geometry Return type: opencg.Geometry
-
openmc.opencg_compatible.
get_opencg_lattice
(openmc_lattice)[source]¶ Return an OpenCG lattice corresponding to an OpenMC lattice.
Parameters: openmc_lattice (openmc.universe.Lattice) – OpenMC lattice Returns: opencg_lattice – Equivalent OpenCG lattice Return type: opencg.Lattice
-
openmc.opencg_compatible.
get_opencg_material
(openmc_material)[source]¶ Return an OpenCG material corresponding to an OpenMC material.
Parameters: openmc_material (openmc.material.Material) – OpenMC material Returns: opencg_material – Equivalent OpenCG material Return type: opencg.Material
-
openmc.opencg_compatible.
get_opencg_surface
(openmc_surface)[source]¶ Return an OpenCG surface corresponding to an OpenMC surface.
Parameters: openmc_surface (openmc.surface.Surface) – OpenMC surface Returns: opencg_surface – Equivalent OpenCG surface Return type: opencg.Surface
-
openmc.opencg_compatible.
get_opencg_universe
(openmc_universe)[source]¶ Return an OpenCG universe corresponding to an OpenMC universe.
Parameters: openmc_universe (openmc.universe.Universe) – OpenMC universe Returns: opencg_universe – Equivalent OpenCG universe Return type: opencg.Universe
-
openmc.opencg_compatible.
get_openmc_cell
(opencg_cell)[source]¶ Return an OpenMC cell corresponding to an OpenCG cell.
Parameters: opencg_cell (opencg.Cell) – OpenCG cell Returns: openmc_cell – Equivalent OpenMC cell Return type: openmc.universe.Cell
-
openmc.opencg_compatible.
get_openmc_geometry
(opencg_geometry)[source]¶ Return an OpenMC geometry corresponding to an OpenCG geometry.
Parameters: opencg_geometry (opencg.Geometry) – OpenCG geometry Returns: openmc_geometry – Equivalent OpenMC geometry Return type: openmc.universe.Geometry
-
openmc.opencg_compatible.
get_openmc_lattice
(opencg_lattice)[source]¶ Return an OpenMC lattice corresponding to an OpenCG lattice.
Parameters: opencg_lattice (opencg.Lattice) – OpenCG lattice Returns: openmc_lattice – Equivalent OpenMC lattice Return type: openmc.universe.Lattice
-
openmc.opencg_compatible.
get_openmc_material
(opencg_material)[source]¶ Return an OpenMC material corresponding to an OpenCG material.
Parameters: opencg_material (opencg.Material) – OpenCG material Returns: openmc_material – Equivalent OpenMC material Return type: openmc.material.Material
-
openmc.opencg_compatible.
get_openmc_surface
(opencg_surface)[source]¶ Return an OpenMC surface corresponding to an OpenCG surface.
Parameters: opencg_surface (opencg.Surface) – OpenCG surface Returns: openmc_surface – Equivalent OpenMC surface Return type: openmc.surface.Surface
-
openmc.opencg_compatible.
get_openmc_universe
(opencg_universe)[source]¶ Return an OpenMC universe corresponding to an OpenCG universe.
Parameters: opencg_universe (opencg.Universe) – OpenCG universe Returns: openmc_universe – Equivalent OpenMC universe Return type: openmc.universe.Universe
-
openmc.opencg_compatible.
is_opencg_surface_compatible
(opencg_surface)[source]¶ Determine whether OpenCG surface is compatible with OpenMC geometry.
A surface is considered compatible if there is a one-to-one correspondence between OpenMC and OpenCG surface types. Note that some OpenCG surfaces, e.g. SquarePrism, do not have a one-to-one correspondence with OpenMC surfaces but can still be converted into an equivalent collection of OpenMC surfaces.
Parameters: opencg_surface (opencg.Surface) – OpenCG surface Returns: Whether OpenCG surface is compatible with OpenMC Return type: bool