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

Comparing trunk/OOPSE-2.0/src/applications/dynamicProps/CorrelationFunction.cpp (file contents):
Revision 2007 by tim, Sun Feb 13 15:56:10 2005 UTC vs.
Revision 2008 by tim, Sun Feb 13 19:10:25 2005 UTC

# Line 41 | Line 41
41  
42   #include "applications/dynamicProps/CorrelationFunction.hpp"
43   #include "utils/simError.h"
44 <
44 > #include "primitives/Molecule.hpp"
45   namespace oopse {
46  
47   CorrelationFunction::CorrelationFunction(SimInfo* info, const std::string& filename,
# Line 73 | Line 73 | CorrelationFunction::CorrelationFunction(SimInfo* info
73          storageLayout_ |= DataStorage::dslElectroFrame;
74      }
75          
76 <    bsMan_ = new BlockSnapshotMananger(info, dumpFilename_, storageLayout_);
77 <    info->setSnapshotManager(bsMan_);
76 >    bsMan_ = new BlockSnapshotManager(info, dumpFilename_, storageLayout_);
77 >    info_->setSnapshotManager(bsMan_);
78  
79      //if selection is static, we only need to evaluate it once
80      if (!evaluator1_.isDynamic()) {
# Line 90 | Line 90 | CorrelationFunction::CorrelationFunction(SimInfo* info
90      nTimeBins_ = nframes;  /**@todo Fixed Me */
91      histogram_.resize(nTimeBins_);
92      count_.resize(nTimeBins_);
93 <
93 >    time_.resize(nTimeBins_);
94      //deltaTime_ = info_->;
95   }
96  
# Line 168 | Line 168 | void CorrelationFunction::correlateFrames(int frame1,
168      int j;
169      StuntDouble* sd1;
170      StuntDouble* sd2;
171 <    for (sd1 = seleMan1_.beginSelected(i), (sd2 = seleMan2_.beginSelected(j); sd1 != NULL && sd2 != NULL;
172 <        sd1 = seleMan1_.nextSelected(i) sd2 = seleMan2_.nextSelected(j)) {
171 >    for (sd1 = seleMan1_.beginSelected(i), sd2 = seleMan2_.beginSelected(j); sd1 != NULL && sd2 != NULL;
172 >        sd1 = seleMan1_.nextSelected(i), sd2 = seleMan2_.nextSelected(j)) {
173 >
174          double corrVal = calcCorrVal(sd1, frame1, sd2, frame2);
175          histogram_[timeBin] += corrVal;    
176      }
# Line 223 | Line 224 | void CorrelationFunction::postCorrelate() {
224   void CorrelationFunction::postCorrelate() {
225      for (int i =0 ; i < nTimeBins_; ++i) {
226          if (count_[i] > 0) {
227 <            histogram_[i] / = count_[i];
227 >            histogram_[i] /= count_[i];
228          }
229      }
230   }
# Line 235 | Line 236 | void CorrelationFunction::writeCorrelate() {
236      if (ofs.is_open()) {
237  
238          ofs << "#" << getCorrFuncType() << "\n";
239 <        ofs << "#selection script1: \"" << selectionScript1_ <<"\"\tselection script2: \"" selectionScript2_ << "\"\n";
239 >        ofs << "#selection script1: \"" << selectionScript1_ <<"\"\tselection script2: \"" << selectionScript2_ << "\"\n";
240          ofs << "#extra information: " << extra_ << "\n";
241          ofs << "#time\tcorrVal\n";
242  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines