fix addforce, keyword every crashes

Hi,

I'm trying to add a force to a system using the fix addforce.

If i type this:

fix 1 all addforce 1.0 0.0 0.0

it works. However, if i type this:

fix 1 all addforce 1.0 0.0 0.0 every 1

it crashes with the message:

ERROR: Illegal fix addforce command (../fix_addforce.cpp:101)

I understand that if the keyword every is used, the default for every is 1. So both commands are equivalent, yet one does not work (i actually want to increase every).

I'm using LAMMPS version 11 Jul 2014.

Thanks
Miguel

Hi,

I'm trying to add a force to a system using the fix addforce.

If i type this:

fix 1 all addforce 1.0 0.0 0.0

it works. However, if i type this:

fix 1 all addforce 1.0 0.0 0.0 every 1

it crashes with the message:

ERROR: Illegal fix addforce command (../fix_addforce.cpp:101)

I understand that if the keyword every is used, the default for every is 1. So both commands are equivalent, yet one does not work (i actually want to increase every).

I'm using LAMMPS version 11 Jul 2014.

there is the problem. the online docs always represent the very
latest version. if you look into the docs that came with your version
you will find that it doesn't exist there (it is the default and could
not be modified).

git annotate shows that the code to recognize this flag was
added/modified only a week ago:

cbdd9523 src/fix_add_force.cpp (sjplimp 2009-08-08 21:52:23 +0000 85)
  int iarg = 6;
cbdd9523 src/fix_add_force.cpp (sjplimp 2009-08-08 21:52:23 +0000 86)
  while (iarg < narg) {
f6c0d4fe src/fix_addforce.cpp (sjplimp 2014-09-05 14:39:17 +0000 87)
    if (strcmp(arg[iarg],"every") == 0) {
f6c0d4fe src/fix_addforce.cpp (sjplimp 2014-09-05 14:39:17 +0000 88)
      if (iarg+2 > narg) error->all(FLERR,"Illegal fix addforce
command");
f6c0d4fe src/fix_addforce.cpp (sjplimp 2014-09-05 14:39:17 +0000 89)
      nevery = atoi(arg[iarg+1]);
f6c0d4fe src/fix_addforce.cpp (sjplimp 2014-09-05 14:39:17 +0000 90)
      if (nevery <= 0) error->all(FLERR,"Illegal fix addforce
command");
f6c0d4fe src/fix_addforce.cpp (sjplimp 2014-09-05 14:39:17 +0000 91)
      iarg += 2;
f6c0d4fe src/fix_addforce.cpp (sjplimp 2014-09-05 14:39:17 +0000 92)
    } else if (strcmp(arg[iarg],"region") == 0) {
19e8c92a src/fix_addforce.cpp (sjplimp 2011-09-23 18:06:55 +0000 93)
      if (iarg+2 > narg) error->all(FLERR,"Illegal fix addforce
command");
cbdd9523 src/fix_add_force.cpp (sjplimp 2009-08-08 21:52:23 +0000 94)
      iregion = domain->find_region(arg[iarg+1]);
5ff00cfd src/fix_addforce.cpp (sjplimp 2010-08-19 16:01:08 +0000 95)
      if (iregion == -1)
ef9e7005 src/fix_addforce.cpp (sjplimp 2012-06-06 22:47:51 +0000 96)
        error->all(FLERR,"Region ID for fix addforce does not exist");
5ff00cfd src/fix_addforce.cpp (sjplimp 2010-08-19 16:01:08 +0000 97)
      int n = strlen(arg[iarg+1]) + 1;
5ff00cfd src/fix_addforce.cpp (sjplimp 2010-08-19 16:01:08 +0000 98)
      idregion = new char[n];
5ff00cfd src/fix_addforce.cpp (sjplimp 2010-08-19 16:01:08 +0000 99)
      strcpy(idregion,arg[iarg+1]);
cbdd9523 src/fix_add_force.cpp (sjplimp 2009-08-08 21:52:23 +0000 100)
      iarg += 2;