1# 2# CDDL HEADER START 3# 4# The contents of this file are subject to the terms of the Common Development 5# and Distribution License Version 1.0 (the "License"). 6# 7# You can obtain a copy of the license at 8# http://www.opensource.org/licenses/CDDL-1.0. See the License for the 9# specific language governing permissions and limitations under the License. 10# 11# When distributing Covered Code, include this CDDL HEADER in each file and 12# include the License file in a prominent location with the name LICENSE.CDDL. 13# If applicable, add the following below this CDDL HEADER, with the fields 14# enclosed by brackets "[]" replaced with your own identifying information: 15# 16# Portions Copyright (c) [yyyy] [name of copyright owner]. All rights reserved. 17# 18# CDDL HEADER END 19# 20 21# 22# Copyright (c) 2013--2018, Regents of the University of Minnesota. 23# All rights reserved. 24# 25# Contributors: 26# Ryan S. Elliott 27# 28 29 30This directory contains an EAM Model Driver which reads Dynamo setfl, funcfl, 31and setfl Finnis Sinclair table files. The driver is written in C++. The 32driver is designed to mimic/reproduce the behavior of LAMMPS's eam, eam/alloy, 33and eam/fs pair_styles. The only difference is that, while these pair styles 34will perform linear extrapolation in the event that the density is outside of 35the interpolative regime tabulated in the parameter file for the relevant 36species, the implementation provided here will simply return an error message 37and exit rather than performing any extrapolation. The type of table file 38provided is automatically detected. 39 40This Model Driver supports optional computation of `partialEnergy', 41`partialForces', `partialParticleEnergy', `ProcessDeDrTerm', and 42`ProcessD2EDr2Term'. When the number of table files provided to the Model 43Driver is greater than one, the Model Driver expects each table file to be a 44funcfl file. These are, together, are used to define a multi-species Model. 45When only one table file is provided, the Model Driver determines the type of 46provided table file by the file's contents. 47 48The format of the Dynamo files supported by this Model Driver follows the 49LAMMPS format. (NOTE an exception: To facilitate auto-detection of table file 50type, all floating point values are expected to be proper floating point 51numbers, with at least a decimal point. This is required in order to 52distinguish them from integer values.) The LAMMPS format is described below 53(adapted from the LAMMPS documentation as of 2013-11-19): 54 55This Model Driver computes pairwise interactions for metals and metal alloys 56using embedded-atom method (EAM) potentials (Daw). The total energy Ei of an 57atom I is given by 58 59 E_i = F_\alpha( \sum_{j\neq i} \rho_\beta(r_{ij})) 60 + (1/2)\sum_{j\neq i} \phi_{\alpha \beta}(r_{ij}) 61 62 63 64A DYNAMO single-element funcfl file is formatted as follows: 65 66* line 1: comment (ignored) 67* line 2: atomic number, mass, lattice constant, lattice type (e.g. FCC) 68* line 3: Nrho, drho, Nr, dr, cutoff 69 70The mass is in mass units, e.g. mass number or grams/mole for metal units. The 71cubic lattice constant is in Angstroms. On line 3, Nrho and Nr are the number 72of tabulated values in the subsequent arrays, drho and dr are the spacing in 73density and distance space for the values in those arrays, and the specified 74cutoff becomes the pairwise cutoff for the potential. The units of dr are 75Angstroms; I'm not sure of the units for drho - some measure of electron 76density. 77 78Following the three header lines are three arrays of tabulated values: 79 80* embedding function F(rho) (Nrho values) 81* effective charge function Z(r) (Nr values) 82* density function rho(r) (Nr values) 83 84The values for each array can be listed as multiple values per line, so long as 85each array starts on a new line. For example, the individual Z(r) values are 86for r = 0.0,dr,2*dr, ... (Nr-1)*dr. 87 88The units for the embedding function F are eV. The units for the density 89function rho are the same as for drho (see above, electron density). The units 90for the effective charge Z are "atomic charge" or sqrt(Hartree * Bohr-radii). 91For two interacting atoms i,j this is used to compute the pair potential term 92in the EAM energy expression as r*phi, in units of eV-Angstroms, via the 93formula 94 95r*phi = 27.2 * 0.529 * Zi * Zj 96where 1 Hartree = 27.2 eV and 1 Bohr = 0.529 Angstroms. 97 98 99 100A DYNAMO multi-element setfl file is formatted as follows: 101 102* lines 1,2,3 = comments (ignored) 103* line 4: Nelements Element1 Element2 ... ElementN 104* line 5: Nrho, drho, Nr, dr, cutoff 105 106In a DYNAMO setfl file, line 4 only lists Nelements = the # of elements in the 107setfl file. The element name (Ni, Cu, etc) of each element must be included on 108the line, in the order the elements appear in the file. 109 110The meaning and units of the values in line 5 is the same as for the funcfl 111file described above. Note that the cutoff (in Angstroms) is a global value, 112valid for all pairwise interactions for all element pairings. 113 114Following the 5 header lines are Nelements sections, one for each element, each 115with the following format: 116 117* line 1 = atomic number, mass, lattice constant, lattice type (e.g. FCC) 118* embedding function F(rho) (Nrho values) 119* density function rho(r) (Nr values) 120 121The cubic lattice constant is in Angstroms. The F and rho arrays are unique to 122a single element and have the same format and units as in a funcfl file. 123 124Following the Nelements sections, Nr values for each pair potential phi(r) 125array are listed for all i,j element pairs in the same format as other arrays. 126Since these interactions are symmetric (i,j = j,i) only phi arrays with i >= j 127are listed, in the following order: i,j = (1,1), (2,1), (2,2), (3,1), (3,2), 128(3,3), (4,1), ..., (Nelements, Nelements). Unlike the effective charge array 129Z(r) in funcfl files, the tabulated values for each phi function are listed in 130setfl files directly as r*phi (in units of eV-Angstroms), since they are for 131atom pairs. 132 133 134 135A DYNAMO Finnis Sinclair setfl file is formatted as follows: 136 137In this case the Model Driver computes pairwise interactions for metals and 138metal alloys using a generalized form of EAM potentials due to Finnis and 139Sinclair (Finnis). The total energy Ei of an atom I is given by 140 141 E_i = F_\alpha( \sum_{j\neq i} \rho_{\alpha \beta}(r_{ij})) 142 + (1/2)\sum_{j\neq i} \phi_{\alpha \beta}(r_{ij}) 143 144These files include more information than the DYNAMO setfl format files 145described above, in that i,j density functionals for all pairs of elements are 146included as needed by the Finnis/Sinclair formulation of the EAM. 147 148* lines 1,2,3 = comments (ignored) 149* line 4: Nelements Element1 Element2 ... ElementN 150* line 5: Nrho, drho, Nr, dr, cutoff 151 152The 5-line header section is identical to an EAM setfl file. 153 154Following the header are Nelements sections, one for each element I, each with 155the following format: 156 157* line 1 = atomic number, mass, lattice constant, lattice type (e.g. FCC) 158* embedding function F(rho) (Nrho values) 159* density function rho(r) for element I at element 1 (Nr values) 160* density function rho(r) for element I at element 2 161* ... 162* density function rho(r) for element I at element Nelement 163 164The units of these quantities in line 1 are the same as for setfl files. Note 165that the rho(r) arrays in Finnis/Sinclair can be asymmetric (i,j != j,i) so 166there are Nelements^2 of them listed in the file. 167 168Following the Nelements sections, Nr values for each pair potential phi(r) 169array are listed in the same manner (r*phi, units of eV-Angstroms) as in EAM 170setfl files. Note that in Finnis/Sinclair, the phi(r) arrays are still 171symmetric, so only phi arrays for i >= j are listed. 172 173 174Updates: 175_002 : Removed double-parameter publishing. Fixed energy problems with ghost 176 atoms when using NEIGH_PURE_F 177_003 : * Fixed half-list missing embedding energy error. 178 * Fix setm_data and setm_method size argument data types 179 * Change/Fix corner-case handling for spline interpolation 180 * Add a check for negative densities 181_004 : * Fixed density calculation for the case where multiple atomic species 182 are present 183_005 : * Updated to be compatible with KIM API 2.0 184