OpenMD 3.1
Molecular Dynamics in the Open
Loading...
Searching...
No Matches
EAM.hpp
1/*
2 * Copyright (c) 2004-present, The University of Notre Dame. All rights
3 * reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer.
10 *
11 * 2. Redistributions in binary form must reproduce the above copyright notice,
12 * this list of conditions and the following disclaimer in the documentation
13 * and/or other materials provided with the distribution.
14 *
15 * 3. Neither the name of the copyright holder nor the names of its
16 * contributors may be used to endorse or promote products derived from
17 * this software without specific prior written permission.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
30 *
31 * SUPPORT OPEN SCIENCE! If you use OpenMD or its source code in your
32 * research, please cite the appropriate papers when you publish your
33 * work. Good starting points are:
34 *
35 * [1] Meineke, et al., J. Comp. Chem. 26, 252-271 (2005).
36 * [2] Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006).
37 * [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 234107 (2008).
38 * [4] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011).
39 * [5] Kuang & Gezelter, Mol. Phys., 110, 691-701 (2012).
40 * [6] Lamichhane, Gezelter & Newman, J. Chem. Phys. 141, 134109 (2014).
41 * [7] Lamichhane, Newman & Gezelter, J. Chem. Phys. 141, 134110 (2014).
42 * [8] Bhattarai, Newman & Gezelter, Phys. Rev. B 99, 094106 (2019).
43 */
44
45#ifndef NONBONDED_EAM_HPP
46#define NONBONDED_EAM_HPP
47
48#include <memory>
49
50#include "brains/ForceField.hpp"
51#include "math/CubicSpline.hpp"
52#include "math/Vector3.hpp"
53#include "nonbonded/Electrostatic.hpp"
54#include "nonbonded/NonBondedInteraction.hpp"
55#include "types/EAMAdapter.hpp"
56
57namespace OpenMD {
58
59 struct EAMAtomData {
60 CubicSplinePtr rho;
61 CubicSplinePtr F;
62 CubicSplinePtr Z;
63 CubicSplinePtr phiCC;
64 CubicSplinePtr phiCV;
65 RealType rcut;
66 RealType nValence;
67 RealType nMobile;
68 bool isFluctuatingCharge;
69 };
70
72 CubicSplinePtr phi;
73 CubicSplinePtr phiCC;
74 RealType Ci = 0.0; // to zero out the CV interaction in the eam-explict
75 // interaction for EAMTable and EAMZhou
76 RealType Cj = 0.0; // to zero out the CV interaction in the eam-explict
77 // interaction for EAMTable and EAMZhou
78 RealType rcut;
79 bool explicitlySet;
80 };
81
82 enum EAMMixingMethod {
83 eamJohnson,
84 eamDaw,
85 eamDream1,
86 eamDream2,
87 eamUnknownMix
88 };
89
90 class EAM : public MetallicInteraction {
91 public:
92 EAM();
93 void setForceField(ForceField* ff) { forceField_ = ff; };
94 void setElectrostatic(Electrostatic* el) { electrostatic_ = el; };
95 void setSimulatedAtomTypes(AtomTypeSet& simtypes) {
96 simTypes_ = simtypes;
97 initialize();
98 };
99 void addType(AtomType* atomType);
100 void addExplicitInteraction(AtomType* atype1, AtomType* atype2, RealType dr,
101 int nr, std::vector<RealType> phiAB);
102
103 void addExplicitInteraction(AtomType* atype1, AtomType* atype2, RealType re,
104 RealType alpha, RealType beta, RealType A,
105 RealType B, RealType kappa, RealType lambda);
106
107 void addExplicitInteraction(AtomType* atype1, AtomType* atype2, RealType re,
108 RealType alpha, RealType A, RealType Ci,
109 RealType Cj);
110
111 RealType fastPower(RealType x, int y);
112
113 // RealType ZhouPhiCoreCore(RealType r, RealType re, RealType A,
114 // RealType alpha, RealType kappa);
115 // RealType ZhouPhiCoreValence(RealType r, RealType re, RealType B,
116 // RealType beta, RealType lambda);
117 //
118 // RealType ZhouPhi(RealType r, RealType re, RealType A, RealType B,
119 // RealType alpha, RealType beta, RealType kappa,
120 // RealType lambda);
121 //
122 // RealType ZhouRho(RealType r, RealType re, RealType fe, RealType beta,
123 // RealType lambda);
124
125 RealType PhiCoreCore(RealType r, RealType re, RealType A, RealType alpha,
126 RealType kappa);
127 RealType PhiCoreValence(RealType r, RealType re, RealType B, RealType beta,
128 RealType lambda);
129
130 RealType Phi(RealType r, RealType re, RealType A, RealType B,
131 RealType alpha, RealType beta, RealType kappa,
132 RealType lambda);
133
134 RealType Rho(RealType r, RealType re, RealType fe, RealType beta,
135 RealType lambda);
136 RealType gFunc(RealType q, RealType nV, RealType nM);
137 RealType gPrime(RealType q, RealType nV, RealType nM);
138 RealType Zhou2001Functional(RealType rho, RealType rhoe,
139 std::vector<RealType> Fn,
140 std::vector<RealType> F, RealType Fe,
141 RealType eta);
142 RealType Zhou2004Functional(RealType rho, RealType rhoe, RealType rhos,
143 std::vector<RealType> Fn,
144 std::vector<RealType> F, RealType Fe,
145 RealType eta, RealType rhol, RealType rhoh);
146 RealType Zhou2005Functional(RealType rho, RealType rhoe, RealType rhos,
147 std::vector<RealType> Fn,
148 std::vector<RealType> F, RealType F3plus,
149 RealType F3minus, RealType Fe, RealType eta);
150 RealType Zhou2005OxygenFunctional(RealType rho,
151 std::vector<RealType> OrhoLimits,
152 std::vector<RealType> OrhoE,
153 std::vector<std::vector<RealType>> OF);
154 RealType RoseFunctional(RealType rho, RealType rhoe, RealType F0);
155
156 void calcDensity(InteractionData& idat);
157 void calcFunctional(SelfData& sdat);
158 void calcForce(InteractionData& idat);
159
160 virtual string getName() { return name_; }
161 virtual int getHash() { return EAM_INTERACTION; }
162 virtual RealType getSuggestedCutoffRadius(
163 pair<AtomType*, AtomType*> atypes);
164 void setCutoffRadius(RealType rCut);
165
166 private:
167 void initialize();
168 CubicSplinePtr getPhi(AtomType* atomType1, AtomType* atomType2);
169
170 bool initialized_;
171 bool haveCutoffRadius_;
172 set<int> EAMtypes; /**< The set of AtomType idents that are EAM types */
173 vector<int>
174 EAMtids; /**< The mapping from AtomType ident -> EAM type ident */
175 vector<EAMAtomData>
176 EAMdata; /**< The EAM atomic data indexed by EAM type ident */
177 vector<vector<EAMInteractionData>>
178 MixingMap; /**< The mixing parameters between two EAM types */
179 int nEAM_;
180
181 ForceField* forceField_;
182 Electrostatic* electrostatic_;
183 AtomTypeSet simTypes_;
184 RealType pre11_;
185 RealType eamRcut_;
186 // RealType oss_;
187 Vector3d rhat;
188
189 EAMMixingMethod mixMeth_;
190 string name_;
191 };
192} // namespace OpenMD
193
194#endif
AtomType is what OpenMD looks to for unchanging data about an atom.
Definition AtomType.hpp:66
The basic interface for metallic interactions.
This basic Periodic Table class was originally taken from the data.cpp file in OpenBabel.
The InteractionData struct.
The SelfData struct.