ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/trunk/src/rnemd/RNEMD.hpp
Revision: 2046
Committed: Tue Dec 2 22:11:04 2014 UTC (10 years, 7 months ago) by gezelter
File size: 7157 byte(s)
Log Message:
Fixed some broken comments for use with Doxygen.
Made changes to allow topology-based force-field overrides in include files.
Fixed a calculation of box quadrupole moments for molecules with point dipoles.

File Contents

# User Rev Content
1 gezelter 1329 /*
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 gezelter 1329 * notice, this list of conditions and the following disclaimer.
11     *
12 gezelter 1390 * 2. Redistributions in binary form must reproduce the above copyright
13 gezelter 1329 * 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 gezelter 1879 * [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 234107 (2008).
39 jmarr 1728 * [4] Kuang & Gezelter, J. Chem. Phys. 133, 164101 (2010).
40     * [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011).
41 gezelter 1329 */
42    
43     #ifndef INTEGRATORS_RNEMD_HPP
44     #define INTEGRATORS_RNEMD_HPP
45     #include "brains/SimInfo.hpp"
46     #include "math/RandNumGen.hpp"
47 gezelter 1331 #include "selection/SelectionEvaluator.hpp"
48     #include "selection/SelectionManager.hpp"
49 skuang 1368 #include <iostream>
50 gezelter 1329
51 gezelter 1629 using namespace std;
52 gezelter 1390 namespace OpenMD {
53 gezelter 1329
54     class RNEMD {
55     public:
56     RNEMD(SimInfo* info);
57 gezelter 1879 ~RNEMD();
58 skuang 1368
59     void doRNEMD();
60 gezelter 1879 void doSwap(SelectionManager& smanA, SelectionManager& smanB);
61     void doNIVS(SelectionManager& smanA, SelectionManager& smanB);
62     void doVSS(SelectionManager& smanA, SelectionManager& smanB);
63     RealType getDividingArea();
64 skuang 1368 void collectData();
65     void getStarted();
66 gezelter 1773 void parseOutputFileFormat(const std::string& format);
67     void writeOutputFile();
68     void writeReal(int index, unsigned int bin);
69     void writeVector(int index, unsigned int bin);
70 gezelter 1979 void writeRealErrorBars(int index, unsigned int bin);
71     void writeVectorErrorBars(int index, unsigned int bin);
72 gezelter 1331
73 gezelter 1329 private:
74 gezelter 1331
75 gezelter 1773 enum RNEMDMethod {
76     rnemdSwap,
77     rnemdNIVS,
78     rnemdVSS,
79     rnemdUnkownMethod
80 gezelter 1329 };
81 gezelter 1773 enum RNEMDFluxType {
82     rnemdKE, // translational kinetic energy flux
83     rnemdRotKE, // rotational kinetic energy flux
84     rnemdFullKE, // full kinetic energy flux
85     rnemdPx, // flux of momentum along x axis
86     rnemdPy, // flux of momentum along y axis
87     rnemdPz, // flux of momentum along z axis
88     rnemdPvector, // flux of momentum vector
89 gezelter 1879 rnemdLx, // flux of angular momentum along x axis
90     rnemdLy, // flux of angular momentum along y axis
91     rnemdLz, // flux of angular momentum along z axis
92     rnemdLvector, // flux of angular momentum vector
93 gezelter 1773 rnemdKePx, // flux of translational KE and x-momentum
94     rnemdKePy, // flux of translational KE and y-momentum
95 gezelter 1879 rnemdKePvector, // full combo flying platter
96     rnemdKeLx, // flux of translational KE and x-angular momentum
97     rnemdKeLy, // flux of translational KE and y-angular momentum
98     rnemdKeLz, // flux of translational KE and z-angular momentum
99     rnemdKeLvector, // full combo spinning platter
100 gezelter 1773 rnemdUnknownFluxType
101     };
102    
103     enum OutputFields {
104     BEGININDEX = 0,
105     Z = BEGININDEX,
106 gezelter 1879 R,
107 gezelter 1773 TEMPERATURE,
108     VELOCITY,
109 gezelter 1879 ANGULARVELOCITY,
110 gezelter 1773 DENSITY,
111     ENDINDEX
112     };
113    
114     struct OutputData {
115     string title;
116     string units;
117     string dataType;
118 gezelter 1791 vector<BaseAccumulator*> accumulator;
119 gezelter 1773 };
120    
121     typedef bitset<ENDINDEX-BEGININDEX> OutputBitSet;
122     typedef map<string, OutputFields> OutputMapType;
123 skuang 1368
124 gezelter 1329 SimInfo* info_;
125 gezelter 1773
126     map<string, RNEMDMethod> stringToMethod_;
127     map<string, RNEMDFluxType> stringToFluxType_;
128     RNEMDMethod rnemdMethod_;
129     RNEMDFluxType rnemdFluxType_;
130 gezelter 1879
131     // object selection for specifying a particular species:
132 gezelter 1629 string rnemdObjectSelection_;
133 skuang 1368 SelectionEvaluator evaluator_;
134 gezelter 1331 SelectionManager seleMan_;
135 gezelter 1879
136     // Geometric selections for the two regions for the exchange:
137     string selectionA_;
138     SelectionEvaluator evaluatorA_;
139     SelectionManager seleManA_;
140     string selectionB_;
141     SelectionEvaluator evaluatorB_;
142     SelectionManager seleManB_;
143     SelectionManager commonA_;
144     SelectionManager commonB_;
145     bool hasSelectionA_;
146     bool hasSelectionB_;
147     bool hasSphereBRadius_;
148    
149 gezelter 1331 bool usePeriodicBoundaryConditions_;
150 gezelter 1879 bool hasDividingArea_;
151     RealType dividingArea_;
152    
153     int nBins_;
154     RealType binWidth_;
155 gezelter 1773 RealType slabWidth_;
156     RealType slabACenter_;
157     RealType slabBCenter_;
158 gezelter 1879 RealType sphereARadius_;
159     RealType sphereBRadius_;
160 gezelter 1903 RealType areaA_;
161     bool AisHull_;
162     RealType areaB_;
163     bool BisHull_;
164 gezelter 1773
165 gezelter 1879 Vector3d coordinateOrigin_;
166    
167 gezelter 1773 RealType kineticFlux_; // target or desired *flux*
168     Vector3d momentumFluxVector_; // target or desired *flux*
169 gezelter 1879 Vector3d angularMomentumFluxVector_; // target or desired *flux*
170 gezelter 1773
171     RealType kineticTarget_; // target or desired one-time exchange energy
172     Vector3d momentumTarget_; // target or desired one-time exchange momentum
173 gezelter 1879 Vector3d angularMomentumTarget_; // target or desired one-time
174     // exchange angular momentum
175 gezelter 1773
176     RealType kineticExchange_; // actual exchange energy (running total)
177     Vector3d momentumExchange_; // actual exchange momentum (running total)
178 gezelter 1879 Vector3d angularMomentumExchange_; // actual exchange momentum
179     // (running total)
180 skuang 1368 RealType exchangeTime_;
181 gezelter 1773
182 jmarr 1728 RealType targetJzpz2_;
183 gezelter 1773
184     unsigned int trialCount_;
185     unsigned int failTrialCount_;
186     unsigned int failRootCount_;
187    
188     string rnemdFileName_;
189     ofstream rnemdFile_;
190    
191     RealType runTime_, statusTime_;
192    
193     vector<OutputData> data_;
194     OutputBitSet outputMask_;
195     OutputMapType outputMap_;
196 gezelter 1774 Accumulator* areaAccumulator_;
197 gezelter 1776 bool doRNEMD_;
198 gezelter 1879 bool hasData_;
199 gezelter 1773
200 gezelter 1329 };
201     }
202 skuang 1368 #endif //INTEGRATORS_RNEMD_HPP

Properties

Name Value
svn:keywords Author Id Revision Date