Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reaction methods should use the cell system to find neighboring particles #4438

Closed
pm-blanco opened this issue Jan 31, 2022 · 1 comment · Fixed by #4401
Closed

Reaction methods should use the cell system to find neighboring particles #4438

pm-blanco opened this issue Jan 31, 2022 · 1 comment · Fixed by #4401

Comments

@pm-blanco
Copy link
Contributor

When inserting/deleting a particle in the reaction methods, instead of calculating its distance to all particles the cell system should be used to find the neighboring particles and calculate the distance only to those to check for the exclusion radius.

@jhossbach
Copy link
Contributor

It's a WIP, see #4399 and #4401

@kodiakhq kodiakhq bot closed this as completed in #4401 May 19, 2022
kodiakhq bot added a commit that referenced this issue May 19, 2022
Fixes #4399, fixes #4438

Description of changes:
- `CellStructure.cpp`: Added the `CellStructure::run_on_particle_short_range_neighbors()` method which runs a kernel function over all particles inside the cell and its neighbors of a given particle
- `cells.hpp`: Added the `mpi_get_short_range_neighbors()` function to execute a parallel search
   - can be called from the Python interface via `system.cell_system.get_neighbors.get_neighbors(p, distance)`
- `energy.hpp`: Added the `compute_non_bonded_pair_energy()` function which returns both the short-range Coulomb interactions plus the non-bonded energy contributions  of two particles
   - can be called from the Python interface via `system.analysis.particle_energy(p)`
- Reaction methods can use the new neighbor search algorithm with constructor argument `search_algorithm="parallel"` (default is `search_algorithm="order_n"`); on 1 MPI rank the original order N algorithm is faster since the parallel algorithm introduces some overhead due to the ghost update (this overhead is negligible with 2 or more MPI ranks)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants