19#ifndef OBSERVABLES_CYLINDRICALDENSITYPROFILE_HPP
20#define OBSERVABLES_CYLINDRICALDENSITYPROFILE_HPP
25#include "system/System.hpp"
45 std::vector<pos_type> local_folded_positions{};
46 local_folded_positions.reserve(local_particles.size());
48 for (
auto const &p : local_particles) {
49 auto const pos = box_geo.folded_position(
traits.position(p));
52 local_folded_positions.emplace_back(
58 auto const global_folded_positions =
59 detail::gather(comm, local_folded_positions);
61 if (comm.rank() != 0) {
67 for (
auto const &vec : global_folded_positions) {
68 for (
auto const &p : vec) {
std::vector< double > evaluate(boost::mpi::communicator const &comm, ParticleReferenceRange const &local_particles, const ParticleObservables::traits< Particle > &traits) const override
CylindricalPidProfileObservable(std::vector< int > const &ids, std::shared_ptr< Utils::CylindricalTransformationParameters > transform_params, int n_r_bins, int n_phi_bins, int n_z_bins, double min_r, double max_r, double min_phi, double max_phi, double min_z, double max_z)
std::shared_ptr< Utils::CylindricalTransformationParameters > transform_params
std::shared_ptr< BoxGeometry > box_geo
Histogram in cylindrical coordinates.
void normalize() override
std::vector< T > get_histogram() const
Get the histogram data.
void update(std::span< const U > pos)
Add data to the histogram.
std::vector< std::reference_wrapper< Particle const > > ParticleReferenceRange
Vector3d transform_coordinate_cartesian_to_cylinder(Vector3d const &pos)
Coordinate transformation from Cartesian to cylindrical coordinates.