Newbie: very much confused setting up the nonbond interactions. Please help!

Dear lammps users,

While writing my first input file, I’ve got stuck at the nonbond interactions.

I have the following atom-based Lennard-Jonnes parameters:

#atom-id epsilon sigma
1 0.0389999952 3.6170487995 # cp
2 0.0380000011 2.4499714540 # h
3 0.0389999952 3.8754094636 # c1
4 0.0389999952 3.8754094636 # c3
5 0.0389999952 3.8754094636 # c2

What is the correct header within a data file in order to pass this information? All I see in the documentation are pair coefficients commands, not single-atom based commands.

In the input file, I have written:

nonbond_style lj/cutoff 12.0 0
mixing_style geometric

And I get this error:

lammps_openmpi -in
ERROR: Unknown command: nonbond_style lj/cutoff 12.0 0 (…/input.cpp:229)

but nonbond_style is a command of lammps, so I am thoroughly confused.Well, I am stuck, any help is greatly appreciated.

Here’s the whole file
units real
dimension 3
boundary p p p
atom_style full
bond_style harmonic
angle_style harmonic
dihedral_style harmonic
improper_style cvff
nonbond_style lj/cutoff 12.0 0
mixing_style geometric
coulomb_style pppm 12.0 1.0E-4
neighbor 2.0 bin
reset_timestep 0
min_style cg
thermo 100
restart 100 minimized.rst


Dear Jose,

nonbond_style is not a LAMMPS command. It looks like it may have been in a much older version.

To specify these interactions, you need a pair_style and pair_coeff commands. pair_style selects the functional form of the interactions (Lennard Jones, for example), and pair_coeff specifies the necessary coefficients. Geometric mixing can be enabled with pair_modify.

A list of available pair styles is available here: Niall

Hi Niall,

Thanks for the tips and for pointing out this webpage manual.

If I understand correctly, I must specify pair_coeffs for interactions between atoms of the same type, and then issue a pair_modify mix to let lammps automatically generate pair_coeff for interactions between atoms of different pairs:

pair_coeff 1 1 …
pair_coeff 2 2 …

pair_coeff N N …

pair_modify mix geometry

Does this summ it up?

That’s right (though it’s actually pair_modify mix geometric).