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). |
38 |
> |
* [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 234107 (2008). |
39 |
|
* [4] Kuang & Gezelter, J. Chem. Phys. 133, 164101 (2010). |
40 |
|
* [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). |
41 |
|
*/ |
44 |
|
* @file Snapshot.cpp |
45 |
|
* @author tlin |
46 |
|
* @date 11/11/2004 |
47 |
– |
* @time 10:56am |
47 |
|
* @version 1.0 |
48 |
|
*/ |
49 |
|
|
72 |
|
frameData.lrPotentials = potVec(0.0); |
73 |
|
frameData.excludedPotentials = potVec(0.0); |
74 |
|
frameData.restraintPotential = 0.0; |
75 |
< |
frameData.rawPotential = 0.0; |
75 |
> |
frameData.rawPotential = 0.0; |
76 |
> |
frameData.xyArea = 0.0; |
77 |
|
frameData.volume = 0.0; |
78 |
|
frameData.thermostat = make_pair(0.0, 0.0); |
79 |
|
frameData.electronicThermostat = make_pair(0.0, 0.0); |
94 |
|
frameData.id = -1; |
95 |
|
frameData.currentTime = 0; |
96 |
|
frameData.hmat = Mat3x3d(0.0); |
97 |
< |
frameData.invHmat = Mat3x3d(0.0); |
97 |
> |
frameData.invHmat = Mat3x3d(0.0); |
98 |
> |
frameData.bBox = Mat3x3d(0.0); |
99 |
> |
frameData.invBbox = Mat3x3d(0.0); |
100 |
|
frameData.orthoRhombic = false; |
101 |
|
frameData.bondPotential = 0.0; |
102 |
|
frameData.bendPotential = 0.0; |
106 |
|
frameData.excludedPotentials = potVec(0.0); |
107 |
|
frameData.restraintPotential = 0.0; |
108 |
|
frameData.rawPotential = 0.0; |
109 |
+ |
frameData.xyArea = 0.0; |
110 |
|
frameData.volume = 0.0; |
111 |
|
frameData.thermostat = make_pair(0.0, 0.0); |
112 |
|
frameData.electronicThermostat = make_pair(0.0, 0.0); |
133 |
|
frameData.electronicTemperature = 0.0; |
134 |
|
frameData.COM = V3Zero; |
135 |
|
frameData.COMvel = V3Zero; |
136 |
< |
frameData.COMw = V3Zero; |
136 |
> |
frameData.COMw = V3Zero; |
137 |
|
|
138 |
|
hasTotalEnergy = false; |
139 |
|
hasTranslationalKineticEnergy = false; |
141 |
|
hasKineticEnergy = false; |
142 |
|
hasShortRangePotential = false; |
143 |
|
hasLongRangePotential = false; |
144 |
< |
hasPotentialEnergy = false; |
144 |
> |
hasPotentialEnergy = false; |
145 |
> |
hasXYarea = false; |
146 |
|
hasVolume = false; |
147 |
|
hasPressure = false; |
148 |
|
hasTemperature = false; |
222 |
|
|
223 |
|
if( oldOrthoRhombic != frameData.orthoRhombic){ |
224 |
|
|
225 |
< |
if( frameData.orthoRhombic ) { |
226 |
< |
sprintf( painCave.errMsg, |
227 |
< |
"OpenMD is switching from the default Non-Orthorhombic\n" |
228 |
< |
"\tto the faster Orthorhombic periodic boundary computations.\n" |
229 |
< |
"\tThis is usually a good thing, but if you want the\n" |
230 |
< |
"\tNon-Orthorhombic computations, make the orthoBoxTolerance\n" |
231 |
< |
"\tvariable ( currently set to %G ) smaller.\n", |
232 |
< |
orthoTolerance_); |
233 |
< |
painCave.severity = OPENMD_INFO; |
234 |
< |
simError(); |
235 |
< |
} |
236 |
< |
else { |
237 |
< |
sprintf( painCave.errMsg, |
238 |
< |
"OpenMD is switching from the faster Orthorhombic to the more\n" |
239 |
< |
"\tflexible Non-Orthorhombic periodic boundary computations.\n" |
240 |
< |
"\tThis is usually because the box has deformed under\n" |
241 |
< |
"\tNPTf integration. If you want to live on the edge with\n" |
242 |
< |
"\tthe Orthorhombic computations, make the orthoBoxTolerance\n" |
243 |
< |
"\tvariable ( currently set to %G ) larger.\n", |
244 |
< |
orthoTolerance_); |
245 |
< |
painCave.severity = OPENMD_WARNING; |
246 |
< |
simError(); |
247 |
< |
} |
225 |
> |
// It is finally time to suppress these warnings once and for |
226 |
> |
// all. They were annoying and not very informative. |
227 |
> |
|
228 |
> |
// if( frameData.orthoRhombic ) { |
229 |
> |
// sprintf( painCave.errMsg, |
230 |
> |
// "OpenMD is switching from the default Non-Orthorhombic\n" |
231 |
> |
// "\tto the faster Orthorhombic periodic boundary computations.\n" |
232 |
> |
// "\tThis is usually a good thing, but if you want the\n" |
233 |
> |
// "\tNon-Orthorhombic computations, make the orthoBoxTolerance\n" |
234 |
> |
// "\tvariable ( currently set to %G ) smaller.\n", |
235 |
> |
// orthoTolerance_); |
236 |
> |
// painCave.severity = OPENMD_INFO; |
237 |
> |
// simError(); |
238 |
> |
// } |
239 |
> |
// else { |
240 |
> |
// sprintf( painCave.errMsg, |
241 |
> |
// "OpenMD is switching from the faster Orthorhombic to the more\n" |
242 |
> |
// "\tflexible Non-Orthorhombic periodic boundary computations.\n" |
243 |
> |
// "\tThis is usually because the box has deformed under\n" |
244 |
> |
// "\tNPTf integration. If you want to live on the edge with\n" |
245 |
> |
// "\tthe Orthorhombic computations, make the orthoBoxTolerance\n" |
246 |
> |
// "\tvariable ( currently set to %G ) larger.\n", |
247 |
> |
// orthoTolerance_); |
248 |
> |
// painCave.severity = OPENMD_WARNING; |
249 |
> |
// simError(); |
250 |
> |
// } |
251 |
|
} |
252 |
|
} |
253 |
|
|
256 |
|
return frameData.invHmat; |
257 |
|
} |
258 |
|
|
259 |
+ |
/** Returns the Bounding Box */ |
260 |
+ |
Mat3x3d Snapshot::getBoundingBox() { |
261 |
+ |
return frameData.bBox; |
262 |
+ |
} |
263 |
+ |
|
264 |
+ |
/** Sets the Bounding Box */ |
265 |
+ |
void Snapshot::setBoundingBox(const Mat3x3d& m) { |
266 |
+ |
frameData.bBox = m; |
267 |
+ |
frameData.invBbox = frameData.bBox.inverse(); |
268 |
+ |
} |
269 |
+ |
|
270 |
+ |
/** Returns the inverse Bounding Box */ |
271 |
+ |
Mat3x3d Snapshot::getInvBoundingBox() { |
272 |
+ |
return frameData.invBbox; |
273 |
+ |
} |
274 |
+ |
|
275 |
+ |
RealType Snapshot::getXYarea() { |
276 |
+ |
if (!hasXYarea) { |
277 |
+ |
Vector3d x = frameData.hmat.getColumn(0); |
278 |
+ |
Vector3d y = frameData.hmat.getColumn(1); |
279 |
+ |
frameData.xyArea = cross(x,y).length(); |
280 |
+ |
hasXYarea = true; |
281 |
+ |
} |
282 |
+ |
return frameData.xyArea; |
283 |
+ |
} |
284 |
+ |
|
285 |
|
RealType Snapshot::getVolume() { |
286 |
|
if (!hasVolume) { |
287 |
|
frameData.volume = frameData.hmat.determinant(); |