Error while trying to read multiple data file

Hi All,

I would like to simulate a GO/solute system. I have four data files that I’m using: three files for the GO layer at different positions (GO_H0, GO_H12, and GO_H24), each with six atom types (1 2 3 4 5 6), and a fourth file for a water and trisodium citrate solution that I created using Moltemplate. The solution contains 908 atom types. I am able to successfully run simulations for both the GO multilayer and solution individually, but when I try to use “read_data append” to read all four files, I encounter the following error message:

“ERROR: All pair coeffs are not set.”

I consulted the LAMMPS documentation and tried adjusting the simulation box by reserving spaces for atoms in the data files during the first read_data command. However, I am still encountering the same error.

Could you please take a look at the input script below and let me know what is wrong with the input script?

Many thanks for your valuable time and comment in advance.

~input script

units real
atom_style full

dimension 3
boundary p p p

bond_style hybrid harmonic
angle_style hybrid harmonic
dihedral_style hybrid multi/harmonic charmm
special_bonds lj 0.0 0.0 0.5 coul 0.0 0.0 0.83333333

read_data GO_H0_converted.lmp extra/atom/types 920 extra/bond/types 10704 extra/angle/types 21624 extra/dihedral/types 50324

pair_style lj/cut/coul/long 9.0 9.0
pair_modify tail yes
kspace_style pppm 1e-8

pair_coeff 1 1 0.0860000 3.3996695
pair_coeff 2 2 0.0860000 3.3996695
pair_coeff 3 3 0.2100000 2.9599219
pair_coeff 4 4 0.2104000 3.0664734
pair_coeff 5 5 0.0000000 0.0000000
pair_coeff 6 6 0.1700000 3.0000123

pair_modify mix arithmetic

read_data GO_H12_converted.lmp add append offset 6 0 0 0 0 shift 0.0 0.0 -12.0# group GO_2

pair_coeff 1 1 0.0860000 3.3996695
pair_coeff 2 2 0.0860000 3.3996695
pair_coeff 3 3 0.2100000 2.9599219
pair_coeff 4 4 0.2104000 3.0664734
pair_coeff 5 5 0.0000000 0.0000000
pair_coeff 6 6 0.1700000 3.0000123

pair_modify mix arithmetic

read_data GO_H24_converted.lmp add append offset 12 0 0 0 0 shift 0.0 0.0 -24.0# group GO_2

pair_coeff 1 1 0.0860000 3.3996695
pair_coeff 2 2 0.0860000 3.3996695
pair_coeff 3 3 0.2100000 2.9599219
pair_coeff 4 4 0.2104000 3.0664734
pair_coeff 5 5 0.0000000 0.0000000
pair_coeff 6 6 0.1700000 3.0000123

pair_modify mix arithmetic

— solution reservoir----

----------------- Init Section -----------------

include “system.in.init”

----------------- Atom Definition Section -----------------

read_data system.data add append offset 18 15486 0 0 0 shift 0.0 0.0 5.0

----------------- Settings Section -----------------

include “system.in.settings”

----------------- Charges Section -----------------

include “system.in.charges”

----------------- Run Section -----------------

thermo_style custom ebond eangle edihed eimp epair evdwl ecoul elong etail pe

run 0

Best regards,

Majid

If your simulation will have 908 atom types, you must also specify coefficients for all 908*907/2 possible pair interactions, or LAMMPS will not start running the simulation. If you know that only a small fraction of those atom types actually exist in your system, it is on you to get rid of the unneeded types in your data files.

Are you sure you are not mixing up the number of atoms, bonds, angles, and dihedrals with the numbers of their types??

You have repeated this same block of six pair_coeffs three times. why?

Dear Prof. Akohlmey and Srtee,

Thank you for your valuable comments. I have made some revisions to the email based on your feedback. Following Srtee’s suggestion, I refined the water+solute structure by eliminating unnecessary atom types, resulting in a system with only 10 atom types. Additionally, I have addressed Dr. Axel’s comment by revising the molecule type numbers and removing the repeated pair_coeffs for the GO layers.

With your feedback and my refined system, I attempted to re-run simulations of the GO/Water+solute system. However, I am still encountering the same error message: “ERROR: All pair coeffs are not set.”

The data file for each GO single layer (I have three of these as GO_H0, GO_H12, GO_H24) consists of

3810 atoms
5162 bonds
10303 angles
24762 dihedrals
0 impropers

6 atom types
5162 bond types
10303 angle types
24762 dihedral types

-1.20000 152.08540000 xlo xhi
-1.61590000 51.8410000 ylo yhi
-30.5700000 60.8300000 zlo zhi
0.0000000 0.0000000 0.0000000 xy xz yz

Masses

1 12.0100000
2 12.0100000
3 16.0000000
4 16.0000000
5 1.0080000
6 16.0000000

Water+solute system consists of

18231 atoms
12187 bonds
6308 angles

10 atom types
8 bond types
13 angle types

-0.0192735 150.997366 xlo xhi
-0.094183 50.035818 ylo yhi
-0.008261 50.052100 zlo zhi

Masses

1 15.999400 # 1
2 12.011000 # 110
3 15.999000 # 111
4 1.008000 # 112
5 1.008000 # 2
6 22.990000 # 351
7 12.011000 # 5
8 15.999000 # 6
9 12.011000 # 760
10 1.008000 # 87

Please also see following the modified input script

# -- Default styles (for solo "SPCE" water) --
 units        real
 atom_style   full
 dimension 3
 boundary p p p


 # ----- GO layers-----

