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, |
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()) { |
90 |
|
nTimeBins_ = nframes; /**@todo Fixed Me */ |
91 |
|
histogram_.resize(nTimeBins_); |
92 |
|
count_.resize(nTimeBins_); |
93 |
< |
|
93 |
> |
time_.resize(nTimeBins_); |
94 |
|
//deltaTime_ = info_->; |
95 |
|
} |
96 |
|
|
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 |
|
} |
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 |
|
} |
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 |
|
|