Unverified Commit 0613790b authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

support having the keyword special multiple times after pair in pair_modify

parent ccd395fd
Loading
Loading
Loading
Loading
+10 −5
Original line number Diff line number Diff line
@@ -859,14 +859,17 @@ void PairHybrid::modify_params(int narg, char **arg)
      iarg = 3;
    }

    // if 2nd keyword (after pair) is special:
    // invoke modify_special() for the sub-style
    // keywords "special" and "compute/tally" have to be listed directly
    // after "pair" but can be given multiple times

again:

    if (iarg < narg && strcmp(arg[iarg],"special") == 0) {
      if (narg < iarg+5)
        error->all(FLERR,"Illegal pair_modify special command");
      modify_special(m,narg-iarg,&arg[iarg+1]);
      iarg += 5;
      goto again;
    }

    // if 2nd keyword (after pair) is compute/tally:
@@ -881,11 +884,13 @@ void PairHybrid::modify_params(int narg, char **arg)
        compute_tally[m] = 0;
      } else error->all(FLERR,"Illegal pair_modify compute/tally command");
      iarg += 2;
      goto again;
    }

    // apply the remaining keywords to the base pair style itself and the
    // sub-style except for "pair" and "special".
    // the former is important for some keywords like "tail" or "compute"
    // apply the remaining keywords to the base pair style itself and
    // the sub-style except for "pair" and "special" or "compute/tally"
    // and their arguments. the former is important for some keywords
    // like "tail" or "compute"

    if (narg-iarg > 0) {
      Pair::modify_params(narg-iarg,&arg[iarg]);