47 using pos_type =
decltype(
traits.position(std::declval<Particle>()));
48 using vel_type =
decltype(
traits.velocity(std::declval<Particle>()));
51 std::vector<pos_type> local_folded_positions{};
52 std::vector<vel_type> local_velocities{};
53 local_folded_positions.reserve(local_particles.size());
54 local_velocities.reserve(local_particles.size());
56 for (
auto const &p : local_particles) {
57 local_folded_positions.emplace_back(
58 box_geo.folded_position(
traits.position(p)));
59 local_velocities.emplace_back(
traits.velocity(p));
62 auto const [global_folded_positions, global_velocities] =
63 detail::gather(comm, local_folded_positions, local_velocities);
65 if (comm.rank() != 0) {
70 detail::accumulate(histogram, global_folded_positions, global_velocities);