OpenMD 3.0
Molecular Dynamics in the Open
Loading...
Searching...
No Matches
EAMAdapter.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 TYPES_EAMADAPTER_HPP
46#define TYPES_EAMADAPTER_HPP
47
48#include <memory>
49
50#include "math/CubicSpline.hpp"
51#include "types/AtomType.hpp"
52#include "utils/GenericData.hpp"
53
54namespace OpenMD {
55
56 string const EAMtypeID = "EAM";
57 string const FuncflTypeID = "FUNCFL";
58 string const ZhouTypeID = "ZHOU";
59 string const ZhouRoseTypeID = "ZHOUROSE";
60
61 enum EAMType {
62 eamFuncfl,
63 eamZhou2001,
64 eamZhou2004,
65 eamZhou2005,
66 eamZhou2005Oxygen,
67 eamZhouRose,
68 eamOxygenFuncfl,
69 eamUnknown
70 };
71
73 EAMType eamType;
74 std::string latticeType;
75 RealType latticeConstant;
76 };
77
79 // This first set is for parameters read from DYNAMO 86 funcfl files:
80 int atomicNumber;
81 RealType atomicMass;
82 int nrho;
83 RealType drho;
84 int nr;
85 RealType dr;
86 RealType rcut;
87 std::vector<RealType> Z; // Z(r)
88 std::vector<RealType> rho; // rho(r)
89 std::vector<RealType> F; // F[rho]
90 };
91
93 // This set is for parameters for the parameterization of EAM
94 // described in: Acta mater 49, 4005 (2001)
95 RealType re;
96 RealType fe;
97 RealType rhoe;
98 RealType alpha;
99 RealType beta;
100 RealType A;
101 RealType B;
102 RealType kappa;
103 RealType lambda;
104 std::vector<RealType> F;
105 std::vector<RealType> Fn;
106 RealType eta;
107 RealType Fe;
108 // These additional parameters are for the parameterization of EAM
109 // described in: in: X. W. Zhou, R. A. Johnson, and
110 // H. N. G. Wadley, Phys. Rev. B, 69, 144113 (2004).
111 RealType rhos;
112 RealType rhol;
113 RealType rhoh;
114 // These additional parameters are for the parammeterization of
115 // EAM described in: X. W. Zhou and H. N. G. Wadley,
116 // J. Phys. Condens. Matter 17 (2005) 3619-3635.
117 RealType F3minus;
118 RealType F3plus;
119 RealType gamma;
120 RealType nu;
121 std::vector<RealType> OrhoLimits;
122 std::vector<RealType> OrhoE;
123 std::vector<std::vector<RealType>> OF;
124 // For a Rose-type functional
125 RealType F0;
126 };
127
128 using EAMData = SimpleTypeData<EAMParameters>;
129 using FuncflData = SimpleTypeData<FuncflParameters>;
130 using ZhouData = SimpleTypeData<ZhouParameters>;
131
133 public:
134 EAMAdapter(AtomType* AT) { at_ = AT; };
135
136 void makeFuncfl(RealType latticeConstant, std::string latticeType, int nrho,
137 RealType drho, int nr, RealType dr, RealType rcut,
138 std::vector<RealType> Z, std::vector<RealType> rho,
139 std::vector<RealType> F);
140
141 void makeZhou2001(std::string latticeType, RealType re, RealType fe,
142 RealType rhoe, RealType alpha, RealType beta, RealType A,
143 RealType B, RealType kappa, RealType lambda,
144 std::vector<RealType> Fn, std::vector<RealType> F,
145 RealType eta, RealType Fe);
146
147 void makeZhou2004(std::string latticeType, RealType re, RealType fe,
148 RealType rhoe, RealType rhos, RealType alpha,
149 RealType beta, RealType A, RealType B, RealType kappa,
150 RealType lambda, std::vector<RealType> Fn,
151 std::vector<RealType> F, RealType eta, RealType Fe,
152 RealType rhol, RealType rhoh);
153
154 void makeZhou2005(std::string latticeType, RealType re, RealType fe,
155 RealType rhoe, RealType rhos, RealType alpha,
156 RealType beta, RealType A, RealType B, RealType kappa,
157 RealType lambda, std::vector<RealType> Fn,
158 std::vector<RealType> F, RealType F3minus,
159 RealType F3plus, RealType eta, RealType Fe);
160
161 void makeZhou2005Oxygen(RealType re, RealType fe, RealType alpha,
162 RealType beta, RealType A, RealType B,
163 RealType kappa, RealType lambda, RealType gamma,
164 RealType nu, std::vector<RealType> OrhoLimits,
165 std::vector<RealType> OrhoE,
166 std::vector<std::vector<RealType>> OF);
167
168 void makeZhouRose(RealType re, RealType fe, RealType rhoe, RealType alpha,
169 RealType beta, RealType A, RealType B, RealType kappa,
170 RealType lambda, RealType F0);
171 void makeOxygenFuncfl(RealType re, RealType fe, RealType alpha,
172 RealType beta, RealType A, RealType B, RealType kappa,
173 RealType lambda, RealType drho, RealType nrho,
174 std::vector<RealType> F);
175
176 bool isEAM();
177 bool hasSplines();
178 EAMType getEAMType();
179 std::string getLatticeType();
180 RealType getLatticeConstant();
181 int getNr();
182 RealType getDr();
183 int getNrho();
184 RealType getDrho();
185 RealType getRcut();
186
187 RealType getRe();
188 RealType get_fe();
189 RealType getRhoe();
190 RealType getAlpha();
191 RealType getBeta();
192 RealType getA();
193 RealType getB();
194 RealType getKappa();
195 RealType getLambda();
196 RealType getGamma();
197 RealType getNu();
198 std::vector<RealType> getFn();
199 std::vector<RealType> getF();
200 RealType getF3plus();
201 RealType getF3minus();
202 RealType getEta();
203 RealType getFe();
204 RealType getRhos();
205 RealType getRhol();
206 RealType getRhoh();
207 std::vector<RealType> getOrhoLimits();
208 std::vector<RealType> getOrhoE();
209 std::vector<std::vector<RealType>> getOF();
210 RealType getF0();
211 CubicSplinePtr getZSpline();
212 CubicSplinePtr getRhoSpline();
213 CubicSplinePtr getFSpline();
214
215 private:
216 AtomType* at_;
217 EAMParameters getEAMParam();
218 FuncflParameters getFuncflParam();
219 ZhouParameters getZhouParam();
220 };
221} // namespace OpenMD
222
223#endif
AtomType is what OpenMD looks to for unchanging data about an atom.
Definition AtomType.hpp:66
This basic Periodic Table class was originally taken from the data.cpp file in OpenBabel.