what is wrong with charmm2lammps.pl program

Dear all:

I build tip4p water box using charmm program. Then I used charmm2lammps.pl program to build data file and input file. Checking the data file, I can see that it listed the bond type as 0 when using tip4p rtf and tip4p prm forcefield files in converting. When using the charmm27 forcefield files in combination with tip4p forcefield, it gave me mass for the second and third atom in the data file as 0.0. I know that is not true either. Can I know how to solve my problem? Thanks a lot.

LqZ

The following is the head of the data file built which showed 0 bond types.

500 atoms
500 bonds
125 angles]
0 dihedrals
0 impropers

3 atom types
0 bond types
0 angle types
0 dihedral types
0 improper types

-8.388 8.388 xlo xhi
-7.994 7.984 ylo yhi
-7.774 7.7 zlo zhi

Masses

1 1.008
2 15.9994
3 0

Pair Coeffs

1 0.0498 1.425438 0.0498 1.425438
2 0.1591 2.850876 0.1591 2.850876
3 -0 1.425438 -0 1.425438

Atoms

1 1 2 0 7.631 6.953 -6.863
2 1 3 -1.04 7.631 6.804 -6.844
3 1 1 0.52 8.388 6.372 -6.787
4 1 1 0.52 6.874 6.372 -6.787

2011/12/4 zhanglaura <[email protected]...>:

Dear all:

I build tip4p water box using charmm program. Then I used charmm2lammps.pl
program to build data file and input file. Checking the data file, I can see

that won't work for LAMMPS.

that it listed the bond type as 0 when using tip4p rtf and tip4p prm
forcefield files in converting. When using the charmm27 forcefield files in
combination with tip4p forcefield, it gave me mass for the second and third
atom in the data file as 0.0. I know that is not true either. Can I know
how to solve my problem? Thanks a lot.

you either don't understand the TIP4P water topology or misunderstand
the data file.
CHARMM builds an explicit four-site model, which won't work in LAMMPS.
the conversion is correct, though. however, what you have to do to do TIP4P
in water is to set up a TIP3P (i.e. a 3-site water), adjust the parameters as
needed and then use the special /tip4p potentials (for pair and kspace as
needed) to have the massless M site coordinates properly computed.
please have a look at the corresponding section of the LAMMPS manual:

axel.

Hi, Axel:

Thanks a lot for the help. I built a input file for tip4p water as following:

LJ system with NPT ensemble

units real

atom_style full
kspace_style pppm/tip4p 0.0001
read_data data.water1

timestep 0.1

pair_style lj/cut/coul/long/tip4p 1 2 7 8 0.3 8.0
pair_coeff 1 1 0.16275 3.16435
pair_coeff 1 2 0.0 0.0
pair_coeff 2 2 0.0 0.0
bond_style harmonic
bond_coeff 1 450.0 0.9572
angle_style harmonic
angle_coeff 1 55 104.52

timestep 0.1

dump 1 all atom 10 trajectory.lmptrj
fix 1 all shake 1e-6 50 100 a 1 b 1
fix 2 all nvt temp 300.0 300.0 1.0

thermo_style multi
thermo 100

restart 200 as-298-1.lammps as-298-2.lammps

run 800000

But I got the error as:
PPPM initialization …
ERROR: Bad TIP4P angle type for PPPM/TIP4P

No matter I used angle_style harmonic or charmm (with coeff changed accordingly), it can not work. So what should I do? Thanks a lot.

LqZ

2011/12/4 zhanglaura <[email protected]...>:

Hi, Axel:

Thanks a lot for the help. I built a input file for tip4p water as
following:

# LJ system with NPT ensemble

units real

atom_style full
kspace_style pppm/tip4p 0.0001
read_data data.water1

timestep 0.1

pair_style lj/cut/coul/long/tip4p 1 2 7 8 0.3 8.0
pair_coeff 1 1 0.16275 3.16435
pair_coeff 1 2 0.0 0.0
pair_coeff 2 2 0.0 0.0
bond_style harmonic
bond_coeff 1 450.0 0.9572
angle_style harmonic
angle_coeff 1 55 104.52

