ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/trunk/src/applications/dynamicProps/TimeCorrFunc.hpp
Revision: 1596
Committed: Mon Jul 25 17:30:53 2011 UTC (14 years, 1 month ago) by gezelter
File size: 4347 byte(s)
Log Message:
Updated the BlockSnapshotManager to use a specified memory footprint
in constructor and not to rely on physmem and residentMem to figure
out free memory. DynamicProps is the only program that uses the
BlockSnapshotManager, so substantial changes were needed there as
well.


File Contents

# User Rev Content
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     * [4] Vardeman & Gezelter, in progress (2009).
40 tim 333 */
41     #ifndef APPLICATIONS_DYNAMICPROPS_TIMECORRFUNC_HPP
42     #define APPLICATIONS_DYNAMICPROPS_TIMECORRFUNC_HPP
43    
44     #include <string>
45     #include <vector>
46    
47     #include "brains/SimInfo.hpp"
48     #include "brains/BlockSnapshotManager.hpp"
49    
50     #include "primitives/StuntDouble.hpp"
51     #include "selection/SelectionEvaluator.hpp"
52     #include "selection/SelectionManager.hpp"
53    
54 gezelter 1390 namespace OpenMD {
55 tim 333
56 gezelter 507 /**
57     * @class TimeCorrFunc TimeCorrFunc.hpp "applications/dynamicProps/TimeCorrFunc"
58     * @brief Base class for Correlation function
59     */
60 tim 333
61 gezelter 507 class TimeCorrFunc {
62     public:
63     TimeCorrFunc(SimInfo* info, const std::string& filename,
64 gezelter 1596 const std::string& sele1, const std::string& sele2,
65     int storageLayout, long long int memSize);
66 tim 333
67 gezelter 507 void doCorrelate();
68 tim 333
69    
70 gezelter 507 void setOutputName(const std::string& filename) {
71     outputFilename_ = filename;
72     }
73 tim 333
74 gezelter 507 const std::string& getOutputFileName() const {
75     return outputFilename_;
76     }
77 tim 333
78    
79 gezelter 507 const std::string& getCorrFuncType() const {
80     return corrFuncType_;
81     }
82 tim 333
83 gezelter 507 void setCorrFuncType(const std::string& type) {
84     corrFuncType_ = type;
85     }
86 tim 333
87 gezelter 507 void setExtraInfo(const std::string& extra) {
88     extra_ = extra;
89     }
90 tim 333
91 gezelter 507 protected:
92 tim 333
93 gezelter 507 virtual void preCorrelate();
94     virtual void postCorrelate();
95     virtual void updateFrame(int frame);
96 tim 333
97 tim 963 RealType deltaTime_;
98 gezelter 507 int nTimeBins_;
99 tim 963 std::vector<RealType> histogram_;
100 gezelter 507 std::vector<int> count_;
101 gezelter 1596 std::vector<RealType> time_;
102 tim 333
103 gezelter 507 SimInfo* info_;
104     int storageLayout_;
105 gezelter 1596 long long int memSize_;
106 gezelter 507 std::string dumpFilename_;
107     SelectionManager seleMan1_;
108     SelectionManager seleMan2_;
109 tim 333
110 gezelter 507 BlockSnapshotManager* bsMan_;
111 tim 333
112 gezelter 507 private:
113 tim 333
114 gezelter 507 void correlateBlocks(int block1, int block2);
115     virtual void correlateFrames(int frame1, int frame2) = 0;
116 tim 333
117 gezelter 507 virtual void writeCorrelate();
118 tim 333
119 gezelter 507 virtual void validateSelection(const SelectionManager& seleMan) {}
120 tim 333
121    
122 gezelter 507 std::string selectionScript1_;
123     std::string selectionScript2_;
124 tim 333
125 gezelter 507 SelectionEvaluator evaluator1_;
126     SelectionEvaluator evaluator2_;
127 tim 333
128    
129 gezelter 507 std::string outputFilename_;
130 tim 333
131 gezelter 507 std::string corrFuncType_;
132     std::string extra_;
133     };
134 tim 333
135     }
136     #endif

Properties

Name Value
svn:executable *
svn:keywords Author Id Revision Date