From 560ca5bb7d6694ad9eea4670a1c218946c5d9d5f Mon Sep 17 00:00:00 2001 From: sjplimp Date: Fri, 6 Jun 2014 21:37:22 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@12094 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/thermo.cpp | 33 +++++++++++++++++++++++++++++++-- src/thermo.h | 3 +++ 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/src/thermo.cpp b/src/thermo.cpp index 3b1d9f5f20..e4e6852f6b 100644 --- a/src/thermo.cpp +++ b/src/thermo.cpp @@ -29,6 +29,7 @@ #include "compute.h" #include "input.h" #include "variable.h" +#include "neighbor.h" #include "force.h" #include "pair.h" #include "bond.h" @@ -54,7 +55,7 @@ using namespace MathConst; // xlat, ylat, zlat // bonds, angles, dihedrals, impropers, // pxx, pyy, pzz, pxy, pxz, pyz -// fmax, fnorm +// fmax, fnorm, nbuild, ndanger, // cella, cellb, cellc, cellalpha, cellbeta, cellgamma // customize a new thermo style by adding a DEFINE to this list @@ -798,6 +799,11 @@ void Thermo::parse_fields(char *str) } else if (strcmp(word,"fnorm") == 0) { addfield("Fnorm",&Thermo::compute_fnorm,FLOAT); + } else if (strcmp(word,"nbuild") == 0) { + addfield("Nbuild",&Thermo::compute_nbuild,BIGINT); + } else if (strcmp(word,"ndanger") == 0) { + addfield("Ndanger",&Thermo::compute_ndanger,BIGINT); + } else if (strcmp(word,"cella") == 0) { addfield("Cella",&Thermo::compute_cella,FLOAT); } else if (strcmp(word,"cellb") == 0) { @@ -1368,10 +1374,19 @@ int Thermo::evaluate_keyword(char *word, double *answer) pressure->invoked_flag |= INVOKED_VECTOR; } compute_pyz(); + } - } else if (strcmp(word,"fmax") == 0) compute_fmax(); + else if (strcmp(word,"fmax") == 0) compute_fmax(); else if (strcmp(word,"fnorm") == 0) compute_fnorm(); + else if (strcmp(word,"nbuild") == 0) { + compute_nbuild(); + dvalue = bivalue; + } else if (strcmp(word,"ndanger") == 0) { + compute_ndanger(); + dvalue = bivalue; + } + else if (strcmp(word,"cella") == 0) compute_cella(); else if (strcmp(word,"cellb") == 0) compute_cellb(); else if (strcmp(word,"cellc") == 0) compute_cellc(); @@ -1972,6 +1987,20 @@ void Thermo::compute_fnorm() /* ---------------------------------------------------------------------- */ +void Thermo::compute_nbuild() +{ + bivalue = neighbor->ncalls; +} + +/* ---------------------------------------------------------------------- */ + +void Thermo::compute_ndanger() +{ + bivalue = neighbor->ndanger; +} + +/* ---------------------------------------------------------------------- */ + void Thermo::compute_cella() { dvalue = domain->xprd; diff --git a/src/thermo.h b/src/thermo.h index 6dbbdd7e05..154800d143 100644 --- a/src/thermo.h +++ b/src/thermo.h @@ -184,6 +184,9 @@ class Thermo : protected Pointers { void compute_fmax(); void compute_fnorm(); + void compute_nbuild(); + void compute_ndanger(); + void compute_cella(); void compute_cellb(); void compute_cellc();