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). |
39 |
< |
* [4] Vardeman & Gezelter, in progress (2009). |
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 |
|
*/ |
42 |
|
|
43 |
|
#include "NPTi.hpp" |
78 |
|
} |
79 |
|
|
80 |
|
void NPTi::calcVelScale() { |
81 |
< |
vScale = chi + eta; |
81 |
> |
vScale = thermostat.first + eta; |
82 |
|
} |
83 |
|
|
84 |
|
void NPTi::getVelScaleA(Vector3d& sc, const Vector3d& vel) { |
112 |
|
painCave.isFatal = 1; |
113 |
|
simError(); |
114 |
|
} else { |
115 |
< |
Mat3x3d hmat = currentSnapshot_->getHmat(); |
115 |
> |
Mat3x3d hmat = snap->getHmat(); |
116 |
|
hmat *= scaleFactor; |
117 |
< |
currentSnapshot_->setHmat(hmat); |
117 |
> |
snap->setHmat(hmat); |
118 |
|
} |
119 |
|
|
120 |
|
} |
126 |
|
|
127 |
|
RealType NPTi::calcConservedQuantity(){ |
128 |
|
|
129 |
< |
chi= currentSnapshot_->getChi(); |
129 |
< |
integralOfChidt = currentSnapshot_->getIntegralOfChiDt(); |
129 |
> |
thermostat = snap->getThermostat(); |
130 |
|
loadEta(); |
131 |
|
// We need NkBT a lot, so just set it here: This is the RAW number |
132 |
|
// of integrableObjects, so no subtraction or addition of constraints or |
145 |
|
RealType barostat_kinetic; |
146 |
|
RealType barostat_potential; |
147 |
|
|
148 |
< |
Energy =thermo.getTotalE(); |
148 |
> |
Energy =thermo.getTotalEnergy(); |
149 |
|
|
150 |
< |
thermostat_kinetic = fkBT* tt2 * chi * chi / (2.0 * PhysicalConstants::energyConvert); |
150 |
> |
thermostat_kinetic = fkBT* tt2 * thermostat.first * |
151 |
> |
thermostat.first / (2.0 * PhysicalConstants::energyConvert); |
152 |
|
|
153 |
< |
thermostat_potential = fkBT* integralOfChidt / PhysicalConstants::energyConvert; |
153 |
> |
thermostat_potential = fkBT* thermostat.second / PhysicalConstants::energyConvert; |
154 |
|
|
155 |
|
|
156 |
|
barostat_kinetic = 3.0 * NkBT * tb2 * eta * eta /(2.0 * PhysicalConstants::energyConvert); |
165 |
|
} |
166 |
|
|
167 |
|
void NPTi::loadEta() { |
168 |
< |
Mat3x3d etaMat = currentSnapshot_->getEta(); |
168 |
> |
Mat3x3d etaMat = snap->getBarostat(); |
169 |
|
eta = etaMat(0,0); |
170 |
|
//if (fabs(etaMat(1,1) - eta) >= OpenMD::epsilon || fabs(etaMat(1,1) - eta) >= OpenMD::epsilon || !etaMat.isDiagonal()) { |
171 |
|
// sprintf( painCave.errMsg, |
180 |
|
etaMat(0, 0) = eta; |
181 |
|
etaMat(1, 1) = eta; |
182 |
|
etaMat(2, 2) = eta; |
183 |
< |
currentSnapshot_->setEta(etaMat); |
183 |
> |
snap->setBarostat(etaMat); |
184 |
|
} |
185 |
|
} |