55 auto const positions_sorted = detail::get_all_particle_positions(
56 comm, local_particles,
ids(),
traits,
false);
58 if (comm.rank() != 0) {
63 auto const no_of_angles =
n_values();
64 auto const no_of_bonds = no_of_angles + 1;
65 std::vector<double> angles(no_of_angles);
66 std::vector<Utils::Vector3d> bond_vectors(no_of_bonds);
67 auto get_bond_vector = [&](
auto index) {
68 return box_geo.get_mi_vector(positions_sorted[index + 1],
69 positions_sorted[index]);
71 for (std::size_t i = 0; i < no_of_bonds; ++i) {
72 auto const tmp = get_bond_vector(i);
73 bond_vectors[i] = tmp / tmp.norm();
76 for (std::size_t i = 0; i < no_of_angles; ++i) {
78 for (std::size_t j = 0; j < no_of_angles - i; ++j) {
79 average += bond_vectors[j] * bond_vectors[j + i + 1];
81 angles[i] = average /
static_cast<double>(no_of_angles - i);