ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
collision.cpp File Reference
#include "collision.hpp"
#include "BoxGeometry.hpp"
#include "Particle.hpp"
#include "bonded_interactions/bonded_interaction_data.hpp"
#include "cell_system/Cell.hpp"
#include "cell_system/CellStructure.hpp"
#include "communication.hpp"
#include "errorhandling.hpp"
#include "nonbonded_interactions/nonbonded_interaction_data.hpp"
#include "system/System.hpp"
#include "virtual_sites.hpp"
#include <utils/Vector.hpp>
#include <utils/constants.hpp>
#include <utils/math/sqr.hpp>
#include <utils/mpi/all_compare.hpp>
#include <utils/mpi/gather_buffer.hpp>
#include <boost/mpi/collectives.hpp>
#include <boost/serialization/serialization.hpp>
#include <algorithm>
#include <array>
#include <cmath>
#include <stdexcept>
#include <string>
#include <utility>
#include <vector>
+ Include dependency graph for collision.cpp:

Go to the source code of this file.

Classes

struct  CollisionPair
 Data type holding the info about a single collision. More...
 

Namespaces

namespace  boost
 
namespace  boost::serialization
 
namespace  anonymous_namespace{collision.cpp}
 

Functions

template<typename Archive >
void boost::serialization::serialize (Archive &ar, CollisionPair &c, const unsigned int)
 
Particleanonymous_namespace{collision.cpp}::get_part (CellStructure &cell_structure, int id)
 
static bool bind_centers ()
 Return true if a bond between the centers of the colliding particles needs to be placed.
 
static int get_bond_num_partners (int bond_id)
 
void prepare_local_collision_queue ()
 
void queue_collision (const int part1, const int part2)
 Add the collision between the given particle ids to the collision queue.
 
static auto const & glue_to_surface_calc_vs_pos (Particle const &p1, Particle const &p2, BoxGeometry const &box_geo, Utils::Vector3d &pos)
 Calculate position of vs for GLUE_TO_SURFACE mode.
 
static void bind_at_point_of_collision_calc_vs_pos (Particle const &p1, Particle const &p2, BoxGeometry const &box_geo, Utils::Vector3d &pos1, Utils::Vector3d &pos2)
 
static void coldet_do_three_particle_bond (Particle &p, Particle const &p1, Particle const &p2, BoxGeometry const &box_geo)
 
static void place_vs_and_relate_to_particle (CellStructure &cell_structure, BoxGeometry const &box_geo, double const min_global_cut, int const current_vs_pid, Utils::Vector3d const &pos, int const relate_to)
 
static void bind_at_poc_create_bond_between_vs (CellStructure &cell_structure, int const current_vs_pid, CollisionPair const &c)
 
static void glue_to_surface_bind_part_to_vs (Particle const *const p1, Particle const *const p2, int const vs_pid_plus_one, CollisionPair const &, CellStructure &cell_structure)
 
std::vector< CollisionPairgather_global_collision_queue ()
 
static void three_particle_binding_do_search (Cell *basecell, Particle &p1, Particle &p2, BoxGeometry const &box_geo)
 
static void three_particle_binding_domain_decomposition (CellStructure &cell_structure, BoxGeometry const &box_geo, std::vector< CollisionPair > const &gathered_queue)
 
void handle_collisions (CellStructure &cell_structure)
 Handle the collisions recorded in the queue.
 

Variables

static std::vector< CollisionPairlocal_collision_queue
 During force calculation, colliding particles are recorded in the queue. The queue is processed after force calculation, when it is safe to add particles.
 
Collision_parameters collision_params
 Parameters for collision detection.
 

Function Documentation

◆ bind_at_poc_create_bond_between_vs()

static void bind_at_poc_create_bond_between_vs ( CellStructure cell_structure,
int const  current_vs_pid,
CollisionPair const &  c 
)
static

◆ bind_at_point_of_collision_calc_vs_pos()

static void bind_at_point_of_collision_calc_vs_pos ( Particle const &  p1,
Particle const &  p2,
BoxGeometry const &  box_geo,
Utils::Vector3d pos1,
Utils::Vector3d pos2 
)
static

◆ bind_centers()

static bool bind_centers ( )
static

Return true if a bond between the centers of the colliding particles needs to be placed.

At this point, all modes need this.

Definition at line 91 of file collision.cpp.

References collision_params, GLUE_TO_SURF, Collision_parameters::mode, and OFF.

Referenced by handle_collisions().

◆ coldet_do_three_particle_bond()

◆ gather_global_collision_queue()

std::vector< CollisionPair > gather_global_collision_queue ( )

Definition at line 408 of file collision.cpp.

References comm_cart, Utils::Mpi::gather_buffer(), local_collision_queue, and res.

Referenced by handle_collisions().

◆ get_bond_num_partners()

static int get_bond_num_partners ( int  bond_id)
static

◆ glue_to_surface_bind_part_to_vs()

static void glue_to_surface_bind_part_to_vs ( Particle const *const  p1,
Particle const *const  p2,
int const  vs_pid_plus_one,
CollisionPair const &  ,
CellStructure cell_structure 
)
static

◆ glue_to_surface_calc_vs_pos()

static auto const & glue_to_surface_calc_vs_pos ( Particle const &  p1,
Particle const &  p2,
BoxGeometry const &  box_geo,
Utils::Vector3d pos 
)
static

Calculate position of vs for GLUE_TO_SURFACE mode.

Returns id of particle to bind vs to.

Definition at line 243 of file collision.cpp.

References collision_params, Collision_parameters::dist_glued_part_to_vs, BoxGeometry::get_mi_vector(), Collision_parameters::part_type_to_attach_vs_to, Collision_parameters::part_type_to_be_glued, Particle::pos(), pos, and Particle::type().

Referenced by handle_collisions().

◆ handle_collisions()

◆ place_vs_and_relate_to_particle()

static void place_vs_and_relate_to_particle ( CellStructure cell_structure,
BoxGeometry const &  box_geo,
double const  min_global_cut,
int const  current_vs_pid,
Utils::Vector3d const &  pos,
int const  relate_to 
)
static

◆ prepare_local_collision_queue()

void prepare_local_collision_queue ( )

Definition at line 234 of file collision.cpp.

References local_collision_queue.

Referenced by System::System::calculate_forces().

◆ queue_collision()

void queue_collision ( const int  part1,
const int  part2 
)

Add the collision between the given particle ids to the collision queue.

Definition at line 236 of file collision.cpp.

References local_collision_queue.

Referenced by detect_collision().

◆ three_particle_binding_do_search()

static void three_particle_binding_do_search ( Cell basecell,
Particle p1,
Particle p2,
BoxGeometry const &  box_geo 
)
static

◆ three_particle_binding_domain_decomposition()

static void three_particle_binding_domain_decomposition ( CellStructure cell_structure,
BoxGeometry const &  box_geo,
std::vector< CollisionPair > const &  gathered_queue 
)
static

Variable Documentation

◆ collision_params

◆ local_collision_queue

std::vector<CollisionPair> local_collision_queue
static

During force calculation, colliding particles are recorded in the queue. The queue is processed after force calculation, when it is safe to add particles.

Definition at line 70 of file collision.cpp.

Referenced by gather_global_collision_queue(), handle_collisions(), prepare_local_collision_queue(), and queue_collision().