ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
core/collision_detection/GlueToSurface.hpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2011-2024 The ESPResSo project
3 *
4 * This file is part of ESPResSo.
5 *
6 * ESPResSo is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * ESPResSo is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#pragma once
21
22#include <config/config.hpp>
23
24#ifdef COLLISION_DETECTION
25#ifdef VIRTUAL_SITES_RELATIVE
26
27#include "CollisionPair.hpp"
28#include "common.hpp"
29
30#include "Particle.hpp"
31#include "system/System.hpp"
32
33#include <vector>
34
35namespace CollisionDetection {
36
38public:
39 /// Distance at which particle are bound
40 double distance;
41 /// Square of distance at which particle are bound
43 /// bond type used between centers of colliding particles
45 /// bond type used between virtual sites
47 /// particle type for virtual sites created on collision
49 /// Distance from the particle which is to be glued to the new virtual site
51 /// The particle type being glued (the small particle)
53 /// The particle type to which virtuals site are attached (the large particle)
55 /// Particle type to which the newly glued particle is converted
57
69
70 void initialize(System::System &system);
71
72 auto cutoff() const { return distance; }
73
74 /** @brief Check additional criteria for the glue_to_surface collision mode */
75 bool glue_to_surface_criterion(Particle const &p1, Particle const &p2) const {
76 return ((p1.type() == part_type_to_be_glued and
78 (p2.type() == part_type_to_be_glued and
80 }
81
83 std::vector<CollisionPair> &local_collision_queue);
84
85 bool detect_collision(Particle const &p1, Particle const &p2,
86 double const dist_sq) const {
87 if (dist_sq > distance_sq)
88 return false;
89
90 if (!glue_to_surface_criterion(p1, p2))
91 return false;
92
94 }
95};
96
97} // namespace CollisionDetection
98#endif // VIRTUAL_SITES_RELATIVE
99#endif // COLLISION_DETECTION
int part_type_vs
particle type for virtual sites created on collision
double dist_glued_part_to_vs
Distance from the particle which is to be glued to the new virtual site.
int bond_centers
bond type used between centers of colliding particles
double distance_sq
Square of distance at which particle are bound.
double distance
Distance at which particle are bound.
int part_type_to_attach_vs_to
The particle type to which virtuals site are attached (the large particle)
int bond_vs
bond type used between virtual sites
int part_type_after_glueing
Particle type to which the newly glued particle is converted.
void initialize(System::System &system)
GlueToSurface(double distance, int bond_centers, int bond_vs, int part_type_vs, double dist_glued_part_to_vs, int part_type_to_be_glued, int part_type_to_attach_vs_to, int part_type_after_glueing)
void handle_collisions(System::System &system, std::vector< CollisionPair > &local_collision_queue)
bool glue_to_surface_criterion(Particle const &p1, Particle const &p2) const
Check additional criteria for the glue_to_surface collision mode.
bool detect_collision(Particle const &p1, Particle const &p2, double const dist_sq) const
int part_type_to_be_glued
The particle type being glued (the small particle)
Main system class.
This file contains the defaults for ESPResSo.
auto detect_collision_common(Particle const &p1, Particle const &p2, int const bond_centers)
Common functions for dipolar and charge P3M.
Struct holding all information for one particle.
Definition Particle.hpp:395
auto const & type() const
Definition Particle.hpp:418