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