19#ifndef OBSERVABLES_CYLINDRICALVELOCITYPROFILE_HPP
20#define OBSERVABLES_CYLINDRICALVELOCITYPROFILE_HPP
24#include "system/System.hpp"
46 std::vector<pos_type> local_folded_positions{};
47 std::vector<vel_type> local_velocities{};
48 local_folded_positions.reserve(local_particles.size());
49 local_velocities.reserve(local_particles.size());
51 for (
auto const &p : local_particles) {
52 auto const pos = box_geo.folded_position(
traits.position(p)) -
54 local_folded_positions.emplace_back(
57 local_velocities.emplace_back(
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);
74 std::vector<std::size_t>
shape()
const override {
76 return {b[0], b[1], b[2], 3};
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::vector< std::size_t > shape() const override
std::vector< double > evaluate(boost::mpi::communicator const &comm, ParticleReferenceRange const &local_particles, const ParticleObservables::traits< Particle > &traits) const override
std::shared_ptr< BoxGeometry > box_geo
Histogram in cylindrical coordinates.
std::vector< std::reference_wrapper< Particle const > > ParticleReferenceRange
Vector3d transform_vector_cartesian_to_cylinder(Vector3d const &vec, Vector3d const &axis, Vector3d const &pos)
Vector transformation from Cartesian to cylindrical coordinates.
Vector3d transform_coordinate_cartesian_to_cylinder(Vector3d const &pos)
Coordinate transformation from Cartesian to cylindrical coordinates.