[lammps-users] lj/cut/tip4p/long q error

Dear all,

I’m very new to lammps and I’m trying to run a water simulation. Unfortunately, I’m having a hard time with the pair style lj/cut/tip4p/long : I get the following error message:

ERROR: Pair style lj/cut/tip4p/long requires atom attribute q (…/pair_lj_cut_tip4p_long.cpp:470)
Last command: minimize 1.0e-6 1.0e-7 10000 10000

Is the q refering to the qdist argument? Because if I’m not wrong, there is a qdist argument already… If not, I don’t know what to rectify or what’s missing…

Here is my code:

What units do we want to use for the calculation?

units real
atom_style atomic

Set the calculatino to be in a periodic box in all 3 dimensions

But in the x direction vary the box length as necessary

boundary p p p

Read in the positions and the box size from the file data.nt

read_data water_data.nt

How do we treat the atoms?

pair_style lj/cut/tip4p/long 1 2 7 8 0.15 12.0 10.0
pair_coeff 1 2 100.0 3.0
pair_coeff 1 1 100.0 3.5 9.0

1/Minimize the structure

fix 1 all box/relax iso 0.0 vmax 0.001
dump mins all xyz 1 dump-min.xyz
dump_modify mins element 1 2
neigh_modify every 1 delay 0 check yes
minimize 1.0e-6 1.0e-7 10000 10000
undump mins

#2/Set the thermostat and temperature of the calculation
#fix 2 all nvt temp 100.0 100.0 0.01
fix 2 all npt temp 100.0 100.0 0.01 z 0. 0. 1000.
thermo 500
thermo_style custom step time etotal temp press lx ly lz

Set the time step to 1 femtosecond

timestep 0.001 # in ps

Get the system into equilibrium

#log log.equib
dump equib all xyz 100 dump-eq.xyz
dump_modify equib element 1
dump_modify equib element 2
run 10000
undump equib


The cause for the error is your choice of atom style.
The atom style determines which per-atom properties are available.
With atom style atomic, there are only positions, velocities, forces and atom ids.
To model TIP4P water you also need to have charges, bonds and angles, which means you need to use atom style full.
Mind you, the choice of atom style also affects how the data file has to be formatted.
For more information, please have a closer look at the documentation of the atom_style and read_data commands in the LAMMPS manual.