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

Comparing trunk/src/applications/staticProps/RhoZ.cpp (file contents):
Revision 894 by gezelter, Tue Mar 7 16:43:53 2006 UTC vs.
Revision 1078 by gezelter, Wed Oct 18 21:58:48 2006 UTC

# Line 44 | Line 44
44   *
45   *  Created by Charles F. Vardeman II on 11/26/05.
46   *  @author  Charles F. Vardeman II
47 < *  @version $Id: RhoZ.cpp,v 1.4 2006-03-07 16:43:52 gezelter Exp $
47 > *  @version $Id: RhoZ.cpp,v 1.6 2006-10-18 21:58:47 gezelter Exp $
48   *
49   */
50  
# Line 58 | Line 58 | namespace oopse {
58   #include "primitives/Molecule.hpp"
59   namespace oopse {
60    
61 <  RhoZ::RhoZ(SimInfo* info, const std::string& filename, const std::string& sele, double len, int nrbins)
61 >  RhoZ::RhoZ(SimInfo* info, const std::string& filename, const std::string& sele, RealType len, int nrbins)
62      : StaticAnalyser(info, filename), selectionScript_(sele),  evaluator_(info), seleMan_(info), len_(len), nRBins_(nrbins){
63  
64      evaluator_.loadScriptString(sele);
# Line 91 | Line 91 | namespace oopse {
91        reader.readFrame(istep);
92        currentSnapshot_ = info_->getSnapshotManager()->getCurrentSnapshot();
93        
94 <      double sliceVolume = currentSnapshot_->getVolume() /nRBins_;
94 >      RealType sliceVolume = currentSnapshot_->getVolume() /nRBins_;
95        //assume simulation box will never change
96        //Mat3x3d hmat = currentSnapshot_->getHmat();
97 <      double halfBoxZ_ = len_ / 2.0;      
97 >      RealType halfBoxZ_ = len_ / 2.0;      
98          
99          if (evaluator_.isDynamic()) {
100            seleMan_.setSelectionSet(evaluator_.evaluate());
# Line 103 | Line 103 | namespace oopse {
103          //wrap the stuntdoubles into a cell      
104          for (sd = seleMan_.beginSelected(i); sd != NULL; sd = seleMan_.nextSelected(i)) {
105              Vector3d pos = sd->getPos();
106 <            currentSnapshot_->wrapVector(pos);
106 >            if (usePeriodicBoundaryConditions_)
107 >              currentSnapshot_->wrapVector(pos);
108              sd->setPos(pos);
109          }
110  
# Line 118 | Line 119 | namespace oopse {
119  
120          //loop over the slices to calculate the densities
121          for (i = 0; i < nRBins_; i++) {
122 <            double totalMass = 0;
122 >            RealType totalMass = 0;
123              for (int k = 0; k < sliceSDLists_[i].size(); ++k) {
124                  totalMass += sliceSDLists_[i][k]->getMass();
125              }
# Line 140 | Line 141 | namespace oopse {
141        rdfStream << "#selection: (" << selectionScript_ << ")\n";
142        rdfStream << "#z\tdensity\n";
143        for (int i = 0; i < density_.size(); ++i) {
144 <        double r = deltaR_ * (i + 0.5);
144 >        RealType r = deltaR_ * (i + 0.5);
145          rdfStream << r << "\t" << 1.660535*density_[i]/nProcessed_ << "\n";
146        }
147        

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines