LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Mailing List Archives
[lammps-users] moltemplate: ERROR: Expected floating point parameter in input script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lammps-users] moltemplate: ERROR: Expected floating point parameter in input script


From: Andrew Jewett <jewett@...1937...>
Date: Mon, 6 Nov 2017 20:41:13 -0800

On Thu, Nov 2, 2017 at 5:49 AM, R. Varsha <varsharani.0909@...24...> wrote:
> 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
> (../pair_lj_cut_coul_long.cpp:630)
> Last command: pair_coeff      5 5  lj/cut/coul/long  0.0684   3.407        #
> C
>
> 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

    ...with:

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.

Andrew





> My input script is as follows-
> units           real
> dimension    3
> boundary     p p p
> atom_style     full
> #atom_modify    map array
> neigh_modify    delay 0 every 1 check yes
> processors     * * *
>
> variable timecoef equal 1.00
> variable T equal 300
> variable thermo_itv equal 50
> variable seed equal 2012
>
> # atom definition:
> read_data     graphene.data
>
> ###############################################
> # group definition:
> group           oxygen type 1
> group           hydrogens type 2
> group           fluidmols type 1 2
> group           potassium type 3
> group           chloride type 4
> group           ions type 3 4
> group           graphene type 5
> group           solutions type 1 2 3 4 5
> #################################################
> # force fields
> variable        rcF equal 12.0
> pair_style      lj/cut/coul/long  ${rcF} ${rcF}
>                       #epsi     #sig
> pair_coeff      1 1  0.15539   3.1656       # O
> pair_coeff      2 2  0.0       0.0          # H
> pair_coeff      3 3  0.43      2.84         # K
> pair_coeff      4 4  0.0128    4.83         # Cl
> #----------Graphene-Water interaction------------------
> 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
>
> pair_modify    mix arithmetic
> ############################################
> kspace_style    pppm 1e-05
> dielectric      1.0
> bond_style      harmonic
> bond_coeff      1 450.0 1.0
>
> angle_style     harmonic
> angle_coeff     1 100.0 109.47
> print "Angle"
>
> # minimization
> min_style       sd
> minimize        1.0e-4 1.0e-5 1000 10000
> print "Min"
> ###############################################3
> reset_timestep 0
> timestep       ${timecoef}
> compute        fluidtemp solutions temp
> velocity       solutions create ${T} ${seed} dist gaussian temp fluidtemp
> mom yes rot yes units box
> ######################################################################################
> fix   1 fluidmols shake 0.0001 20 0 b 1 a 1
> fix   GD ions flow/gauss 0 0 1 energy yes
> dump  2 ions dcd 1000 ions.dcd
> dump  3 all custom 5000 system.lammpstrj id type x y z
> fix   fxnpt solutions npt temp 300.0 300.0 100.0 iso 1.0 1.0 1000.0
> run   1000000
> ################################################
> fix   fxnvt solutions nvt temp 300 300 100.0
> run   1000000
> #####################################################
> fix   ef all efield 0.0 0.0 0.1    #L=60A 1lammps=V/A*60A=6V
> dump  4 ions dcd 1000 ions2.dcd
> ################################################################################################=
> reset_timestep 0
> thermo ${thermo_itv}
> thermo_style    multi
> restart         1000 extend_01.restart1 extend_01.restart2
> run 15000000
>
>
> Can you please help me out of this.
>
> Thanks
> Varsha