ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
particle_enumeration.hpp File Reference
#include <config/config.hpp>
#include "Cell.hpp"
#include "CellStructure.hpp"
#include <Kokkos_Core.hpp>
#include <cstddef>
#include <numeric>
#include <vector>
+ Include dependency graph for particle_enumeration.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

template<typename Kernel >
void enumerate_local_particles (CellStructure const &cs, Kernel &&kernel)
 Run a kernel on all local particles with enumeration.
 

Function Documentation

◆ enumerate_local_particles()

template<typename Kernel >
void enumerate_local_particles ( CellStructure const &  cs,
Kernel &&  kernel 
)
inline

Run a kernel on all local particles with enumeration.

The kernel is called with (index, particle) and is assumed to be thread-safe.

Template Parameters
KernelCallable with signature void(std::size_t, Particle&)
Parameters
csThe cell structure containing the particles
kernelThe kernel to apply to each particle with its index

Definition at line 44 of file particle_enumeration.hpp.

References CellStructure::decomposition(), ParticleDecomposition::local_cells(), and CellStructure::use_parallel_for_each_local_particle().

Referenced by CellStructure::set_index_map().