moltemplate: ERROR: Expected floating point parameter in input script

Now days I am working on a graphene system. I am simulating a graphene layer
with the pore in spc/e water box through moltemplate.
I am facing this error when I ran my simulation in lammps.
ERROR: Expected floating point parameter in input script or data file
Last command: pair_coeff 5 5 lj/cut/coul/long 0.0684 3.407 #

I am unable to resolve this error. Please help me to understand where I am
doing wrong.

Hi Varsha

It's a good question. Here is the problem:

pair_style lj/cut/coul/long \{rcF\} {rcF}

The problem is that you have combined hybrid pair_coeff command with a
non-hybrid pair_style in the same simulation.

This is easy to do because the moltemplate examples always use hybrid
styles (even if they only use one _style. I'll explain why later.)
Hybrid pair_styles are typically used when you need to combine
multiple pair_styles in the same simulation. However most of the
other LAMMPS examples don't do this. So if you combine one of the
moltemplate examples with excerpts from an example you found
elsewhere, then you are likely to run into this error. Using a
non-hybrid pair_style changes the syntax of all the pair_coeff
commands. (Same goes for bond_coeff, angle_coeff, dihedral_coeff, and
improper_coeff commands.) In your case, it looks like you changed
your pair_style command but did not update all of your pair_coeff
commands accordingly.

I admit, this is confusing.

There are two ways to fix this error:

1) Go back to using a hybrid pair_style again. (just put the "hybrid"
keyword after the _style command)

pair_style hybrid lj/cut/coul/long \{rcF\} {rcF}

If you are going to do this, I suggest you should try to be consistent
and do the same thing with your bond_style, angle_style,
dihedral_style, and improper_style commands. So, in your case, I
suggest you also replace:

bond_style harmonic
bond_coeff 1 450.0 1.0

angle_style harmonic
angle_coeff 1 100.0 109.47


bond_style hybrid harmonic
bond_coeff harmonic 1 450.0 1.0

angle_style hybrid harmonic
angle_coeff harmonic 1 100.0 109.47

I have never detected any performance penalty from using a hybrid
style when you don't need one, and it keeps options open for you later
on (see below).

2) Alternatley, if you don't like having spurious "hybrid" keywords in
your input file, then delete the "_style" name (in your case,
"lj/cut/coul/long"), from all of your "_coeff" commands. In your
case, you would replace these lines:

pair_coeff 5 5 lj/cut/coul/long 0.06844 3.407 # C
pair_coeff 5 1 lj/cut/coul/long 0.1039 3.372 # C-O
pair_coeff 5 2 lj/cut/coul/long 0.0256 2.640 # C-H

with these lines:

pair_coeff 5 5 0.06844 3.407 # C
pair_coeff 5 1 0.1039 3.372 # C-O
pair_coeff 5 2 0.0256 2.640 # C-H

      Here's rationale for using hybrid styles:

Moltemplate examples try to be as general as possible by using hybrid
pair_styles, even if you don't need them yet. All of the force-fields
which are distributed with moltemplate do this as well. This is
because it forces you to use an alternative syntax of the pair_coeff
commands (and bond_coeff, angle_coeff, ... commands). This
alternative syntax will allow you to combine your molecule with other
molecules which use different pair_styles, (and bond_styles, etc...)
later on. Several of the moltemplate examples actually do that (but,
I admit, most don't). If you don't end up doing this, then using a
hybrid pair_style when you don't need it does not slow down the
simulation. I've never detected any slow down at least.

I wonder how many other people were confused about this but were too
timid to ask for help

Hope this helps.


1 Like