From db40cbe7b74ead510ca15a3ae03ab05729b3835d Mon Sep 17 00:00:00 2001 From: sjplimp Date: Thu, 3 Dec 2009 20:54:54 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@3489 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/thermo.cpp | 14 +++++++++++++- src/thermo.h | 1 + 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/thermo.cpp b/src/thermo.cpp index 21d1d46c72..7bda7b2b05 100644 --- a/src/thermo.cpp +++ b/src/thermo.cpp @@ -40,7 +40,7 @@ using namespace LAMMPS_NS; // customize a new keyword by adding to this list: -// step, atoms, cpu, temp, press, pe, ke, etotal, enthalpy +// step, atoms, cpu, dt, temp, press, pe, ke, etotal, enthalpy // evdwl, ecoul, epair, ebond, eangle, edihed, eimp, emol, elong, etail // vol, lx, ly, lz, xlo, xhi, ylo, yhi, zlo, zhi, xy, xz, yz // pxx, pyy, pzz, pxy, pxz, pyz @@ -575,6 +575,8 @@ void Thermo::parse_fields(char *str) addfield("Atoms",&Thermo::compute_atoms,INT); } else if (strcmp(word,"cpu") == 0) { addfield("CPU",&Thermo::compute_cpu,FLOAT); + } else if (strcmp(word,"dt") == 0) { + addfield("Dt",&Thermo::compute_dt,FLOAT); } else if (strcmp(word,"temp") == 0) { addfield("Temp",&Thermo::compute_temp,FLOAT); @@ -835,6 +837,9 @@ int Thermo::evaluate_keyword(char *word, double *answer) if (update->whichflag == 0) firststep = 0; compute_cpu(); + } else if (strcmp(word,"dt") == 0) { + compute_dt(); + } else if (strcmp(word,"temp") == 0) { if (!temperature) error->all("Thermo keyword in variable requires " @@ -1214,6 +1219,13 @@ void Thermo::compute_cpu() /* ---------------------------------------------------------------------- */ +void Thermo::compute_dt() +{ + dvalue = update->dt; +} + +/* ---------------------------------------------------------------------- */ + void Thermo::compute_temp() { dvalue = temperature->scalar; diff --git a/src/thermo.h b/src/thermo.h index 8daf5984a1..4c47a978ec 100644 --- a/src/thermo.h +++ b/src/thermo.h @@ -109,6 +109,7 @@ class Thermo : protected Pointers { void compute_step(); void compute_atoms(); void compute_cpu(); + void compute_dt(); void compute_temp(); void compute_press();