84 System::System &system, std::vector<CollisionPair> &local_collision_queue) {
87 auto const &box_geo = *system.
box_geo;
98 auto const global_max_seen_particle = boost::mpi::all_reduce(
99 ::comm_cart, cell_structure.get_max_local_particle_id(),
100 boost::mpi::maximum<int>());
102 int current_vs_pid = global_max_seen_particle + 1;
105 for (
auto const &[pid1, pid2] : global_collision_queue) {
108 Particle *p1 = cell_structure.get_local_particle(pid1);
109 Particle *p2 = cell_structure.get_local_particle(pid2);
131 auto const vec21 = box_geo.get_mi_vector(p1->
pos(), p2->
pos());
135 auto handle_particle = [&
136#if defined(__clang__) and defined(__cray__)
138 pid1 = pid1, pid2 = pid2
141 if (not p->is_ghost()) {
143 min_global_cut, current_vs_pid, pos,
147 p1 = cell_structure.get_local_particle(pid1);
148 p2 = cell_structure.get_local_particle(pid2);
153 handle_particle(p1, pos1);
157 handle_particle(p2, pos2);
163 if (n_partners == 1) {
165 const int bondG[] = {current_vs_pid - 2};
167 if (
auto p = cell_structure.get_local_particle(current_vs_pid - 1))
168 p->bonds().insert({
bond_vs, bondG});
170 if (n_partners == 2) {
172 const int bondG[] = {pid1, pid2};
174 if (
auto p = cell_structure.get_local_particle(current_vs_pid - 1))
175 p->bonds().insert({
bond_vs, bondG});
176 if (
auto p = cell_structure.get_local_particle(current_vs_pid - 2))
177 p->bonds().insert({
bond_vs, bondG});
181#ifdef ESPRESSO_ADDITIONAL_CHECKS
183 "Nodes disagree about current_vs_pid");
187 if (not global_collision_queue.empty()) {
189 cell_structure.update_ghosts_and_resort_particle(
void place_vs_and_relate_to_particle(CellStructure &cell_structure, BoxGeometry const &box_geo, int const part_type_vs, double const min_global_cut, int const current_vs_pid, Utils::Vector3d const &pos, int const relate_to)
Struct holding all information for one particle.
void set_can_rotate_all_axes()