ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
core/pair_criteria/DistanceCriterion.hpp
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2010-2022 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
#ifndef ESPRESSO_SRC_CORE_PAIR_CRITERIA_DISTANCE_CRITERION_HPP
20
#define ESPRESSO_SRC_CORE_PAIR_CRITERIA_DISTANCE_CRITERION_HPP
21
22
#include "pair_criteria/PairCriterion.hpp"
23
24
#include "
BoxGeometry.hpp
"
25
#include "system/System.hpp"
26
27
namespace
PairCriteria
{
28
/**
29
* @brief True if two particles are closer than a cut off distance,
30
* respecting minimum image convention.
31
*/
32
class
DistanceCriterion
:
public
PairCriterion
{
33
public
:
34
bool
decide
(
const
Particle
&p1,
const
Particle
&p2)
const override
{
35
auto
const
&box_geo = *
System::get_system
().
box_geo
;
36
return
box_geo.get_mi_vector(p1.
pos
(), p2.
pos
()).norm() <= m_cut_off;
37
}
38
double
get_cut_off
() {
return
m_cut_off; }
39
void
set_cut_off
(
double
c) { m_cut_off = c; }
40
41
private
:
42
double
m_cut_off;
43
};
44
45
}
// namespace PairCriteria
46
47
#endif
BoxGeometry.hpp
PairCriteria::DistanceCriterion
True if two particles are closer than a cut off distance, respecting minimum image convention.
Definition
core/pair_criteria/DistanceCriterion.hpp:32
PairCriteria::DistanceCriterion::decide
bool decide(const Particle &p1, const Particle &p2) const override
Definition
core/pair_criteria/DistanceCriterion.hpp:34
PairCriteria::DistanceCriterion::get_cut_off
double get_cut_off()
Definition
core/pair_criteria/DistanceCriterion.hpp:38
PairCriteria::DistanceCriterion::set_cut_off
void set_cut_off(double c)
Definition
core/pair_criteria/DistanceCriterion.hpp:39
PairCriteria::PairCriterion
Criterion which returns a true/false value for a pair of particles.
Definition
core/pair_criteria/PairCriterion.hpp:29
System::System::box_geo
std::shared_ptr< BoxGeometry > box_geo
Definition
core/system/System.hpp:278
PairCriteria
Definition
core/pair_criteria/BondCriterion.hpp:26
System::get_system
System & get_system()
Definition
core/system/System.cpp:122
Particle
Struct holding all information for one particle.
Definition
Particle.hpp:395
Particle::pos
auto const & pos() const
Definition
Particle.hpp:431
src
core
pair_criteria
DistanceCriterion.hpp
Generated on Fri Nov 8 2024 02:12:53 for ESPResSo by
1.9.8