Awk scripts


There are several awk scripts available in the potfit/util/old/awk folder. Most of them are no longer maintained, however, they might still be useful.

To install them to your ${HOME}/bin/share folder, run:

make awkscripts

Note: This command has to be run in the /util/old directory and not in the /util/old/awk directory!

add_type.awk

add_type adds potentials for another atom type to an existing EAM potential.

Usage:

add_type.awk orig_eam.pt add_eam.pt cross_pair1.pt ...

add_type.awk needs the following arguments:

orig_eam.pt - original EAM potential for n atom types.
add_eam.pt - EAM potential for additional atom type (3 columns).
cross_pair*.pt - old-new pair interaction potential, each 1 column. (1 file for each original atom type, n in total).

The potentials are rearranged in the proper order. The resulting potential is written to standard output.

combine_eam.awk

combine_eam.awk combines single potentials from separate files into a single potential file.

Usage:

combine_eam.awk potential1.pt potential2.pt ....

where potential1.pt … are files containing a single potential.

Combines all potentials into one single potential file written to standard output. Can be used to combine three potentials to form an EAM potential, but will combine any files containing only a single potential.

genpot.awk

genpot is an interactive AWK script that generates an interpolated representation of an analytic potential with an arbitrary number of parameters.

Usage:

genpot.awk

genpot takes no parameters, however the parameters of the potentials are read from standard input and may of course be supplied through a pipe (one parameter on each line). The sequence of the parameters is as follows:

mindist - Minimal distance in table.
maxdist - Maximal distance in table.
nsamp - Number of sampling points.
type - Potential function to be used (s. below)
params - Space separated list of all parameters.

genpot does not verify or validate any parameter or input value.

Potential functions supported:

 f(r)=0 – Potential which is zero everywhere.
 f(r)=a1*r-12 – Repulsive part of Lennard-Jones potential.
 f(r)=a1*exp(-a2*r) – Exponential decay.
 f(r)=a1*(r-a2)^2 + a3 – Parabola with vertex (a2,a3).

lammpseam2potfit.awk

Converts a LAMMPS pair_style eam/alloy potential file to potfit format.

Usage:

lammpseam2potfit.awk <potential>

<potential> is a LAMMPS eam/alloy potential. Command writes a potfit tabulated EAM potential files (type 3) to standard output. Atom types are sorted alphabetically.

ATTENTION: USE AT YOUR OWN RISK. VERIFY POTENTIALS, e.g. by comparing forces and energies!

In general, the resulting potential will have way too many sampling points to be used in a potfit optimization and needs to be downsampled considerably. However, the main purpose of this utility is to convert a LAMMPS potential (sampling points equidistant in r) to IMD format (sampling points equidistant in r2) by using potfit potentials type 3 as an intermediate stage. A potfit run with opt=0 can be used to convert the potential to IMD format, controlled by the imd_file and imdpotsteps parameters.