mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 14:15:42 -04:00
Fix distribcell labels for lattices used as fill in multiple cells (#2813)
Co-authored-by: Paul Romano <paul.k.romano@gmail.com>
This commit is contained in:
parent
db3b6f3e9e
commit
c85ba93040
3 changed files with 25 additions and 5 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
@ -570,11 +570,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);
|
||||
path << distribcell_path_inner(target_cell, map, target_offset,
|
||||
*model::universes[*it], offset + c.offset_[map]);
|
||||
return path.str();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,7 +48,8 @@ void DistribcellFilter::get_all_bins(
|
|||
auto& lat {*model::lattices[p.coord(i + 1).lattice]};
|
||||
const auto& i_xyz {p.coord(i + 1).lattice_i};
|
||||
if (lat.are_valid_indices(i_xyz)) {
|
||||
offset += lat.offset(distribcell_index, i_xyz);
|
||||
offset +=
|
||||
lat.offset(distribcell_index, i_xyz) + c.offset_[distribcell_index];
|
||||
}
|
||||
}
|
||||
if (cell_ == p.coord(i).cell) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue