update suffix handling to be consistent (also with pending fix pair changes)
This commit is contained in:
@ -120,7 +120,7 @@ The *pstyle* argument is the name of the pair style. If
|
||||
:doc:`pair_style hybrid or hybrid/overlay <pair_hybrid>` is used,
|
||||
*pstyle* should be a sub-style name. If there are multiple
|
||||
sub-styles using the same pair style, then *pstyle* should be specified
|
||||
as "style:N", where :math:`N` is which instance of the pair style you wish to
|
||||
as "style:N", where *N* is which instance of the pair style you wish to
|
||||
adapt (e.g., the first or second). For example, *pstyle* could be
|
||||
specified as "soft" or "lubricate" or "lj/cut:1" or "lj/cut:2". The
|
||||
*pparam* argument is the name of the parameter to change. This is the
|
||||
|
||||
@ -201,23 +201,18 @@ void ComputeFEP::init()
|
||||
pairflag = 1;
|
||||
Pair *pair = nullptr;
|
||||
if (lmp->suffix_enable) {
|
||||
if (lmp->suffix) {
|
||||
auto pstyle = fmt::format("{}/{}", pert->pstyle, lmp->suffix);
|
||||
pair = force->pair_match(pstyle, 1);
|
||||
}
|
||||
if ((pair == nullptr) && lmp->suffix2) {
|
||||
auto pstyle = fmt::format("{}/{}", pert->pstyle, lmp->suffix2);
|
||||
pair = force->pair_match(pstyle, 1);
|
||||
}
|
||||
if (lmp->suffix)
|
||||
pair = force->pair_match(fmt::format("{}/{}", pert->pstyle, lmp->suffix), 1);
|
||||
if ((pair == nullptr) && lmp->suffix2)
|
||||
pair = force->pair_match(fmt::format("{}/{}", pert->pstyle, lmp->suffix2), 1);
|
||||
}
|
||||
|
||||
if (pair == nullptr) pair = force->pair_match(pert->pstyle, 1);
|
||||
if (pair == nullptr)
|
||||
error->all(FLERR, "compute fep pair style {} does not exist", pert->pstyle);
|
||||
if (pair == nullptr) error->all(FLERR, "Compute fep pair style {} not found", pert->pstyle);
|
||||
|
||||
void *ptr = pair->extract(pert->pparam, pert->pdim);
|
||||
if (ptr == nullptr)
|
||||
error->all(FLERR, "compute fep pair style param {} not supported", pert->pparam);
|
||||
error->all(FLERR, "Compute fep pair style param {} not supported", pert->pparam);
|
||||
|
||||
pert->array = (double **) ptr;
|
||||
|
||||
|
||||
@ -357,12 +357,14 @@ void FixAdapt::init()
|
||||
nsub = utils::inumeric(FLERR,cptr+1,false,lmp);
|
||||
}
|
||||
|
||||
if (lmp->suffix_enable)
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user