--- branches/development/src/brains/Snapshot.cpp 2013/01/22 16:20:11 1838 +++ branches/development/src/brains/Snapshot.cpp 2013/04/30 15:56:54 1868 @@ -35,7 +35,7 @@ * * [1] Meineke, et al., J. Comp. Chem. 26, 252-271 (2005). * [2] Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006). - * [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008). + * [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 234107 (2008). * [4] Kuang & Gezelter, J. Chem. Phys. 133, 164101 (2010). * [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). */ @@ -94,7 +94,9 @@ namespace OpenMD { frameData.id = -1; frameData.currentTime = 0; frameData.hmat = Mat3x3d(0.0); - frameData.invHmat = Mat3x3d(0.0); + frameData.invHmat = Mat3x3d(0.0); + frameData.bBox = Mat3x3d(0.0); + frameData.invBbox = Mat3x3d(0.0); frameData.orthoRhombic = false; frameData.bondPotential = 0.0; frameData.bendPotential = 0.0; @@ -131,7 +133,7 @@ namespace OpenMD { frameData.electronicTemperature = 0.0; frameData.COM = V3Zero; frameData.COMvel = V3Zero; - frameData.COMw = V3Zero; + frameData.COMw = V3Zero; hasTotalEnergy = false; hasTranslationalKineticEnergy = false; @@ -155,6 +157,7 @@ namespace OpenMD { hasGyrationalVolume = false; hasHullVolume = false; hasConservedQuantity = false; + hasBoundingBox = false; } /** Returns the id of this Snapshot */ @@ -252,8 +255,25 @@ namespace OpenMD { /** Returns the inverse H-Matrix */ Mat3x3d Snapshot::getInvHmat() { return frameData.invHmat; + } + + /** Returns the Bounding Box */ + Mat3x3d Snapshot::getBoundingBox() { + return frameData.bBox; + } + + /** Sets the Bounding Box */ + void Snapshot::setBoundingBox(const Mat3x3d& m) { + frameData.bBox = m; + frameData.invBbox = frameData.bBox.inverse(); + hasBoundingBox = true; } + /** Returns the inverse Bounding Box */ + Mat3x3d Snapshot::getInvBoundingBox() { + return frameData.invBbox; + } + RealType Snapshot::getXYarea() { if (!hasXYarea) { Vector3d x = frameData.hmat.getColumn(0);