git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@5336 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -47,8 +47,7 @@ PairTersoff::PairTersoff(LAMMPS *lmp) : Pair(lmp)
|
|||||||
|
|
||||||
nelements = 0;
|
nelements = 0;
|
||||||
elements = NULL;
|
elements = NULL;
|
||||||
nparams = 0;
|
nparams = maxparam = 0;
|
||||||
maxparam = 0;
|
|
||||||
params = NULL;
|
params = NULL;
|
||||||
elem2param = NULL;
|
elem2param = NULL;
|
||||||
}
|
}
|
||||||
@ -364,9 +363,9 @@ void PairTersoff::read_file(char *file)
|
|||||||
int params_per_line = 17;
|
int params_per_line = 17;
|
||||||
char **words = new char*[params_per_line+1];
|
char **words = new char*[params_per_line+1];
|
||||||
|
|
||||||
if (params) delete [] params;
|
if (params) memory->sfree(params);
|
||||||
params = NULL;
|
params = NULL;
|
||||||
nparams = 0;
|
nparams = maxparam = 0;
|
||||||
|
|
||||||
// open file on proc 0
|
// open file on proc 0
|
||||||
|
|
||||||
|
|||||||
@ -524,7 +524,7 @@ void Input::echo()
|
|||||||
|
|
||||||
void Input::ifthenelse()
|
void Input::ifthenelse()
|
||||||
{
|
{
|
||||||
if (narg < 4) error->all("Illegal if command");
|
if (narg < 3) error->all("Illegal if command");
|
||||||
|
|
||||||
// substitute for variables in Boolean expression for "if"
|
// substitute for variables in Boolean expression for "if"
|
||||||
// in case expression was enclosed in quotes
|
// in case expression was enclosed in quotes
|
||||||
|
|||||||
@ -3163,13 +3163,13 @@ double Variable::evaluate_boolean(char *str)
|
|||||||
// number: push value onto stack
|
// number: push value onto stack
|
||||||
// ----------------
|
// ----------------
|
||||||
|
|
||||||
} else if (isdigit(onechar) || onechar == '.') {
|
} else if (isdigit(onechar) || onechar == '.' || onechar == '-') {
|
||||||
if (expect == OP) error->all("Invalid Boolean syntax in if command");
|
if (expect == OP) error->all("Invalid Boolean syntax in if command");
|
||||||
expect = OP;
|
expect = OP;
|
||||||
|
|
||||||
// istop = end of number, including scientific notation
|
// istop = end of number, including scientific notation
|
||||||
|
|
||||||
int istart = i;
|
int istart = i++;
|
||||||
while (isdigit(str[i]) || str[i] == '.') i++;
|
while (isdigit(str[i]) || str[i] == '.') i++;
|
||||||
if (str[i] == 'e' || str[i] == 'E') {
|
if (str[i] == 'e' || str[i] == 'E') {
|
||||||
i++;
|
i++;
|
||||||
|
|||||||
Reference in New Issue
Block a user