6 |
|
* redistribute this software in source and binary code form, provided |
7 |
|
* that the following conditions are met: |
8 |
|
* |
9 |
< |
* 1. Acknowledgement of the program authors must be made in any |
10 |
< |
* publication of scientific results based in part on use of the |
11 |
< |
* program. An acceptable form of acknowledgement is citation of |
12 |
< |
* the article in which the program was described (Matthew |
13 |
< |
* A. Meineke, Charles F. Vardeman II, Teng Lin, Christopher |
14 |
< |
* J. Fennell and J. Daniel Gezelter, "OOPSE: An Object-Oriented |
15 |
< |
* Parallel Simulation Engine for Molecular Dynamics," |
16 |
< |
* J. Comput. Chem. 26, pp. 252-271 (2005)) |
17 |
< |
* |
18 |
< |
* 2. Redistributions of source code must retain the above copyright |
9 |
> |
* 1. Redistributions of source code must retain the above copyright |
10 |
|
* notice, this list of conditions and the following disclaimer. |
11 |
|
* |
12 |
< |
* 3. Redistributions in binary form must reproduce the above copyright |
12 |
> |
* 2. Redistributions in binary form must reproduce the above copyright |
13 |
|
* notice, this list of conditions and the following disclaimer in the |
14 |
|
* documentation and/or other materials provided with the |
15 |
|
* distribution. |
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 |
+ |
* |
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] Kuang & Gezelter, J. Chem. Phys. 133, 164101 (2010). |
40 |
+ |
* [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). |
41 |
|
*/ |
42 |
|
|
43 |
|
/** |
44 |
|
* @file RNEMD.hpp |
45 |
|
* @author gezelter |
46 |
|
* @date 03/13/2009 |
46 |
– |
* @time 15:56pm |
47 |
|
* @version 1.0 |
48 |
|
*/ |
49 |
|
|
55 |
|
#include "selection/SelectionManager.hpp" |
56 |
|
#include <iostream> |
57 |
|
|
58 |
< |
namespace oopse { |
58 |
> |
using namespace std; |
59 |
> |
namespace OpenMD { |
60 |
|
|
60 |
– |
/** |
61 |
– |
* @class RNEMD RNEMD.hpp "integrators/RNEMD.hpp" |
62 |
– |
* @todo document |
63 |
– |
*/ |
61 |
|
class RNEMD { |
62 |
|
public: |
63 |
|
RNEMD(SimInfo* info); |
65 |
|
|
66 |
|
void doRNEMD(); |
67 |
|
void doSwap(); |
68 |
< |
void doScale(); |
68 |
> |
void doNIVS(); |
69 |
> |
void doVSS(); |
70 |
|
void collectData(); |
71 |
|
void getStarted(); |
72 |
< |
void getStatus(); |
73 |
< |
void set_RNEMD_exchange_time(RealType exchangeTime) { |
74 |
< |
exchangeTime_ = exchangeTime; |
75 |
< |
} |
76 |
< |
void set_RNEMD_nBins(int nbins) { nBins_ = nbins; } |
77 |
< |
RealType get_RNEMD_exchange_total() { return exchangeSum_; } |
78 |
< |
void set_RNEMD_exchange_total(RealType et) { exchangeSum_ = et; } |
79 |
< |
void set_RNEMD_target_flux(RealType targetFlux) {targetFlux_ = targetFlux;} |
72 |
> |
bool inSlabA(Vector3d pos); |
73 |
> |
bool inSlabB(Vector3d pos); |
74 |
> |
void parseOutputFileFormat(const std::string& format); |
75 |
> |
void writeOutputFile(); |
76 |
> |
void writeReal(int index, unsigned int bin); |
77 |
> |
void writeVector(int index, unsigned int bin); |
78 |
> |
void writeRealStdDev(int index, unsigned int bin); |
79 |
> |
void writeVectorStdDev(int index, unsigned int bin); |
80 |
|
|
81 |
|
private: |
82 |
|
|
83 |
< |
enum RNEMDTypeEnum { |
84 |
< |
rnemdKineticSwap, |
85 |
< |
rnemdKineticScale, |
86 |
< |
rnemdPxScale, |
87 |
< |
rnemdPyScale, |
90 |
< |
rnemdPzScale, |
91 |
< |
rnemdPx, |
92 |
< |
rnemdPy, |
93 |
< |
rnemdPz, |
94 |
< |
rnemdUnknown |
83 |
> |
enum RNEMDMethod { |
84 |
> |
rnemdSwap, |
85 |
> |
rnemdNIVS, |
86 |
> |
rnemdVSS, |
87 |
> |
rnemdUnkownMethod |
88 |
|
}; |
89 |
+ |
enum RNEMDFluxType { |
90 |
+ |
rnemdKE, // translational kinetic energy flux |
91 |
+ |
rnemdRotKE, // rotational kinetic energy flux |
92 |
+ |
rnemdFullKE, // full kinetic energy flux |
93 |
+ |
rnemdPx, // flux of momentum along x axis |
94 |
+ |
rnemdPy, // flux of momentum along y axis |
95 |
+ |
rnemdPz, // flux of momentum along z axis |
96 |
+ |
rnemdPvector, // flux of momentum vector |
97 |
+ |
rnemdKePx, // flux of translational KE and x-momentum |
98 |
+ |
rnemdKePy, // flux of translational KE and y-momentum |
99 |
+ |
rnemdKePvector, // full combo platter |
100 |
+ |
rnemdUnknownFluxType |
101 |
+ |
}; |
102 |
+ |
|
103 |
+ |
enum OutputFields { |
104 |
+ |
BEGININDEX = 0, |
105 |
+ |
Z = BEGININDEX, |
106 |
+ |
TEMPERATURE, |
107 |
+ |
VELOCITY, |
108 |
+ |
DENSITY, |
109 |
+ |
ENDINDEX |
110 |
+ |
}; |
111 |
+ |
|
112 |
+ |
struct OutputData { |
113 |
+ |
string title; |
114 |
+ |
string units; |
115 |
+ |
string dataType; |
116 |
+ |
vector<Accumulator*> accumulator; |
117 |
+ |
}; |
118 |
+ |
|
119 |
+ |
typedef bitset<ENDINDEX-BEGININDEX> OutputBitSet; |
120 |
+ |
typedef map<string, OutputFields> OutputMapType; |
121 |
|
|
122 |
|
SimInfo* info_; |
123 |
< |
RandNumGen* randNumGen_; |
124 |
< |
std::map<std::string, RNEMDTypeEnum> stringToEnumMap_; |
125 |
< |
RNEMDTypeEnum rnemdType_; |
126 |
< |
std::string rnemdObjectSelection_; |
123 |
> |
|
124 |
> |
map<string, RNEMDMethod> stringToMethod_; |
125 |
> |
map<string, RNEMDFluxType> stringToFluxType_; |
126 |
> |
RNEMDMethod rnemdMethod_; |
127 |
> |
RNEMDFluxType rnemdFluxType_; |
128 |
> |
string rnemdObjectSelection_; |
129 |
|
SelectionEvaluator evaluator_; |
130 |
|
SelectionManager seleMan_; |
131 |
|
bool usePeriodicBoundaryConditions_; |
132 |
< |
int nBins_; |
133 |
< |
int midBin_; |
134 |
< |
int rnemdLogWidth_; |
132 |
> |
int nBins_; |
133 |
> |
RealType slabWidth_; |
134 |
> |
RealType slabACenter_; |
135 |
> |
RealType slabBCenter_; |
136 |
> |
|
137 |
> |
RealType kineticFlux_; // target or desired *flux* |
138 |
> |
Vector3d momentumFluxVector_; // target or desired *flux* |
139 |
> |
|
140 |
> |
RealType kineticTarget_; // target or desired one-time exchange energy |
141 |
> |
Vector3d momentumTarget_; // target or desired one-time exchange momentum |
142 |
> |
|
143 |
> |
RealType kineticExchange_; // actual exchange energy (running total) |
144 |
> |
Vector3d momentumExchange_; // actual exchange momentum (running total) |
145 |
> |
|
146 |
|
RealType exchangeTime_; |
109 |
– |
RealType targetFlux_; |
110 |
– |
RealType exchangeSum_; |
111 |
– |
int failTrialCount_; |
112 |
– |
int failRootCount_; |
113 |
– |
std::ofstream rnemdLog_; |
114 |
– |
// keeps track of what's being averaged |
115 |
– |
std::vector<RealType> valueHist_; |
116 |
– |
std::vector<int> valueCount_; |
117 |
– |
// keeps track of the number of degrees of freedom being averaged |
118 |
– |
std::vector<RealType> xTempHist_, yTempHist_, zTempHist_; |
119 |
– |
std::ofstream xTempLog_, yTempLog_, zTempLog_; |
120 |
– |
}; |
147 |
|
|
148 |
+ |
RealType targetJzpz2_; |
149 |
+ |
|
150 |
+ |
unsigned int trialCount_; |
151 |
+ |
unsigned int failTrialCount_; |
152 |
+ |
unsigned int failRootCount_; |
153 |
+ |
|
154 |
+ |
string rnemdFileName_; |
155 |
+ |
ofstream rnemdFile_; |
156 |
+ |
|
157 |
+ |
RealType runTime_, statusTime_; |
158 |
+ |
|
159 |
+ |
vector<OutputData> data_; |
160 |
+ |
OutputBitSet outputMask_; |
161 |
+ |
OutputMapType outputMap_; |
162 |
+ |
Accumulator* areaAccumulator_; |
163 |
+ |
bool doRNEMD_; |
164 |
+ |
|
165 |
+ |
}; |
166 |
|
} |
167 |
|
#endif //INTEGRATORS_RNEMD_HPP |