ECP-copa / Cabana

Performance-portable library for particle-based simulations
Other
188 stars 51 forks source link

Missing overloads for partial range candidate neighbors in VerletList #725

Open Azrael3000 opened 5 months ago

Azrael3000 commented 5 months ago

https://github.com/ECP-copa/Cabana/blob/973e7d0722ddb2503a3c5cb9220410a7666768e4/core/src/Cabana_VerletList.hpp#L287

Should be

linked_cell_list = LinkedCellList<memory_space>( position, begin, end, grid_delta,

as otherwise VerletList will take the positions from 0 to position.size() which in my case it should not do as I'm using this during insertion and not everything in the position array is populated.

streeve commented 5 months ago

This was a purposeful choice because of the common use case for only storing neighbors for local (MPI) particles (0, num_local), but including ghosted particles (num_local, position.size()) in that list. We can certainly add an overload which separates neighbor_list_{begin,end} and candidate_neighbor_{begin,end}

Azrael3000 commented 5 months ago

I agree that it makes sense from this point of view, so an overloaded version should be the solution

streeve commented 5 months ago

@lebuller if you have a minute, can you add these constructor/build overloads? I may be able to get to it today/tomorrow otherwise