ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
core/pair_criteria/BondCriterion.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_BOND_CRITERION_HPP
20
#define ESPRESSO_SRC_CORE_PAIR_CRITERIA_BOND_CRITERION_HPP
21
22
#include "pair_criteria/PairCriterion.hpp"
23
24
#include "
BondList.hpp
"
25
26
namespace
PairCriteria
{
27
/** @brief True if a bond of given type exists between two particles. */
28
class
BondCriterion
:
public
PairCriterion
{
29
public
:
30
bool
decide
(
Particle
const
&p1,
Particle
const
&p2)
const override
{
31
return
pair_bond_exists_on
(p1.
bonds
(), p2.
id
(), m_bond_type) ||
32
pair_bond_exists_on
(p2.
bonds
(), p1.
id
(), m_bond_type);
33
}
34
int
get_bond_type
() {
return
m_bond_type; }
35
void
set_bond_type
(
int
t) { m_bond_type = t; }
36
37
private
:
38
int
m_bond_type;
39
};
40
}
// namespace PairCriteria
41
42
#endif
BondList.hpp
pair_bond_exists_on
bool pair_bond_exists_on(BondList const &bonds, int partner_id, int bond_id)
Check if there is a specific bond in a bond list.
Definition
BondList.hpp:238
PairCriteria::BondCriterion
True if a bond of given type exists between two particles.
Definition
core/pair_criteria/BondCriterion.hpp:28
PairCriteria::BondCriterion::decide
bool decide(Particle const &p1, Particle const &p2) const override
Definition
core/pair_criteria/BondCriterion.hpp:30
PairCriteria::BondCriterion::set_bond_type
void set_bond_type(int t)
Definition
core/pair_criteria/BondCriterion.hpp:35
PairCriteria::BondCriterion::get_bond_type
int get_bond_type()
Definition
core/pair_criteria/BondCriterion.hpp:34
PairCriteria::PairCriterion
Criterion which returns a true/false value for a pair of particles.
Definition
core/pair_criteria/PairCriterion.hpp:29
PairCriteria
Definition
core/pair_criteria/BondCriterion.hpp:26
Particle
Struct holding all information for one particle.
Definition
Particle.hpp:395
Particle::bonds
auto const & bonds() const
Definition
Particle.hpp:428
Particle::id
auto const & id() const
Definition
Particle.hpp:414
src
core
pair_criteria
BondCriterion.hpp
Generated on Thu Dec 19 2024 02:13:16 for ESPResSo by
1.9.8