ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/branches/development/src/brains/Snapshot.cpp
(Generate patch)

Comparing branches/development/src/brains/Snapshot.cpp (file contents):
Revision 1764 by gezelter, Tue Jul 3 18:32:27 2012 UTC vs.
Revision 1838 by gezelter, Tue Jan 22 16:20:11 2013 UTC

# Line 44 | Line 44
44   * @file Snapshot.cpp
45   * @author tlin
46   * @date 11/11/2004
47 * @time 10:56am
47   * @version 1.0
48   */
49  
# Line 73 | Line 72 | namespace OpenMD {
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);
# Line 104 | Line 104 | namespace OpenMD {
104      frameData.excludedPotentials = potVec(0.0);
105      frameData.restraintPotential = 0.0;
106      frameData.rawPotential = 0.0;      
107 +    frameData.xyArea = 0.0;
108      frameData.volume = 0.0;          
109      frameData.thermostat = make_pair(0.0, 0.0);
110      frameData.electronicThermostat = make_pair(0.0, 0.0);
# Line 138 | Line 139 | namespace OpenMD {
139      hasKineticEnergy = false;      
140      hasShortRangePotential = false;
141      hasLongRangePotential = false;
142 <    hasPotentialEnergy = false;    
142 >    hasPotentialEnergy = false;  
143 >    hasXYarea = false;
144      hasVolume = false;        
145      hasPressure = false;      
146      hasTemperature = false;    
# Line 218 | Line 220 | namespace OpenMD {
220      
221      if( oldOrthoRhombic != frameData.orthoRhombic){
222        
223 <      if( frameData.orthoRhombic ) {
224 <        sprintf( painCave.errMsg,
225 <                 "OpenMD is switching from the default Non-Orthorhombic\n"
226 <                 "\tto the faster Orthorhombic periodic boundary computations.\n"
227 <                 "\tThis is usually a good thing, but if you want the\n"
228 <                 "\tNon-Orthorhombic computations, make the orthoBoxTolerance\n"
229 <                 "\tvariable ( currently set to %G ) smaller.\n",
230 <                 orthoTolerance_);
231 <        painCave.severity = OPENMD_INFO;
232 <        simError();
233 <      }
234 <      else {
235 <        sprintf( painCave.errMsg,
236 <                 "OpenMD is switching from the faster Orthorhombic to the more\n"
237 <                 "\tflexible Non-Orthorhombic periodic boundary computations.\n"
238 <                 "\tThis is usually because the box has deformed under\n"
239 <                 "\tNPTf integration. If you want to live on the edge with\n"
240 <                 "\tthe Orthorhombic computations, make the orthoBoxTolerance\n"
241 <                 "\tvariable ( currently set to %G ) larger.\n",
242 <                 orthoTolerance_);
243 <        painCave.severity = OPENMD_WARNING;
244 <        simError();
245 <      }
223 >      // It is finally time to suppress these warnings once and for
224 >      // all.  They were annoying and not very informative.
225 >
226 >      // if( frameData.orthoRhombic ) {
227 >      //   sprintf( painCave.errMsg,
228 >      //         "OpenMD is switching from the default Non-Orthorhombic\n"
229 >      //         "\tto the faster Orthorhombic periodic boundary computations.\n"
230 >      //         "\tThis is usually a good thing, but if you want the\n"
231 >      //         "\tNon-Orthorhombic computations, make the orthoBoxTolerance\n"
232 >      //         "\tvariable ( currently set to %G ) smaller.\n",
233 >      //         orthoTolerance_);
234 >      //   painCave.severity = OPENMD_INFO;
235 >      //   simError();
236 >      // }
237 >      // else {
238 >      //   sprintf( painCave.errMsg,
239 >      //         "OpenMD is switching from the faster Orthorhombic to the more\n"
240 >      //         "\tflexible Non-Orthorhombic periodic boundary computations.\n"
241 >      //         "\tThis is usually because the box has deformed under\n"
242 >      //         "\tNPTf integration. If you want to live on the edge with\n"
243 >      //         "\tthe Orthorhombic computations, make the orthoBoxTolerance\n"
244 >      //         "\tvariable ( currently set to %G ) larger.\n",
245 >      //         orthoTolerance_);
246 >      //   painCave.severity = OPENMD_WARNING;
247 >      //   simError();
248 >      // }
249      }    
250    }
251    
252    /** Returns the inverse H-Matrix */
253    Mat3x3d Snapshot::getInvHmat() {
254      return frameData.invHmat;
255 +  }
256 +
257 +  RealType Snapshot::getXYarea() {
258 +    if (!hasXYarea) {
259 +      Vector3d x = frameData.hmat.getColumn(0);
260 +      Vector3d y = frameData.hmat.getColumn(1);
261 +      frameData.xyArea = cross(x,y).length();
262 +      hasXYarea = true;
263 +    }
264 +    return frameData.xyArea;
265    }
266  
267    RealType Snapshot::getVolume() {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines