git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@5520 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -133,19 +133,18 @@ Thermo::Thermo(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
|
||||
|
||||
// format strings
|
||||
|
||||
format_multi = (char *) "---------------- Step %8d ----- "
|
||||
"CPU = %11.4f (sec) ----------------";
|
||||
char *bigint_format = BIGINT_FORMAT;
|
||||
char *fformat_multi = (char *) "---------------- Step %%8%s ----- "
|
||||
"CPU = %%11.4f (sec) ----------------";
|
||||
|
||||
sprintf(format_multi,fformat_multi,&bigint_format[1]);
|
||||
format_float_one_def = (char *) "%12.8g";
|
||||
format_float_multi_def = (char *) "%14.4f";
|
||||
format_int_one_def = (char *) "%8d";
|
||||
format_int_multi_def = (char *) "%14d";
|
||||
if (sizeof(bigint) == 8) {
|
||||
format_bigint_one_def = (char *) "%8ld";
|
||||
format_bigint_multi_def = (char *) "%14ld";
|
||||
} else if (sizeof(bigint) == 4) {
|
||||
format_bigint_one_def = (char *) "%8d";
|
||||
format_bigint_multi_def = (char *) "%14d";
|
||||
}
|
||||
sprintf(format_bigint_one_def,"%%8%s",&bigint_format[1]);
|
||||
sprintf(format_bigint_multi_def,"%%14%s",&bigint_format[1]);
|
||||
|
||||
format_float_user = NULL;
|
||||
format_int_user = NULL;
|
||||
format_bigint_user = NULL;
|
||||
@ -281,7 +280,7 @@ void Thermo::compute(int flag)
|
||||
int i;
|
||||
|
||||
firststep = flag;
|
||||
int ntimestep = update->ntimestep;
|
||||
bigint ntimestep = update->ntimestep;
|
||||
|
||||
// check for lost atoms
|
||||
// turn off normflag if natoms = 0 to avoid divide by 0
|
||||
@ -629,11 +628,11 @@ void Thermo::parse_fields(char *str)
|
||||
while (word) {
|
||||
|
||||
if (strcmp(word,"step") == 0) {
|
||||
addfield("Step",&Thermo::compute_step,INT);
|
||||
addfield("Step",&Thermo::compute_step,BIGINT);
|
||||
} else if (strcmp(word,"elapsed") == 0) {
|
||||
addfield("Elapsed",&Thermo::compute_elapsed,INT);
|
||||
addfield("Elapsed",&Thermo::compute_elapsed,BIGINT);
|
||||
} else if (strcmp(word,"elaplong") == 0) {
|
||||
addfield("Elaplong",&Thermo::compute_elapsed_long,INT);
|
||||
addfield("Elaplong",&Thermo::compute_elapsed_long,BIGINT);
|
||||
} else if (strcmp(word,"dt") == 0) {
|
||||
addfield("Dt",&Thermo::compute_dt,FLOAT);
|
||||
} else if (strcmp(word,"cpu") == 0) {
|
||||
@ -942,7 +941,6 @@ int Thermo::evaluate_keyword(char *word, double *answer)
|
||||
|
||||
if (strcmp(word,"step") == 0) {
|
||||
compute_step();
|
||||
dvalue = ivalue;
|
||||
|
||||
} else if (strcmp(word,"elapsed") == 0) {
|
||||
if (update->whichflag == 0)
|
||||
@ -1356,27 +1354,27 @@ void Thermo::compute_variable()
|
||||
one method for every keyword thermo can output
|
||||
called by compute() or evaluate_keyword()
|
||||
compute will have already been called
|
||||
set ivalue/dvalue if value is integer/double
|
||||
set ivalue/dvalue/bivalue if value is int/double/bigint
|
||||
customize a new keyword by adding a method
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void Thermo::compute_step()
|
||||
{
|
||||
ivalue = update->ntimestep;
|
||||
bivalue = update->ntimestep;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void Thermo::compute_elapsed()
|
||||
{
|
||||
ivalue = update->ntimestep - update->firststep;
|
||||
bivalue = update->ntimestep - update->firststep;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void Thermo::compute_elapsed_long()
|
||||
{
|
||||
ivalue = update->ntimestep - update->beginstep;
|
||||
bivalue = update->ntimestep - update->beginstep;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
Reference in New Issue
Block a user