git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@7039 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -37,6 +37,7 @@ ComputePair::ComputePair(LAMMPS *lmp, int narg, char **arg) :
|
||||
timeflag = 1;
|
||||
|
||||
int n = strlen(arg[3]) + 1;
|
||||
if (lmp->suffix) n += strlen(lmp->suffix) + 1;
|
||||
pstyle = new char[n];
|
||||
strcpy(pstyle,arg[3]);
|
||||
|
||||
@ -46,8 +47,17 @@ ComputePair::ComputePair(LAMMPS *lmp, int narg, char **arg) :
|
||||
if (strcmp(arg[4],"ecoul") == 0) evalue = ECOUL;
|
||||
} else evalue = EPAIR;
|
||||
|
||||
// check if pair style with and without suffix exists
|
||||
|
||||
pair = force->pair_match(pstyle,1);
|
||||
if (!pair) error->all(FLERR,"Unrecognized pair style in compute pair command");
|
||||
if (!pair && lmp->suffix) {
|
||||
strcat(pstyle,"/");
|
||||
strcat(pstyle,lmp->suffix);
|
||||
pair = force->pair_match(pstyle,1);
|
||||
}
|
||||
|
||||
if (!pair)
|
||||
error->all(FLERR,"Unrecognized pair style in compute pair command");
|
||||
npair = pair->nextra;
|
||||
|
||||
if (npair) {
|
||||
@ -75,7 +85,8 @@ void ComputePair::init()
|
||||
// recheck for pair style in case it has been deleted
|
||||
|
||||
pair = force->pair_match(pstyle,1);
|
||||
if (!pair) error->all(FLERR,"Unrecognized pair style in compute pair command");
|
||||
if (!pair)
|
||||
error->all(FLERR,"Unrecognized pair style in compute pair command");
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
Reference in New Issue
Block a user