LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Mailing List Archives
Re: [lammps-users] Methan molecule simulation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lammps-users] Methan molecule simulation


From: Andrew Jewett <jewett@...1937...>
Date: Tue, 28 Nov 2017 18:16:13 -0800

On Tue, Nov 28, 2017 at 4:17 PM, Kim, Changjae <cjkim@...1803...> wrote:
> 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

> 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
>
> #
>
> # 1  1H1
>
> # 2  2H1
>
> # 3  3H1
>
> # 4  4H1
>
> # 5  B
>
> # 6  C1
>
> # 7  N
>
>
>
> # Bond Coeffs
>
> #
>
> # 1  1
>
>
>
> # Angle Coeffs
>
> #
>
> # 1  1
>
> # 2  2
>
>
>
> # Dihedral Coeffs
>
> #
>
> # 1  1
>
>
>
> # Improper Coeffs
>
> #
>
> # 1  1
>
> # 2  2
>
>
>
> c) input script
>
> #-
>
> #------------------------ INITIALIZATION ----------------------------
>
>
>
> units real
>
> dimension 3
>
> boundary p p p
>
> atom_style full
>
>
>
> #------------------------ CONFIGURATION ----------------------------
>
>
>
> read_data       case1.data
>
>
>
> # ------------------------ FORCE FIELD ------------------------------
>
>
>
> # interaction styles
>
> pair_style lj/cut/coul/cut 12.0
>
> bond_style harmonic
>
> angle_style harmonic
>
>
>
> pair_coeff 1 1 0.00 0.00 #1H
>
> pair_coeff 2 2 0.00 0.00 #2H
>
> pair_coeff 3 3 0.00 0.00 #3H
>
> pair_coeff 4 4 0.00 0.00 #4H
>
> pair_coeff 5 5 0.102 3.188 #B
>
> pair_coeff 6 6 0.086 3.4 #C1
>
> pair_coeff 7 7 0.102 3.188 #N
>
>
>
> 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
>
>
>
> bond_coeff 5 340 1.09
>
>
>
> angle_coeff 5 33 107.8
>
>
>
> If you have experienced or solved this problem, please give me your own
> solution or share your experience.
>
> Thanks
>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> lammps-users mailing list
> lammps-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/lammps-users
>