This commit is contained in:
Axel Kohlmeyer
2021-09-15 16:46:33 -04:00
parent 3caa066c28
commit 36b3ee32a4
5 changed files with 21 additions and 64 deletions

View File

@ -331,15 +331,9 @@ void FixAdapt::init()
nsub = utils::inumeric(FLERR,cptr+1,false,lmp);
}
if (lmp->suffix_enable) {
int len = 2 + strlen(pstyle) + strlen(lmp->suffix);
char *psuffix = new char[len];
strcpy(psuffix,pstyle);
strcat(psuffix,"/");
strcat(psuffix,lmp->suffix);
ad->pair = force->pair_match(psuffix,1,nsub);
delete[] psuffix;
}
if (lmp->suffix_enable)
ad->pair = force->pair_match(fmt::format("{}/{}",pstyle,lmp->suffix),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");
@ -374,15 +368,9 @@ void FixAdapt::init()
anybond = 1;
char *bstyle = utils::strdup(ad->bstyle);
if (lmp->suffix_enable) {
int len = 2 + strlen(bstyle) + strlen(lmp->suffix);
char *bsuffix = new char[len];
strcpy(bsuffix,bstyle);
strcat(bsuffix,"/");
strcat(bsuffix,lmp->suffix);
ad->bond = force->bond_match(bsuffix);
delete [] bsuffix;
}
if (lmp->suffix_enable)
ad->bond = force->bond_match(fmt::format("{}/{}",bstyle,lmp->suffix));
if (ad->bond == nullptr) ad->bond = force->bond_match(bstyle);
if (ad->bond == nullptr )
error->all(FLERR,"Fix adapt bond style does not exist");