timestep 0.1

dump 1 all atom 10 trajectory.lmptrj
fix 1 all shake 1e-6 50 100 a 1 b 1
fix 2 all nvt temp 300.0 300.0 1.0

thermo_style multi
thermo 100

restart 200 as-298-1.lammps as-298-2.lammps

run 800000

But I got the error as:
PPPM initialization ...
ERROR: Bad TIP4P angle type for PPPM/TIP4P

No matter I used angle_style harmonic or charmm (with coeff changed
accordingly), it can not work. So what should I do? Thanks a lot.

the error is about angle *type* not angle *style*.

you didn't read the documentation correctly
and thus your pair style definition is wrong.

re-read the documentation and correct your input.

axel.

Hi, Axel:

Thanks a lot for your help. I figured out how to solve the angle error. With my progress, I found that my new problem was on atom type not found, which is related to the order to otype and htype listed in the data file based on my searching online. I checked my original file (tip3p water data file from charmm) and the new data file from charmm2lammps.pl. I was surprised to see that the order of otype and htype was switched. The original tip3p water data file from charmm is like following:

1 1 TIP3 OH2 -31.04245 -30.65189 -31.04309 BOX 1 0.00000
2 1 TIP3 H1 -30.28342 -31.23963 -31.04309 BOX 1 0.00000
3 1 TIP3 H2 -31.80151 -31.23962 -31.04309 BOX 1 0.00000
4 2 TIP3 OH2 -27.93813 -30.65183 -31.04309 BOX 2 0.00000
5 2 TIP3 H1 -27.17910 -31.23957 -31.04309 BOX 2 0.00000
6 2 TIP3 H2 -28.69719 -31.23956 -31.04309 BOX 2 0.00000

Then in the new data file from charmm2lammps.pl, it has following:


Masses

1 1.008
2 15.9994

Pair Coeffs

1 0.046 0.4000135 0.046 0.4000135
2 0.1521 3.150574 0.1521 3.150574

Atoms

1 1 2 -0.834 -13.339 -14.101 -15.701
2 1 1 0.417 -12.67 -14.677 -16.098
3 1 1 0.417 -14.141 -14.388 -16.161
4 2 2 -0.834 -9.29 -12.943 -13.637
5 2 1 0.417 -8.34 -12.702 -13.502
6 2 1 0.417 -9.173 -13.712 -14.206

Is there any way to let the charmm2lammps.pl to output O as atom type 1 while H as atom type 2? Thank you very much.

LqZ

2011/12/5 zhanglaura <[email protected]...>:

Hi, Axel:

Thanks a lot for your help. I figured out how to solve the angle error. With
my progress, I found that my new problem was on atom type not found, which
is related to the order to otype and htype listed in the data file based on
my searching online. I checked my original file (tip3p water data file from
charmm) and the new data file from charmm2lammps.pl. I was surprised to see
that the order of otype and htype was switched. The original tip3p water
data file from charmm is like following:

1    1 TIP3 OH2  \-31\.04245 \-30\.65189 \-31\.04309 BOX  1      0\.00000
2    1 TIP3 H1   \-30\.28342 \-31\.23963 \-31\.04309 BOX  1      0\.00000
3    1 TIP3 H2   \-31\.80151 \-31\.23962 \-31\.04309 BOX  1      0\.00000
4    2 TIP3 OH2  \-27\.93813 \-30\.65183 \-31\.04309 BOX  2      0\.00000
5    2 TIP3 H1   \-27\.17910 \-31\.23957 \-31\.04309 BOX  2      0\.00000
6    2 TIP3 H2   \-28\.69719 \-31\.23956 \-31\.04309 BOX  2      0\.00000

Then in the new data file from charmm2lammps.pl, it has following:

......

Masses

   1      1\.008
   2    15\.9994

Pair Coeffs

   1      0\.046  0\.4000135      0\.046  0\.4000135
   2     0\.1521   3\.150574     0\.1521   3\.150574

Atoms

   1       1     2    \-0\.834     \-13\.339     \-14\.101     \-15\.701
   2       1     1     0\.417      \-12\.67     \-14\.677     \-16\.098
   3       1     1     0\.417     \-14\.141     \-14\.388     \-16\.161
   4       2     2    \-0\.834       \-9\.29     \-12\.943     \-13\.637
   5       2     1     0\.417       \-8\.34     \-12\.702     \-13\.502
   6       2     1     0\.417      \-9\.173     \-13\.712     \-14\.206

Is there any way to let the charmm2lammps.pl to output O as atom type 1
while H as atom type 2? Thank you very much.

why that?
this is not needed; all you need to do
is to adjust your pair style command...

axel

Hi, Axel:

I fixed the potential problem based on your former hint. My current input file is like following:

LJ system with NPT ensemble

units real
atom_style full
kspace_style pppm/tip4p 0.0001
pair_style lj/cut/coul/long/tip4p 1 2 1 1 0.125 0.3 8.0
bond_style harmonic
angle_style harmonic
read_data water.lammps.data

timestep 0.1

pair_coeff 1 1 0.16275 3.16435
pair_coeff 1 2 0.0 0.0
pair_coeff 2 2 0.0 0.0
bond_coeff 1 450.0 0.9572
angle_coeff 1 55 104.52

dump 1 all atom 10 trajectory.lmptrj
fix 1 all shake 1e-6 50 100 a 1 b 1
fix 2 all nvt temp 300.0 300.0 1.0

thermo_style multi
thermo 100

restart 200 as-298-1.lammps as-298-2.lammps

run 800000

I got the error as:

PPPM initialization …
G vector = 0.330885
grid = 20 20 24
stencil order = 5
RMS precision = 6.83088e-05
using double precision FFTs
brick FFT buffer size/proc = 22599 9600 10044
Setting up run …
ERROR on proc 0: TIP4P hydrogen has incorrect atom type (pair_lj_cut_coul_long_tip4p.cpp:484)

Based on my search online, it should relate to the order of Otype and Htype. But the Otype and Htype was switched after using charmm2lammps.pl program. So I am wondering what I should do to switch back the Htype and Otype order. Thanks a lot.

LqZ

2011/12/5 zhanglaura <[email protected]...>:

Hi, Axel:

I fixed the potential problem based on your former hint. My current input
file is like following:

no you didn't fix it. you only fixed the bond and angle part.
the atom type mapping is still not correct.

# LJ system with NPT ensemble

units real
atom_style full
kspace_style pppm/tip4p 0.0001
pair_style lj/cut/coul/long/tip4p 1 2 1 1 0.125 0.3 8.0
bond_style harmonic
angle_style harmonic
read_data water.lammps.data

timestep 0.1

pair_coeff 1 1 0.16275 3.16435
pair_coeff 1 2 0.0 0.0
pair_coeff 2 2 0.0 0.0
bond_coeff 1 450.0 0.9572
angle_coeff 1 55 104.52

dump 1 all atom 10 trajectory.lmptrj
fix 1 all shake 1e-6 50 100 a 1 b 1
fix 2 all nvt temp 300.0 300.0 1.0

thermo_style multi
thermo 100

restart 200 as-298-1.lammps as-298-2.lammps

run 800000

I got the error as:

PPPM initialization ...
G vector = 0.330885
grid = 20 20 24
stencil order = 5
RMS precision = 6.83088e-05
using double precision FFTs
brick FFT buffer size/proc = 22599 9600 10044
Setting up run ...
ERROR on proc 0: TIP4P hydrogen has incorrect atom type
(pair_lj_cut_coul_long_tip4p.cpp:484)

Based on my search online, it should relate to the order of Otype and Htype.
But the Otype and Htype was switched after using charmm2lammps.pl program.
So I am wondering what I should do to switch back the Htype and Otype order.

you don't have to!! just use your brains.
it doesn't matter what atom type charmm2lammps.pl
assigned, but it *does* matter that you list the correct
atom type in your pair style command (which you don't)

axel.