Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix offset accountancy for distribcell_path_inner
  • Loading branch information
pshriwise committed Dec 19, 2023
commit 873295b726722fb5716ca739380f4d72b6c63602
8 changes: 4 additions & 4 deletions src/geometry_aux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ std::string distribcell_path_inner(int32_t target_cell, int32_t map,
if (c.type_ != Fill::MATERIAL) {
int32_t temp_offset;
if (c.type_ == Fill::UNIVERSE) {
temp_offset = offset + c.offset_[map];
temp_offset = offset + c.offset_[map]; // should also apply to lattice fills?
} else {
Lattice& lat = *model::lattices[c.fill_];
int32_t indx = lat.universes_.size() * map + lat.begin().indx_;
Expand All @@ -539,7 +539,7 @@ std::string distribcell_path_inner(int32_t target_cell, int32_t map,

// The desired cell is the first cell that gives an offset smaller or
// equal to the target offset.
if (temp_offset <= target_offset)
if (temp_offset <= target_offset - c.offset_[map])
break;
}
}
Expand All @@ -561,11 +561,11 @@ std::string distribcell_path_inner(int32_t target_cell, int32_t map,
for (ReverseLatticeIter it = lat.rbegin(); it != lat.rend(); ++it) {
int32_t indx = lat.universes_.size() * map + it.indx_;
int32_t temp_offset = offset + lat.offsets_[indx];
if (temp_offset <= target_offset) {
if (temp_offset <= target_offset - c.offset_[map]) {
offset = temp_offset;
path << "(" << lat.index_to_string(it.indx_) << ")->";
path << distribcell_path_inner(
target_cell, map, target_offset, *model::universes[*it], offset);
target_cell, map, target_offset, *model::universes[*it], offset+c.offset_[map]);
return path.str();
}
}
Expand Down
2 changes: 0 additions & 2 deletions tests/unit_tests/test_cell_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ def double_lattice_model():
space = openmc.stats.Box(*bbox)
source = openmc.IndependentSource(space=space)
model.settings.source = source
# TODO: fix problem with tally output for multilattice models
model.settings.output = {'tallies': False}

# Add necessary settings and export
model.settings.batches = 10
Expand Down