bond_style hybrid harmonic
angle_style hybrid harmonic
dihedral_style hybrid multi/harmonic charmm
special_bonds lj 0.0 0.0 0.5 coul 0.0 0.0 0.83333333

 read_data GO_H0_converted.lmp extra/atom/types 28 extra/bond/types 10323 extra/angle/types 20619 extra/dihedral/types 49524
 read_data GO_H12_converted.lmp add append offset 6 0 0 0 0 shift 0.0 0.0 -12.0 # group GO_2
 read_data GO_H24_converted.lmp add append offset 12 0 0 0 0 shift 0.0 0.0 -24.0 # group GO_2

pair_style lj/cut/coul/long 9.0 9.0
pair_modify tail yes
kspace_style pppm 1e-8

pair_coeff 1 1   0.0860000   3.3996695
pair_coeff 2 2   0.0860000   3.3996695
pair_coeff 3 3   0.2100000   2.9599219
pair_coeff 4 4   0.2104000   3.0664734
pair_coeff 5 5   0.0000000   0.0000000
pair_coeff 6 6   0.1700000   3.0000123

pair_modify mix arithmetic


 # ---- Water+Solute ------


 read_data VMD.lmp add append offset 18 0 0 0 0 shift 0.0 0.0 5.0.0 # group solution

 group ow    type 1
 group cx    type 2
 group ox    type 3
 group hx    type 4
 group hw    type 5
 group na    type 6
 group cy    type 7
 group oy    type 8
 group cz    type 9
 group hz    type 10
 group water type 1 5
 group sol   type 1 2 3 4 5 6 7 8 9 10


 bond_style   harmonic
 angle_style  harmonic
 pair_style lj/cut/coul/long 11.0 11.0

 pair_coeff   1 1  0.1553  3.166 # OW
 pair_coeff   2 2  0.1050  3.750 # C
 pair_coeff   3 3  0.2100  2.960  # O
 pair_coeff   4 4  0.0300  2.500 # H
 pair_coeff   5 5  0.0000  0.000 # HW
 pair_coeff   6 6  0.0005  4.070 # Na
 pair_coeff   7 7  0.0700  3.550 # C
 pair_coeff   8 8  0.1700  3.070 # O
 pair_coeff   9 9  0.135  3.300 # C
 pair_coeff   10 10  0.0000  0.000 # H
 
 pair_modify  mix arithmetic  
 special_bonds lj/coul 0.0 0.0 0.5
 #kspace_style pppm 0.0001


bond_coeff 1  600.0 1.000 # OW-HW
bond_coeff 2  469.0 1.400 # 2 C-O
bond_coeff 3  450.0 1.279 # 3 C-C
bond_coeff 4  450.0 1.279 # 4 C-C
bond_coeff 5  553.0 0.945 # 5 O-H
bond_coeff 6  469.0 1.400 # 6 C-O
bond_coeff 7  450.0 1.279 # 7 C-C
bond_coeff 8  420.0 1.080 # 8 C-H

angle_coeff 7  75.0 109.47 # 7 H-O-H
angle_coeff 1  35.0 113.0 # 1 C-O-H   
angle_coeff 2  40.0 115.0 # 2 C-C-O
angle_coeff 3  40.0 109.5 # 3 C-C-C
angle_coeff 4  35.0 109.5 # 4 C-C-H 
angle_coeff 5  40.0 115.0 # 5 C-C-O
angle_coeff 6  40.0 115.0 # 6 C-C-O
angle_coeff 8  40.0 109.5 # 8 C-C-C
angle_coeff 9  35.0 109.5 # 9 C-C-H 
angle_coeff 10  80.0 126.0 # 10 O-C-O
angle_coeff 11  40.0 115.0 # 11 C-C-O  
angle_coeff 12  40.0 109.5 # 12 C-C-C 
angle_coeff 13  35.0 109.5 # 13 H-C-H


thermo   100
thermo_style    custom step temp etotal press
thermo_modify   norm no flush yes


minimize 1.0e-4 1.0e-6 1000 100000


fix spce_model  water shake 0.0001 20 0 b 1 a 1

thermo_style custom ebond eangle edihed eimp epair evdwl ecoul elong etail pe

run 0

I would greatly appreciate any further guidance you can provide on resolving this issue.

Many thanks for your help

Best,
Majid

You will have to debug your inputs yourself. The error message is pretty straightforward and it should be equally straightforward to resolve this. Using the info coeffs command can be helpful with that.

Personally, I prefer to combine different systems outside of LAMMPS, since the process with restart_data add is rather cumbersome in comparison.

Of course, general debugging advice like “build your input in stages and check each stage” applies and can make this a much more straightforward procedure and issues easier to pinpoint.

I am guessing your initial data file has 6 data types and you are leaving room for 28 more, so you should have 34 in total. You are only defining 6 i-i pair coefficients in your input script. So the error message seems inevitable.

You need to understand exactly what LAMMPS does when it reads in and combines your multiple data files. I recommend writing a script that reads in and combines the data files and then writes out the resulting composite via

write_data combined.lmp nocoeff

and ends there (set "universal’ coefficients like pair_coeff * * 0 0 if you have to). Then you can see for yourself what happens to each of the types from your original file, using the text editor and molecular visualiser of your choice.

(You also seem to still have an impractical number of bond, angle and dihedral types, so unless you understand exactly what LAMMPS is doing here, you are going to run into the exact same problems for bond_coeff and so on.)