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 */
25
27
28#include <algorithm>
29#include <cassert>
30#include <cstddef>
31#include <memory>
32#include <utility>
33#include <vector>
34
35static double recalc_maximal_cutoff(IA_parameters const &data) {
36 auto max_cut_current = INACTIVE_CUTOFF;
37
38#ifdef LENNARD_JONES
39 max_cut_current = std::max(max_cut_current, data.lj.max_cutoff());
40#endif
41
42#ifdef WCA
43 max_cut_current = std::max(max_cut_current, data.wca.max_cutoff());
44#endif
45
46#ifdef DPD
47 max_cut_current = std::max(max_cut_current, data.dpd.max_cutoff());
48#endif
49
50#ifdef LENNARD_JONES_GENERIC
51 max_cut_current = std::max(max_cut_current, data.ljgen.max_cutoff());
52#endif
53
54#ifdef SMOOTH_STEP
55 max_cut_current = std::max(max_cut_current, data.smooth_step.max_cutoff());
56#endif
57
58#ifdef HERTZIAN
59 max_cut_current = std::max(max_cut_current, data.hertzian.max_cutoff());
60#endif
61
62#ifdef GAUSSIAN
63 max_cut_current = std::max(max_cut_current, data.gaussian.max_cutoff());
64#endif
65
66#ifdef BMHTF_NACL
67 max_cut_current = std::max(max_cut_current, data.bmhtf.max_cutoff());
68#endif
69
70#ifdef MORSE
71 max_cut_current = std::max(max_cut_current, data.morse.max_cutoff());
72#endif
73
74#ifdef BUCKINGHAM
75 max_cut_current = std::max(max_cut_current, data.buckingham.max_cutoff());
76#endif
77
78#ifdef SOFT_SPHERE
79 max_cut_current = std::max(max_cut_current, data.soft_sphere.max_cutoff());
80#endif
81
82#ifdef HAT
83 max_cut_current = std::max(max_cut_current, data.hat.max_cutoff());
84#endif
85
86#ifdef LJCOS
87 max_cut_current = std::max(max_cut_current, data.ljcos.max_cutoff());
88#endif
89
90#ifdef LJCOS2
91 max_cut_current = std::max(max_cut_current, data.ljcos2.max_cutoff());
92#endif
93
94#ifdef GAY_BERNE
95 max_cut_current = std::max(max_cut_current, data.gay_berne.max_cutoff());
96#endif
97
98#ifdef TABULATED
99 max_cut_current = std::max(max_cut_current, data.tab.cutoff());
100#endif
101
102#ifdef THOLE
103 // If THOLE is active, use p3m cutoff
104 if (data.thole.scaling_coeff != 0.)
105 max_cut_current =
106 std::max(max_cut_current, Coulomb::get_coulomb().cutoff());
107#endif
108
109 return max_cut_current;
110}
111
113 for (auto &data : m_nonbonded_ia_params) {
114 data->max_cut = recalc_maximal_cutoff(*data);
115 }
116}
117
119 auto max_cut_nonbonded = INACTIVE_CUTOFF;
120 for (auto &data : m_nonbonded_ia_params) {
121 max_cut_nonbonded = std::max(max_cut_nonbonded, data->max_cut);
122 }
123 return max_cut_nonbonded;
124}
void recalc_maximal_cutoffs()
Recalculate cutoff of each interaction struct.
double maximal_cutoff() const
Get maximal cutoff.
Solver const & get_coulomb()
Definition coulomb.cpp:68
static double recalc_maximal_cutoff(IA_parameters const &data)
Various procedures concerning interactions between particles.
constexpr double INACTIVE_CUTOFF
Cutoff for deactivated interactions.
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