| 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). |
| 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 |
|
*/ |
| 195 |
|
|
| 196 |
|
StatsData hydrogenbonding_potential; |
| 197 |
|
hydrogenbonding_potential.units = "kcal/mol"; |
| 198 |
< |
hydrogenbonding_potential.title = "Metallic Potential"; |
| 198 |
> |
hydrogenbonding_potential.title = "Hydrogen Bonding Potential"; |
| 199 |
|
hydrogenbonding_potential.dataType = "RealType"; |
| 200 |
|
hydrogenbonding_potential.accumulator = new Accumulator(); |
| 201 |
|
data_[HYDROGENBONDING_POTENTIAL] = hydrogenbonding_potential; |
| 202 |
|
statsMap_["HYDROGENBONDING_POTENTIAL"] = HYDROGENBONDING_POTENTIAL; |
| 203 |
+ |
|
| 204 |
+ |
StatsData reciprocal_potential; |
| 205 |
+ |
reciprocal_potential.units = "kcal/mol"; |
| 206 |
+ |
reciprocal_potential.title = "Reciprocal Space Potential"; |
| 207 |
+ |
reciprocal_potential.dataType = "RealType"; |
| 208 |
+ |
reciprocal_potential.accumulator = new Accumulator(); |
| 209 |
+ |
data_[RECIPROCAL_POTENTIAL] = reciprocal_potential; |
| 210 |
+ |
statsMap_["RECIPROCAL_POTENTIAL"] = RECIPROCAL_POTENTIAL; |
| 211 |
|
|
| 212 |
|
StatsData short_range_potential; |
| 213 |
|
short_range_potential.units = "kcal/mol"; |
| 320 |
|
electronic_temperature.accumulator = new Accumulator(); |
| 321 |
|
data_[ELECTRONIC_TEMPERATURE] = electronic_temperature; |
| 322 |
|
statsMap_["ELECTRONIC_TEMPERATURE"] = ELECTRONIC_TEMPERATURE; |
| 323 |
+ |
|
| 324 |
+ |
StatsData com; |
| 325 |
+ |
com.units = "A"; |
| 326 |
+ |
com.title = "Center of Mass"; |
| 327 |
+ |
com.dataType = "Vector3d"; |
| 328 |
+ |
com.accumulator = new VectorAccumulator(); |
| 329 |
+ |
data_[COM] = com; |
| 330 |
+ |
statsMap_["COM"] = COM; |
| 331 |
|
|
| 332 |
+ |
StatsData comVel; |
| 333 |
+ |
comVel.units = "A/fs"; |
| 334 |
+ |
comVel.title = "Center of Mass Velocity"; |
| 335 |
+ |
comVel.dataType = "Vector3d"; |
| 336 |
+ |
comVel.accumulator = new VectorAccumulator(); |
| 337 |
+ |
data_[COM_VELOCITY] = comVel; |
| 338 |
+ |
statsMap_["COM_VELOCITY"] = COM_VELOCITY; |
| 339 |
+ |
|
| 340 |
+ |
StatsData angMom; |
| 341 |
+ |
angMom.units = "amu A^2/fs"; |
| 342 |
+ |
angMom.title = "Angular Momentum"; |
| 343 |
+ |
angMom.dataType = "Vector3d"; |
| 344 |
+ |
angMom.accumulator = new VectorAccumulator(); |
| 345 |
+ |
data_[ANGULAR_MOMENTUM] = angMom; |
| 346 |
+ |
statsMap_["ANGULAR_MOMENTUM"] = ANGULAR_MOMENTUM; |
| 347 |
+ |
|
| 348 |
|
// Now, set some defaults in the mask: |
| 349 |
|
|
| 350 |
|
Globals* simParams = info_->getSimParams(); |
| 411 |
|
} |
| 412 |
|
} |
| 413 |
|
|
| 414 |
+ |
Stats::~Stats() { |
| 415 |
+ |
data_.clear(); |
| 416 |
+ |
statsMap_.clear(); |
| 417 |
+ |
} |
| 418 |
|
|
| 419 |
|
std::string Stats::getTitle(int index) { |
| 420 |
|
assert(index >=0 && index < ENDINDEX); |
| 432 |
|
} |
| 433 |
|
|
| 434 |
|
void Stats::collectStats(){ |
| 399 |
– |
Globals* simParams = info_->getSimParams(); |
| 435 |
|
Snapshot* snap = info_->getSnapshotManager()->getCurrentSnapshot(); |
| 436 |
|
Thermo thermo(info_); |
| 437 |
|
|
| 439 |
|
if (statsMask_[i]) { |
| 440 |
|
switch (i) { |
| 441 |
|
case TIME: |
| 442 |
< |
data_[i].accumulator->add(snap->getTime()); |
| 442 |
> |
dynamic_cast<Accumulator *>(data_[i].accumulator)->add(snap->getTime()); |
| 443 |
|
break; |
| 444 |
|
case KINETIC_ENERGY: |
| 445 |
< |
data_[i].accumulator->add(thermo.getKinetic()); |
| 445 |
> |
dynamic_cast<Accumulator *>(data_[i].accumulator)->add(thermo.getKinetic()); |
| 446 |
|
break; |
| 447 |
|
case POTENTIAL_ENERGY: |
| 448 |
< |
data_[i].accumulator->add(thermo.getPotential()); |
| 448 |
> |
dynamic_cast<Accumulator *>(data_[i].accumulator)->add(thermo.getPotential()); |
| 449 |
|
break; |
| 450 |
|
case TOTAL_ENERGY: |
| 451 |
< |
data_[i].accumulator->add(thermo.getTotalEnergy()); |
| 451 |
> |
dynamic_cast<Accumulator *>(data_[i].accumulator)->add(thermo.getTotalEnergy()); |
| 452 |
|
break; |
| 453 |
|
case TEMPERATURE: |
| 454 |
< |
data_[i].accumulator->add(thermo.getTemperature()); |
| 454 |
> |
dynamic_cast<Accumulator *>(data_[i].accumulator)->add(thermo.getTemperature()); |
| 455 |
|
break; |
| 456 |
|
case PRESSURE: |
| 457 |
< |
data_[i].accumulator->add(thermo.getPressure()); |
| 457 |
> |
dynamic_cast<Accumulator *>(data_[i].accumulator)->add(thermo.getPressure()); |
| 458 |
|
break; |
| 459 |
|
case VOLUME: |
| 460 |
< |
data_[i].accumulator->add(thermo.getVolume()); |
| 460 |
> |
dynamic_cast<Accumulator *>(data_[i].accumulator)->add(thermo.getVolume()); |
| 461 |
|
break; |
| 462 |
|
case CONSERVED_QUANTITY: |
| 463 |
< |
data_[i].accumulator->add(snap->getConservedQuantity()); |
| 463 |
> |
dynamic_cast<Accumulator *>(data_[i].accumulator)->add(snap->getConservedQuantity()); |
| 464 |
|
break; |
| 465 |
|
case PRESSURE_TENSOR: |
| 466 |
|
dynamic_cast<MatrixAccumulator *>(data_[i].accumulator)->add(thermo.getPressureTensor()); |
| 472 |
|
dynamic_cast<VectorAccumulator *>(data_[i].accumulator)->add(thermo.getHeatFlux()); |
| 473 |
|
break; |
| 474 |
|
case HULLVOLUME: |
| 475 |
< |
data_[i].accumulator->add(thermo.getHullVolume()); |
| 475 |
> |
dynamic_cast<Accumulator *>(data_[i].accumulator)->add(thermo.getHullVolume()); |
| 476 |
|
break; |
| 477 |
|
case GYRVOLUME: |
| 478 |
< |
data_[i].accumulator->add(thermo.getGyrationalVolume()); |
| 478 |
> |
dynamic_cast<Accumulator *>(data_[i].accumulator)->add(thermo.getGyrationalVolume()); |
| 479 |
|
break; |
| 480 |
|
case TRANSLATIONAL_KINETIC: |
| 481 |
< |
data_[i].accumulator->add(thermo.getTranslationalKinetic()); |
| 481 |
> |
dynamic_cast<Accumulator *>(data_[i].accumulator)->add(thermo.getTranslationalKinetic()); |
| 482 |
|
break; |
| 483 |
|
case ROTATIONAL_KINETIC: |
| 484 |
< |
data_[i].accumulator->add(thermo.getRotationalKinetic()); |
| 484 |
> |
dynamic_cast<Accumulator *>(data_[i].accumulator)->add(thermo.getRotationalKinetic()); |
| 485 |
|
break; |
| 486 |
|
case LONG_RANGE_POTENTIAL: |
| 487 |
< |
data_[i].accumulator->add(snap->getLongRangePotential()); |
| 487 |
> |
dynamic_cast<Accumulator *>(data_[i].accumulator)->add(snap->getLongRangePotential()); |
| 488 |
|
break; |
| 489 |
|
case VANDERWAALS_POTENTIAL: |
| 490 |
< |
data_[i].accumulator->add(snap->getLongRangePotentials()[VANDERWAALS_FAMILY]); |
| 490 |
> |
dynamic_cast<Accumulator *>(data_[i].accumulator)->add(snap->getLongRangePotentials()[VANDERWAALS_FAMILY]); |
| 491 |
|
break; |
| 492 |
|
case ELECTROSTATIC_POTENTIAL: |
| 493 |
< |
data_[i].accumulator->add(snap->getLongRangePotentials()[ELECTROSTATIC_FAMILY]); |
| 493 |
> |
dynamic_cast<Accumulator *>(data_[i].accumulator)->add(snap->getLongRangePotentials()[ELECTROSTATIC_FAMILY]); |
| 494 |
|
break; |
| 495 |
|
case METALLIC_POTENTIAL: |
| 496 |
< |
data_[i].accumulator->add(snap->getLongRangePotentials()[METALLIC_FAMILY]); |
| 496 |
> |
dynamic_cast<Accumulator *>(data_[i].accumulator)->add(snap->getLongRangePotentials()[METALLIC_FAMILY]); |
| 497 |
|
break; |
| 498 |
|
case HYDROGENBONDING_POTENTIAL: |
| 499 |
< |
data_[i].accumulator->add(snap->getLongRangePotentials()[HYDROGENBONDING_FAMILY]); |
| 499 |
> |
dynamic_cast<Accumulator *>(data_[i].accumulator)->add(snap->getLongRangePotentials()[HYDROGENBONDING_FAMILY]); |
| 500 |
|
break; |
| 501 |
+ |
case RECIPROCAL_POTENTIAL: |
| 502 |
+ |
dynamic_cast<Accumulator *>(data_[i].accumulator)->add(snap->getReciprocalPotential()); |
| 503 |
+ |
break; |
| 504 |
|
case SHORT_RANGE_POTENTIAL: |
| 505 |
< |
data_[i].accumulator->add(snap->getShortRangePotential()); |
| 505 |
> |
dynamic_cast<Accumulator *>(data_[i].accumulator)->add(snap->getShortRangePotential()); |
| 506 |
|
break; |
| 507 |
|
case BOND_POTENTIAL: |
| 508 |
< |
data_[i].accumulator->add(snap->getBondPotential()); |
| 508 |
> |
dynamic_cast<Accumulator *>(data_[i].accumulator)->add(snap->getBondPotential()); |
| 509 |
|
break; |
| 510 |
|
case BEND_POTENTIAL: |
| 511 |
< |
data_[i].accumulator->add(snap->getBendPotential()); |
| 511 |
> |
dynamic_cast<Accumulator *>(data_[i].accumulator)->add(snap->getBendPotential()); |
| 512 |
|
break; |
| 513 |
|
case DIHEDRAL_POTENTIAL: |
| 514 |
< |
data_[i].accumulator->add(snap->getTorsionPotential()); |
| 514 |
> |
dynamic_cast<Accumulator *>(data_[i].accumulator)->add(snap->getTorsionPotential()); |
| 515 |
|
break; |
| 516 |
|
case INVERSION_POTENTIAL: |
| 517 |
< |
data_[i].accumulator->add(snap->getInversionPotential()); |
| 517 |
> |
dynamic_cast<Accumulator *>(data_[i].accumulator)->add(snap->getInversionPotential()); |
| 518 |
|
break; |
| 519 |
|
case RAW_POTENTIAL: |
| 520 |
< |
data_[i].accumulator->add(snap->getRawPotential()); |
| 520 |
> |
dynamic_cast<Accumulator *>(data_[i].accumulator)->add(snap->getRawPotential()); |
| 521 |
|
break; |
| 522 |
|
case RESTRAINT_POTENTIAL: |
| 523 |
< |
data_[i].accumulator->add(snap->getRestraintPotential()); |
| 523 |
> |
dynamic_cast<Accumulator *>(data_[i].accumulator)->add(snap->getRestraintPotential()); |
| 524 |
|
break; |
| 525 |
|
case TAGGED_PAIR_DISTANCE: |
| 526 |
< |
data_[i].accumulator->add(thermo.getTaggedAtomPairDistance()); |
| 526 |
> |
dynamic_cast<Accumulator *>(data_[i].accumulator)->add(thermo.getTaggedAtomPairDistance()); |
| 527 |
|
break; |
| 528 |
+ |
case ELECTRONIC_TEMPERATURE: |
| 529 |
+ |
dynamic_cast<Accumulator *>(data_[i].accumulator)->add(thermo.getElectronicTemperature()); |
| 530 |
+ |
break; |
| 531 |
+ |
case COM: |
| 532 |
+ |
dynamic_cast<VectorAccumulator *>(data_[i].accumulator)->add(thermo.getCom()); |
| 533 |
+ |
break; |
| 534 |
+ |
case COM_VELOCITY: |
| 535 |
+ |
dynamic_cast<VectorAccumulator *>(data_[i].accumulator)->add(thermo.getComVel()); |
| 536 |
+ |
break; |
| 537 |
+ |
case ANGULAR_MOMENTUM: |
| 538 |
+ |
dynamic_cast<VectorAccumulator *>(data_[i].accumulator)->add(thermo.getAngularMomentum()); |
| 539 |
+ |
break; |
| 540 |
|
/* |
| 541 |
|
case SHADOWH: |
| 542 |
< |
data_[i].accumulator->add(thermo.getShadowHamiltionian()); |
| 542 |
> |
dynamic_cast<Accumulator *>(data_[i].accumulator)->add(thermo.getShadowHamiltionian()); |
| 543 |
|
break; |
| 544 |
|
case HELFANDMOMENT: |
| 545 |
< |
data_[i].accumulator->add(thermo.getHelfandMoment()); |
| 545 |
> |
dynamic_cast<Accumulator *>(data_[i].accumulator)->add(thermo.getHelfandMoment()); |
| 546 |
|
break; |
| 547 |
|
*/ |
| 498 |
– |
case ELECTRONIC_TEMPERATURE: |
| 499 |
– |
data_[i].accumulator->add(thermo.getElectronicTemperature()); |
| 500 |
– |
break; |
| 548 |
|
} |
| 549 |
|
} |
| 550 |
|
} |
| 553 |
|
int Stats::getIntData(int index) { |
| 554 |
|
assert(index >=0 && index < ENDINDEX); |
| 555 |
|
RealType value; |
| 556 |
< |
data_[index].accumulator->getLastValue(value); |
| 556 |
> |
dynamic_cast<Accumulator *>(data_[index].accumulator)->getLastValue(value); |
| 557 |
|
return (int) value; |
| 558 |
|
} |
| 559 |
|
RealType Stats::getRealData(int index) { |
| 560 |
|
assert(index >=0 && index < ENDINDEX); |
| 561 |
|
RealType value(0.0); |
| 562 |
< |
data_[index].accumulator->getLastValue(value); |
| 562 |
> |
dynamic_cast<Accumulator *>(data_[index].accumulator)->getLastValue(value); |
| 563 |
|
return value; |
| 564 |
|
} |
| 565 |
|
Vector3d Stats::getVectorData(int index) { |