37 boost::mpi::communicator
const &comm,
40 using pos_type =
decltype(
traits.position(std::declval<Particle>()));
43 std::vector<pos_type> local_folded_positions{};
44 std::vector<flux_type> local_flux_densities{};
45 local_folded_positions.reserve(local_particles.size());
46 local_flux_densities.reserve(local_particles.size());
49 auto const &box_geo = *system.box_geo;
51 auto const vel_conv = lb.get_lattice_speed();
52 lb.ghost_communication_pdf();
53 lb.ghost_communication_vel();
55 for (
auto const &p : local_particles) {
56 auto const pos = box_geo.folded_position(
traits.position(p));
58 auto const vel = *lb.get_interpolated_velocity(pos);
59 auto const dens = *lb.get_interpolated_density(pos);
64 local_folded_positions.emplace_back(pos_cyl);
65 local_flux_densities.emplace_back(flux_cyl);
68 auto const [global_folded_positions, global_flux_densities] =
69 detail::gather(comm, local_folded_positions, local_flux_densities);
71 if (comm.rank() != 0) {
76 detail::accumulate(histogram, global_folded_positions, global_flux_densities);
77 return detail::normalize_by_bin_size(histogram);
std::vector< double > evaluate(boost::mpi::communicator const &comm, ParticleReferenceRange const &local_particles, const ParticleObservables::traits< Particle > &traits) const override