add and use Neighbor::modify_params() convenience function

This commit is contained in:
Axel Kohlmeyer
2021-04-13 14:53:03 -04:00
parent 208d9f1fce
commit 3b2c0871cc
6 changed files with 21 additions and 35 deletions

View File

@ -2356,6 +2356,22 @@ void Neighbor::modify_params(int narg, char **arg)
}
}
/* ----------------------------------------------------------------------
convenience function to allow modifying parameters from a single string
------------------------------------------------------------------------- */
void Neighbor::modify_params(const std::string &modcmd)
{
auto args = utils::split_words(modcmd);
char **newarg = new char*[args.size()];
int i=0;
for (const auto &arg : args) {
newarg[i++] = (char *)arg.c_str();
}
modify_params(args.size(),newarg);
delete[] newarg;
}
/* ----------------------------------------------------------------------
remove the first group-group exclusion matching group1, group2
------------------------------------------------------------------------- */