--- trunk/src/applications/staticProps/BondAngleDistribution.cpp 2009/11/25 20:02:06 1390 +++ trunk/src/applications/staticProps/BondAngleDistribution.cpp 2013/07/31 18:03:35 1919 @@ -35,12 +35,12 @@ * * [1] Meineke, et al., J. Comp. Chem. 26, 252-271 (2005). * [2] Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006). - * [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008). - * [4] Vardeman & Gezelter, in progress (2009). - * + * [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 234107 (2008). + * [4] Kuang & Gezelter, J. Chem. Phys. 133, 164101 (2010). + * [4] , Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). * * Created by J. Daniel Gezelter on 07/27/07. * @author J. Daniel Gezelter - * @version $Id: BondAngleDistribution.cpp,v 1.2 2009-11-25 20:01:59 gezelter Exp $ + * @version $Id$ * */ @@ -50,14 +50,15 @@ #include "primitives/Molecule.hpp" #include "utils/NumericConstant.hpp" +using namespace std; namespace OpenMD { BondAngleDistribution::BondAngleDistribution(SimInfo* info, - const std::string& filename, - const std::string& sele, - double rCut, int nbins) : StaticAnalyser(info, filename), - selectionScript_(sele), - evaluator_(info), seleMan_(info){ + const string& filename, + const string& sele, + double rCut, int nbins) + : StaticAnalyser(info, filename), selectionScript_(sele), evaluator_(info), + seleMan_(info) { setOutputName(getPrefix(filename) + ".bad"); @@ -81,7 +82,7 @@ namespace OpenMD { histogram_.clear(); } - void BondAngleDistribution::initalizeHistogram() { + void BondAngleDistribution::initializeHistogram() { for (int bin = 0; bin < nBins_; bin++) { histogram_[bin] = 0; } @@ -98,15 +99,10 @@ namespace OpenMD { StuntDouble* sd; Vector3d vec; std::vector bondvec; - std::vector bonddist; - RealType costheta; - RealType r; - RealType dist; + RealType r; + int nBonds; + int i; - int nBonds; - - int i, j; - DumpReader reader(info_, dumpFilename_); int nFrames = reader.getNFrames(); frameCounter_ = 0; @@ -178,14 +174,14 @@ namespace OpenMD { Vector3d vec2 = bondvec[j]; vec2.normalize(); - + RealType theta = acos(dot(vec1,vec2))*180.0/NumericConstant::PI; - + if (theta > 180.0){ theta = 360.0 - theta; } - int whichBin = theta/deltaTheta_; + int whichBin = int(theta/deltaTheta_); histogram_[whichBin] += 2; }