--- trunk/src/applications/staticProps/BondAngleDistribution.cpp 2012/08/22 18:43:27 1785 +++ trunk/src/applications/staticProps/BondAngleDistribution.cpp 2015/03/07 21:41:51 2071 @@ -35,7 +35,7 @@ * * [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). + * [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. @@ -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), seleMan_(info), + evaluator_(info) { setOutputName(getPrefix(filename) + ".bad"); @@ -71,8 +72,8 @@ namespace OpenMD { rCut_ = rCut; nBins_ = nbins; - // Theta can take values from 0 to 180 + deltaTheta_ = (180.0) / nBins_; histogram_.resize(nBins_); } @@ -98,7 +99,6 @@ namespace OpenMD { StuntDouble* sd; Vector3d vec; std::vector bondvec; - std::vector bonddist; RealType r; int nBonds; int i; @@ -174,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; }