openmc.Geometry¶
-
class
openmc.
Geometry
(root_universe=None)[source]¶ Geometry representing a collection of surfaces, cells, and universes.
Parameters: root_universe (openmc.Universe, optional) – Root universe which contains all others
Variables: - root_universe (openmc.Universe) – Root universe which contains all others
- bounding_box (2-tuple of numpy.array) – Lower-left and upper-right coordinates of an axis-aligned bounding box of the universe.
-
add_volume_information
(volume_calc)[source]¶ Add volume information from a stochastic volume calculation.
Parameters: volume_calc (openmc.VolumeCalculation) – Results from a stochastic volume calculation
-
clone
()[source]¶ Create a copy of this geometry with new unique IDs for all of its enclosed materials, surfaces, cells, universes and lattices.
-
determine_paths
(instances_only=False)[source]¶ Determine paths through CSG tree for cells and materials.
This method recursively traverses the CSG tree to determine each unique path that reaches every cell and material. The paths are stored in the
Cell.paths
andMaterial.paths
attributes.Parameters: instances_only (bool, optional) – If true, this method will only determine the number of instances of each cell and material.
-
export_to_xml
(path='geometry.xml')[source]¶ Export geometry to an XML file.
Parameters: path (str) – Path to file to write. Defaults to ‘geometry.xml’.
-
find
(point)[source]¶ Find cells/universes/lattices which contain a given point
Parameters: point (3-tuple of float) – Cartesian coordinates of the point Returns: Sequence of universes, cells, and lattices which are traversed to find the given point Return type: list
-
get_all_cells
()[source]¶ Return all cells in the geometry.
Returns: Dictionary mapping cell IDs to openmc.Cell
instancesReturn type: collections.OrderedDict
-
get_all_lattices
()[source]¶ Return all lattices defined
Returns: Dictionary mapping lattice IDs to openmc.Lattice
instancesReturn type: collections.OrderedDict
-
get_all_material_cells
()[source]¶ Return all cells filled by a material
Returns: Dictionary mapping cell IDs to openmc.Cell
instances that are filled with materials or distributed materials.Return type: collections.OrderedDict
-
get_all_material_universes
()[source]¶ Return all universes having at least one material-filled cell.
This method can be used to find universes that have at least one cell that is filled with a material or is void.
Returns: Dictionary mapping universe IDs to openmc.Universe
instances with at least one material-filled cellReturn type: collections.OrderedDict
-
get_all_materials
()[source]¶ Return all materials within the geometry.
Returns: Dictionary mapping material IDs to openmc.Material
instancesReturn type: collections.OrderedDict
-
get_all_surfaces
()[source]¶ Return all surfaces used in the geometry
Returns: Dictionary mapping surface IDs to openmc.Surface
instancesReturn type: collections.OrderedDict
-
get_all_universes
()[source]¶ Return all universes in the geometry.
Returns: Dictionary mapping universe IDs to openmc.Universe
instancesReturn type: collections.OrderedDict
-
get_cells_by_fill_name
(name, case_sensitive=False, matching=False)[source]¶ Return a list of cells with fills with matching names.
Parameters: Returns: Cells with fills matching the queried name
Return type: list of openmc.Cell
-
get_cells_by_name
(name, case_sensitive=False, matching=False)[source]¶ Return a list of cells with matching names.
Parameters: Returns: Cells matching the queried name
Return type: list of openmc.Cell
-
get_instances
(paths)[source]¶ Return the instance number(s) for a cell/material in a geometry path.
The instance numbers are used as indices into distributed material/temperature arrays and tally distribcell filter arrays.
Parameters: paths (str or iterable of str) – The path traversed through the CSG tree to reach a cell or material instance. For example, ‘u0->c10->l20(2,2,1)->u5->c5’ would indicate the cell instance whose first level is universe 0 and cell 10, second level is lattice 20 position (2,2,1), and third level is universe 5 and cell 5. Returns: Instance number(s) for the given path(s) Return type: int or list of int
-
get_lattices_by_name
(name, case_sensitive=False, matching=False)[source]¶ Return a list of lattices with matching names.
Parameters: Returns: Lattices matching the queried name
Return type: list of openmc.Lattice
-
get_materials_by_name
(name, case_sensitive=False, matching=False)[source]¶ Return a list of materials with matching names.
Parameters: Returns: Materials matching the queried name
Return type: list of openmc.Material