diff --git a/docs/source/usersguide/output/statepoint.rst b/docs/source/usersguide/output/statepoint.rst index d3c1729af6..15bc79f739 100644 --- a/docs/source/usersguide/output/statepoint.rst +++ b/docs/source/usersguide/output/statepoint.rst @@ -185,10 +185,6 @@ if run_mode == 'k-eigenvalue': Type of the j-th filter. Can be 'universe', 'material', 'cell', 'cellborn', 'surface', 'mesh', 'energy', 'energyout', or 'distribcell'. -**/tallies/tally /filter /offset** (*int*) - - Filter offset (used for distribcell filter). - **/tallies/tally /filter /n_bins** (*int*) Number of bins for the j-th filter. diff --git a/docs/source/usersguide/output/summary.rst b/docs/source/usersguide/output/summary.rst index f87f60c4a0..302f340799 100644 --- a/docs/source/usersguide/output/summary.rst +++ b/docs/source/usersguide/output/summary.rst @@ -121,6 +121,10 @@ The current revision of the summary file format is 1. Region specification for the cell. +**/geometry/cells/cell /distribcell_index** (*int*) + + Index of this cell in distribcell filter arrays. + **/geometry/surfaces/surface /index** (*int*) Index in surfaces array used internally in OpenMC. diff --git a/openmc/geometry.py b/openmc/geometry.py index eb2b9db558..fc8e19f071 100644 --- a/openmc/geometry.py +++ b/openmc/geometry.py @@ -66,20 +66,20 @@ class Geometry(object): # Find the distribcell index of the cell. cells = self.get_all_cells() if path[-1] in cells: - distribcell_ind = cells[path[-1]].distribcell_ind + distribcell_index = cells[path[-1]].distribcell_index else: raise RuntimeError('Could not find cell {} specified in a \ distribcell filter'.format(path[-1])) # Return memoize'd offset if possible - if (path, distribcell_ind) in self._offsets: - offset = self._offsets[(path, distribcell_ind)] + if (path, distribcell_index) in self._offsets: + offset = self._offsets[(path, distribcell_index)] # Begin recursive call to compute offset starting with the base Universe else: offset = self._root_universe.get_cell_instance(path, - distribcell_ind) - self._offsets[(path, distribcell_ind)] = offset + distribcell_index) + self._offsets[(path, distribcell_index)] = offset # Return the final offset return offset diff --git a/openmc/summary.py b/openmc/summary.py index 9e2145b343..1c4c69aab7 100644 --- a/openmc/summary.py +++ b/openmc/summary.py @@ -272,9 +272,9 @@ class Summary(object): region, {s.id: s for s in self.surfaces.values()}) # Get the distribcell index - ind = self._f['geometry/cells'][key]['distribcell_ind'].value + ind = self._f['geometry/cells'][key]['distribcell_index'].value if ind != 0: - cell.distribcell_ind = ind + cell.distribcell_index = ind # Add the Cell to the global dictionary of all Cells self.cells[index] = cell diff --git a/openmc/universe.py b/openmc/universe.py index e7b2151a32..8c50ddbc75 100644 --- a/openmc/universe.py +++ b/openmc/universe.py @@ -63,7 +63,7 @@ class Cell(object): that is used to translate (shift) the universe. offsets : ndarray Array of offsets used for distributed cell searches - distribcell_ind : int + distribcell_index : int Index of this cell in distribcell arrays """ @@ -78,7 +78,7 @@ class Cell(object): self._rotation = None self._translation = None self._offsets = None - self._distribcell_ind = None + self._distribcell_index = None def __eq__(self, other): if not isinstance(other, Cell): @@ -126,7 +126,7 @@ class Cell(object): self._translation) string += '{0: <16}{1}{2}\n'.format('\tOffset', '=\t', self._offsets) string += '{0: <16}{1}{2}\n'.format('\tDistribcell index', '=\t', - self._distribcell_ind) + self._distribcell_index) return string @@ -170,8 +170,8 @@ class Cell(object): return self._offsets @property - def distribcell_ind(self): - return self._distribcell_ind + def distribcell_index(self): + return self._distribcell_index @id.setter def id(self, cell_id): @@ -240,10 +240,10 @@ class Cell(object): cv.check_type('cell region', region, Region) self._region = region - @distribcell_ind.setter - def distribcell_ind(self, ind): + @distribcell_index.setter + def distribcell_index(self, ind): cv.check_type('distribcell index', ind, Integral) - self._distribcell_ind = ind + self._distribcell_index = ind def add_surface(self, surface, halfspace): """Add a half-space to the list of half-spaces whose intersection defines the @@ -285,7 +285,7 @@ class Cell(object): else: self.region = Intersection(self.region, region) - def get_cell_instance(self, path, distribcell_ind): + def get_cell_instance(self, path, distribcell_index): # Get the current element and remove it from the list cell_id = path[0] path = path[1:] @@ -296,12 +296,12 @@ class Cell(object): # If the Cell is filled by a Universe elif self._type == 'fill': - offset = self.offsets[distribcell_ind-1] - offset += self.fill.get_cell_instance(path, distribcell_ind) + offset = self.offsets[distribcell_index-1] + offset += self.fill.get_cell_instance(path, distribcell_index) # If the Cell is filled by a Lattice else: - offset = self.fill.get_cell_instance(path, distribcell_ind) + offset = self.fill.get_cell_instance(path, distribcell_index) return offset @@ -605,7 +605,7 @@ class Universe(object): self._cells.clear() - def get_cell_instance(self, path, distribcell_ind): + def get_cell_instance(self, path, distribcell_index): # Get the current element and remove it from the list path = path[1:] @@ -613,7 +613,7 @@ class Universe(object): cell_id = path[0] # Make a recursive call to the Cell within this Universe - offset = self.cells[cell_id].get_cell_instance(path, distribcell_ind) + offset = self.cells[cell_id].get_cell_instance(path, distribcell_index) # Return the offset computed at all nested Universe levels return offset @@ -1073,22 +1073,22 @@ class RectLattice(Lattice): cv.check_greater_than('lattice pitch', dim, 0.0) self._pitch = pitch - def get_cell_instance(self, path, distribcell_ind): + def get_cell_instance(self, path, distribcell_index): # Get the current element and remove it from the list i = path[0] path = path[1:] # For 2D Lattices if len(self._dimension) == 2: - offset = self._offsets[i[1]-1, i[2]-1, 0, distribcell_ind-1] + offset = self._offsets[i[1]-1, i[2]-1, 0, distribcell_index-1] offset += self._universes[i[1]][i[2]].get_cell_instance(path, - distribcell_ind) + distribcell_index) # For 3D Lattices else: - offset = self._offsets[i[1]-1, i[2]-1, i[3]-1, distribcell_ind-1] + offset = self._offsets[i[1]-1, i[2]-1, i[3]-1, distribcell_index-1] offset += self._universes[i[1]-1][i[2]-1][i[3]-1].get_cell_instance( - path, distribcell_ind) + path, distribcell_index) return offset diff --git a/src/geometry_header.F90 b/src/geometry_header.F90 index 684de883c2..3dad3ba395 100644 --- a/src/geometry_header.F90 +++ b/src/geometry_header.F90 @@ -136,7 +136,7 @@ module geometry_header ! expression logical :: simple ! Is the region simple (intersections ! only) - integer :: distribcell_ind ! Index corresponding to this cell in + integer :: distribcell_index ! Index corresponding to this cell in ! distribcell arrays ! Rotation matrix and translation vector diff --git a/src/initialize.F90 b/src/initialize.F90 index 1134040e9a..30654be9d2 100644 --- a/src/initialize.F90 +++ b/src/initialize.F90 @@ -1092,7 +1092,7 @@ contains univ => universes(i) do j = 1, univ % n_cells if (cell_list % contains(univ % cells(j))) then - cells(univ % cells(j)) % distribcell_ind = k + cells(univ % cells(j)) % distribcell_index = k univ_list(k) = univ % id k = k + 1 end if diff --git a/src/input_xml.F90 b/src/input_xml.F90 index a4317ed8e3..07d739b889 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -1051,7 +1051,7 @@ contains ! Initialize distribcell instances and distribcell index c % instances = 0 - c % distribcell_ind = NONE + c % distribcell_index = NONE ! Get pointer to i-th cell node call get_list_item(node_cell_list, i, node_cell) diff --git a/src/output.F90 b/src/output.F90 index 5b938e98d3..66e6831371 100644 --- a/src/output.F90 +++ b/src/output.F90 @@ -1436,7 +1436,7 @@ contains class(Lattice), pointer :: lat ! Pointer to current lattice ! Get the distribcell index for this cell - map = cells(goal) % distribcell_ind + map = cells(goal) % distribcell_index n = univ % n_cells diff --git a/src/summary.F90 b/src/summary.F90 index 11c4cd434b..7a430cf741 100644 --- a/src/summary.F90 +++ b/src/summary.F90 @@ -196,7 +196,7 @@ contains end do call write_dataset(cell_group, "region", adjustl(region_spec)) - call write_dataset(cell_group, "distribcell_ind", c % distribcell_ind) + call write_dataset(cell_group, "distribcell_index", c % distribcell_index) call close_group(cell_group) end do CELL_LOOP diff --git a/src/tally.F90 b/src/tally.F90 index 2ccd59a58e..7210efc5c8 100644 --- a/src/tally.F90 +++ b/src/tally.F90 @@ -1712,7 +1712,7 @@ contains integer :: j integer :: n ! number of bins for single filter integer :: offset ! offset for distribcell - integer :: distribcell_ind ! index in distribcell arrays + integer :: distribcell_index ! index in distribcell arrays real(8) :: E ! particle energy real(8) :: theta, phi ! Polar and Azimuthal Angles, respectively type(TallyObject), pointer :: t @@ -1757,13 +1757,14 @@ contains case (FILTER_DISTRIBCELL) ! determine next distribcell bin - distribcell_ind = cells(t % filters(i) % int_bins(1)) % distribcell_ind + distribcell_index = cells(t % filters(i) % int_bins(1)) & + % distribcell_index matching_bins(i) = NO_BIN_FOUND offset = 0 do j = 1, p % n_coord if (cells(p % coord(j) % cell) % type == CELL_FILL) then offset = offset + cells(p % coord(j) % cell) % & - offset(distribcell_ind) + offset(distribcell_index) elseif(cells(p % coord(j) % cell) % type == CELL_LATTICE) then if (lattices(p % coord(j + 1) % lattice) % obj & % are_valid_indices([& @@ -1771,7 +1772,7 @@ contains p % coord(j + 1) % lattice_y, & p % coord(j + 1) % lattice_z])) then offset = offset + lattices(p % coord(j + 1) % lattice) % obj % & - offset(distribcell_ind, & + offset(distribcell_index, & p % coord(j + 1) % lattice_x, & p % coord(j + 1) % lattice_y, & p % coord(j + 1) % lattice_z)