fix bug looking up neighbor lists

This commit is contained in:
Axel Kohlmeyer
2022-03-06 05:24:15 -05:00
parent 4781a4c8c6
commit 72cbffee7d
2 changed files with 5 additions and 5 deletions

View File

@ -1740,7 +1740,7 @@ void Neighbor::requests_new2old()
TODO: should have optional argument "id" to match ID if multiple requests
------------------------------------------------------------------------- */
NeighRequest *Neighbor::find_request(void *classptr)
NeighRequest *Neighbor::find_request(void *classptr) const
{
if (classptr == nullptr) return nullptr;
@ -1768,11 +1768,11 @@ const std::vector<NeighRequest *> Neighbor::get_pair_requests() const
TODO: should have optional argument "id" to match ID if multiple requests
------------------------------------------------------------------------- */
NeighList *Neighbor::find_list(void *classptr)
NeighList *Neighbor::find_list(void *classptr) const
{
if (classptr == nullptr) return nullptr;
for (int i = 0; i < nrequest; i++)
for (int i = 0; i < nlist; i++)
if (lists[i]->requestor == classptr) return lists[i];
return nullptr;

View File

@ -153,8 +153,8 @@ class Neighbor : protected Pointers {
void exclusion_group_group_delete(int, int); // rm a group-group exclusion
int exclude_setting(); // return exclude value to accelerator pkg
NeighList *find_list(void *); // find a neighbor request
NeighRequest *find_request(void *); // find a neighbor request
NeighList *find_list(void *) const; // find a neighbor list based on requestor
NeighRequest *find_request(void *) const; // find a neighbor request based on requestor
const std::vector<NeighRequest *> get_pair_requests() const;
int any_full(); // Check if any old requests had full neighbor lists
void build_collection(int); // build peratom collection array starting at the given index