Skip to content

Commit

Permalink
Merge pull request #578 from wbinventor/hotfix-3dlat-offsets
Browse files Browse the repository at this point in the history
Fixed Issue with 3D Lattice Distribcell Offsets
  • Loading branch information
smharper committed Jan 31, 2016
2 parents 1abb847 + fb0e166 commit d3ec579
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
3 changes: 2 additions & 1 deletion openmc/arithmetic.py
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,8 @@ def get_bin_index(self, filter_bin):
"""

if filter_bin not in self.bins:
if filter_bin not in self.bins and \
filter_bin != self._aggregate_filter.bins:
msg = 'Unable to get the bin index for AggregateFilter since ' \
'"{0}" is not one of the bins'.format(filter_bin)
raise ValueError(msg)
Expand Down
5 changes: 3 additions & 2 deletions openmc/mgxs/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -568,8 +568,9 @@ def get_subdomain_avg_library(self):
for domain in self.domains:
for mgxs_type in self.mgxs_types:
mgxs = subdomain_avg_library.get_mgxs(domain, mgxs_type)
avg_mgxs = mgxs.get_subdomain_avg_xs()
subdomain_avg_library.all_mgxs[domain.id][mgxs_type] = avg_mgxs
if mgxs.domain_type == 'distribcell':
avg_mgxs = mgxs.get_subdomain_avg_xs()
subdomain_avg_library.all_mgxs[domain.id][mgxs_type] = avg_mgxs

return subdomain_avg_library

Expand Down
2 changes: 1 addition & 1 deletion openmc/summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,8 @@ def _read_lattices(self):
# Set the universes for the lattice
lattice.universes = universes

# Set the distribcell offsets for the lattice
if offsets is not None:
offsets = np.swapaxes(offsets, 0, 2)
lattice.offsets = offsets

# Add the Lattice to the global dictionary of all Lattices
Expand Down
6 changes: 3 additions & 3 deletions openmc/universe.py
Original file line number Diff line number Diff line change
Expand Up @@ -1095,14 +1095,14 @@ def get_cell_instance(self, path, distribcell_index):

# For 2D Lattices
if len(self._dimension) == 2:
offset = self._offsets[i[1]-1, i[2]-1, 0, distribcell_index-1]
offset = self._offsets[i[3]-1, i[2]-1, i[1]-1, distribcell_index-1]
offset += self._universes[i[1]-1][i[2]-1].get_cell_instance(path,
distribcell_index)

# For 3D Lattices
else:
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(
offset = self._offsets[i[3]-1, i[2]-1, i[1]-1, distribcell_index-1]
offset += self._universes[i[3]-1][i[2]-1][i[1]-1].get_cell_instance(
path, distribcell_index)

return offset
Expand Down

0 comments on commit d3ec579

Please sign in to comment.