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
22#pragma once
23
24/** \file
25 * Routines to calculate the Born-Meyer-Huggins-Tosi-Fumi potential
26 * between particle pairs.
27 *
28 * Implementation in \ref bmhtf-nacl.cpp.
29 */
30
31#include "config/config.hpp"
32
33#ifdef ESPRESSO_BMHTF_NACL
34
36
38
39#include <cmath>
40
41/** Calculate BMHTF force factor */
43 double dist) {
44 if (dist < ia_params.bmhtf.cut) {
45 auto const dist8 = Utils::int_pow<8>(dist);
46 auto const dist10 = Utils::int_pow<10>(dist);
47 return ia_params.bmhtf.A * ia_params.bmhtf.B *
48 exp(ia_params.bmhtf.B * (ia_params.bmhtf.sig - dist)) / dist -
49 6 * ia_params.bmhtf.C / dist8 - 8 * ia_params.bmhtf.D / dist10;
50 }
51 return 0.0;
52}
53
54/** Calculate BMHTF potential energy */
55inline double BMHTF_pair_energy(IA_parameters const &ia_params, double dist) {
56 if (dist < ia_params.bmhtf.cut) {
57 auto const dist6 = Utils::int_pow<6>(dist);
58 auto const dist8 = Utils::int_pow<8>(dist);
59 return ia_params.bmhtf.A *
60 exp(ia_params.bmhtf.B * (ia_params.bmhtf.sig - dist)) -
61 ia_params.bmhtf.C / dist6 - ia_params.bmhtf.D / dist8 +
62 ia_params.bmhtf.computed_shift;
63 }
64 return 0.0;
65}
66
67#endif // ESPRESSO_BMHTF_NACL
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.
cudaStream_t stream[1]
CUDA streams for parallel computing on CPU and GPU.
Various procedures concerning interactions between particles.
Parameters for non-bonded interactions.