1 |
tim |
333 |
/* |
2 |
|
|
* Copyright (c) 2005 The University of Notre Dame. All Rights Reserved. |
3 |
|
|
* |
4 |
|
|
* The University of Notre Dame grants you ("Licensee") a |
5 |
|
|
* non-exclusive, royalty free, license to use, modify and |
6 |
|
|
* redistribute this software in source and binary code form, provided |
7 |
|
|
* that the following conditions are met: |
8 |
|
|
* |
9 |
gezelter |
1390 |
* 1. Redistributions of source code must retain the above copyright |
10 |
tim |
333 |
* notice, this list of conditions and the following disclaimer. |
11 |
|
|
* |
12 |
gezelter |
1390 |
* 2. Redistributions in binary form must reproduce the above copyright |
13 |
tim |
333 |
* notice, this list of conditions and the following disclaimer in the |
14 |
|
|
* documentation and/or other materials provided with the |
15 |
|
|
* distribution. |
16 |
|
|
* |
17 |
|
|
* This software is provided "AS IS," without a warranty of any |
18 |
|
|
* kind. All express or implied conditions, representations and |
19 |
|
|
* warranties, including any implied warranty of merchantability, |
20 |
|
|
* fitness for a particular purpose or non-infringement, are hereby |
21 |
|
|
* excluded. The University of Notre Dame and its licensors shall not |
22 |
|
|
* be liable for any damages suffered by licensee as a result of |
23 |
|
|
* using, modifying or distributing the software or its |
24 |
|
|
* derivatives. In no event will the University of Notre Dame or its |
25 |
|
|
* licensors be liable for any lost revenue, profit or data, or for |
26 |
|
|
* direct, indirect, special, consequential, incidental or punitive |
27 |
|
|
* damages, however caused and regardless of the theory of liability, |
28 |
|
|
* arising out of the use of or inability to use software, even if the |
29 |
|
|
* University of Notre Dame has been advised of the possibility of |
30 |
|
|
* such damages. |
31 |
gezelter |
1390 |
* |
32 |
|
|
* SUPPORT OPEN SCIENCE! If you use OpenMD or its source code in your |
33 |
|
|
* research, please cite the appropriate papers when you publish your |
34 |
|
|
* work. Good starting points are: |
35 |
|
|
* |
36 |
|
|
* [1] Meineke, et al., J. Comp. Chem. 26, 252-271 (2005). |
37 |
|
|
* [2] Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006). |
38 |
|
|
* [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008). |
39 |
gezelter |
1665 |
* [4] Kuang & Gezelter, J. Chem. Phys. 133, 164101 (2010). |
40 |
|
|
* [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). |
41 |
tim |
333 |
*/ |
42 |
|
|
#ifndef APPLICATIONS_DYNAMICPROPS_TIMECORRFUNC_HPP |
43 |
|
|
#define APPLICATIONS_DYNAMICPROPS_TIMECORRFUNC_HPP |
44 |
|
|
|
45 |
|
|
#include <string> |
46 |
|
|
#include <vector> |
47 |
|
|
|
48 |
|
|
#include "brains/SimInfo.hpp" |
49 |
|
|
#include "brains/BlockSnapshotManager.hpp" |
50 |
|
|
|
51 |
|
|
#include "primitives/StuntDouble.hpp" |
52 |
|
|
#include "selection/SelectionEvaluator.hpp" |
53 |
|
|
#include "selection/SelectionManager.hpp" |
54 |
|
|
|
55 |
gezelter |
1390 |
namespace OpenMD { |
56 |
tim |
333 |
|
57 |
gezelter |
507 |
/** |
58 |
|
|
* @class TimeCorrFunc TimeCorrFunc.hpp "applications/dynamicProps/TimeCorrFunc" |
59 |
|
|
* @brief Base class for Correlation function |
60 |
|
|
*/ |
61 |
tim |
333 |
|
62 |
gezelter |
507 |
class TimeCorrFunc { |
63 |
|
|
public: |
64 |
|
|
TimeCorrFunc(SimInfo* info, const std::string& filename, |
65 |
gezelter |
1629 |
const std::string& sele1, const std::string& sele2, |
66 |
|
|
int storageLayout, long long int memSize); |
67 |
tim |
333 |
|
68 |
gezelter |
507 |
void doCorrelate(); |
69 |
tim |
333 |
|
70 |
|
|
|
71 |
gezelter |
507 |
void setOutputName(const std::string& filename) { |
72 |
|
|
outputFilename_ = filename; |
73 |
|
|
} |
74 |
tim |
333 |
|
75 |
gezelter |
507 |
const std::string& getOutputFileName() const { |
76 |
|
|
return outputFilename_; |
77 |
|
|
} |
78 |
tim |
333 |
|
79 |
|
|
|
80 |
gezelter |
507 |
const std::string& getCorrFuncType() const { |
81 |
|
|
return corrFuncType_; |
82 |
|
|
} |
83 |
tim |
333 |
|
84 |
gezelter |
507 |
void setCorrFuncType(const std::string& type) { |
85 |
|
|
corrFuncType_ = type; |
86 |
|
|
} |
87 |
tim |
333 |
|
88 |
gezelter |
507 |
void setExtraInfo(const std::string& extra) { |
89 |
|
|
extra_ = extra; |
90 |
|
|
} |
91 |
tim |
333 |
|
92 |
gezelter |
507 |
protected: |
93 |
tim |
333 |
|
94 |
gezelter |
507 |
virtual void preCorrelate(); |
95 |
|
|
virtual void postCorrelate(); |
96 |
|
|
virtual void updateFrame(int frame); |
97 |
tim |
333 |
|
98 |
tim |
963 |
RealType deltaTime_; |
99 |
gezelter |
507 |
int nTimeBins_; |
100 |
tim |
963 |
std::vector<RealType> histogram_; |
101 |
gezelter |
507 |
std::vector<int> count_; |
102 |
gezelter |
1629 |
std::vector<RealType> time_; |
103 |
tim |
333 |
|
104 |
gezelter |
507 |
SimInfo* info_; |
105 |
|
|
int storageLayout_; |
106 |
gezelter |
1629 |
long long int memSize_; |
107 |
gezelter |
507 |
std::string dumpFilename_; |
108 |
|
|
SelectionManager seleMan1_; |
109 |
|
|
SelectionManager seleMan2_; |
110 |
tim |
333 |
|
111 |
gezelter |
507 |
BlockSnapshotManager* bsMan_; |
112 |
tim |
333 |
|
113 |
gezelter |
507 |
private: |
114 |
tim |
333 |
|
115 |
gezelter |
507 |
void correlateBlocks(int block1, int block2); |
116 |
|
|
virtual void correlateFrames(int frame1, int frame2) = 0; |
117 |
tim |
333 |
|
118 |
gezelter |
507 |
virtual void writeCorrelate(); |
119 |
tim |
333 |
|
120 |
gezelter |
507 |
virtual void validateSelection(const SelectionManager& seleMan) {} |
121 |
tim |
333 |
|
122 |
|
|
|
123 |
gezelter |
507 |
std::string selectionScript1_; |
124 |
|
|
std::string selectionScript2_; |
125 |
tim |
333 |
|
126 |
gezelter |
507 |
SelectionEvaluator evaluator1_; |
127 |
|
|
SelectionEvaluator evaluator2_; |
128 |
tim |
333 |
|
129 |
|
|
|
130 |
gezelter |
507 |
std::string outputFilename_; |
131 |
tim |
333 |
|
132 |
gezelter |
507 |
std::string corrFuncType_; |
133 |
|
|
std::string extra_; |
134 |
|
|
}; |
135 |
tim |
333 |
|
136 |
|
|
} |
137 |
|
|
#endif |