support having the keyword special multiple times after pair in pair_modify
This commit is contained in:
@ -859,14 +859,17 @@ void PairHybrid::modify_params(int narg, char **arg)
|
|||||||
iarg = 3;
|
iarg = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if 2nd keyword (after pair) is special:
|
// keywords "special" and "compute/tally" have to be listed directly
|
||||||
// invoke modify_special() for the sub-style
|
// after "pair" but can be given multiple times
|
||||||
|
|
||||||
|
again:
|
||||||
|
|
||||||
if (iarg < narg && strcmp(arg[iarg],"special") == 0) {
|
if (iarg < narg && strcmp(arg[iarg],"special") == 0) {
|
||||||
if (narg < iarg+5)
|
if (narg < iarg+5)
|
||||||
error->all(FLERR,"Illegal pair_modify special command");
|
error->all(FLERR,"Illegal pair_modify special command");
|
||||||
modify_special(m,narg-iarg,&arg[iarg+1]);
|
modify_special(m,narg-iarg,&arg[iarg+1]);
|
||||||
iarg += 5;
|
iarg += 5;
|
||||||
|
goto again;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if 2nd keyword (after pair) is compute/tally:
|
// if 2nd keyword (after pair) is compute/tally:
|
||||||
@ -881,11 +884,13 @@ void PairHybrid::modify_params(int narg, char **arg)
|
|||||||
compute_tally[m] = 0;
|
compute_tally[m] = 0;
|
||||||
} else error->all(FLERR,"Illegal pair_modify compute/tally command");
|
} else error->all(FLERR,"Illegal pair_modify compute/tally command");
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
|
goto again;
|
||||||
}
|
}
|
||||||
|
|
||||||
// apply the remaining keywords to the base pair style itself and the
|
// apply the remaining keywords to the base pair style itself and
|
||||||
// sub-style except for "pair" and "special".
|
// the sub-style except for "pair" and "special" or "compute/tally"
|
||||||
// the former is important for some keywords like "tail" or "compute"
|
// and their arguments. the former is important for some keywords
|
||||||
|
// like "tail" or "compute"
|
||||||
|
|
||||||
if (narg-iarg > 0) {
|
if (narg-iarg > 0) {
|
||||||
Pair::modify_params(narg-iarg,&arg[iarg]);
|
Pair::modify_params(narg-iarg,&arg[iarg]);
|
||||||
|
|||||||
Reference in New Issue
Block a user