24#ifdef COLLISION_DETECTION
31#include "communication.hpp"
37#include <boost/mpi/collectives.hpp>
38#include <boost/serialization/utility.hpp>
51 throw std::runtime_error(
"Could not handle collision because particle " +
52 std::to_string(
id) +
" was not found.");
58#ifdef VIRTUAL_SITES_RELATIVE
61 int const part_type_vs,
double const min_global_cut,
62 int const current_vs_pid,
Utils::Vector3d const &pos,
int const relate_to) {
64 new_part.id() = current_vs_pid;
66 auto p_vs = cell_structure.
add_particle(std::move(new_part));
69 p_vs->type() = part_type_vs;
84 for (
auto &c : collision_queue) {
87 std::swap(c.first, c.second);
90 const int bondG[] = {c.second};
93 get_part(cell_structure, c.first).bonds().insert({bond_centers, bondG});
Vector implementation and trait types for boost qvm interoperability.
boost::mpi::communicator comm_cart
The communicator.
This file contains the defaults for ESPResSo.
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)
auto gather_collision_queue(std::vector< CollisionPair > const &local)
void add_bind_centers(std::vector< CollisionPair > &collision_queue, CellStructure &cell_structure, int bond_centers)
auto & get_part(CellStructure &cell_structure, int id)
void gather_buffer(std::vector< T, Allocator > &buffer, boost::mpi::communicator const &comm, int root=0)
Gather buffer with different size on each node.
Describes a cell structure / cell system.
Particle * get_local_particle(int id)
Get a local particle by id.
Particle * add_particle(Particle &&p)
Add a particle.
Struct holding all information for one particle.
void vs_relate_to(Particle &p_vs, Particle const &p_relate_to, BoxGeometry const &box_geo, double min_global_cut)
Setup a virtual site to track a real particle.