From 1949102ef9def81eb957bf4782b3cfea1c4d34ce Mon Sep 17 00:00:00 2001 From: sjplimp Date: Fri, 8 Nov 2013 20:56:32 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@11007 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/thermo.cpp | 16 +++++++++++++++- src/thermo.h | 1 + 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/thermo.cpp b/src/thermo.cpp index 8498b8495b..57ad8cb8cc 100644 --- a/src/thermo.cpp +++ b/src/thermo.cpp @@ -21,6 +21,7 @@ #include "update.h" #include "comm.h" #include "domain.h" +#include "universe.h" #include "lattice.h" #include "group.h" #include "modify.h" @@ -46,7 +47,7 @@ using namespace MathConst; // customize a new keyword by adding to this list: -// step, elapsed, elaplong, dt, time, cpu, tpcpu, spcpu, cpuremain +// step, elapsed, elaplong, dt, time, cpu, tpcpu, spcpu, cpuremain, part // atoms, temp, press, pe, ke, etotal, enthalpy // evdwl, ecoul, epair, ebond, eangle, edihed, eimp, emol, elong, etail // vol, density, lx, ly, lz, xlo, xhi, ylo, yhi, zlo, zhi, xy, xz, yz, @@ -659,6 +660,8 @@ void Thermo::parse_fields(char *str) addfield("S/CPU",&Thermo::compute_spcpu,FLOAT); } else if (strcmp(word,"cpuremain") == 0) { addfield("CPULeft",&Thermo::compute_cpuremain,FLOAT); + } else if (strcmp(word,"part") == 0) { + addfield("Part",&Thermo::compute_part,INT); } else if (strcmp(word,"atoms") == 0) { addfield("Atoms",&Thermo::compute_atoms,BIGINT); @@ -1023,6 +1026,10 @@ int Thermo::evaluate_keyword(char *word, double *answer) "This variable thermo keyword cannot be used between runs"); compute_cpuremain(); + } else if (strcmp(word,"part") == 0) { + compute_part(); + dvalue = ivalue; + } else if (strcmp(word,"atoms") == 0) { compute_atoms(); dvalue = bivalue; @@ -1522,6 +1529,13 @@ void Thermo::compute_cpuremain() /* ---------------------------------------------------------------------- */ +void Thermo::compute_part() +{ + ivalue = universe->iworld; +} + +/* ---------------------------------------------------------------------- */ + void Thermo::compute_atoms() { bivalue = atom->natoms; diff --git a/src/thermo.h b/src/thermo.h index 026a3e1e3f..83973a478a 100644 --- a/src/thermo.h +++ b/src/thermo.h @@ -127,6 +127,7 @@ class Thermo : protected Pointers { void compute_tpcpu(); void compute_spcpu(); void compute_cpuremain(); + void compute_part(); void compute_atoms(); void compute_temp();