ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
bmhtf-nacl.hpp
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#ifndef BMHTF_NACL_H
22#define BMHTF_NACL_H
23/** \file
24 * Routines to calculate the Born-Meyer-Huggins-Tosi-Fumi potential
25 * between particle pairs.
26 *
27 * Implementation in \ref bmhtf-nacl.cpp.
28 */
29
30#include "config/config.hpp"
31
32#ifdef BMHTF_NACL
33
35
37
38#include <cmath>
39
40/** Calculate BMHTF force factor */
41inline double BMHTF_pair_force_factor(IA_parameters const &ia_params,
42 double dist) {
43 if (dist < ia_params.bmhtf.cut) {
44 auto const dist8 = Utils::int_pow<8>(dist);
45 auto const dist10 = Utils::int_pow<10>(dist);
46 return ia_params.bmhtf.A * ia_params.bmhtf.B *
47 exp(ia_params.bmhtf.B * (ia_params.bmhtf.sig - dist)) / dist -
48 6 * ia_params.bmhtf.C / dist8 - 8 * ia_params.bmhtf.D / dist10;
49 }
50 return 0.0;
51}
52
53/** Calculate BMHTF potential energy */
54inline double BMHTF_pair_energy(IA_parameters const &ia_params, double dist) {
55 if (dist < ia_params.bmhtf.cut) {
56 auto const dist6 = Utils::int_pow<6>(dist);
57 auto const dist8 = Utils::int_pow<8>(dist);
58 return ia_params.bmhtf.A *
59 exp(ia_params.bmhtf.B * (ia_params.bmhtf.sig - dist)) -
60 ia_params.bmhtf.C / dist6 - ia_params.bmhtf.D / dist8 +
61 ia_params.bmhtf.computed_shift;
62 }
63 return 0.0;
64}
65
66#endif // BMHTF_NACL
67#endif
double BMHTF_pair_force_factor(IA_parameters const &ia_params, double dist)
Calculate BMHTF force factor.
double BMHTF_pair_energy(IA_parameters const &ia_params, double dist)
Calculate BMHTF potential energy.
This file contains the defaults for ESPResSo.
Various procedures concerning interactions between particles.
Parameters for non-bonded interactions.