| 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]  Vardeman & Gezelter, in progress (2009).                         | 
| 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 | 
  | 
#include "brains/SimInfo.hpp" | 
| 62 | 
  | 
 | 
| 63 | 
  | 
     | 
| 64 | 
  | 
  RealType NPTxyz::calcConservedQuantity(){ | 
| 65 | 
< | 
 | 
| 65 | 
< | 
    chi= currentSnapshot_->getChi(); | 
| 66 | 
< | 
    integralOfChidt = currentSnapshot_->getIntegralOfChiDt(); | 
| 65 | 
> | 
    thermostat = snap->getThermostat(); | 
| 66 | 
  | 
    loadEta(); | 
| 67 | 
< | 
     | 
| 67 | 
> | 
 | 
| 68 | 
  | 
    // We need NkBT a lot, so just set it here: This is the RAW number | 
| 69 | 
  | 
    // of integrableObjects, so no subtraction or addition of constraints or | 
| 70 | 
  | 
    // orientational degrees of freedom: | 
| 83 | 
  | 
    RealType barostat_potential; | 
| 84 | 
  | 
    RealType trEta; | 
| 85 | 
  | 
 | 
| 86 | 
< | 
    totalEnergy = thermo.getTotalE(); | 
| 86 | 
> | 
    totalEnergy = thermo.getTotalEnergy(); | 
| 87 | 
  | 
 | 
| 88 | 
< | 
    thermostat_kinetic = fkBT * tt2 * chi * chi /(2.0 * PhysicalConstants::energyConvert); | 
| 88 | 
> | 
    thermostat_kinetic = fkBT * tt2 * thermostat.first * thermostat.first  | 
| 89 | 
> | 
      / (2.0 * PhysicalConstants::energyConvert); | 
| 90 | 
  | 
 | 
| 91 | 
< | 
    thermostat_potential = fkBT* integralOfChidt / PhysicalConstants::energyConvert; | 
| 91 | 
> | 
    thermostat_potential = fkBT* thermostat.second  | 
| 92 | 
> | 
      / PhysicalConstants::energyConvert; | 
| 93 | 
  | 
 | 
| 94 | 
  | 
    SquareMatrix<RealType, 3> tmp = eta.transpose() * eta; | 
| 95 | 
  | 
    trEta = tmp.trace(); | 
| 109 | 
  | 
     | 
| 110 | 
  | 
  void NPTxyz::scaleSimBox(){ | 
| 111 | 
  | 
 | 
| 112 | 
< | 
    int i,j,k; | 
| 112 | 
> | 
    int i, j; | 
| 113 | 
  | 
    Mat3x3d scaleMat; | 
| 114 | 
< | 
    RealType eta2ij, scaleFactor; | 
| 115 | 
< | 
    RealType bigScale, smallScale, offDiagMax; | 
| 114 | 
> | 
    RealType scaleFactor; | 
| 115 | 
> | 
    RealType bigScale, smallScale; | 
| 116 | 
  | 
    Mat3x3d hm; | 
| 117 | 
  | 
    Mat3x3d hmnew; | 
| 118 | 
  | 
 | 
| 118 | 
– | 
 | 
| 119 | 
– | 
 | 
| 119 | 
  | 
    // Scale the box after all the positions have been moved: | 
| 120 | 
  | 
 | 
| 121 | 
  | 
    // Use a taylor expansion for eta products:  Hmat = Hmat . exp(dt * etaMat) | 
| 123 | 
  | 
 | 
| 124 | 
  | 
    bigScale = 1.0; | 
| 125 | 
  | 
    smallScale = 1.0; | 
| 127 | 
– | 
    offDiagMax = 0.0; | 
| 126 | 
  | 
 | 
| 127 | 
  | 
    for(i=0; i<3; i++){ | 
| 128 | 
  | 
      for(j=0; j<3; j++){ | 
| 164 | 
  | 
      simError(); | 
| 165 | 
  | 
    } else { | 
| 166 | 
  | 
 | 
| 167 | 
< | 
      Mat3x3d hmat = currentSnapshot_->getHmat(); | 
| 167 | 
> | 
      Mat3x3d hmat = snap->getHmat(); | 
| 168 | 
  | 
      hmat = hmat *scaleMat; | 
| 169 | 
< | 
      currentSnapshot_->setHmat(hmat); | 
| 169 | 
> | 
      snap->setHmat(hmat); | 
| 170 | 
  | 
    } | 
| 171 | 
  | 
  } | 
| 172 | 
  | 
 | 
| 173 | 
  | 
  void NPTxyz::loadEta() { | 
| 174 | 
< | 
    eta= currentSnapshot_->getEta(); | 
| 174 | 
> | 
    eta= snap->getBarostat(); | 
| 175 | 
  | 
  } | 
| 176 | 
  | 
 | 
| 177 | 
  | 
} |