From fc3584f316b5c8a579a8f8c23fbc411e07680866 Mon Sep 17 00:00:00 2001 From: Gareth Tribello <gareth.tribello@gmail.com> Date: Sat, 30 Aug 2014 18:04:55 +0200 Subject: [PATCH] Fixed a bug in reading in of temperature in histogram --- src/analysis/Analysis.cpp | 6 +++--- src/analysis/Histogram.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/analysis/Analysis.cpp b/src/analysis/Analysis.cpp index 6de684c62..7b40eda60 100644 --- a/src/analysis/Analysis.cpp +++ b/src/analysis/Analysis.cpp @@ -158,10 +158,10 @@ argument_names(getNumberOfArguments()) rtemp*=plumed.getAtoms().getKBoltzmann(); } simtemp=0.; parse("TEMP",simtemp); - if( rtemp>0 || !biases.empty() ){ - if(simtemp>0) simtemp*=plumed.getAtoms().getKBoltzmann(); - else simtemp*=plumed.getAtoms().getKbT(); + if(simtemp>0) simtemp*=plumed.getAtoms().getKBoltzmann(); + else simtemp=plumed.getAtoms().getKbT(); + if( rtemp>0 || !biases.empty() ){ if(simtemp==0) error("The MD engine does not pass the temperature to plumed so you have to specify it using TEMP"); } diff --git a/src/analysis/Histogram.cpp b/src/analysis/Histogram.cpp index fe211f6f2..b41c01d87 100644 --- a/src/analysis/Histogram.cpp +++ b/src/analysis/Histogram.cpp @@ -185,7 +185,7 @@ fenergy(false) error("Wrong number of values for BANDWIDTH: they should be equal to the number of arguments"); parseFlag("FREE-ENERGY",fenergy); - if(getTemp()<=0&&fenergy) error("Set the temperature (TEMP) if you want a free energy."); + if(getTemp()<=0 && fenergy) error("Set the temperature (TEMP) if you want a free energy."); checkRead(); log.printf(" Using %s kernel functions\n",kerneltype.c_str() ); -- GitLab