33 boost::mpi::communicator
const &comm,
36 using pos_type =
decltype(
traits.position(std::declval<Particle>()));
39 std::vector<pos_type> local_folded_positions{};
40 std::vector<vel_type> local_velocities{};
41 local_folded_positions.reserve(local_particles.size());
42 local_velocities.reserve(local_particles.size());
45 auto const &box_geo = *system.box_geo;
47 auto const vel_conv = lb.get_lattice_speed();
48 lb.ghost_communication_vel();
50 for (
auto const &p : local_particles) {
51 auto const pos = box_geo.folded_position(
traits.position(p));
53 auto const vel = *lb.get_interpolated_velocity(pos);
58 local_folded_positions.emplace_back(pos_cyl);
59 local_velocities.emplace_back(vel_cyl);
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);
71 return detail::normalize_by_bin_size(histogram);
std::vector< double > evaluate(boost::mpi::communicator const &comm, ParticleReferenceRange const &particles, const ParticleObservables::traits< Particle > &) const override