update suffix handling to be consistent (also with pending fix pair changes)

This commit is contained in:
Axel Kohlmeyer
2023-01-03 14:16:28 -05:00
parent 73300b080b
commit e48e5ad965
3 changed files with 14 additions and 17 deletions

View File

@ -357,12 +357,14 @@ void FixAdapt::init()
nsub = utils::inumeric(FLERR,cptr+1,false,lmp);
}
if (lmp->suffix_enable)
ad->pair = force->pair_match(fmt::format("{}/{}",pstyle,lmp->suffix),1,nsub);
if (lmp->suffix_enable) {
if (lmp->suffix)
ad->pair = force->pair_match(fmt::format("{}/{}",pstyle,lmp->suffix),1,nsub);
if ((ad->pair == nullptr) && lmp->suffix2)
ad->pair = force->pair_match(fmt::format("{}/{}",pstyle,lmp->suffix2),1,nsub);
}
if (ad->pair == nullptr) ad->pair = force->pair_match(pstyle,1,nsub);
if (ad->pair == nullptr)
error->all(FLERR,"Fix adapt pair style does not exist");
if (ad->pair == nullptr) error->all(FLERR,"Fix adapt pair style {} not found", pstyle);
void *ptr = ad->pair->extract(ad->pparam,ad->pdim);
if (ptr == nullptr)