diff --git a/src/output.F90 b/src/output.F90
index 7b5e98564..49908fed6 100644
--- a/src/output.F90
+++ b/src/output.F90
@@ -2398,10 +2398,24 @@ contains
end if
if (final >= lat % offset(map, k, l, m) + offset) then
- old_m = m
- old_l = l
- old_k = k
- cycle
+ if (k == lat % n_rings .and. l == n_y .and. m == n_z) then
+ ! This is last lattice cell, so target must be here
+ lat_offset = lat % offset(map, k, l, m)
+ offset = offset + lat_offset
+ next_univ => universes(lat % universes(k, l, m))
+ path = trim(path) // "(" // &
+ trim(to_str(k - lat % n_rings)) // "," // &
+ trim(to_str(l - lat % n_rings)) // "," // &
+ trim(to_str(m)) // ")"
+ call find_offset(map, goal, next_univ, final, offset, &
+ path)
+ return
+ else
+ old_m = m
+ old_l = l
+ old_k = k
+ cycle
+ end if
else
! Target is at this lattice position
lat_offset = lat % offset(map, old_k, old_l, old_m)
diff --git a/tests/test_filter_distribcell/case-4/geometry.xml b/tests/test_filter_distribcell/case-4/geometry.xml
new file mode 100644
index 000000000..4c2a7fd5e
--- /dev/null
+++ b/tests/test_filter_distribcell/case-4/geometry.xml
@@ -0,0 +1,23 @@
+
+
+ |
+ |
+ |
+ |
+
+ 1.0
+ 3
+ 0.0 0.0
+
+ 1
+1 1
+ 1
+1 1
+ 1
+
+
+
+
+
+
+
diff --git a/tests/test_filter_distribcell/case-4/materials.xml b/tests/test_filter_distribcell/case-4/materials.xml
new file mode 100644
index 000000000..19678c2a1
--- /dev/null
+++ b/tests/test_filter_distribcell/case-4/materials.xml
@@ -0,0 +1,18 @@
+
+
+ 71c
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/test_filter_distribcell/case-4/results_true.dat b/tests/test_filter_distribcell/case-4/results_true.dat
new file mode 100644
index 000000000..b8bd2b339
--- /dev/null
+++ b/tests/test_filter_distribcell/case-4/results_true.dat
@@ -0,0 +1,17 @@
+k-combined:
+0.000000E+00 0.000000E+00
+tally 1:
+2.166056E-02
+4.691799E-04
+2.281665E-02
+5.205994E-04
+1.938848E-02
+3.759132E-04
+3.055366E-02
+9.335264E-04
+2.338209E-02
+5.467222E-04
+2.719869E-02
+7.397689E-04
+1.895698E-02
+3.593670E-04
diff --git a/tests/test_filter_distribcell/case-4/settings.xml b/tests/test_filter_distribcell/case-4/settings.xml
new file mode 100644
index 000000000..90e48b9c1
--- /dev/null
+++ b/tests/test_filter_distribcell/case-4/settings.xml
@@ -0,0 +1,13 @@
+
+
+
+ 1000
+ 1
+ 0
+
+
+
+ -1 -1 -1 1 1 1
+
+
+
diff --git a/tests/test_filter_distribcell/case-4/tallies.xml b/tests/test_filter_distribcell/case-4/tallies.xml
new file mode 100644
index 000000000..b46de5f4e
--- /dev/null
+++ b/tests/test_filter_distribcell/case-4/tallies.xml
@@ -0,0 +1,7 @@
+
+
+
+
+ total
+
+
diff --git a/tests/test_filter_distribcell/test_filter_distribcell.py b/tests/test_filter_distribcell/test_filter_distribcell.py
index b5895f81b..492f03dae 100644
--- a/tests/test_filter_distribcell/test_filter_distribcell.py
+++ b/tests/test_filter_distribcell/test_filter_distribcell.py
@@ -18,10 +18,11 @@ class DistribcellTestHarness(TestHarness):
"""Run OpenMC with the appropriate arguments and check the outputs."""
base_dir = os.getcwd()
try:
- dirs = ('case-1', '../case-2', '../case-3')
- sps = ('statepoint.1.*', 'statepoint.1.*', 'statepoint.3.*')
- tallies_out_present = (True, True, False)
- hash_out = (False, False, True)
+ dirs = ('case-1', '../case-2', '../case-3', '../case-4')
+ sps = ('statepoint.1.*', 'statepoint.1.*', 'statepoint.3.*',
+ 'statepoint.1.*')
+ tallies_out_present = (True, True, False, True)
+ hash_out = (False, False, True, False)
for i in range(len(dirs)):
os.chdir(dirs[i])
self._sp_name = sps[i]
@@ -41,10 +42,11 @@ class DistribcellTestHarness(TestHarness):
"""Update the results_true using the current version of OpenMC."""
base_dir = os.getcwd()
try:
- dirs = ('case-1', '../case-2', '../case-3')
- sps = ('statepoint.1.*', 'statepoint.1.*', 'statepoint.3.*')
- tallies_out_present = (True, True, False)
- hash_out = (False, False, True)
+ dirs = ('case-1', '../case-2', '../case-3', '../case-4')
+ sps = ('statepoint.1.*', 'statepoint.1.*', 'statepoint.3.*',
+ 'statepoint.1.*')
+ tallies_out_present = (True, True, False, True)
+ hash_out = (False, False, True, False)
for i in range(len(dirs)):
os.chdir(dirs[i])
self._sp_name = sps[i]