43#include "applications/dynamicProps/ParticleTimeCorrFunc.hpp"
47 ParticleTimeCorrFunc::ParticleTimeCorrFunc(SimInfo * info,
48 const std::string & filename,
49 const std :: string & sele1,
50 const std :: string & sele2,
52 long long int memSize)
53 : TimeCorrFunc(info, filename, sele1, sele2, storageLayout, memSize){
56 nSelected_ = seleMan1_.getSelectionCount();
57 assert( nSelected_ == seleMan2_.getSelectionCount());
60 void ParticleTimeCorrFunc::correlateFrames(
int frame1,
int frame2) {
61 Snapshot* snapshot1 = bsMan_->getSnapshot(frame1);
62 Snapshot* snapshot2 = bsMan_->getSnapshot(frame2);
63 assert(snapshot1 && snapshot2);
65 RealType time1 = snapshot1->getTime();
66 RealType time2 = snapshot2->getTime();
68 int timeBin = int ((time2 - time1) /deltaTime_ + 0.5);
77 for (sd1 = seleMan1_.beginSelected(i), sd2 = seleMan2_.beginSelected(j);
78 sd1 != NULL && sd2 != NULL;
79 sd1 = seleMan1_.nextSelected(i), sd2 = seleMan2_.nextSelected(j) ) {
81 id1 = sd1->getGlobalIndex();
82 id2 = sd2->getGlobalIndex();
88 while (id1 < id2 && sd1 != NULL) {
89 sd1 = seleMan1_.nextSelected(i);
90 if (sd1 != NULL) id1 = sd1->getGlobalIndex();
92 while (id2 < id1 && sd2 != NULL) {
93 sd2 = seleMan2_.nextSelected(j);
94 if (sd2 != NULL) id2 = sd2->getGlobalIndex();
97 if (sd1 == NULL || sd2 == NULL)
break;
99 RealType corrVal = calcCorrVal(frame1, frame2, sd1, sd2);
101 histogram_[timeBin] += corrVal;
This basic Periodic Table class was originally taken from the data.cpp file in OpenBabel.