git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@14659 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp
2016-02-22 17:10:07 +00:00
parent f705ef5600
commit 00fc71e8b8
2 changed files with 10 additions and 10 deletions

View File

@ -452,8 +452,8 @@ void PairTable::read_table(Table *tb, char *file, char *keyword)
if (ferror) { if (ferror) {
char str[128]; char str[128];
sprintf(str,"%d force values in table are inconsistent with -dE/dr;" sprintf(str,"%d force values in table are inconsistent with -dE/dr; "
"should only happen at inflection points",ferror); "should only be mistakenly flagged at inflection points",ferror);
error->warning(FLERR,str); error->warning(FLERR,str);
} }

View File

@ -1010,9 +1010,13 @@ int Thermo::evaluate_keyword(char *word, double *answer)
// if keyword requires a compute, error if thermo doesn't use the compute // if keyword requires a compute, error if thermo doesn't use the compute
// if inbetween runs and needed compute is not current, error // if inbetween runs and needed compute is not current, error
// if in middle of run and needed compute is not current, invoke it // if in middle of run and needed compute is not current, invoke it
// for keywords that use pe indirectly (evdwl, ebond, etc): // for keywords that use energy (evdwl, ebond, etc):
// check if energy was tallied on this timestep and set pe->invoked_flag // check if energy was tallied on this timestep and set pe->invoked_flag
// this will trigger next timestep for energy tallying via addstep() // this will trigger next timestep for energy tallying via addstep()
// this means keywords that use pe (pe, etotal, enthalpy)
// need to always invoke it even if invoked_flag is set,
// because evdwl/etc may have set invoked_flag w/out
// actually invoking pe->compute_scalar()
if (strcmp(word,"step") == 0) { if (strcmp(word,"step") == 0) {
compute_step(); compute_step();
@ -1106,7 +1110,7 @@ int Thermo::evaluate_keyword(char *word, double *answer)
if (pe->invoked_scalar != update->ntimestep) if (pe->invoked_scalar != update->ntimestep)
error->all(FLERR,"Compute used in variable thermo keyword between runs " error->all(FLERR,"Compute used in variable thermo keyword between runs "
"is not current"); "is not current");
} else if (!(pe->invoked_flag & INVOKED_SCALAR)) { } else {
pe->compute_scalar(); pe->compute_scalar();
pe->invoked_flag |= INVOKED_SCALAR; pe->invoked_flag |= INVOKED_SCALAR;
} }
@ -1134,7 +1138,7 @@ int Thermo::evaluate_keyword(char *word, double *answer)
if (pe->invoked_scalar != update->ntimestep) if (pe->invoked_scalar != update->ntimestep)
error->all(FLERR,"Compute used in variable thermo keyword between runs " error->all(FLERR,"Compute used in variable thermo keyword between runs "
"is not current"); "is not current");
} else if (!(pe->invoked_flag & INVOKED_SCALAR)) { } else {
pe->compute_scalar(); pe->compute_scalar();
pe->invoked_flag |= INVOKED_SCALAR; pe->invoked_flag |= INVOKED_SCALAR;
} }
@ -1159,7 +1163,7 @@ int Thermo::evaluate_keyword(char *word, double *answer)
if (pe->invoked_scalar != update->ntimestep) if (pe->invoked_scalar != update->ntimestep)
error->all(FLERR,"Compute used in variable thermo keyword between runs " error->all(FLERR,"Compute used in variable thermo keyword between runs "
"is not current"); "is not current");
} else if (!(pe->invoked_flag & INVOKED_SCALAR)) { } else {
pe->compute_scalar(); pe->compute_scalar();
pe->invoked_flag |= INVOKED_SCALAR; pe->invoked_flag |= INVOKED_SCALAR;
} }
@ -1271,10 +1275,6 @@ int Thermo::evaluate_keyword(char *word, double *answer)
} else if (strcmp(word,"etail") == 0) { } else if (strcmp(word,"etail") == 0) {
if (update->eflag_global != update->ntimestep) if (update->eflag_global != update->ntimestep)
error->all(FLERR,"Energy was not tallied on needed timestep"); error->all(FLERR,"Energy was not tallied on needed timestep");
if (!pe)
error->all(FLERR,
"Thermo keyword in variable requires thermo to use/init pe");
pe->invoked_flag |= INVOKED_SCALAR;
compute_etail(); compute_etail();
} else if (strcmp(word,"vol") == 0) compute_vol(); } else if (strcmp(word,"vol") == 0) compute_vol();