Skip to content

Neighbor Lists Never Populated #1827

@jtramm

Description

@jtramm

It appears that cell neighbor lists are not being populated in the current version of OpenMC -- i.e., the neighbor list push_back() function is never called. From what I can tell, this regression was introduced in #1784 when recursive calls were eliminated from the cell finding process.

The issue stems from a change made in find_cell_inner() of geometry.cpp. The old version basically had the following logic:

if( neighbor_list )
    ... check neighbor list cells
else
    ... do exhaustive search

The new version was changed to do

if( neighbor_list )
    ... check neighbor list cells

do exhaustive search

This means that the find_cell_inner() function will always find the cell, even if a neighbor list is passed and the cell is not in the neighbor list. This is a problem, due to the way find_cell_inner is called:

// Search for the particle in that cell's neighbor list.  Return if we
// found the particle.
bool found = find_cell_inner(p, &c.neighbors_);
if (found) return found;

// The particle could not be found in the neighbor list.  Try searching all
// cells in this universe, and update the neighbor list if we find a new
// neighboring cell.
found = find_cell_inner(p, nullptr);
if (found) c.neighbors_.push_back(p.coord_[coord_lvl].cell);
return found;

This regression could potentially have a significant performance impact on a lot of problems. It may be worth doing some analysis to see if a new release with a patch is worthwhile, as this PR went in right before 12.1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions