ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/branches/development/src/applications/staticProps/pAngle.cpp
(Generate patch)

Comparing branches/development/src/applications/staticProps/pAngle.cpp (file contents):
Revision 1665 by gezelter, Tue Nov 22 20:38:56 2011 UTC vs.
Revision 1767 by gezelter, Fri Jul 6 22:01:58 2012 UTC

# Line 43 | Line 43
43   /* Calculates Rho(theta) */
44  
45   #include <algorithm>
46 <  #include <fstream>
46 > #include <fstream>
47   #include "applications/staticProps/pAngle.hpp"
48   #include "utils/simError.h"
49   #include "io/DumpReader.hpp"
50   #include "primitives/Molecule.hpp"
51 + #include "brains/Thermo.hpp"
52 +
53   namespace OpenMD {
54    
55    pAngle::pAngle(SimInfo* info, const std::string& filename,
# Line 74 | Line 76 | namespace OpenMD {
76      Molecule::RigidBodyIterator rbIter;
77      int i;
78  
79 +    Thermo thermo(info_);
80      DumpReader reader(info_, dumpFilename_);    
81      int nFrames = reader.getNFrames();
82      nProcessed_ = nFrames/step_;
# Line 94 | Line 97 | namespace OpenMD {
97          }
98        }
99        
100 <      Vector3d CenterOfMass = info_->getCom();      
100 >      Vector3d CenterOfMass = thermo.getCom();      
101  
102        if  (evaluator_.isDynamic()) {
103          seleMan_.setSelectionSet(evaluator_.evaluate());
# Line 131 | Line 134 | namespace OpenMD {
134    void pAngle::processHistogram() {
135      
136      int atot = 0;
137 <    for(int i = 0; i < count_.size(); ++i)
137 >    for(unsigned int i = 0; i < count_.size(); ++i)
138        atot += count_[i];
139      
140 <    for(int i = 0; i < count_.size(); ++i) {
140 >    for(unsigned int i = 0; i < count_.size(); ++i) {
141        histogram_[i] = double(count_[i] / double(atot));
142      }    
143    }
# Line 149 | Line 152 | namespace OpenMD {
152        rdfStream << "#selection: (" << selectionScript_ << ")\n";
153        rdfStream << "#cos(theta)\tp(cos(theta))\n";
154        RealType dct = 2.0 / histogram_.size();
155 <      for (int i = 0; i < histogram_.size(); ++i) {
155 >      for (unsigned int i = 0; i < histogram_.size(); ++i) {
156          RealType ct = -1.0 + (2.0 * i + 1) / (histogram_.size());
157          rdfStream << ct << "\t" << histogram_[i]/dct << "\n";
158        }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines