"ERROR: Not all per-type masses are set" whenusing molecule command inserting TIP4P water molecule

Hi, Axel,

Thanks for you reply.

After adding mass command for the extra 2 atom type, the ERROR is solved
but comes another.

   1.

   set kspace_style to ewald will result in “ERROR: KSpace style is
   incompatible with Pair style (../kspace.cpp:201)”
   I guess ewald is conflicted with the TIP4P long water model.

​yes, there is no TIP4P version of the ewald kspace style. that doesn't
mean, you cannot use TIP4P, you would just have to enter it as a 4-site
rigid object ​and use fix rigid/small instead of fix shake (or fix rattle).

   1.

   set kspace_style pppm/tip4p will result in “ERROR: Bad TIP4P angle
   type for PPPM/TIP4P (../pppm.cpp:266)”
   It seems like other pair styles is incompatible to pppm/tip4p

no. your input is bad. your pair style command has:

lj/cut/tip4p/long 9 10 9 16

​i.e. the OH bond type in tip4p is set to 9 and the angle type to 16, but
you have only 5 bond types and 4 angle types.

Besides, if two molecules are dedined in different angle_style (just like
what I did in the script below), can lammps calculate the interaction
between them properly?

​interactions *between* molecules are determined by the pair style. the
angle style only applies to interactions *within* a molecule for the exact
angles that are define​d in the data file.

​axel.​