From 42f18bf06b2a246223bd39c9ff8f10f3eb63e211 Mon Sep 17 00:00:00 2001 From: pscrozi Date: Tue, 30 Jun 2009 15:38:31 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@2916 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/fix_heat.cpp | 9 ++++++++- src/fix_heat.h | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/fix_heat.cpp b/src/fix_heat.cpp index a253ea618e..dfe1a356a1 100644 --- a/src/fix_heat.cpp +++ b/src/fix_heat.cpp @@ -76,7 +76,7 @@ void FixHeat::end_of_step() double vcmsq = vcm[0]*vcm[0] + vcm[1]*vcm[1] + vcm[2]*vcm[2]; double escale = (ke + heat - 0.5*vcmsq*masstotal)/(ke - 0.5*vcmsq*masstotal); if (escale < 0.0) error->all("Fix heat kinetic energy went negative"); - double r = sqrt(escale); + r = sqrt(escale); vsub[0] = (r-1.0) * vcm[0]; vsub[1] = (r-1.0) * vcm[1]; @@ -89,3 +89,10 @@ void FixHeat::end_of_step() v[i][2] = r*v[i][2] - vsub[2]; } } + +/* ---------------------------------------------------------------------- */ + +double FixHeat::compute_scalar() +{ + return r; +} diff --git a/src/fix_heat.h b/src/fix_heat.h index f05e3f3bdc..f012605bea 100644 --- a/src/fix_heat.h +++ b/src/fix_heat.h @@ -24,10 +24,12 @@ class FixHeat : public Fix { int setmask(); void init(); void end_of_step(); + double compute_scalar(); private: double heat; double masstotal; + double r; }; }