openmc.Lattice
- class openmc.Lattice(lattice_id=None, name='')[source]
A repeating structure wherein each element is a universe.
- Parameters:
- Variables:
id (int) – Unique identifier for the lattice
name (str) – Name of the lattice
pitch (Iterable of float) – Pitch of the lattice in each direction in cm
outer (openmc.UniverseBase) – A universe to fill all space outside the lattice
universes (Iterable of Iterable of openmc.UniverseBase) – A two-or three-dimensional list/array of universes filling each element of the lattice
- clone(clone_materials=True, clone_regions=True, memo=None)[source]
Create a copy of this lattice with a new unique ID, and clones all universes within this lattice.
- Parameters:
clone_materials (bool) – Whether to create separate copies of the materials filling cells contained in this lattice and its outer universe.
clone_regions (bool) – Whether to create separate copies of the regions bounding cells contained in this lattice and its outer universe.
memo (dict or None) – A nested dictionary of previously cloned objects. This parameter is used internally and should not be specified by the user.
- Returns:
clone – The clone of this lattice
- Return type:
- static from_hdf5(group, universes)[source]
Create lattice from HDF5 group
- Parameters:
group (h5py.Group) – Group in HDF5 file
universes (dict) – Dictionary mapping universe IDs to instances of
openmc.UniverseBase.
- Returns:
Instance of lattice subclass
- Return type:
- get_unique_universes()[source]
Determine all unique universes in the lattice
- Returns:
universes – Dictionary whose keys are universe IDs and values are
openmc.UniverseBaseinstances- Return type:
- get_universe(idx)[source]
Return universe corresponding to a lattice element index
- Parameters:
idx (Iterable of int) – Lattice element indices. For a rectangular lattice, the indices are given in the \((x,y)\) or \((x,y,z)\) coordinate system. For hexagonal lattices, they are given in the \(x,\alpha\) or \(x,\alpha,z\) coordinate systems for “y” orientations and \(\alpha,y\) or \(\alpha,y,z\) coordinate systems for “x” orientations.
- Returns:
Universe with given indices
- Return type:
openmc.UniverseBase