Skip to content

Commit

Permalink
Expose the index of the neighboring particle to users of the iterator. (
Browse files Browse the repository at this point in the history
AMReX-Codes#1628)

The proposed changes:
- [ ] fix a bug or incorrect behavior in AMReX
- [x] add new capabilities to AMReX
- [ ] changes answers in the test suite to more than roundoff level
- [ ] are likely to significantly affect the results of downstream AMReX users
- [ ] are described in the proposed changes to the AMReX documentation, if appropriate
  • Loading branch information
atmyers authored Dec 12, 2020
1 parent 73509be commit 389a0cc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Src/Particle/AMReX_NeighborList.H
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ struct Neighbors
AMREX_GPU_HOST_DEVICE
ParticleType& operator* () const { return m_pstruct[m_nbor_list_ptr[m_index]]; }

AMREX_GPU_HOST_DEVICE
unsigned int index () const { return m_nbor_list_ptr[m_index]; }

private:
int m_index;
int m_stop;
Expand All @@ -51,6 +54,9 @@ struct Neighbors
AMREX_GPU_HOST_DEVICE
const ParticleType& operator* () const { return m_pstruct[m_nbor_list_ptr[m_index]]; }

AMREX_GPU_HOST_DEVICE
unsigned int index () const { return m_nbor_list_ptr[m_index]; }

private:
int m_index;
int m_stop;
Expand Down

0 comments on commit 389a0cc

Please sign in to comment.