ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-3.0/src/applications/staticProps/P2OrderParameter.cpp
(Generate patch)

Comparing trunk/OOPSE-3.0/src/applications/staticProps/P2OrderParameter.cpp (file contents):
Revision 2240 by tim, Thu May 26 22:45:00 2005 UTC vs.
Revision 2241 by tim, Fri May 27 04:41:34 2005 UTC

# Line 43 | Line 43
43   #include "utils/simError.h"
44   #include "io/DumpReader.hpp"
45   #include "primitives/Molecule.hpp"
46 <
46 > #include "utils/NumericConstant.hpp"
47   namespace oopse {
48  
49  
# Line 112 | Line 112 | void P2OrderParameter::process() {
112    for (int i = 0; i < nFrames; i += step_) {
113      reader.readFrame(i);
114      currentSnapshot_ = info_->getSnapshotManager()->getCurrentSnapshot();
115 <    Mat3x3d orderTensor(0.0);
115 >
116      
117      for (mol = info_->beginMolecule(mi); mol != NULL; mol = info_->nextMolecule(mi)) {
118          //change the positions of atoms which belong to the rigidbodies
# Line 122 | Line 122 | void P2OrderParameter::process() {
122          
123      }      
124  
125 +      Mat3x3d orderTensor(0.0);
126        for (std::vector<std::pair<StuntDouble*, StuntDouble*> >::iterator j = sdPairs_.begin(); j != sdPairs_.end(); ++j) {
127            Vector3d vec = j->first->getPos() - j->second->getPos();
128            vec.normalize();
# Line 158 | Line 159 | void P2OrderParameter::process() {
159  
160            angle += acos(dot(vec, director)) ;
161        }
162 <      angle /= sdPairs_.size();
162 >      angle = angle / (sdPairs_.size() * NumericConstant::PI) * 180.0;
163  
164         OrderParam param;
165         param.p2 = p2;
# Line 169 | Line 170 | void P2OrderParameter::process() {
170      
171    }
172  
173 <  writeOrderParam();
173 >  writeP2();
174    
175   }
176  
177 < void P2OrderParameter::writeOrderParam() {
177 > void P2OrderParameter::writeP2() {
178  
179      std::ofstream os(getOutputFileName().c_str());
180      os << "#radial distribution function\n";

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines