Skip to content
Merged
Changes from all commits
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
18 changes: 17 additions & 1 deletion src/geometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,26 @@ find_cell_inner(Particle& p, const NeighborList* neighbor_list)
break;
}
}

// If we're attempting a neighbor list search and fail, we
// now know we should return false. This will trigger an
// exhaustive search from neighbor_list_find_cell and make
// the result from that be appended to the neighbor list.
if (!found) {
return found;
}
}

// Check successively lower coordinate levels until finding material fill
for (;;++p.n_coord_) {
// If neighbor lists did not find a cell, must do exhaustive search
// If we did not attempt to use neighbor lists, i_cell is still C_NONE. In
// that case, we should now do an exhaustive search to find the right value
// of i_cell.
//
// Alternatively, neighbor list searches could have succeeded, but we found
// that the fill of the neighbor cell was another universe. As such, in the
// code below this conditional, we set i_cell back to C_NONE to indicate
// that.
if (i_cell == C_NONE) {
int i_universe = p.coord_[p.n_coord_-1].universe;
const auto& univ {*model::universes[i_universe]};
Expand Down Expand Up @@ -238,6 +253,7 @@ find_cell_inner(Particle& p, const NeighborList* neighbor_list)
}
}
i_cell = C_NONE; // trip non-neighbor cell search at next iteration
found = false;
}

return found;
Expand Down