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

Comparing trunk/src/applications/staticProps/P2OrderParameter.cpp (file contents):
Revision 1657 by gezelter, Tue Oct 18 13:44:44 2011 UTC vs.
Revision 1782 by gezelter, Wed Aug 22 02:28:28 2012 UTC

# Line 36 | Line 36
36   * [1]  Meineke, et al., J. Comp. Chem. 26, 252-271 (2005).            
37   * [2]  Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006).          
38   * [3]  Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008).          
39 < * [4]  Vardeman & Gezelter, in progress (2009).                        
39 > * [4]  Kuang & Gezelter,  J. Chem. Phys. 133, 164101 (2010).
40 > * [5]  Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011).
41   */
42  
43   #include "applications/staticProps/P2OrderParameter.hpp"
# Line 121 | Line 122 | namespace OpenMD {
122      SimInfo::MoleculeIterator mi;
123      Molecule::RigidBodyIterator rbIter;
124      StuntDouble* sd;
125 <    int i, ii;
125 >    int ii;
126    
127      DumpReader reader(info_, dumpFilename_);    
128      int nFrames = reader.getNFrames();
# Line 196 | Line 197 | namespace OpenMD {
197        }  
198  
199        RealType angle = 0.0;
199      RealType p4 = 0.0;
200        
201        if (doVect_) {
202          for (sd = seleMan1_.beginSelected(ii); sd != NULL;
# Line 204 | Line 204 | namespace OpenMD {
204            if (sd->isDirectional()) {
205              Vector3d vec = sd->getA().getColumn(2);
206              vec.normalize();
207 <            RealType myDot = dot(vec, director);
208 <            angle += acos(myDot);
209 <            p4 += (35.0 * pow(myDot, 4) - 30.0 * pow(myDot, 2) + 3.0) / 8.0;
207 >            angle += acos(dot(vec, director));
208            }
209          }
210          angle = angle/(seleMan1_.getSelectionCount()*NumericConstant::PI)*180.0;
211 <        p4 /= (seleMan1_.getSelectionCount());
211 >        
212        } else {
213          for (vector<pair<StuntDouble*, StuntDouble*> >::iterator j = sdPairs_.begin(); j != sdPairs_.end(); ++j) {
214            Vector3d vec = j->first->getPos() - j->second->getPos();
215            if (usePeriodicBoundaryConditions_)
216              currentSnapshot_->wrapVector(vec);
217            vec.normalize();          
218 <          RealType myDot = dot(vec, director);
221 <          angle += acos(myDot);
222 <          p4 += (35.0 * pow(myDot, 4) - 30.0 * pow(myDot, 2) + 3.0) / 8.0;
218 >          angle += acos(dot(vec, director)) ;
219          }
220          angle = angle / (sdPairs_.size() * NumericConstant::PI) * 180.0;
225        p4 /= (seleMan1_.getSelectionCount());
221        }
222  
223        OrderParam param;
224        param.p2 = p2;
225        param.director = director;
226        param.angle = angle;
232      param.p4 = p4;
227  
228        orderParams_.push_back(param);      
229      
# Line 247 | Line 241 | namespace OpenMD {
241      if (!doVect_) {
242        os << "selection2: (" << selectionScript2_ << ")\n";
243      }
244 <    os << "#p2\tdirector_x\tdirector_y\tdiretor_z\tangle(degree)\t<p4>\n";    
244 >    os << "#p2\tdirector_x\tdirector_y\tdiretor_z\tangle(degree)\n";    
245  
246      for (size_t i = 0; i < orderParams_.size(); ++i) {
247        os <<  orderParams_[i].p2 << "\t"
248           <<  orderParams_[i].director[0] << "\t"
249           <<  orderParams_[i].director[1] << "\t"
250           <<  orderParams_[i].director[2] << "\t"
251 <         <<  orderParams_[i].angle << "\t"
258 <         <<  orderParams_[i].p4 << "\n";
251 >         <<  orderParams_[i].angle << "\n";
252  
253      }
254  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines