From ed9d4758974e723cac7bc708e27132f043e32f11 Mon Sep 17 00:00:00 2001 From: sjplimp Date: Mon, 8 Feb 2010 21:41:24 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@3791 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/thermo.cpp | 54 +++++++++++++++++++++++++++++++++++++++++++++++--- src/thermo.h | 4 ++++ 2 files changed, 55 insertions(+), 3 deletions(-) diff --git a/src/thermo.cpp b/src/thermo.cpp index d14220452c..bedd8459f6 100644 --- a/src/thermo.cpp +++ b/src/thermo.cpp @@ -16,9 +16,10 @@ #include "string.h" #include "thermo.h" #include "atom.h" +#include "update.h" #include "comm.h" #include "domain.h" -#include "update.h" +#include "lattice.h" #include "modify.h" #include "fix.h" #include "compute.h" @@ -42,7 +43,7 @@ using namespace LAMMPS_NS; // 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 +// vol, lx, ly, lz, xlo, xhi, ylo, yhi, zlo, zhi, xy, xz, yz, xlat, ylat, zlat // pxx, pyy, pzz, pxy, pxz, pyz // customize a new thermo style by adding a DEFINE to this list @@ -671,6 +672,19 @@ void Thermo::parse_fields(char *str) } else if (strcmp(word,"yz") == 0) { addfield("Yz",&Thermo::compute_yz,FLOAT); + } else if (strcmp(word,"xlat") == 0) { + if (domain->lattice == NULL) + error->all("Thermo keyword requires lattice be defined"); + addfield("Xlat",&Thermo::compute_xlat,FLOAT); + } else if (strcmp(word,"ylat") == 0) { + if (domain->lattice == NULL) + error->all("Thermo keyword requires lattice be defined"); + addfield("Ylat",&Thermo::compute_ylat,FLOAT); + } else if (strcmp(word,"zlat") == 0) { + if (domain->lattice == NULL) + error->all("Thermo keyword requires lattice be defined"); + addfield("Zlat",&Thermo::compute_zlat,FLOAT); + } else if (strcmp(word,"pxx") == 0) { addfield("Pxx",&Thermo::compute_pxx,FLOAT); index_press_vector = add_compute(id_press,VECTOR); @@ -1091,7 +1105,20 @@ int Thermo::evaluate_keyword(char *word, double *answer) else if (strcmp(word,"xz") == 0) compute_xz(); else if (strcmp(word,"yz") == 0) compute_yz(); - else if (strcmp(word,"pxx") == 0) { + else if (strcmp(word,"xlat") == 0) { + if (domain->lattice == NULL) + error->all("Thermo keyword in variable requires lattice be defined"); + compute_xlat(); + } else if (strcmp(word,"ylat") == 0) { + if (domain->lattice == NULL) + error->all("Thermo keyword in variable requires lattice be defined"); + compute_ylat(); + } else if (strcmp(word,"zlat") == 0) { + if (domain->lattice == NULL) + error->all("Thermo keyword in variable requires lattice be defined"); + compute_zlat(); + + } else if (strcmp(word,"pxx") == 0) { if (!pressure) error->all("Thermo keyword in variable requires " "thermo to use/init press"); @@ -1553,6 +1580,27 @@ void Thermo::compute_yz() /* ---------------------------------------------------------------------- */ +void Thermo::compute_xlat() +{ + dvalue = domain->lattice->xlattice; +} + +/* ---------------------------------------------------------------------- */ + +void Thermo::compute_ylat() +{ + dvalue = domain->lattice->ylattice; +} + +/* ---------------------------------------------------------------------- */ + +void Thermo::compute_zlat() +{ + dvalue = domain->lattice->zlattice; +} + +/* ---------------------------------------------------------------------- */ + void Thermo::compute_pxx() { dvalue = pressure->vector[0]; diff --git a/src/thermo.h b/src/thermo.h index 3e49247f07..cf3febee74 100644 --- a/src/thermo.h +++ b/src/thermo.h @@ -145,6 +145,10 @@ class Thermo : protected Pointers { void compute_xz(); void compute_yz(); + void compute_xlat(); + void compute_ylat(); + void compute_zlat(); + void compute_pxx(); void compute_pyy(); void compute_pzz();