48#ifndef APPLICATIONS_DYNAMICPROPS_TIMECORRFUNC_HPP
49#define APPLICATIONS_DYNAMICPROPS_TIMECORRFUNC_HPP
54#include "applications/dynamicProps/DynamicProperty.hpp"
58#include "selection/SelectionEvaluator.hpp"
59#include "selection/SelectionManager.hpp"
60#include "utils/ProgressBar.hpp"
103 TimeCorrFunc(SimInfo* info,
const std::string& filename,
104 const std::string& sele1,
const std::string& sele2);
106 virtual ~TimeCorrFunc() {
delete reader_; }
109 void setWindowingParameters(RealType tcorr_fs,
int nStart, RealType tsep_fs);
111 virtual void doCorrelate();
113 const std::string& getCorrFuncType()
const {
return corrFuncType_; }
115 void setCorrFuncType(
const std::string& type) { corrFuncType_ = type; }
117 void setParameterString(
const std::string& params) {
118 paramString_ = params;
121 void setLabelString(
const std::string& label) { labelString_ = label; }
124 virtual void preCorrelate();
125 virtual void correlation();
126 virtual void postCorrelate();
127 virtual void computeFrame(
int frame);
128 virtual void validateSelection(SelectionManager& seleMan);
129 virtual void correlateFrames(
int frame1,
int frame2,
int timeBin);
130 virtual void writeCorrelate();
135 virtual void computeProperty1(
int frame) = 0;
136 virtual void computeProperty2(
int frame) = 0;
137 virtual T calcCorrVal(
int frame1,
int frame2) = 0;
139 virtual int computeProperty1(
int frame, Molecule* mol) = 0;
140 virtual int computeProperty2(
int frame, Molecule* mol) = 0;
142 virtual int computeProperty1(
int frame, StuntDouble* sd) = 0;
143 virtual int computeProperty2(
int frame, StuntDouble* sd) = 0;
145 virtual int computeProperty1(
int frame, Bond* b) = 0;
146 virtual int computeProperty2(
int frame, Bond* b) = 0;
148 virtual T calcCorrVal(
int frame1,
int frame2,
int id1,
int id2) = 0;
151 unsigned int nTimeBins_;
153 std::vector<T> histogram_;
154 std::vector<int> count_;
155 std::vector<RealType> times_;
157 RealType dtSigma_ {};
159 SimInfo* info_ {
nullptr};
161 std::string dumpFilename_;
162 SelectionManager seleMan1_;
163 SelectionManager seleMan2_;
165 Snapshot* currentSnapshot_;
167 std::string selectionScript1_;
168 std::string selectionScript2_;
170 SelectionEvaluator evaluator1_;
171 SelectionEvaluator evaluator2_;
173 bool uniqueSelections_;
175 bool doSystemProperties_;
176 bool doMolecularProperties_;
177 bool doObjectProperties_;
178 bool doAtomicProperties_;
179 bool doBondProperties_;
182 std::string corrFuncType_;
183 std::string paramString_;
184 std::string labelString_;
186 std::vector<std::vector<int>> sele1ToIndex_;
187 std::vector<std::vector<int>> sele2ToIndex_;
188 std::vector<std::vector<int>> GIDtoSele1_;
189 std::vector<std::vector<int>> GIDtoSele2_;
190 std::vector<std::vector<int>> selection1StartFrame_;
191 std::vector<std::vector<int>> selection2StartFrame_;
193 ProgressBarPtr progressBar_;
232 bool useWindowing_ {
false};
239 AutoCorrFunc(SimInfo* info,
const std::string& filename,
240 const std::string& sele1,
const std::string& sele2);
243 virtual void computeProperty1(
int frame) = 0;
244 virtual int computeProperty1(
int frame, Molecule* mol) = 0;
245 virtual int computeProperty1(
int frame, StuntDouble* sd) = 0;
246 virtual int computeProperty1(
int frame, Bond* bond) = 0;
248 virtual void computeProperty2(
int) {}
249 virtual int computeProperty2(
int, Molecule*) {
return -1; }
250 virtual int computeProperty2(
int, StuntDouble*) {
return -1; }
251 virtual int computeProperty2(
int, Bond*) {
return -1; }
257 CrossCorrFunc(SimInfo* info,
const std::string& filename,
258 const std::string& sele1,
const std::string& sele2);
261 virtual void computeProperty1(
int frame) = 0;
262 virtual int computeProperty1(
int frame, Molecule* mol) = 0;
263 virtual int computeProperty1(
int frame, StuntDouble* sd) = 0;
264 virtual int computeProperty1(
int frame, Bond* bond) = 0;
265 virtual void computeProperty2(
int frame) = 0;
266 virtual int computeProperty2(
int frame, Molecule* mol) = 0;
267 virtual int computeProperty2(
int frame, StuntDouble* sd) = 0;
268 virtual int computeProperty2(
int frame, Bond* bond) = 0;
274 SystemACF(SimInfo* info,
const std::string& filename,
275 const std::string& sele1,
const std::string& sele2);
278 virtual void computeProperty1(
int frame) = 0;
279 virtual T calcCorrVal(
int frame1,
int frame2) = 0;
281 virtual int computeProperty1(
int, Molecule*) {
return -1; }
282 virtual int computeProperty1(
int, StuntDouble*) {
return -1; }
283 virtual int computeProperty1(
int, Bond*) {
return -1; }
285 virtual void computeProperty2(
int) {}
286 virtual int computeProperty2(
int, Molecule*) {
return -1; }
287 virtual int computeProperty2(
int, StuntDouble*) {
return -1; }
288 virtual int computeProperty2(
int, Bond*) {
return -1; }
290 T calcCorrVal(
int,
int,
int,
int) {
return T(0.0); }
296 SystemCCF(SimInfo* info,
const std::string& filename,
297 const std::string& sele1,
const std::string& sele2);
300 virtual void computeProperty1(
int frame) = 0;
301 virtual void computeProperty2(
int frame) = 0;
302 virtual T calcCorrVal(
int frame1,
int frame2) = 0;
304 virtual int computeProperty1(
int, Molecule*) {
return -1; }
305 virtual int computeProperty1(
int, StuntDouble*) {
return -1; }
306 virtual int computeProperty1(
int, Bond*) {
return -1; }
308 virtual int computeProperty2(
int, Molecule*) {
return -1; }
309 virtual int computeProperty2(
int, StuntDouble*) {
return -1; }
310 virtual int computeProperty2(
int, Bond*) {
return -1; }
312 T calcCorrVal(
int,
int,
int,
int) {
return T(0.0); }
318 ObjectACF(SimInfo* info,
const std::string& filename,
319 const std::string& sele1,
const std::string& sele2);
322 virtual int computeProperty1(
int frame, StuntDouble* sd) = 0;
323 virtual T calcCorrVal(
int frame1,
int frame2,
int id1,
int id2) = 0;
325 virtual void computeProperty1(
int) {
return; }
326 virtual int computeProperty1(
int, Molecule*) {
return -1; }
327 virtual int computeProperty1(
int, Bond*) {
return -1; }
329 virtual void computeProperty2(
int) {
return; }
330 virtual int computeProperty2(
int, Molecule*) {
return -1; }
331 virtual int computeProperty2(
int, StuntDouble*) {
return -1; }
332 virtual int computeProperty2(
int, Bond*) {
return -1; }
334 virtual T calcCorrVal(
int,
int) {
return T(0.0); }
340 ObjectCCF(SimInfo* info,
const std::string& filename,
341 const std::string& sele1,
const std::string& sele2);
344 virtual int computeProperty1(
int frame, StuntDouble* sd) = 0;
345 virtual int computeProperty2(
int frame, StuntDouble* sd) = 0;
346 virtual T calcCorrVal(
int frame1,
int frame2,
int id1,
int id2) = 0;
348 virtual void computeProperty1(
int) {
return; }
349 virtual int computeProperty1(
int, Molecule*) {
return -1; }
350 virtual int computeProperty1(
int, Bond*) {
return -1; }
352 virtual void computeProperty2(
int) {}
353 virtual int computeProperty2(
int, Molecule*) {
return -1; }
354 virtual int computeProperty2(
int, Bond*) {
return -1; }
356 virtual T calcCorrVal(
int,
int) {
return T(0.0); }
362 MoleculeACF(SimInfo* info,
const std::string& filename,
363 const std::string& sele1,
const std::string& sele2);
366 virtual int computeProperty1(
int frame, Molecule* mol) = 0;
367 virtual T calcCorrVal(
int frame1,
int frame2,
int id1,
int id2) = 0;
369 virtual void computeProperty1(
int) {
return; }
370 virtual int computeProperty1(
int, StuntDouble*) {
return -1; }
371 virtual int computeProperty1(
int, Bond*) {
return -1; }
373 virtual void computeProperty2(
int) {
return; }
374 virtual int computeProperty2(
int, Molecule*) {
return -1; }
375 virtual int computeProperty2(
int, StuntDouble*) {
return -1; }
376 virtual int computeProperty2(
int, Bond*) {
return -1; }
378 virtual T calcCorrVal(
int,
int) {
return T(0.0); }
384 MoleculeCCF(SimInfo* info,
const std::string& filename,
385 const std::string& sele1,
const std::string& sele2);
388 virtual int computeProperty1(
int frame, Molecule* mol) = 0;
389 virtual int computeProperty2(
int frame, Molecule* mol) = 0;
390 virtual T calcCorrVal(
int frame1,
int frame2,
int id1,
int id2) = 0;
392 virtual void computeProperty1(
int) {
return; }
393 virtual int computeProperty1(
int, StuntDouble*) {
return -1; }
394 virtual int computeProperty1(
int, Bond*) {
return -1; }
396 virtual void computeProperty2(
int) {}
397 virtual int computeProperty2(
int, StuntDouble*) {
return -1; }
398 virtual int computeProperty2(
int, Bond*) {
return -1; }
400 virtual T calcCorrVal(
int,
int) {
return T(0.0); }
"applications/dynamicProps/DynamicProperty"
Computes a correlation function by scanning a trajectory once to precompute quantities to be correlat...
This basic Periodic Table class was originally taken from the data.cpp file in OpenBabel.