Adding potential files to the pre-built ubuntu package

Dear LAMMPS users,

I have installed the pre-built ubuntu package of LAMMPS by Anton Gladky on ubuntu 18.04. Now, is it possible to add the potential files such as AIREBO to the LAMMPS executable (lmp_daily in this case) from a tar file? How?

Kind regards,


Hi Ehsan
     If you are using a precompiled version of LAMMPS (such as the
ubuntu package, or a conda package) then you will not be able to add
your own custom pair_styles, bond_styles, angle_styles,
dihedral_styles, improper_styles, or fixes. Adding your own code to
LAMMPS requires recompiling LAMMPS. But this does not sound like what
you wanted.
     If you want to add new files which contain force field parameters
for the existing pair_styles (and bond_styles, angle_styles, etc...)
already supported by LAMMPS (such as an .airebo file), then the answer
is (almost certainly) yes. In the particular case of the AIREBO
potential, you actually specify the .airebo file that you want to use
as one of the arguments to that command:

pair_coeff * * CH.airebo H C

In this case, LAMMPS will (presumably) look for the "CH.airebo" fine
in the current working directory (wherever you are invoking LAMMPS).
See: I think
"pair_style tersoff" and "pair_style sw", and "pair_style table"
behave the same way.

The various molecule-builder tools (some of them are at have their own file formats
for storing force-field parameters as well (eg .LT, .PRM, .FRC, ...),
and you can install these tools and copy their files regardless of how
you installed LAMMPS.

That said, I have personally found it useful to compile LAMMPS because
occasionally my simulations will fail in some way that causes LAMMPS
to print out an unhelpful error message. Inevitably, the problem is
(almost always) my fault. But I have found that compiling the code
with debug flags enabled, and stepping through the code with a
debugger (like gdb) can help me find the problems in my input files
faster than reading the documentation. (And sometimes the problem is
not my fault. LAMMPS does occasionally have bugs, although that seems
to be getting better lately.)



Dear Andrew,

Thanks for your detailed and informative answer. That solved my issue.

Kind regards,