ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
nonbonded_interaction_data.cpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2010-2022 The ESPResSo project
3 * Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
4 * Max-Planck-Institute for Polymer Research, Theory Group
5 *
6 * This file is part of ESPResSo.
7 *
8 * ESPResSo is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * ESPResSo is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 */
21/** \file
22 * Implementation of nonbonded_interaction_data.hpp
23 */
24
25#include <config/config.hpp>
26
28
30#include "system/System.hpp"
31
32#include <algorithm>
33#include <cassert>
34#include <cstddef>
35#include <memory>
36#include <utility>
37#include <vector>
38
39static double
41 [[maybe_unused]] System::System const &system) {
42 auto max_cut_current = inactive_cutoff;
43
44#ifdef ESPRESSO_LENNARD_JONES
45 max_cut_current = std::max(max_cut_current, data.lj.max_cutoff());
46#endif
47
48#ifdef ESPRESSO_WCA
49 max_cut_current = std::max(max_cut_current, data.wca.max_cutoff());
50#endif
51
52#ifdef ESPRESSO_DPD
53 max_cut_current = std::max(max_cut_current, data.dpd.max_cutoff());
54#endif
55
56#ifdef ESPRESSO_LENNARD_JONES_GENERIC
57 max_cut_current = std::max(max_cut_current, data.ljgen.max_cutoff());
58#endif
59
60#ifdef ESPRESSO_SMOOTH_STEP
61 max_cut_current = std::max(max_cut_current, data.smooth_step.max_cutoff());
62#endif
63
64#ifdef ESPRESSO_HERTZIAN
65 max_cut_current = std::max(max_cut_current, data.hertzian.max_cutoff());
66#endif
67
68#ifdef ESPRESSO_GAUSSIAN
69 max_cut_current = std::max(max_cut_current, data.gaussian.max_cutoff());
70#endif
71
72#ifdef ESPRESSO_BMHTF_NACL
73 max_cut_current = std::max(max_cut_current, data.bmhtf.max_cutoff());
74#endif
75
76#ifdef ESPRESSO_MORSE
77 max_cut_current = std::max(max_cut_current, data.morse.max_cutoff());
78#endif
79
80#ifdef ESPRESSO_BUCKINGHAM
81 max_cut_current = std::max(max_cut_current, data.buckingham.max_cutoff());
82#endif
83
84#ifdef ESPRESSO_SOFT_SPHERE
85 max_cut_current = std::max(max_cut_current, data.soft_sphere.max_cutoff());
86#endif
87
88#ifdef ESPRESSO_HAT
89 max_cut_current = std::max(max_cut_current, data.hat.max_cutoff());
90#endif
91
92#ifdef ESPRESSO_LJCOS
93 max_cut_current = std::max(max_cut_current, data.ljcos.max_cutoff());
94#endif
95
96#ifdef ESPRESSO_LJCOS2
97 max_cut_current = std::max(max_cut_current, data.ljcos2.max_cutoff());
98#endif
99
100#ifdef ESPRESSO_GAY_BERNE
101 max_cut_current = std::max(max_cut_current, data.gay_berne.max_cutoff());
102#endif
103
104#ifdef ESPRESSO_TABULATED
105 max_cut_current = std::max(max_cut_current, data.tab.cutoff());
106#endif
107
108#ifdef ESPRESSO_THOLE
109 // If THOLE is active, use p3m cutoff
110 if (data.thole.scaling_coeff != 0.)
111 max_cut_current = std::max(max_cut_current, system.coulomb.cutoff());
112#endif
113
114 return max_cut_current;
115}
116
118 auto const &system = get_system();
119 for (auto &data : m_nonbonded_ia_params) {
120 data->max_cut = recalc_maximal_cutoff(*data, system);
121 }
122}
123
125 auto max_cut_nonbonded = inactive_cutoff;
126 for (auto &data : m_nonbonded_ia_params) {
127 max_cut_nonbonded = std::max(max_cut_nonbonded, data->max_cut);
128 }
129 return max_cut_nonbonded;
130}
131
133 get_system().on_non_bonded_ia_change();
134}
void recalc_maximal_cutoffs()
Recalculate cutoff of each interaction struct.
void on_non_bonded_ia_change() const
Notify system that non-bonded interactions changed.
double maximal_cutoff() const
Get maximal cutoff.
Main system class.
constexpr double inactive_cutoff
Special cutoff value for an inactive interaction.
Definition config.hpp:44
static double recalc_maximal_cutoff(IA_parameters const &data, System::System const &system)
Various procedures concerning interactions between particles.
Parameters for non-bonded interactions.
Gaussian_Parameters gaussian
GayBerne_Parameters gay_berne
SoftSphere_Parameters soft_sphere
SmoothStep_Parameters smooth_step
Hertzian_Parameters hertzian
Buckingham_Parameters buckingham