forked from lijiext/lammps
Recheck existence of pair style in init
This commit is contained in:
parent
350d8f5812
commit
9984cbc99a
|
@ -87,7 +87,7 @@ ComputePressure::ComputePressure(LAMMPS *lmp, int narg, char **arg) :
|
||||||
pstyle = new char[n];
|
pstyle = new char[n];
|
||||||
strcpy(pstyle,arg[iarg++]);
|
strcpy(pstyle,arg[iarg++]);
|
||||||
|
|
||||||
int nsub = 0;
|
nsub = 0;
|
||||||
|
|
||||||
if (narg > iarg) {
|
if (narg > iarg) {
|
||||||
if (isdigit(arg[iarg][0])) {
|
if (isdigit(arg[iarg][0])) {
|
||||||
|
@ -166,6 +166,20 @@ void ComputePressure::init()
|
||||||
temperature = modify->compute[icompute];
|
temperature = modify->compute[icompute];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// recheck if pair style with and without suffix exists
|
||||||
|
|
||||||
|
if (pairhybridflag) {
|
||||||
|
pairhybrid = (Pair *) force->pair_match(pstyle,1,nsub);
|
||||||
|
if (!pairhybrid && lmp->suffix) {
|
||||||
|
strcat(pstyle,"/");
|
||||||
|
strcat(pstyle,lmp->suffix);
|
||||||
|
pairhybrid = (Pair *) force->pair_match(pstyle,1,nsub);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!pairhybrid)
|
||||||
|
error->all(FLERR,"Unrecognized pair style in compute pressure command");
|
||||||
|
}
|
||||||
|
|
||||||
// detect contributions to virial
|
// detect contributions to virial
|
||||||
// vptr points to all virial[6] contributions
|
// vptr points to all virial[6] contributions
|
||||||
|
|
||||||
|
|
|
@ -50,6 +50,7 @@ class ComputePressure : public Compute {
|
||||||
|
|
||||||
private:
|
private:
|
||||||
char *pstyle;
|
char *pstyle;
|
||||||
|
int nsub;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue