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 |
|
*/ |
44 |
|
* @file Stats.cpp |
45 |
|
* @author tlin |
46 |
|
* @date 11/04/2004 |
47 |
+ |
* @time 14:26am |
48 |
|
* @version 1.0 |
49 |
|
*/ |
50 |
|
|
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; |
312 |
|
electronic_temperature.accumulator = new Accumulator(); |
313 |
|
data_[ELECTRONIC_TEMPERATURE] = electronic_temperature; |
314 |
|
statsMap_["ELECTRONIC_TEMPERATURE"] = ELECTRONIC_TEMPERATURE; |
315 |
+ |
|
316 |
+ |
StatsData com; |
317 |
+ |
com.units = "A"; |
318 |
+ |
com.title = "Center of Mass"; |
319 |
+ |
com.dataType = "Vector3d"; |
320 |
+ |
com.accumulator = new VectorAccumulator(); |
321 |
+ |
data_[COM] = com; |
322 |
+ |
statsMap_["COM"] = COM; |
323 |
+ |
|
324 |
+ |
StatsData comVel; |
325 |
+ |
comVel.units = "A/fs"; |
326 |
+ |
comVel.title = "Center of Mass Velocity"; |
327 |
+ |
comVel.dataType = "Vector3d"; |
328 |
+ |
comVel.accumulator = new VectorAccumulator(); |
329 |
+ |
data_[COM_VELOCITY] = comVel; |
330 |
+ |
statsMap_["COM_VELOCITY"] = COM_VELOCITY; |
331 |
|
|
332 |
+ |
StatsData angMom; |
333 |
+ |
angMom.units = "amu A^2/fs"; |
334 |
+ |
angMom.title = "Angular Momentum"; |
335 |
+ |
angMom.dataType = "Vector3d"; |
336 |
+ |
angMom.accumulator = new VectorAccumulator(); |
337 |
+ |
data_[ANGULAR_MOMENTUM] = angMom; |
338 |
+ |
statsMap_["ANGULAR_MOMENTUM"] = ANGULAR_MOMENTUM; |
339 |
+ |
|
340 |
|
// Now, set some defaults in the mask: |
341 |
|
|
342 |
|
Globals* simParams = info_->getSimParams(); |
403 |
|
} |
404 |
|
} |
405 |
|
|
406 |
+ |
Stats::~Stats() { |
407 |
+ |
data_.clear(); |
408 |
+ |
statsMap_.clear(); |
409 |
+ |
} |
410 |
|
|
411 |
|
std::string Stats::getTitle(int index) { |
412 |
|
assert(index >=0 && index < ENDINDEX); |
424 |
|
} |
425 |
|
|
426 |
|
void Stats::collectStats(){ |
398 |
– |
Globals* simParams = info_->getSimParams(); |
427 |
|
Snapshot* snap = info_->getSnapshotManager()->getCurrentSnapshot(); |
428 |
|
Thermo thermo(info_); |
429 |
|
|
431 |
|
if (statsMask_[i]) { |
432 |
|
switch (i) { |
433 |
|
case TIME: |
434 |
< |
data_[i].accumulator->add(snap->getTime()); |
434 |
> |
dynamic_cast<Accumulator *>(data_[i].accumulator)->add(snap->getTime()); |
435 |
|
break; |
436 |
|
case KINETIC_ENERGY: |
437 |
< |
data_[i].accumulator->add(thermo.getKinetic()); |
437 |
> |
dynamic_cast<Accumulator *>(data_[i].accumulator)->add(thermo.getKinetic()); |
438 |
|
break; |
439 |
|
case POTENTIAL_ENERGY: |
440 |
< |
data_[i].accumulator->add(thermo.getPotential()); |
440 |
> |
dynamic_cast<Accumulator *>(data_[i].accumulator)->add(thermo.getPotential()); |
441 |
|
break; |
442 |
|
case TOTAL_ENERGY: |
443 |
< |
data_[i].accumulator->add(thermo.getTotalEnergy()); |
443 |
> |
dynamic_cast<Accumulator *>(data_[i].accumulator)->add(thermo.getTotalEnergy()); |
444 |
|
break; |
445 |
|
case TEMPERATURE: |
446 |
< |
data_[i].accumulator->add(thermo.getTemperature()); |
446 |
> |
dynamic_cast<Accumulator *>(data_[i].accumulator)->add(thermo.getTemperature()); |
447 |
|
break; |
448 |
|
case PRESSURE: |
449 |
< |
data_[i].accumulator->add(thermo.getPressure()); |
449 |
> |
dynamic_cast<Accumulator *>(data_[i].accumulator)->add(thermo.getPressure()); |
450 |
|
break; |
451 |
|
case VOLUME: |
452 |
< |
data_[i].accumulator->add(thermo.getVolume()); |
452 |
> |
dynamic_cast<Accumulator *>(data_[i].accumulator)->add(thermo.getVolume()); |
453 |
|
break; |
454 |
|
case CONSERVED_QUANTITY: |
455 |
< |
data_[i].accumulator->add(snap->getConservedQuantity()); |
455 |
> |
dynamic_cast<Accumulator *>(data_[i].accumulator)->add(snap->getConservedQuantity()); |
456 |
|
break; |
457 |
|
case PRESSURE_TENSOR: |
458 |
|
dynamic_cast<MatrixAccumulator *>(data_[i].accumulator)->add(thermo.getPressureTensor()); |
464 |
|
dynamic_cast<VectorAccumulator *>(data_[i].accumulator)->add(thermo.getHeatFlux()); |
465 |
|
break; |
466 |
|
case HULLVOLUME: |
467 |
< |
data_[i].accumulator->add(thermo.getHullVolume()); |
467 |
> |
dynamic_cast<Accumulator *>(data_[i].accumulator)->add(thermo.getHullVolume()); |
468 |
|
break; |
469 |
|
case GYRVOLUME: |
470 |
< |
data_[i].accumulator->add(thermo.getGyrationalVolume()); |
470 |
> |
dynamic_cast<Accumulator *>(data_[i].accumulator)->add(thermo.getGyrationalVolume()); |
471 |
|
break; |
472 |
|
case TRANSLATIONAL_KINETIC: |
473 |
< |
data_[i].accumulator->add(thermo.getTranslationalKinetic()); |
473 |
> |
dynamic_cast<Accumulator *>(data_[i].accumulator)->add(thermo.getTranslationalKinetic()); |
474 |
|
break; |
475 |
|
case ROTATIONAL_KINETIC: |
476 |
< |
data_[i].accumulator->add(thermo.getRotationalKinetic()); |
476 |
> |
dynamic_cast<Accumulator *>(data_[i].accumulator)->add(thermo.getRotationalKinetic()); |
477 |
|
break; |
478 |
|
case LONG_RANGE_POTENTIAL: |
479 |
< |
data_[i].accumulator->add(snap->getLongRangePotential()); |
479 |
> |
dynamic_cast<Accumulator *>(data_[i].accumulator)->add(snap->getLongRangePotential()); |
480 |
|
break; |
481 |
|
case VANDERWAALS_POTENTIAL: |
482 |
< |
data_[i].accumulator->add(snap->getLongRangePotentials()[VANDERWAALS_FAMILY]); |
482 |
> |
dynamic_cast<Accumulator *>(data_[i].accumulator)->add(snap->getLongRangePotentials()[VANDERWAALS_FAMILY]); |
483 |
|
break; |
484 |
|
case ELECTROSTATIC_POTENTIAL: |
485 |
< |
data_[i].accumulator->add(snap->getLongRangePotentials()[ELECTROSTATIC_FAMILY]); |
485 |
> |
dynamic_cast<Accumulator *>(data_[i].accumulator)->add(snap->getLongRangePotentials()[ELECTROSTATIC_FAMILY]); |
486 |
|
break; |
487 |
|
case METALLIC_POTENTIAL: |
488 |
< |
data_[i].accumulator->add(snap->getLongRangePotentials()[METALLIC_FAMILY]); |
488 |
> |
dynamic_cast<Accumulator *>(data_[i].accumulator)->add(snap->getLongRangePotentials()[METALLIC_FAMILY]); |
489 |
|
break; |
490 |
|
case HYDROGENBONDING_POTENTIAL: |
491 |
< |
data_[i].accumulator->add(snap->getLongRangePotentials()[HYDROGENBONDING_FAMILY]); |
491 |
> |
dynamic_cast<Accumulator *>(data_[i].accumulator)->add(snap->getLongRangePotentials()[HYDROGENBONDING_FAMILY]); |
492 |
|
break; |
493 |
|
case SHORT_RANGE_POTENTIAL: |
494 |
< |
data_[i].accumulator->add(snap->getShortRangePotential()); |
494 |
> |
dynamic_cast<Accumulator *>(data_[i].accumulator)->add(snap->getShortRangePotential()); |
495 |
|
break; |
496 |
|
case BOND_POTENTIAL: |
497 |
< |
data_[i].accumulator->add(snap->getBondPotential()); |
497 |
> |
dynamic_cast<Accumulator *>(data_[i].accumulator)->add(snap->getBondPotential()); |
498 |
|
break; |
499 |
|
case BEND_POTENTIAL: |
500 |
< |
data_[i].accumulator->add(snap->getBendPotential()); |
500 |
> |
dynamic_cast<Accumulator *>(data_[i].accumulator)->add(snap->getBendPotential()); |
501 |
|
break; |
502 |
|
case DIHEDRAL_POTENTIAL: |
503 |
< |
data_[i].accumulator->add(snap->getTorsionPotential()); |
503 |
> |
dynamic_cast<Accumulator *>(data_[i].accumulator)->add(snap->getTorsionPotential()); |
504 |
|
break; |
505 |
|
case INVERSION_POTENTIAL: |
506 |
< |
data_[i].accumulator->add(snap->getInversionPotential()); |
506 |
> |
dynamic_cast<Accumulator *>(data_[i].accumulator)->add(snap->getInversionPotential()); |
507 |
|
break; |
508 |
|
case RAW_POTENTIAL: |
509 |
< |
data_[i].accumulator->add(snap->getRawPotential()); |
509 |
> |
dynamic_cast<Accumulator *>(data_[i].accumulator)->add(snap->getRawPotential()); |
510 |
|
break; |
511 |
|
case RESTRAINT_POTENTIAL: |
512 |
< |
data_[i].accumulator->add(snap->getRestraintPotential()); |
512 |
> |
dynamic_cast<Accumulator *>(data_[i].accumulator)->add(snap->getRestraintPotential()); |
513 |
|
break; |
514 |
|
case TAGGED_PAIR_DISTANCE: |
515 |
< |
data_[i].accumulator->add(thermo.getTaggedAtomPairDistance()); |
515 |
> |
dynamic_cast<Accumulator *>(data_[i].accumulator)->add(thermo.getTaggedAtomPairDistance()); |
516 |
|
break; |
517 |
+ |
case ELECTRONIC_TEMPERATURE: |
518 |
+ |
dynamic_cast<Accumulator *>(data_[i].accumulator)->add(thermo.getElectronicTemperature()); |
519 |
+ |
break; |
520 |
+ |
case COM: |
521 |
+ |
dynamic_cast<VectorAccumulator *>(data_[i].accumulator)->add(thermo.getCom()); |
522 |
+ |
break; |
523 |
+ |
case COM_VELOCITY: |
524 |
+ |
dynamic_cast<VectorAccumulator *>(data_[i].accumulator)->add(thermo.getComVel()); |
525 |
+ |
break; |
526 |
+ |
case ANGULAR_MOMENTUM: |
527 |
+ |
dynamic_cast<VectorAccumulator *>(data_[i].accumulator)->add(thermo.getAngularMomentum()); |
528 |
+ |
break; |
529 |
|
/* |
530 |
|
case SHADOWH: |
531 |
< |
data_[i].accumulator->add(thermo.getShadowHamiltionian()); |
531 |
> |
dynamic_cast<Accumulator *>(data_[i].accumulator)->add(thermo.getShadowHamiltionian()); |
532 |
|
break; |
533 |
|
case HELFANDMOMENT: |
534 |
< |
data_[i].accumulator->add(thermo.getHelfandMoment()); |
534 |
> |
dynamic_cast<Accumulator *>(data_[i].accumulator)->add(thermo.getHelfandMoment()); |
535 |
|
break; |
536 |
|
*/ |
497 |
– |
case ELECTRONIC_TEMPERATURE: |
498 |
– |
data_[i].accumulator->add(thermo.getElectronicTemperature()); |
499 |
– |
break; |
537 |
|
} |
538 |
|
} |
539 |
|
} |
542 |
|
int Stats::getIntData(int index) { |
543 |
|
assert(index >=0 && index < ENDINDEX); |
544 |
|
RealType value; |
545 |
< |
data_[index].accumulator->getLastValue(value); |
545 |
> |
dynamic_cast<Accumulator *>(data_[index].accumulator)->getLastValue(value); |
546 |
|
return (int) value; |
547 |
|
} |
548 |
|
RealType Stats::getRealData(int index) { |
549 |
|
assert(index >=0 && index < ENDINDEX); |
550 |
|
RealType value(0.0); |
551 |
< |
data_[index].accumulator->getLastValue(value); |
551 |
> |
dynamic_cast<Accumulator *>(data_[index].accumulator)->getLastValue(value); |
552 |
|
return value; |
553 |
|
} |
554 |
|
Vector3d Stats::getVectorData(int index) { |