22#include "galilei/Galilei.hpp"
28#include "communication.hpp"
30#include "system/System.hpp"
32#include <boost/mpi/collectives/all_reduce.hpp>
39#ifndef ESPRESSO_ROTATION
42 for (
auto &p :
system.cell_structure->local_particles()) {
44#ifdef ESPRESSO_ROTATION
50 system.on_particle_change();
54#ifndef ESPRESSO_ROTATION
57 for (
auto &p :
system.cell_structure->local_particles()) {
59#ifdef ESPRESSO_ROTATION
65 system.on_particle_change();
70 auto const &box_geo = *
system.box_geo;
73 for (
auto const &p :
system.cell_structure->local_particles()) {
74 if (
not p.is_virtual()) {
75 total_mass += p.mass();
76 cms_pos += p.mass() * box_geo.unfolded_position(p.pos(), p.image_box());
79 total_mass = boost::mpi::all_reduce(
comm_cart, total_mass, std::plus<>());
89 for (
auto const &p :
system.cell_structure->local_particles()) {
90 if (
not p.is_virtual()) {
91 total_mass += p.mass();
95 total_mass = boost::mpi::all_reduce(
comm_cart, total_mass, std::plus<>());
103 for (
auto &p :
system.cell_structure->local_particles()) {
106 system.on_particle_change();
Vector implementation and trait types for boost qvm interoperability.
void kill_particle_motion(System::System &system, bool omega) const
Stop particle motion by setting the velocity of each particle to zero.
void galilei_transform(System::System &system) const
Remove the CMS velocity.
Utils::Vector3d calc_system_cms_velocity(System::System const &system) const
Calculate the CMS velocity of the system.
Utils::Vector3d calc_system_cms_position(System::System const &system) const
Calculate the CMS of the system.
void kill_particle_forces(System::System &system, bool torque) const
Set all the forces acting on the particles to zero.
cudaStream_t stream[1]
CUDA streams for parallel computing on CPU and GPU.
boost::mpi::communicator comm_cart
The communicator.