git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@7003 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -37,7 +37,7 @@ enum{PAIR,TAIL,KSPACE};
|
||||
ComputeTI::ComputeTI(LAMMPS *lmp, int narg, char **arg) :
|
||||
Compute(lmp, narg, arg)
|
||||
{
|
||||
if (narg < 4) error->all("Illegal compute ti command");
|
||||
if (narg < 4) error->all(FLERR,"Illegal compute ti command");
|
||||
|
||||
peflag = 1;
|
||||
scalar_flag = 1;
|
||||
@ -47,7 +47,7 @@ ComputeTI::ComputeTI(LAMMPS *lmp, int narg, char **arg) :
|
||||
// terms come in triplets
|
||||
|
||||
nterms = (narg-3) / 3;
|
||||
if (narg != 3*nterms + 3) error->all("Illegal compute ti command");
|
||||
if (narg != 3*nterms + 3) error->all(FLERR,"Illegal compute ti command");
|
||||
|
||||
which = new int[nterms];
|
||||
ivar1 = new int[nterms];
|
||||
@ -65,7 +65,7 @@ ComputeTI::ComputeTI(LAMMPS *lmp, int narg, char **arg) :
|
||||
|
||||
int iarg = 3;
|
||||
while (iarg < narg) {
|
||||
if (iarg+3 > narg) error->all("Illegal compute ti command");
|
||||
if (iarg+3 > narg) error->all(FLERR,"Illegal compute ti command");
|
||||
if (strcmp(arg[iarg],"kspace") == 0) which[nterms] = KSPACE;
|
||||
else if (strcmp(arg[iarg],"tail") == 0) which[nterms] = TAIL;
|
||||
else {
|
||||
@ -79,12 +79,12 @@ ComputeTI::ComputeTI(LAMMPS *lmp, int narg, char **arg) :
|
||||
int n = strlen(&arg[iarg+1][2]) + 1;
|
||||
var1[nterms] = new char[n];
|
||||
strcpy(var1[nterms],&arg[iarg+1][2]);
|
||||
} else error->all("Illegal compute ti command");
|
||||
} else error->all(FLERR,"Illegal compute ti command");
|
||||
if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) {
|
||||
int n = strlen(&arg[iarg+2][2]) + 1;
|
||||
var2[nterms] = new char[n];
|
||||
strcpy(var2[nterms],&arg[iarg+2][2]);
|
||||
} else error->all("Illegal compute ti command");
|
||||
} else error->all(FLERR,"Illegal compute ti command");
|
||||
|
||||
nterms++;
|
||||
iarg += 3;
|
||||
@ -119,23 +119,23 @@ void ComputeTI::init()
|
||||
ivar1[m] = input->variable->find(var1[m]);
|
||||
ivar2[m] = input->variable->find(var2[m]);
|
||||
if (ivar1[m] < 0 || ivar2 < 0)
|
||||
error->all("Variable name for compute ti does not exist");
|
||||
error->all(FLERR,"Variable name for compute ti does not exist");
|
||||
if (!input->variable->equalstyle(ivar1[m]) ||
|
||||
!input->variable->equalstyle(ivar2[m]))
|
||||
error->all("Variable for compute ti is invalid style");
|
||||
error->all(FLERR,"Variable for compute ti is invalid style");
|
||||
|
||||
if (which[m] == PAIR) {
|
||||
pptr[m] = force->pair_match(pstyle[m],1);
|
||||
if (pptr[m] == NULL) error->all("Compute ti pair style does not exist");
|
||||
if (pptr[m] == NULL) error->all(FLERR,"Compute ti pair style does not exist");
|
||||
|
||||
} else if (which[m] == TAIL) {
|
||||
if (force->pair == NULL || force->pair->tail_flag == 0)
|
||||
error->all("Compute ti tail when pair style does not "
|
||||
error->all(FLERR,"Compute ti tail when pair style does not "
|
||||
"compute tail corrections");
|
||||
|
||||
} else if (which[m] == KSPACE) {
|
||||
if (force->kspace == NULL)
|
||||
error->all("Compute ti kspace style does not exist");
|
||||
error->all(FLERR,"Compute ti kspace style does not exist");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -148,7 +148,7 @@ double ComputeTI::compute_scalar()
|
||||
|
||||
invoked_scalar = update->ntimestep;
|
||||
if (update->eflag_global != invoked_scalar)
|
||||
error->all("Energy was not tallied on needed timestep");
|
||||
error->all(FLERR,"Energy was not tallied on needed timestep");
|
||||
|
||||
double dUdl = 0.0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user