expand pair_only_flag processing to also apply to other suffix handlers

This commit is contained in:
Axel Kohlmeyer
2022-10-31 21:47:40 -04:00
parent e0181e8c46
commit ccea984c4c
8 changed files with 67 additions and 63 deletions

View File

@ -680,7 +680,8 @@ void Atom::create_avec(const std::string &style, int narg, char **arg, int trysu
if (sflag) {
std::string estyle = style + "/";
if (sflag == 1) estyle += lmp->suffix;
else estyle += lmp->suffix2;
else if (sflag == 2) estyle += lmp->suffix2;
else if (sflag == 3) estyle += lmp->non_pair_suffix();
atom_style = utils::strdup(estyle);
} else {
atom_style = utils::strdup(style);
@ -704,9 +705,9 @@ void Atom::create_avec(const std::string &style, int narg, char **arg, int trysu
AtomVec *Atom::new_avec(const std::string &style, int trysuffix, int &sflag)
{
if (trysuffix && lmp->suffix_enable) {
if (lmp->suffix) {
sflag = 1;
std::string estyle = style + "/" + lmp->suffix;
if (lmp->non_pair_suffix()) {
sflag = 1 + 2*lmp->pair_only_flag;
std::string estyle = style + "/" + lmp->non_pair_suffix();
if (avec_map->find(estyle) != avec_map->end()) {
AtomVecCreator &avec_creator = (*avec_map)[estyle];
return avec_creator(lmp);