Hi guys,
I was trying to run simulation for methane molecules in nanotubes but I had an error message that all pair coeffs were not set in my model.
My data file and input script
a) running error
Reading data file …
orthogonal box = (-19.964 -20.0245 5.03305) to (80.036 79.9755 55.124)
1 by 1 by 1 MPI processor grid
reading atoms …
3700 atoms
scanning bonds …
4 = max bonds/atom
scanning angles …
3 = max angles/atom
scanning dihedrals …
8 = max dihedrals/atom
scanning impropers …
2 = max impropers/atom
reading bonds …
3770 bonds
reading angles …
3480 angles
reading dihedrals …
6870 dihedrals
reading impropers …
1140 impropers
Finding 1-2 1-3 1-4 neighbors …
special bond factors lj: 0 0 0
special bond factors coul: 0 0 0
4 = max # of 1-2 neighbors
6 = max # of 1-3 neighbors
18 = max # of 1-4 neighbors
18 = max # of special neighbors
500 atoms in group cnt
1000 atoms in group ch4
3700 atoms in group all
ERROR: All pair coeffs are not set (…/pair.cpp:228)
b) data file
LAMMPS data file. CGCMM style. atom_style full generated by VMD/TopoTools v1.7 on Tue Nov 28 21:55:27 +0900 2017
3700 atoms
3770 bonds
3480 angles
6870 dihedrals
1140 impropers
7 atom types
1 bond types
2 angle types
1 dihedral types
2 improper types
-19.963999 80.036001 xlo xhi
-20.024500 79.975500 ylo yhi
5.033046 55.123954 zlo zhi
Pair Coeffs
ERROR: All pair coeffs are not set (../pair.cpp:228)
:
7 atom types
I'd like to say I know the reason, but somehow I'm not seeing the
problem either.
Checking pair.cpp line 228:
for (i = 1; i <= atom->ntypes; i++)
if (setflag[i][i] == 0) error->all(FLERR,"All pair coeffs are not set");
Either somehow LAMMPS thinks atom->ntypes is larger than 7, or it got
confused by these lines:
pair_coeff 1 6 0.03 2.5 #1H-C
pair_coeff 2 6 0.03 2.5 #2H-C
pair_coeff 3 6 0.03 2.5 #3H-C
pair_coeff 4 6 0.03 2.5 #4H-C
Curious: Did you place these lines before or after the other
pair_coeff commands in your script?
To help diagnose the problem, try replacing the code above with:
for (i = 1; i <= atom->ntypes; i++) {
fprintf(stderr,"i=%d, ntypes=%d\n");
if (setflag[i][i] == 0) error->all(FLERR,"All pair coeffs are not set");
}
compile LAMMPS, run your code, and let us know what you found.
Andrew
ERROR: All pair coeffs are not set (../pair.cpp:228)
:
7 atom types
I'd like to say I know the reason, but somehow I'm not seeing the
problem either.
Checking pair.cpp line 228:
for (i = 1; i <= atom->ntypes; i++)
if (setflag[i][i] == 0) error->all(FLERR,"All pair coeffs are not set");
Either somehow LAMMPS thinks atom->ntypes is larger than 7, or it got
confused by these lines:
pair_coeff 1 6 0.03 2.5 #1H-C
pair_coeff 2 6 0.03 2.5 #2H-C
pair_coeff 3 6 0.03 2.5 #3H-C
pair_coeff 4 6 0.03 2.5 #4H-C
Curious: Did you place these lines before or after the other
pair_coeff commands in your script?
To help diagnose the problem, try replacing the code above with:
for (i = 1; i <= atom->ntypes; i++) {
fprintf(stderr,"i=%d, ntypes=%d\n");
if (setflag[i][i] == 0) error->all(FLERR,"All pair coeffs are not set");
}
ugh. My apologies. I meant to say:
for (i = 1; i <= atom->ntypes; i++) {
fprintf(stderr,"i=%d, ntypes=%d\n", i, atom->ntypes);
if (setflag[i][i] == 0) error->all(FLERR,"All pair coeffs are not set");
}