diff --git a/doc/src/Tools.rst b/doc/src/Tools.rst index 0788a27623..f24659b278 100644 --- a/doc/src/Tools.rst +++ b/doc/src/Tools.rst @@ -277,13 +277,15 @@ at ens-lyon.fr, alain.dequidt at uca.fr eam database tool ----------------------------- -The tools/eam_database directory contains a Fortran program that will -generate EAM alloy setfl potential files for any combination of 17 -elements: Cu, Ag, Au, Ni, Pd, Pt, Al, Pb, Fe, Mo, Ta, W, Mg, Co, Ti, -Zr, Cr. The files can then be used with the :doc:`pair_style eam/alloy ` command. +The tools/eam_database directory contains a Fortran and a Python program +that will generate EAM alloy setfl potential files for any combination +of the 17 elements: Cu, Ag, Au, Ni, Pd, Pt, Al, Pb, Fe, Mo, Ta, W, Mg, +Co, Ti, Zr, Cr. The files can then be used with the :doc:`pair_style +eam/alloy ` command. -The tool is authored by Xiaowang Zhou (Sandia), xzhou at sandia.gov, -with updates from Lucas Hale (NIST) lucas.hale at nist.gov and is based on his paper: +The Fortran version of the tool was authored by Xiaowang Zhou (Sandia), +xzhou at sandia.gov, with updates from Lucas Hale (NIST) lucas.hale at +nist.gov and is based on his paper: X. W. Zhou, R. A. Johnson, and H. N. G. Wadley, Phys. Rev. B, 69, 144113 (2004). @@ -292,6 +294,17 @@ The parameters for Cr were taken from: Lin Z B, Johnson R A and Zhigilei L V, Phys. Rev. B 77 214108 (2008). +The Python version of the tool was authored by Germain Clavier +(TU Eindhoven) g.m.g.c.clavier at tue.nl or germain.clavier at gmail.com + +.. note:: + + The parameters in the database are only optimized for individual + elements. The mixed parameters for interactions between different + elements generated by this tool are derived from simple mixing rules + and are thus inferior to parameterizations that are specifically + optimized for specific mixtures and combinations of elements. + ---------- .. _eamgn: diff --git a/doc/utils/sphinx-config/false_positives.txt b/doc/utils/sphinx-config/false_positives.txt index dfff998cf5..02dce2f3c2 100644 --- a/doc/utils/sphinx-config/false_positives.txt +++ b/doc/utils/sphinx-config/false_positives.txt @@ -1145,6 +1145,7 @@ Geier gencode georg Georg +germain Germann Germano gerolf @@ -1816,6 +1817,7 @@ lsfftw ltbbmalloc Lua lubricateU +lucas lucy Luding Luijten diff --git a/tools/eam_database/README b/tools/eam_database/README index fa868b583b..21f1fe15d1 100644 --- a/tools/eam_database/README +++ b/tools/eam_database/README @@ -1,9 +1,11 @@ EAM database tool -Xiaowang Zhou (Sandia), xzhou at sandia.gov -Revised version including fixes from https://www.ctcms.nist.gov/potentials/entry/2004--Zhou-X-W-Johnson-R-A-Wadley-H-N-G--Al/ +Fortran version (create.f) by Xiaowang Zhou (Sandia), xzhou at sandia.gov +with revisions by Lucas Hale lucas.hale at nist.gov from https://www.ctcms.nist.gov/potentials/entry/2004--Zhou-X-W-Johnson-R-A-Wadley-H-N-G--Al/ -based on this paper: +Python version (create_eam.py) by Germain Clavier germain.clavier at gmail.com + +Most parameters based on this paper: X. W. Zhou, R. A. Johnson, and H. N. G. Wadley, Phys. Rev. B, 69, 144113 (2004). @@ -26,10 +28,25 @@ alloys. Thus any potential files created with this tool should be used with care and test calculations (e.g. on multiple binary mixtures) performed to gauge the error. -Steps: +Steps (create.f): 1) compile create.f -> a.out (e.g. gfortran create.f) 2) edit the input file EAM.input to list 2 or more desired elements to include 3) a.out < EAM.input will create an *.eam.alloy potential file -4) in DYNAMO or LAMMPS context this file is referred to as a setfl file - that can be used with the LAMMPS pair_style eam/alloy command + +Steps (create_eam.py): + +Usage: create_eam.py [-h] [-n NAME [NAME ...]] [-nr NR] [-nrho NRHO] + +options: + -n NAME [NAME ...], --names NAME [NAME ...] + Element names + -nr NR Number of point in r space [default 2000] + -nrho NRHO Number of point in rho space [default 2000] + +1) you must have numpy installed +2) run "python create_eam.py -n Ta Cu" with the list of desired elements +3) this will create an *.eam.alloy potential file + +in DYNAMO or LAMMPS context the created file is referred to as a setfl file + that can be used with the LAMMPS pair_style eam/alloy command diff --git a/tools/eam_database/create.f b/tools/eam_database/create.f index ce6f03a7ac..54b0d55ab7 100644 --- a/tools/eam_database/create.f +++ b/tools/eam_database/create.f @@ -243,11 +243,12 @@ ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc outfile = outfile(1:index(outfile,' ')-1)//'.eam.alloy' open(unit=1,file=outfile) call date_and_time(DATE=date) - write(1,*) ' DATE: ',date(1:4),'-',date(5:6),'-',date(7:8),' ', - * 'CONTRIBUTOR: Xiaowang Zhou xzhou@sandia.gov and ', - * 'Lucas Hale lucas.hale@nist.gov ', - * 'CITATION: X. W. Zhou, R. A. Johnson, ', + write(1,*) 'DATE: ',date(1:4),'-',date(5:6),'-',date(7:8), + * ' UNITS: metal CONTRIBUTOR: Xiaowang Zhou xzhou@sandia.gov and ', + * 'Lucas Hale lucas.hale@nist.gov ' + write(1,*) 'CITATION: X. W. Zhou, R. A. Johnson, ', * 'H. N. G. Wadley, Phys. Rev. B, 69, 144113(2004)' + write(1,*) 'Generated by create.f' write(1,8)ntypes,outelem 8 format(i5,' ',a24) write(1,9)nrho,drho,nr,dr,rc diff --git a/tools/eam_database/create_eam.py b/tools/eam_database/create_eam.py new file mode 100644 index 0000000000..8b230b87b4 --- /dev/null +++ b/tools/eam_database/create_eam.py @@ -0,0 +1,165 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +""" +Python version of the code Zhou04_create_v2.f +original author: X. W. Zhou, xzhou@sandia.gov +based on updates by: Lucas Hale lucas.hale@nist.gov +written by: Germain Clavier g.m.g.c.clavier@tue.nl +This script requires the numpy library. +""" + +import sys +import argparse as ap +from datetime import date + +import numpy as np +from eamDatabase import Database + +def prof(at, r): + atom = Database[at] + f = np.zeros(r.shape) + f = atom.fe * np.exp(-atom.beta1 * (r[r >= 0.5] / atom.re - 1.0)) + f = f / (1.0 + (r / atom.re - atom.ramda1) ** 20) + return f + + +def pair(at1, at2, r): + atom = Database[at1] + psi1 = atom.A * np.exp(-atom.alpha * (r / atom.re - 1.0)) + psi1 /= 1.0 + (r / atom.re - atom.cai) ** 20 + psi2 = atom.B * np.exp(-atom.beta * (r / atom.re - 1.0)) + psi2 /= 1.0 + (r / atom.re - atom.ramda) ** 20 + if at1 == at2: + psi = psi1 - psi2 + else: + psia = psi1 - psi2 + atom2 = Database[at2] + psi1 = atom2.A * np.exp(-atom2.alpha * (r / atom2.re - 1.0)) + psi1 /= 1.0 + (r / atom2.re - atom2.cai) ** 20 + psi2 = atom2.B * np.exp(-atom2.beta * (r / atom2.re - 1.0)) + psi2 /= 1.0 + (r / atom2.re - atom2.ramda) ** 20 + psib = psi1 - psi2 + prof1 = prof(at1, r) + prof2 = prof(at2, r) + psi = 0.5 * (prof2 / prof1 * psia + prof1 / prof2 * psib) + return psi + + +def embed(at, rho): + atom = Database[at] + Fm33 = np.zeros(rho.shape) + Fm33[rho < atom.rhoe] = atom.Fm3 + Fm33[rho >= atom.rhoe] = atom.Fm4 + emb = np.zeros(rho.shape) + for i, r in enumerate(rho): + if r == 0: + emb[i] = 0 + elif r < atom.rhoin: + dr = r / atom.rhoin - 1 + emb[i] = atom.Fi0 + atom.Fi1 * dr + atom.Fi2 * dr**2 + atom.Fi3 * dr**3 + elif r < atom.rhoout: + dr = r / atom.rhoe - 1 + emb[i] = atom.Fm0 + atom.Fm1 * dr + atom.Fm2 * dr**2 + Fm33[i] * dr**3 + else: + dr = r / atom.rhos + emb[i] = atom.Fn * (1.0 - atom.fnn * np.log(dr)) * dr**atom.fnn + return emb + +def write_file(attypes, filename, Fr, rhor, z2r, nrho, drho, nr, dr, rc): + struc = "fcc" + with open(filename, "w") as f: + f.write("DATE: " + date.today().strftime("%Y-%m-%d") + " UNITS: metal") + f.write(" CONTRIBUTOR: Xiaowang Zhou xzhou@sandia.gov, Lucas Hale lucas.hale@nist.gov,") + f.write(" and Germain Clavier g.m.g.c.clavier@tue.nl/germain.clavier@gmail.com\n") + f.write(" CITATION: X. W. Zhou, R. A. Johnson, H. N. G. Wadley, Phys. Rev. B, 69, 144113(2004)\n") + f.write("Generated by create_eam.py\n") + f.write("{:<5d} {:<24}\n".format(len(attypes), " ".join(attypes))) + f.write("{:<5d} {:<24.16e} {:<5d} {:<24.16e} {:<24.16e}\n".format(nrho, drho, nr, dr, rc)) + for at in attypes: + atom = Database[at] + f.write( + "{:>5d} {:>15.5f} {:>15.5f} {:>8}\n".format( + atom.ielement, atom.amass, atom.blat, struc + ) + ) + for i, fr in enumerate(Fr[at]): + f.write(" {:>24.16E}".format(fr)) + if not (i + 1) % 5: + f.write("\n") + for i, rho in enumerate(rhor[at]): + f.write(" {:>24.16E}".format(rho)) + if not (i + 1) % 5: + f.write("\n") + for n1 in range(len(attypes)): + for n2 in range(n1 + 1): + for i, z in enumerate(z2r[n1, n2]): + f.write(" {:>24.16E}".format(z)) + if not (i + 1) % 5: + f.write("\n") + +def create_eam(argv=None): + parser = ap.ArgumentParser(description="Script to create EAM alloy potential files.") + + parser.add_argument("-n", "--names", dest="name", nargs="+", + help="Element names") + parser.add_argument("-nr", dest="nr", type=int, default=2000, + help="Number of point in r space [default 2000]") + parser.add_argument("-nrho", dest="nrho", type=int, default=2000, + help="Number of point in rho space [default 2000]") + args = parser.parse_args(argv) + if not args.name: + parser.print_help() + sys.exit("") + + atnames = args.name + nr = args.nr + nrho = args.nrho + + for n in atnames: + try: + Database[n] + except KeyError: + output = "Element {} not found in database.\n".format(n) + valid = "Supported elements are: {}".format(" ".join(Database.keys())) + sys.exit("".join([output, valid])) + + ntypes = len(atnames) + outfilename = "".join([*atnames, ".eam.alloy"]) + rhor = {} + Fr = {} + + alatmax = max([Database[at].blat for at in atnames]) + rhoemax = max([Database[at].rhoe for at in atnames]) + rc = np.sqrt(10.0) / 2.0 * alatmax + rst = 0.5 + r = np.linspace(0.0, rc, num=nr, dtype=np.double) + dr = r[1] - r[0] + r[r < rst] = rst + z2r = np.zeros([ntypes, ntypes, nr]) + rhomax = -np.inf + + for i, n1 in enumerate(atnames): + for j, n2 in enumerate(atnames): + if j > i: + continue + if i == j: + rhor[n1] = prof(n1, r) + rhomax = max(rhomax,np.max(rhor[n1])) + z2r[i, j, :] = r * pair(n1, n2, r) + else: + z2r[i, j, :] = r * pair(n1, n2, r) + z2r = np.where(z2r, z2r, z2r.transpose((1, 0, 2))) + rhomax = max(rhomax, 2.0 * rhoemax, 100.0) + rho = np.linspace(0.0, rhomax, num=nrho, dtype=np.double) + drho = rho[1] - rho[0] + for i, n1 in enumerate(atnames): + Fr[n1] = embed(n1, rho) + + write_file(atnames, outfilename, Fr, rhor, z2r, nrho, drho, nr, dr, rc) + +if __name__ == "__main__": + try: + create_eam(sys.argv[1:]) + except KeyboardInterrupt as exc: + raise SystemExit("User interruption.") from exc diff --git a/tools/eam_database/eamDatabase.py b/tools/eam_database/eamDatabase.py new file mode 100644 index 0000000000..db70b7d2b7 --- /dev/null +++ b/tools/eam_database/eamDatabase.py @@ -0,0 +1,640 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +""" +Python version of the code Zhou04_create_v2.f +original author: X. W. Zhou, xzhou@sandia.gov +based on updates by: Lucas Hale lucas.hale@nist.gov +written by: Germain Clavier g.m.g.c.clavier@tue.nl + +This file contains atom attributes for the EAM model and alloy combination. The +original file is EAM_code. It is designed to be used with create_eam.py script. +To add new contribution, just add new AtType instances. +""" + +import math + +class AtType: + def __init__( + self, + name, + re, + fe, + rhoe, + rhos, + alpha, + beta, + A, + B, + cai, + ramda, + Fi0, + Fi1, + Fi2, + Fi3, + Fm0, + Fm1, + Fm2, + Fm3, + fnn, + Fn, + ielement, + amass, + Fm4, + beta1, + ramda1, + rhol, + rhoh, + ): + self.name = name + self.re = re + self.fe = fe + self.rhoe = rhoe + self.rhos = rhos + self.alpha = alpha + self.beta = beta + self.A = A + self.B = B + self.cai = cai + self.ramda = ramda + self.Fi0 = Fi0 + self.Fi1 = Fi1 + self.Fi2 = Fi2 + self.Fi3 = Fi3 + self.Fm0 = Fm0 + self.Fm1 = Fm1 + self.Fm2 = Fm2 + self.Fm3 = Fm3 + self.fnn = fnn + self.Fn = Fn + self.ielement = ielement + self.amass = amass + self.Fm4 = Fm4 + self.beta1 = beta1 + self.ramda1 = ramda1 + self.rhol = rhol + self.rhoh = rhoh + self.blat = math.sqrt(2.0) * self.re + self.rhoin = self.rhol * self.rhoe + self.rhoout = self.rhoh * self.rhoe + + def __repr__(self): + output = """{}: + re = {}; fe = {} + rhoe = {}; rhos = {}; + alpha = {}; beta = {}; + A = {}; B = {} + cai = {}; ramda = {} + Fi0 = {}; Fi1 = {}; Fi2 = {}; Fi3 = {} + Fm0 = {}; Fm1 = {}; Fm2 = {}; Fm3 = {}; Fm4 = {} + fnn = {}; Fn = {} + ielement = {}; amass = {} + beta1 = {}; ramda1 = {} + rhol = {}; rhoh = {} + blat = {}; rhoin = {}; rhoout = {}""" + return output.format( + self.name, + self.re, + self.fe, + self.rhoe, + self.rhos, + self.alpha, + self.beta, + self.A, + self.B, + self.cai, + self.ramda, + self.Fi0, + self.Fi1, + self.Fi2, + self.Fi3, + self.Fm0, + self.Fm1, + self.Fm2, + self.Fm3, + self.Fm4, + self.fnn, + self.Fn, + self.ielement, + self.amass, + self.beta1, + self.ramda1, + self.rhol, + self.rhoh, + self.blat, + self.rhoin, + self.rhoout, + ) + + +Database = {} +Database["Cu"] = AtType( + "Cu", # Name + 2.556162, # re + 1.554485, # fe + 21.175871, # rhoe + 21.175395, # rhos + 8.127620, # alpha + 4.334731, # beta + 0.396620, # A + 0.548085, # B + 0.308782, # cai + 0.756515, # ramda + -2.170269, # Fi0 + -0.263788, # Fi1 + 1.088878, # Fi2 + -0.817603, # Fi3 + -2.19, # Fm0 + 0.00, # Fm1 + 0.561830, # Fm2 + -2.100595, # Fm3 + 0.310490, # fnn + -2.186568, # Fn + 29, # ielement + 63.546, # amass + -2.100595, # Fm4 + 4.334731, # beta1 + 0.756515, # ramda1 + 0.85, # rhol + 1.15, # rhoh +) +Database["Ag"] = AtType( + "Ag", + 2.891814, + 1.106232, + 14.604100, + 14.604144, + 9.132010, + 4.870405, + 0.277758, + 0.419611, + 0.339710, + 0.750758, + -1.729364, + -0.255882, + 0.912050, + -0.561432, + -1.75, + 0.00, + 0.744561, + -1.150650, + 0.783924, + -1.748423, + 47, + 107.8682, + -1.150650, + 4.870405, + 0.750758, + 0.85, + 1.15, +) +Database["Au"] = AtType( + "Au", + 2.885034, + 1.529021, + 19.991632, + 19.991509, + 9.516052, + 5.075228, + 0.229762, + 0.356666, + 0.356570, + 0.748798, + -2.937772, + -0.500288, + 1.601954, + -0.835530, + -2.98, + 0.00, + 1.706587, + -1.134778, + 1.021095, + -2.978815, + 79, + 196.96654, + -1.134778, + 5.075228, + 0.748798, + 0.85, + 1.15, +) +Database["Ni"] = AtType( + "Ni", + 2.488746, + 2.007018, + 27.562015, + 27.562031, + 8.383453, + 4.471175, + 0.429046, + 0.633531, + 0.443599, + 0.820658, + -2.693513, + -0.076445, + 0.241442, + -2.375626, + -2.70, + 0.00, + 0.265390, + -0.152856, + 0.445470, + -2.7, + 28, + 58.6934, + -0.152856, + 4.471175, + 0.820658, + 0.85, + 1.15, +) +Database["Pd"] = AtType( + "Pd", + 2.750897, + 1.595417, + 21.335246, + 21.940073, + 8.697397, + 4.638612, + 0.406763, + 0.598880, + 0.397263, + 0.754799, + -2.321006, + -0.473983, + 1.615343, + -0.231681, + -2.36, + 0.00, + 1.481742, + -1.675615, + 1.130000, + -2.352753, + 46, + 106.42, + -1.675615, + 4.638612, + 0.754799, + 0.85, + 1.15, +) +Database["Pt"] = AtType( + "Pt", + 2.771916, + 2.336509, + 33.367564, + 35.205357, + 7.105782, + 3.789750, + 0.556398, + 0.696037, + 0.385255, + 0.770510, + -1.455568, + -2.149952, + 0.528491, + 1.222875, + -4.17, + 0.00, + 3.010561, + -2.420128, + 1.450000, + -4.145597, + 78, + 195.08, + -2.420128, + 3.789750, + 0.770510, + 0.25, + 1.15, +) +Database["Al"] = AtType( + "Al", + 2.863924, + 1.403115, + 20.418205, + 23.195740, + 6.613165, + 3.527021, + 0.314873, + 0.365551, + 0.379846, + 0.759692, + -2.807602, + -0.301435, + 1.258562, + -1.247604, + -2.83, + 0.00, + 0.622245, + -2.488244, + 0.785902, + -2.824528, + 13, + 26.981539, + -2.488244, + 3.527021, + 0.759692, + 0.85, + 1.15, +) +Database["Pb"] = AtType( + "Pb", + 3.499723, + 0.647872, + 8.450154, + 8.450063, + 9.121799, + 5.212457, + 0.161219, + 0.236884, + 0.250805, + 0.764955, + -1.422370, + -0.210107, + 0.682886, + -0.529378, + -1.44, + 0.00, + 0.702726, + -0.538766, + 0.935380, + -1.439436, + 82, + 207.2, + -0.538766, + 5.212457, + 0.764955, + 0.85, + 1.15, +) +Database["Fe"] = AtType( + "Fe", + 2.481987, + 1.885957, + 20.041463, + 20.041463, + 9.818270, + 5.236411, + 0.392811, + 0.646243, + 0.170306, + 0.340613, + -2.534992, + -0.059605, + 0.193065, + -2.282322, + -2.54, + 0.00, + 0.200269, + -0.148770, + 0.391750, + -2.539945, + 26, + 55.847, + -0.148770, + 5.236411, + 0.340613, + 0.85, + 1.15, +) +Database["Mo"] = AtType( + "Mo", + 2.728100, + 2.723710, + 29.354065, + 29.354065, + 8.393531, + 4.476550, + 0.708787, + 1.120373, + 0.137640, + 0.275280, + -3.692913, + -0.178812, + 0.380450, + -3.133650, + -3.71, + 0.00, + 0.875874, + 0.776222, + 0.790879, + -3.712093, + 42, + 95.94, + 0.776222, + 4.476550, + 0.275280, + 0.85, + 1.15, +) +Database["Ta"] = AtType( + "Ta", + 2.860082, + 3.086341, + 33.787168, + 33.787168, + 8.489528, + 4.527748, + 0.611679, + 1.032101, + 0.176977, + 0.353954, + -5.103845, + -0.405524, + 1.112997, + -3.585325, + -5.14, + 0.00, + 1.640098, + 0.221375, + 0.848843, + -5.141526, + 73, + 180.9479, + 0.221375, + 4.527748, + 0.353954, + 0.85, + 1.15, +) +Database["W"] = AtType( + "W", + 2.740840, + 3.487340, + 37.234847, + 37.234847, + 8.900114, + 4.746728, + 0.882435, + 1.394592, + 0.139209, + 0.278417, + -4.946281, + -0.148818, + 0.365057, + -4.432406, + -4.96, + 0.00, + 0.661935, + 0.348147, + 0.582714, + -4.961306, + 74, + 183.84, + 0.348147, + 4.746728, + 0.278417, + 0.85, + 1.15, +) +Database["Mg"] = AtType( + "Mg", + 3.196291, + 0.544323, + 7.132600, + 7.132600, + 10.228708, + 5.455311, + 0.137518, + 0.225930, + 0.5, + 1.0, + -0.896473, + -0.044291, + 0.162232, + -0.689950, + -0.90, + 0.00, + 0.122838, + -0.226010, + 0.431425, + -0.899702, + 12, + 24.305, + -0.226010, + 5.455311, + 1.0, + 0.85, + 1.15, +) +Database["Co"] = AtType( + "Co", + 2.505979, + 1.975299, + 27.206789, + 27.206789, + 8.679625, + 4.629134, + 0.421378, + 0.640107, + 0.5, + 1.0, + -2.541799, + -0.219415, + 0.733381, + -1.589003, + -2.56, + 0.00, + 0.705845, + -0.687140, + 0.694608, + -2.559307, + 27, + 58.9332, + -0.687140, + 4.629134, + 1.0, + 0.85, + 1.15, +) +Database["Ti"] = AtType( + "Ti", + 2.933872, + 1.863200, + 25.565138, + 25.565138, + 8.775431, + 4.680230, + 0.373601, + 0.570968, + 0.5, + 1.0, + -3.203773, + -0.198262, + 0.683779, + -2.321732, + -3.22, + 0.00, + 0.608587, + -0.750710, + 0.558572, + -3.219176, + 22, + 47.88, + -0.750710, + 4.680230, + 1.0, + 0.85, + 1.15, +) +Database["Zr"] = AtType( + "Zr", + 3.199978, + 2.230909, + 30.879991, + 30.879991, + 8.559190, + 4.564902, + 0.424667, + 0.640054, + 0.5, + 1.0, + -4.485793, + -0.293129, + 0.990148, + -3.202516, + -4.51, + 0.00, + 0.928602, + -0.981870, + 0.597133, + -4.509025, + 40, + 91.224, + -0.981870, + 4.564902, + 1.0, + 0.85, + 1.15, +) +Database["Cr"] = AtType( + "Cr", + 2.493879, +1.793835, +17.641302, +19.60545, +8.604593, +7.170494, +1.551848, +1.827556, +0.18533, +0.277995, +-2.022754, +0.039608, +-0.183611, +-2.245972, +-2.02, +0.00, +-0.056517, +0.439144, +0.456, +-2.020038, +24, +51.9961, +0.439144, +7.170494, +0.277995, +0.85, +1.15 +) diff --git a/tools/eam_database/test/EAM.input b/tools/eam_database/test/EAM.input new file mode 100644 index 0000000000..4e16d7df69 --- /dev/null +++ b/tools/eam_database/test/EAM.input @@ -0,0 +1,9 @@ + &funccard + atomtype='@ELEM1@' + &end + &funccard + atomtype='@ELEM2@' + &end + &funccard + &end + diff --git a/tools/eam_database/test/EAM_code b/tools/eam_database/test/EAM_code new file mode 120000 index 0000000000..8c67aeaca3 --- /dev/null +++ b/tools/eam_database/test/EAM_code @@ -0,0 +1 @@ +../EAM_code \ No newline at end of file diff --git a/tools/eam_database/test/README b/tools/eam_database/test/README new file mode 100644 index 0000000000..4812f7526f --- /dev/null +++ b/tools/eam_database/test/README @@ -0,0 +1,2 @@ +This directory contains a systematic regression test for eam parameters +comparing the old Zhou's FORTRAN version with the new Python script. diff --git a/tools/eam_database/test/create_eam.py b/tools/eam_database/test/create_eam.py new file mode 120000 index 0000000000..610cdcbb77 --- /dev/null +++ b/tools/eam_database/test/create_eam.py @@ -0,0 +1 @@ +../create_eam.py \ No newline at end of file diff --git a/tools/eam_database/test/create_lattice.lmp b/tools/eam_database/test/create_lattice.lmp new file mode 100644 index 0000000000..78591a9145 --- /dev/null +++ b/tools/eam_database/test/create_lattice.lmp @@ -0,0 +1,20 @@ +# Creates an "NaCl like" structure in data.lmp file +# Assigns a type 2 to the second atom of a bcc lattice +# replicate the box in every direction 5x5x5=250 atoms +units metal +boundary p p p +atom_style atomic + +lattice bcc 5.4 +region Myreg block 0 1 0 1 0 1 units lattice + +create_box 2 Myreg +create_atoms 1 box + +set atom 2 type 2 + +mass * 1. + +replicate 5 5 5 + +write_data data.lmp diff --git a/tools/eam_database/test/data.lmp b/tools/eam_database/test/data.lmp new file mode 100644 index 0000000000..ee8d7530c8 --- /dev/null +++ b/tools/eam_database/test/data.lmp @@ -0,0 +1,519 @@ +LAMMPS data file via write_data, version 7 Jan 2022, timestep = 0 + +250 atoms +2 atom types + +0 27 xlo xhi +0 27 ylo yhi +0 27 zlo zhi + +Masses + +1 1 +2 1 + +Atoms # atomic + +1 1 0 0 0 0 0 0 +2 2 2.7 2.7 2.7 0 0 0 +51 1 0 0 5.4 0 0 0 +52 2 2.7 2.7 8.100000000000001 0 0 0 +101 1 0 0 10.8 0 0 0 +102 2 2.7 2.7 13.5 0 0 0 +151 1 0 0 16.200000000000003 0 0 0 +152 2 2.7 2.7 18.900000000000002 0 0 0 +201 1 0 0 21.6 0 0 0 +202 2 2.7 2.7 24.3 0 0 0 +11 1 0 5.4 0 0 0 0 +12 2 2.7 8.100000000000001 2.7 0 0 0 +61 1 0 5.4 5.4 0 0 0 +62 2 2.7 8.100000000000001 8.100000000000001 0 0 0 +111 1 0 5.4 10.8 0 0 0 +112 2 2.7 8.100000000000001 13.5 0 0 0 +161 1 0 5.4 16.200000000000003 0 0 0 +162 2 2.7 8.100000000000001 18.900000000000002 0 0 0 +211 1 0 5.4 21.6 0 0 0 +212 2 2.7 8.100000000000001 24.3 0 0 0 +21 1 0 10.8 0 0 0 0 +22 2 2.7 13.5 2.7 0 0 0 +71 1 0 10.8 5.4 0 0 0 +72 2 2.7 13.5 8.100000000000001 0 0 0 +121 1 0 10.8 10.8 0 0 0 +122 2 2.7 13.5 13.5 0 0 0 +171 1 0 10.8 16.200000000000003 0 0 0 +172 2 2.7 13.5 18.900000000000002 0 0 0 +221 1 0 10.8 21.6 0 0 0 +222 2 2.7 13.5 24.3 0 0 0 +31 1 0 16.200000000000003 0 0 0 0 +32 2 2.7 18.900000000000002 2.7 0 0 0 +81 1 0 16.200000000000003 5.4 0 0 0 +82 2 2.7 18.900000000000002 8.100000000000001 0 0 0 +131 1 0 16.200000000000003 10.8 0 0 0 +132 2 2.7 18.900000000000002 13.5 0 0 0 +181 1 0 16.200000000000003 16.200000000000003 0 0 0 +182 2 2.7 18.900000000000002 18.900000000000002 0 0 0 +231 1 0 16.200000000000003 21.6 0 0 0 +232 2 2.7 18.900000000000002 24.3 0 0 0 +41 1 0 21.6 0 0 0 0 +42 2 2.7 24.3 2.7 0 0 0 +91 1 0 21.6 5.4 0 0 0 +92 2 2.7 24.3 8.100000000000001 0 0 0 +141 1 0 21.6 10.8 0 0 0 +142 2 2.7 24.3 13.5 0 0 0 +191 1 0 21.6 16.200000000000003 0 0 0 +192 2 2.7 24.3 18.900000000000002 0 0 0 +241 1 0 21.6 21.6 0 0 0 +242 2 2.7 24.3 24.3 0 0 0 +3 1 5.4 0 0 0 0 0 +4 2 8.100000000000001 2.7 2.7 0 0 0 +53 1 5.4 0 5.4 0 0 0 +54 2 8.100000000000001 2.7 8.100000000000001 0 0 0 +103 1 5.4 0 10.8 0 0 0 +104 2 8.100000000000001 2.7 13.5 0 0 0 +153 1 5.4 0 16.200000000000003 0 0 0 +154 2 8.100000000000001 2.7 18.900000000000002 0 0 0 +203 1 5.4 0 21.6 0 0 0 +204 2 8.100000000000001 2.7 24.3 0 0 0 +13 1 5.4 5.4 0 0 0 0 +14 2 8.100000000000001 8.100000000000001 2.7 0 0 0 +63 1 5.4 5.4 5.4 0 0 0 +64 2 8.100000000000001 8.100000000000001 8.100000000000001 0 0 0 +113 1 5.4 5.4 10.8 0 0 0 +114 2 8.100000000000001 8.100000000000001 13.5 0 0 0 +163 1 5.4 5.4 16.200000000000003 0 0 0 +164 2 8.100000000000001 8.100000000000001 18.900000000000002 0 0 0 +213 1 5.4 5.4 21.6 0 0 0 +214 2 8.100000000000001 8.100000000000001 24.3 0 0 0 +23 1 5.4 10.8 0 0 0 0 +24 2 8.100000000000001 13.5 2.7 0 0 0 +73 1 5.4 10.8 5.4 0 0 0 +74 2 8.100000000000001 13.5 8.100000000000001 0 0 0 +123 1 5.4 10.8 10.8 0 0 0 +124 2 8.100000000000001 13.5 13.5 0 0 0 +173 1 5.4 10.8 16.200000000000003 0 0 0 +174 2 8.100000000000001 13.5 18.900000000000002 0 0 0 +223 1 5.4 10.8 21.6 0 0 0 +224 2 8.100000000000001 13.5 24.3 0 0 0 +33 1 5.4 16.200000000000003 0 0 0 0 +34 2 8.100000000000001 18.900000000000002 2.7 0 0 0 +83 1 5.4 16.200000000000003 5.4 0 0 0 +84 2 8.100000000000001 18.900000000000002 8.100000000000001 0 0 0 +133 1 5.4 16.200000000000003 10.8 0 0 0 +134 2 8.100000000000001 18.900000000000002 13.5 0 0 0 +183 1 5.4 16.200000000000003 16.200000000000003 0 0 0 +184 2 8.100000000000001 18.900000000000002 18.900000000000002 0 0 0 +233 1 5.4 16.200000000000003 21.6 0 0 0 +234 2 8.100000000000001 18.900000000000002 24.3 0 0 0 +43 1 5.4 21.6 0 0 0 0 +44 2 8.100000000000001 24.3 2.7 0 0 0 +93 1 5.4 21.6 5.4 0 0 0 +94 2 8.100000000000001 24.3 8.100000000000001 0 0 0 +143 1 5.4 21.6 10.8 0 0 0 +144 2 8.100000000000001 24.3 13.5 0 0 0 +193 1 5.4 21.6 16.200000000000003 0 0 0 +194 2 8.100000000000001 24.3 18.900000000000002 0 0 0 +243 1 5.4 21.6 21.6 0 0 0 +244 2 8.100000000000001 24.3 24.3 0 0 0 +5 1 10.8 0 0 0 0 0 +6 2 13.5 2.7 2.7 0 0 0 +55 1 10.8 0 5.4 0 0 0 +56 2 13.5 2.7 8.100000000000001 0 0 0 +105 1 10.8 0 10.8 0 0 0 +106 2 13.5 2.7 13.5 0 0 0 +155 1 10.8 0 16.200000000000003 0 0 0 +156 2 13.5 2.7 18.900000000000002 0 0 0 +205 1 10.8 0 21.6 0 0 0 +206 2 13.5 2.7 24.3 0 0 0 +15 1 10.8 5.4 0 0 0 0 +16 2 13.5 8.100000000000001 2.7 0 0 0 +65 1 10.8 5.4 5.4 0 0 0 +66 2 13.5 8.100000000000001 8.100000000000001 0 0 0 +115 1 10.8 5.4 10.8 0 0 0 +116 2 13.5 8.100000000000001 13.5 0 0 0 +165 1 10.8 5.4 16.200000000000003 0 0 0 +166 2 13.5 8.100000000000001 18.900000000000002 0 0 0 +215 1 10.8 5.4 21.6 0 0 0 +216 2 13.5 8.100000000000001 24.3 0 0 0 +25 1 10.8 10.8 0 0 0 0 +26 2 13.5 13.5 2.7 0 0 0 +75 1 10.8 10.8 5.4 0 0 0 +76 2 13.5 13.5 8.100000000000001 0 0 0 +125 1 10.8 10.8 10.8 0 0 0 +126 2 13.5 13.5 13.5 0 0 0 +175 1 10.8 10.8 16.200000000000003 0 0 0 +176 2 13.5 13.5 18.900000000000002 0 0 0 +225 1 10.8 10.8 21.6 0 0 0 +226 2 13.5 13.5 24.3 0 0 0 +35 1 10.8 16.200000000000003 0 0 0 0 +36 2 13.5 18.900000000000002 2.7 0 0 0 +85 1 10.8 16.200000000000003 5.4 0 0 0 +86 2 13.5 18.900000000000002 8.100000000000001 0 0 0 +135 1 10.8 16.200000000000003 10.8 0 0 0 +136 2 13.5 18.900000000000002 13.5 0 0 0 +185 1 10.8 16.200000000000003 16.200000000000003 0 0 0 +186 2 13.5 18.900000000000002 18.900000000000002 0 0 0 +235 1 10.8 16.200000000000003 21.6 0 0 0 +236 2 13.5 18.900000000000002 24.3 0 0 0 +45 1 10.8 21.6 0 0 0 0 +46 2 13.5 24.3 2.7 0 0 0 +95 1 10.8 21.6 5.4 0 0 0 +96 2 13.5 24.3 8.100000000000001 0 0 0 +145 1 10.8 21.6 10.8 0 0 0 +146 2 13.5 24.3 13.5 0 0 0 +195 1 10.8 21.6 16.200000000000003 0 0 0 +196 2 13.5 24.3 18.900000000000002 0 0 0 +245 1 10.8 21.6 21.6 0 0 0 +246 2 13.5 24.3 24.3 0 0 0 +7 1 16.200000000000003 0 0 0 0 0 +8 2 18.900000000000002 2.7 2.7 0 0 0 +57 1 16.200000000000003 0 5.4 0 0 0 +58 2 18.900000000000002 2.7 8.100000000000001 0 0 0 +107 1 16.200000000000003 0 10.8 0 0 0 +108 2 18.900000000000002 2.7 13.5 0 0 0 +157 1 16.200000000000003 0 16.200000000000003 0 0 0 +158 2 18.900000000000002 2.7 18.900000000000002 0 0 0 +207 1 16.200000000000003 0 21.6 0 0 0 +208 2 18.900000000000002 2.7 24.3 0 0 0 +17 1 16.200000000000003 5.4 0 0 0 0 +18 2 18.900000000000002 8.100000000000001 2.7 0 0 0 +67 1 16.200000000000003 5.4 5.4 0 0 0 +68 2 18.900000000000002 8.100000000000001 8.100000000000001 0 0 0 +117 1 16.200000000000003 5.4 10.8 0 0 0 +118 2 18.900000000000002 8.100000000000001 13.5 0 0 0 +167 1 16.200000000000003 5.4 16.200000000000003 0 0 0 +168 2 18.900000000000002 8.100000000000001 18.900000000000002 0 0 0 +217 1 16.200000000000003 5.4 21.6 0 0 0 +218 2 18.900000000000002 8.100000000000001 24.3 0 0 0 +27 1 16.200000000000003 10.8 0 0 0 0 +28 2 18.900000000000002 13.5 2.7 0 0 0 +77 1 16.200000000000003 10.8 5.4 0 0 0 +78 2 18.900000000000002 13.5 8.100000000000001 0 0 0 +127 1 16.200000000000003 10.8 10.8 0 0 0 +128 2 18.900000000000002 13.5 13.5 0 0 0 +177 1 16.200000000000003 10.8 16.200000000000003 0 0 0 +178 2 18.900000000000002 13.5 18.900000000000002 0 0 0 +227 1 16.200000000000003 10.8 21.6 0 0 0 +228 2 18.900000000000002 13.5 24.3 0 0 0 +37 1 16.200000000000003 16.200000000000003 0 0 0 0 +38 2 18.900000000000002 18.900000000000002 2.7 0 0 0 +87 1 16.200000000000003 16.200000000000003 5.4 0 0 0 +88 2 18.900000000000002 18.900000000000002 8.100000000000001 0 0 0 +137 1 16.200000000000003 16.200000000000003 10.8 0 0 0 +138 2 18.900000000000002 18.900000000000002 13.5 0 0 0 +187 1 16.200000000000003 16.200000000000003 16.200000000000003 0 0 0 +188 2 18.900000000000002 18.900000000000002 18.900000000000002 0 0 0 +237 1 16.200000000000003 16.200000000000003 21.6 0 0 0 +238 2 18.900000000000002 18.900000000000002 24.3 0 0 0 +47 1 16.200000000000003 21.6 0 0 0 0 +48 2 18.900000000000002 24.3 2.7 0 0 0 +97 1 16.200000000000003 21.6 5.4 0 0 0 +98 2 18.900000000000002 24.3 8.100000000000001 0 0 0 +147 1 16.200000000000003 21.6 10.8 0 0 0 +148 2 18.900000000000002 24.3 13.5 0 0 0 +197 1 16.200000000000003 21.6 16.200000000000003 0 0 0 +198 2 18.900000000000002 24.3 18.900000000000002 0 0 0 +247 1 16.200000000000003 21.6 21.6 0 0 0 +248 2 18.900000000000002 24.3 24.3 0 0 0 +9 1 21.6 0 0 0 0 0 +10 2 24.3 2.7 2.7 0 0 0 +59 1 21.6 0 5.4 0 0 0 +60 2 24.3 2.7 8.100000000000001 0 0 0 +109 1 21.6 0 10.8 0 0 0 +110 2 24.3 2.7 13.5 0 0 0 +159 1 21.6 0 16.200000000000003 0 0 0 +160 2 24.3 2.7 18.900000000000002 0 0 0 +209 1 21.6 0 21.6 0 0 0 +210 2 24.3 2.7 24.3 0 0 0 +19 1 21.6 5.4 0 0 0 0 +20 2 24.3 8.100000000000001 2.7 0 0 0 +69 1 21.6 5.4 5.4 0 0 0 +70 2 24.3 8.100000000000001 8.100000000000001 0 0 0 +119 1 21.6 5.4 10.8 0 0 0 +120 2 24.3 8.100000000000001 13.5 0 0 0 +169 1 21.6 5.4 16.200000000000003 0 0 0 +170 2 24.3 8.100000000000001 18.900000000000002 0 0 0 +219 1 21.6 5.4 21.6 0 0 0 +220 2 24.3 8.100000000000001 24.3 0 0 0 +29 1 21.6 10.8 0 0 0 0 +30 2 24.3 13.5 2.7 0 0 0 +79 1 21.6 10.8 5.4 0 0 0 +80 2 24.3 13.5 8.100000000000001 0 0 0 +129 1 21.6 10.8 10.8 0 0 0 +130 2 24.3 13.5 13.5 0 0 0 +179 1 21.6 10.8 16.200000000000003 0 0 0 +180 2 24.3 13.5 18.900000000000002 0 0 0 +229 1 21.6 10.8 21.6 0 0 0 +230 2 24.3 13.5 24.3 0 0 0 +39 1 21.6 16.200000000000003 0 0 0 0 +40 2 24.3 18.900000000000002 2.7 0 0 0 +89 1 21.6 16.200000000000003 5.4 0 0 0 +90 2 24.3 18.900000000000002 8.100000000000001 0 0 0 +139 1 21.6 16.200000000000003 10.8 0 0 0 +140 2 24.3 18.900000000000002 13.5 0 0 0 +189 1 21.6 16.200000000000003 16.200000000000003 0 0 0 +190 2 24.3 18.900000000000002 18.900000000000002 0 0 0 +239 1 21.6 16.200000000000003 21.6 0 0 0 +240 2 24.3 18.900000000000002 24.3 0 0 0 +49 1 21.6 21.6 0 0 0 0 +50 2 24.3 24.3 2.7 0 0 0 +99 1 21.6 21.6 5.4 0 0 0 +100 2 24.3 24.3 8.100000000000001 0 0 0 +149 1 21.6 21.6 10.8 0 0 0 +150 2 24.3 24.3 13.5 0 0 0 +199 1 21.6 21.6 16.200000000000003 0 0 0 +200 2 24.3 24.3 18.900000000000002 0 0 0 +249 1 21.6 21.6 21.6 0 0 0 +250 2 24.3 24.3 24.3 0 0 0 + +Velocities + +1 0 0 0 +2 0 0 0 +51 0 0 0 +52 0 0 0 +101 0 0 0 +102 0 0 0 +151 0 0 0 +152 0 0 0 +201 0 0 0 +202 0 0 0 +11 0 0 0 +12 0 0 0 +61 0 0 0 +62 0 0 0 +111 0 0 0 +112 0 0 0 +161 0 0 0 +162 0 0 0 +211 0 0 0 +212 0 0 0 +21 0 0 0 +22 0 0 0 +71 0 0 0 +72 0 0 0 +121 0 0 0 +122 0 0 0 +171 0 0 0 +172 0 0 0 +221 0 0 0 +222 0 0 0 +31 0 0 0 +32 0 0 0 +81 0 0 0 +82 0 0 0 +131 0 0 0 +132 0 0 0 +181 0 0 0 +182 0 0 0 +231 0 0 0 +232 0 0 0 +41 0 0 0 +42 0 0 0 +91 0 0 0 +92 0 0 0 +141 0 0 0 +142 0 0 0 +191 0 0 0 +192 0 0 0 +241 0 0 0 +242 0 0 0 +3 0 0 0 +4 0 0 0 +53 0 0 0 +54 0 0 0 +103 0 0 0 +104 0 0 0 +153 0 0 0 +154 0 0 0 +203 0 0 0 +204 0 0 0 +13 0 0 0 +14 0 0 0 +63 0 0 0 +64 0 0 0 +113 0 0 0 +114 0 0 0 +163 0 0 0 +164 0 0 0 +213 0 0 0 +214 0 0 0 +23 0 0 0 +24 0 0 0 +73 0 0 0 +74 0 0 0 +123 0 0 0 +124 0 0 0 +173 0 0 0 +174 0 0 0 +223 0 0 0 +224 0 0 0 +33 0 0 0 +34 0 0 0 +83 0 0 0 +84 0 0 0 +133 0 0 0 +134 0 0 0 +183 0 0 0 +184 0 0 0 +233 0 0 0 +234 0 0 0 +43 0 0 0 +44 0 0 0 +93 0 0 0 +94 0 0 0 +143 0 0 0 +144 0 0 0 +193 0 0 0 +194 0 0 0 +243 0 0 0 +244 0 0 0 +5 0 0 0 +6 0 0 0 +55 0 0 0 +56 0 0 0 +105 0 0 0 +106 0 0 0 +155 0 0 0 +156 0 0 0 +205 0 0 0 +206 0 0 0 +15 0 0 0 +16 0 0 0 +65 0 0 0 +66 0 0 0 +115 0 0 0 +116 0 0 0 +165 0 0 0 +166 0 0 0 +215 0 0 0 +216 0 0 0 +25 0 0 0 +26 0 0 0 +75 0 0 0 +76 0 0 0 +125 0 0 0 +126 0 0 0 +175 0 0 0 +176 0 0 0 +225 0 0 0 +226 0 0 0 +35 0 0 0 +36 0 0 0 +85 0 0 0 +86 0 0 0 +135 0 0 0 +136 0 0 0 +185 0 0 0 +186 0 0 0 +235 0 0 0 +236 0 0 0 +45 0 0 0 +46 0 0 0 +95 0 0 0 +96 0 0 0 +145 0 0 0 +146 0 0 0 +195 0 0 0 +196 0 0 0 +245 0 0 0 +246 0 0 0 +7 0 0 0 +8 0 0 0 +57 0 0 0 +58 0 0 0 +107 0 0 0 +108 0 0 0 +157 0 0 0 +158 0 0 0 +207 0 0 0 +208 0 0 0 +17 0 0 0 +18 0 0 0 +67 0 0 0 +68 0 0 0 +117 0 0 0 +118 0 0 0 +167 0 0 0 +168 0 0 0 +217 0 0 0 +218 0 0 0 +27 0 0 0 +28 0 0 0 +77 0 0 0 +78 0 0 0 +127 0 0 0 +128 0 0 0 +177 0 0 0 +178 0 0 0 +227 0 0 0 +228 0 0 0 +37 0 0 0 +38 0 0 0 +87 0 0 0 +88 0 0 0 +137 0 0 0 +138 0 0 0 +187 0 0 0 +188 0 0 0 +237 0 0 0 +238 0 0 0 +47 0 0 0 +48 0 0 0 +97 0 0 0 +98 0 0 0 +147 0 0 0 +148 0 0 0 +197 0 0 0 +198 0 0 0 +247 0 0 0 +248 0 0 0 +9 0 0 0 +10 0 0 0 +59 0 0 0 +60 0 0 0 +109 0 0 0 +110 0 0 0 +159 0 0 0 +160 0 0 0 +209 0 0 0 +210 0 0 0 +19 0 0 0 +20 0 0 0 +69 0 0 0 +70 0 0 0 +119 0 0 0 +120 0 0 0 +169 0 0 0 +170 0 0 0 +219 0 0 0 +220 0 0 0 +29 0 0 0 +30 0 0 0 +79 0 0 0 +80 0 0 0 +129 0 0 0 +130 0 0 0 +179 0 0 0 +180 0 0 0 +229 0 0 0 +230 0 0 0 +39 0 0 0 +40 0 0 0 +89 0 0 0 +90 0 0 0 +139 0 0 0 +140 0 0 0 +189 0 0 0 +190 0 0 0 +239 0 0 0 +240 0 0 0 +49 0 0 0 +50 0 0 0 +99 0 0 0 +100 0 0 0 +149 0 0 0 +150 0 0 0 +199 0 0 0 +200 0 0 0 +249 0 0 0 +250 0 0 0 diff --git a/tools/eam_database/test/eamDatabase.py b/tools/eam_database/test/eamDatabase.py new file mode 120000 index 0000000000..600def02b9 --- /dev/null +++ b/tools/eam_database/test/eamDatabase.py @@ -0,0 +1 @@ +../eamDatabase.py \ No newline at end of file diff --git a/tools/eam_database/test/in.lmp b/tools/eam_database/test/in.lmp new file mode 100644 index 0000000000..d37bba5b09 --- /dev/null +++ b/tools/eam_database/test/in.lmp @@ -0,0 +1,37 @@ +units metal +boundary p p p +atom_style atomic + +read_data data.lmp + +pair_style eam/alloy +pair_coeff * * @FORTRANFILE@ @ELEM1@ @ELEM2@ + +variable etot equal etotal +variable press equal press +thermo_style custom pe etotal press + +run 0 post no + +variable efor equal ${etot} +variable pfor equal ${press} +thermo_style custom pe etotal v_efor press v_pfor + +run 0 post no + +pair_coeff * * @PYTHONFILE@ @ELEM1@ @ELEM2@ + +variable epyt equal ${etot} +variable ppyt equal ${press} +thermo_style custom pe etotal v_epyt press v_ppyt + +run 0 post no + +variable e equal "1 - v_epyt/v_efor" +variable p equal "1 - v_ppyt/v_pfor" +variable de equal v_epyt-v_efor +variable dp equal v_ppyt-v_pfor + +print "Relative energy and pressure error for pair @ELEM1@ @ELEM2@ de = $e; dp = $p" append ../errors.dat +print "Absolute energy and pressure error for pair @ELEM1@ @ELEM2@ de = ${de}; dp = ${dp}" append ../errors.dat + diff --git a/tools/eam_database/test/test.sh b/tools/eam_database/test/test.sh new file mode 100755 index 0000000000..3f098902aa --- /dev/null +++ b/tools/eam_database/test/test.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash + +elements=(Cu Ag Au Ni Pd Pt Al Pb Fe Mo Ta W Mg Co Ti Zr Cr) +LMP=${LMP-../../../src/lmp_serial} + +rm -r tmp +for ((i=0; i< ${#elements[@]}; i=$i+1)) +do + for (( j=$i; j<${#elements[@]}; j=$j+1)) + do + e1=${elements[${i}]} + e2=${elements[${j}]} + echo "e1 = ${e1} e2 = ${e2}" + pythonfile="${e1}${e2}.eam.alloy.python" + fortranfile="${e1}${e2}.eam.alloy.fortran" + mkdir tmp; + cp eamDatabase.py create_eam.py in.lmp data.lmp a.out EAM.input EAM_code tmp/ + cd tmp + sed -i "s/@ELEM1@/${e1}/g" EAM.input + sed -i "s/@ELEM2@/${e2}/g" EAM.input + ./a.out < EAM.input + mv "${e1}${e2}.eam.alloy" ${fortranfile} + python create_eam.py -n ${e1} ${e2} + mv "${e1}${e2}.eam.alloy" ${pythonfile} + sed -i "s/@ELEM1@/${e1}/g" in.lmp + sed -i "s/@ELEM2@/${e2}/g" in.lmp + sed -i "s/@PYTHONFILE@/${pythonfile}/g" in.lmp + sed -i "s/@FORTRANFILE@/${fortranfile}/g" in.lmp + ${LMP} -i in.lmp + cd ../ + rm -r tmp + done +done + diff --git a/unittest/tools/CMakeLists.txt b/unittest/tools/CMakeLists.txt index 5ed9c55b57..bde006a3ab 100644 --- a/unittest/tools/CMakeLists.txt +++ b/unittest/tools/CMakeLists.txt @@ -6,7 +6,7 @@ if(CMAKE_VERSION VERSION_LESS 3.12) set(Python_EXECUTABLE ${PYTHON_EXECUTABLE}) endif() else() - find_package(Python3 COMPONENTS Interpreter) + find_package(Python 3.5 COMPONENTS Interpreter) endif() if(Python_EXECUTABLE)