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 1808 by gezelter, Mon Oct 22 20:42:10 2012 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 247 | Line 249 | namespace OpenMD {
249    /** Returns the inverse H-Matrix */
250    Mat3x3d Snapshot::getInvHmat() {
251      return frameData.invHmat;
252 +  }
253 +
254 +  RealType Snapshot::getXYarea() {
255 +    if (!hasXYarea) {
256 +      Vector3d x = frameData.hmat.getColumn(0);
257 +      Vector3d y = frameData.hmat.getColumn(1);
258 +      frameData.xyArea = cross(x,y).length();
259 +      hasXYarea = true;
260 +    }
261 +    return frameData.xyArea;
262    }
263  
264    RealType Snapshot::getVolume() {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines