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" |
70 |
|
vScale(i, j) = eta(i, j); |
71 |
|
|
72 |
|
if (i == j) { |
73 |
< |
vScale(i, j) += chi; |
73 |
> |
vScale(i, j) += thermostat.first; |
74 |
|
} |
75 |
|
} |
76 |
|
} |
104 |
|
} |
105 |
|
|
106 |
|
scaleMat(2, 2) = exp(dt*eta(2, 2)); |
107 |
< |
Mat3x3d hmat = currentSnapshot_->getHmat(); |
107 |
> |
Mat3x3d hmat = snap->getHmat(); |
108 |
|
hmat = hmat *scaleMat; |
109 |
< |
currentSnapshot_->setHmat(hmat); |
109 |
> |
snap->setHmat(hmat); |
110 |
|
} |
111 |
|
|
112 |
|
bool NPAT::etaConverged() { |
125 |
|
|
126 |
|
RealType NPAT::calcConservedQuantity(){ |
127 |
|
|
128 |
< |
chi= currentSnapshot_->getChi(); |
128 |
< |
integralOfChidt = currentSnapshot_->getIntegralOfChiDt(); |
128 |
> |
thermostat = snap->getThermostat(); |
129 |
|
loadEta(); |
130 |
|
|
131 |
|
// We need NkBT a lot, so just set it here: This is the RAW number |
146 |
|
RealType barostat_potential; |
147 |
|
RealType trEta; |
148 |
|
|
149 |
< |
totalEnergy = thermo.getTotalE(); |
149 |
> |
totalEnergy = thermo.getTotalEnergy(); |
150 |
|
|
151 |
< |
thermostat_kinetic = fkBT * tt2 * chi * chi /(2.0 * PhysicalConstants::energyConvert); |
151 |
> |
thermostat_kinetic = fkBT * tt2 * thermostat.first * |
152 |
> |
thermostat.first /(2.0 * PhysicalConstants::energyConvert); |
153 |
|
|
154 |
< |
thermostat_potential = fkBT* integralOfChidt / PhysicalConstants::energyConvert; |
154 |
> |
thermostat_potential = fkBT* thermostat.second / PhysicalConstants::energyConvert; |
155 |
|
|
156 |
|
SquareMatrix<RealType, 3> tmp = eta.transpose() * eta; |
157 |
|
trEta = tmp.trace(); |
168 |
|
} |
169 |
|
|
170 |
|
void NPAT::loadEta() { |
171 |
< |
eta= currentSnapshot_->getEta(); |
171 |
> |
eta= snap->getBarostat(); |
172 |
|
|
173 |
|
//if (!eta.isDiagonal()) { |
174 |
|
// sprintf( painCave.errMsg, |
179 |
|
} |
180 |
|
|
181 |
|
void NPAT::saveEta() { |
182 |
< |
currentSnapshot_->setEta(eta); |
182 |
> |
snap->setBarostat(eta); |
183 |
|
} |
184 |
|
|
185 |
|
} |