8 |
|
|
9 |
|
namespace oopse { |
10 |
|
|
11 |
– |
static IntegratorBuilder<NPTf>* NPTfCreator = new IntegratorBuilder<NPTf>("NPTf"); |
12 |
– |
|
11 |
|
// Basic non-isotropic thermostating and barostating via the Melchionna |
12 |
|
// modification of the Hoover algorithm: |
13 |
|
// |
203 |
|
|
204 |
|
double NPTf::calcConservedQuantity(){ |
205 |
|
|
206 |
+ |
chi= currentSnapshot_->getChi(); |
207 |
+ |
integralOfChidt = currentSnapshot_->getIntegralOfChiDt(); |
208 |
+ |
loadEta(); |
209 |
+ |
|
210 |
+ |
// We need NkBT a lot, so just set it here: This is the RAW number |
211 |
+ |
// of integrableObjects, so no subtraction or addition of constraints or |
212 |
+ |
// orientational degrees of freedom: |
213 |
+ |
NkBT = info_->getNGlobalIntegrableObjects()*OOPSEConstant::kB *targetTemp; |
214 |
+ |
|
215 |
+ |
// fkBT is used because the thermostat operates on more degrees of freedom |
216 |
+ |
// than the barostat (when there are particles with orientational degrees |
217 |
+ |
// of freedom). |
218 |
+ |
fkBT = info_->getNdf()*OOPSEConstant::kB *targetTemp; |
219 |
+ |
|
220 |
|
double conservedQuantity; |
221 |
|
double totalEnergy; |
222 |
|
double thermostat_kinetic; |
248 |
|
void NPTf::loadEta() { |
249 |
|
eta= currentSnapshot_->getEta(); |
250 |
|
|
251 |
< |
if (!eta.isDiagonal()) { |
252 |
< |
sprintf( painCave.errMsg, |
253 |
< |
"NPTi error: the diagonal elements of are eta matrix is not same or etaMat is not a diagonal matrix"); |
254 |
< |
painCave.isFatal = 1; |
255 |
< |
simError(); |
256 |
< |
} |
251 |
> |
//if (!eta.isDiagonal()) { |
252 |
> |
// sprintf( painCave.errMsg, |
253 |
> |
// "NPTf error: the diagonal elements of eta matrix are not the same or etaMat is not a diagonal matrix"); |
254 |
> |
// painCave.isFatal = 1; |
255 |
> |
// simError(); |
256 |
> |
//} |
257 |
|
} |
258 |
|
|
259 |
|
void NPTf::saveEta() { |