19#ifndef OBSERVABLES_CYLINDRICALFLUXDENSITYPROFILE_HPP
20#define OBSERVABLES_CYLINDRICALFLUXDENSITYPROFILE_HPP
24#include "system/System.hpp"
43 using pos_type =
decltype(
traits.position(std::declval<Particle>()));
44 using vel_type =
decltype(
traits.velocity(std::declval<Particle>()));
47 std::vector<pos_type> local_folded_positions{};
48 local_folded_positions.reserve(local_particles.size());
49 std::vector<vel_type> local_velocities{};
50 local_velocities.reserve(local_particles.size());
52 for (
auto const &p : local_particles) {
53 auto const pos = box_geo.folded_position(
traits.position(p)) -
56 local_folded_positions.emplace_back(
59 local_velocities.emplace_back(
64 auto const [global_folded_positions, global_velocities] =
65 detail::gather(comm, local_folded_positions, local_velocities);
67 if (comm.rank() != 0) {
72 detail::accumulate(histogram, global_folded_positions, global_velocities);
76 std::vector<std::size_t>
shape()
const override {
78 return {b[0], b[1], b[2], 3};
std::vector< double > evaluate(boost::mpi::communicator const &comm, ParticleReferenceRange const &local_particles, const ParticleObservables::traits< Particle > &traits) const override
std::vector< std::size_t > shape() 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.
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.