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
35
#include "
nonbonded_interaction_data.hpp
"
36
37
#include <
utils/math/int_pow.hpp
>
38
39
#include <cmath>
40
41
/** Calculate BMHTF force factor */
42
inline
double
BMHTF_pair_force_factor
(
IA_parameters
const
&ia_params,
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 */
55
inline
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
BMHTF_pair_force_factor
double BMHTF_pair_force_factor(IA_parameters const &ia_params, double dist)
Calculate BMHTF force factor.
Definition
bmhtf-nacl.hpp:42
BMHTF_pair_energy
double BMHTF_pair_energy(IA_parameters const &ia_params, double dist)
Calculate BMHTF potential energy.
Definition
bmhtf-nacl.hpp:55
config.hpp
int_pow.hpp
nonbonded_interaction_data.hpp
Various procedures concerning interactions between particles.
BMHTF_Parameters::A
double A
Definition
nonbonded_interaction_data.hpp:139
BMHTF_Parameters::C
double C
Definition
nonbonded_interaction_data.hpp:141
BMHTF_Parameters::D
double D
Definition
nonbonded_interaction_data.hpp:142
BMHTF_Parameters::cut
double cut
Definition
nonbonded_interaction_data.hpp:144
BMHTF_Parameters::sig
double sig
Definition
nonbonded_interaction_data.hpp:143
BMHTF_Parameters::B
double B
Definition
nonbonded_interaction_data.hpp:140
BMHTF_Parameters::computed_shift
double computed_shift
Definition
nonbonded_interaction_data.hpp:145
IA_parameters
Parameters for non-bonded interactions.
Definition
nonbonded_interaction_data.hpp:276
IA_parameters::bmhtf
BMHTF_Parameters bmhtf
Definition
nonbonded_interaction_data.hpp:308
src
core
nonbonded_interactions
bmhtf-nacl.hpp
Generated on Sun Jan 4 2026 02:32:22 for ESPResSo by
1.9.8