51 using pos_type =
decltype(
traits.position(std::declval<Particle>()));
52 using force_type =
decltype(
traits.force(std::declval<Particle>()));
55 std::vector<pos_type> local_folded_positions{};
56 local_folded_positions.reserve(local_particles.size());
57 std::vector<force_type> local_forces{};
58 local_forces.reserve(local_particles.size());
60 for (
auto const &p : local_particles) {
61 local_folded_positions.emplace_back(
62 box_geo.folded_position(
traits.position(p)));
63 local_forces.emplace_back(
traits.force(p));
66 auto const [global_folded_positions, global_forces] =
67 detail::gather(comm, local_folded_positions, local_forces);
69 if (comm.rank() != 0) {
74 detail::accumulate(histogram, global_folded_positions, global_forces);