| 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(); | 
| 428 | 
  | 
      if (statsMask_[i]) { | 
| 429 | 
  | 
        switch (i) { | 
| 430 | 
  | 
        case TIME: | 
| 431 | 
< | 
          data_[i].accumulator->add(snap->getTime()); | 
| 431 | 
> | 
          dynamic_cast<Accumulator *>(data_[i].accumulator)->add(snap->getTime()); | 
| 432 | 
  | 
          break; | 
| 433 | 
  | 
        case KINETIC_ENERGY: | 
| 434 | 
< | 
          data_[i].accumulator->add(thermo.getKinetic()); | 
| 434 | 
> | 
          dynamic_cast<Accumulator *>(data_[i].accumulator)->add(thermo.getKinetic()); | 
| 435 | 
  | 
          break; | 
| 436 | 
  | 
        case POTENTIAL_ENERGY: | 
| 437 | 
< | 
          data_[i].accumulator->add(thermo.getPotential()); | 
| 437 | 
> | 
          dynamic_cast<Accumulator *>(data_[i].accumulator)->add(thermo.getPotential()); | 
| 438 | 
  | 
          break; | 
| 439 | 
  | 
        case TOTAL_ENERGY: | 
| 440 | 
< | 
          data_[i].accumulator->add(thermo.getTotalEnergy()); | 
| 440 | 
> | 
          dynamic_cast<Accumulator *>(data_[i].accumulator)->add(thermo.getTotalEnergy()); | 
| 441 | 
  | 
          break; | 
| 442 | 
  | 
        case TEMPERATURE: | 
| 443 | 
< | 
          data_[i].accumulator->add(thermo.getTemperature()); | 
| 443 | 
> | 
          dynamic_cast<Accumulator *>(data_[i].accumulator)->add(thermo.getTemperature()); | 
| 444 | 
  | 
          break; | 
| 445 | 
  | 
        case PRESSURE: | 
| 446 | 
< | 
          data_[i].accumulator->add(thermo.getPressure()); | 
| 446 | 
> | 
          dynamic_cast<Accumulator *>(data_[i].accumulator)->add(thermo.getPressure()); | 
| 447 | 
  | 
          break; | 
| 448 | 
  | 
        case VOLUME: | 
| 449 | 
< | 
          data_[i].accumulator->add(thermo.getVolume()); | 
| 449 | 
> | 
          dynamic_cast<Accumulator *>(data_[i].accumulator)->add(thermo.getVolume()); | 
| 450 | 
  | 
          break; | 
| 451 | 
  | 
        case CONSERVED_QUANTITY: | 
| 452 | 
< | 
          data_[i].accumulator->add(snap->getConservedQuantity()); | 
| 452 | 
> | 
          dynamic_cast<Accumulator *>(data_[i].accumulator)->add(snap->getConservedQuantity()); | 
| 453 | 
  | 
          break; | 
| 454 | 
  | 
        case PRESSURE_TENSOR: | 
| 455 | 
  | 
          dynamic_cast<MatrixAccumulator *>(data_[i].accumulator)->add(thermo.getPressureTensor()); | 
| 461 | 
  | 
          dynamic_cast<VectorAccumulator *>(data_[i].accumulator)->add(thermo.getHeatFlux()); | 
| 462 | 
  | 
          break; | 
| 463 | 
  | 
        case HULLVOLUME: | 
| 464 | 
< | 
          data_[i].accumulator->add(thermo.getHullVolume()); | 
| 464 | 
> | 
          dynamic_cast<Accumulator *>(data_[i].accumulator)->add(thermo.getHullVolume()); | 
| 465 | 
  | 
          break; | 
| 466 | 
  | 
        case GYRVOLUME: | 
| 467 | 
< | 
          data_[i].accumulator->add(thermo.getGyrationalVolume()); | 
| 467 | 
> | 
          dynamic_cast<Accumulator *>(data_[i].accumulator)->add(thermo.getGyrationalVolume()); | 
| 468 | 
  | 
          break; | 
| 469 | 
  | 
        case TRANSLATIONAL_KINETIC: | 
| 470 | 
< | 
          data_[i].accumulator->add(thermo.getTranslationalKinetic()); | 
| 470 | 
> | 
          dynamic_cast<Accumulator *>(data_[i].accumulator)->add(thermo.getTranslationalKinetic()); | 
| 471 | 
  | 
          break; | 
| 472 | 
  | 
        case ROTATIONAL_KINETIC: | 
| 473 | 
< | 
          data_[i].accumulator->add(thermo.getRotationalKinetic()); | 
| 473 | 
> | 
          dynamic_cast<Accumulator *>(data_[i].accumulator)->add(thermo.getRotationalKinetic()); | 
| 474 | 
  | 
          break; | 
| 475 | 
  | 
        case LONG_RANGE_POTENTIAL: | 
| 476 | 
< | 
          data_[i].accumulator->add(snap->getLongRangePotential()); | 
| 476 | 
> | 
          dynamic_cast<Accumulator *>(data_[i].accumulator)->add(snap->getLongRangePotential()); | 
| 477 | 
  | 
          break; | 
| 478 | 
  | 
        case VANDERWAALS_POTENTIAL: | 
| 479 | 
< | 
          data_[i].accumulator->add(snap->getLongRangePotentials()[VANDERWAALS_FAMILY]); | 
| 479 | 
> | 
          dynamic_cast<Accumulator *>(data_[i].accumulator)->add(snap->getLongRangePotentials()[VANDERWAALS_FAMILY]); | 
| 480 | 
  | 
          break; | 
| 481 | 
  | 
        case ELECTROSTATIC_POTENTIAL: | 
| 482 | 
< | 
          data_[i].accumulator->add(snap->getLongRangePotentials()[ELECTROSTATIC_FAMILY]); | 
| 482 | 
> | 
          dynamic_cast<Accumulator *>(data_[i].accumulator)->add(snap->getLongRangePotentials()[ELECTROSTATIC_FAMILY]); | 
| 483 | 
  | 
          break; | 
| 484 | 
  | 
        case METALLIC_POTENTIAL: | 
| 485 | 
< | 
          data_[i].accumulator->add(snap->getLongRangePotentials()[METALLIC_FAMILY]); | 
| 485 | 
> | 
          dynamic_cast<Accumulator *>(data_[i].accumulator)->add(snap->getLongRangePotentials()[METALLIC_FAMILY]); | 
| 486 | 
  | 
          break; | 
| 487 | 
  | 
        case HYDROGENBONDING_POTENTIAL: | 
| 488 | 
< | 
          data_[i].accumulator->add(snap->getLongRangePotentials()[HYDROGENBONDING_FAMILY]); | 
| 488 | 
> | 
          dynamic_cast<Accumulator *>(data_[i].accumulator)->add(snap->getLongRangePotentials()[HYDROGENBONDING_FAMILY]); | 
| 489 | 
  | 
          break; | 
| 490 | 
  | 
        case SHORT_RANGE_POTENTIAL: | 
| 491 | 
< | 
          data_[i].accumulator->add(snap->getShortRangePotential()); | 
| 491 | 
> | 
          dynamic_cast<Accumulator *>(data_[i].accumulator)->add(snap->getShortRangePotential()); | 
| 492 | 
  | 
          break; | 
| 493 | 
  | 
        case BOND_POTENTIAL: | 
| 494 | 
< | 
          data_[i].accumulator->add(snap->getBondPotential()); | 
| 494 | 
> | 
          dynamic_cast<Accumulator *>(data_[i].accumulator)->add(snap->getBondPotential()); | 
| 495 | 
  | 
          break; | 
| 496 | 
  | 
        case BEND_POTENTIAL: | 
| 497 | 
< | 
          data_[i].accumulator->add(snap->getBendPotential()); | 
| 497 | 
> | 
          dynamic_cast<Accumulator *>(data_[i].accumulator)->add(snap->getBendPotential()); | 
| 498 | 
  | 
          break; | 
| 499 | 
  | 
        case DIHEDRAL_POTENTIAL: | 
| 500 | 
< | 
          data_[i].accumulator->add(snap->getTorsionPotential()); | 
| 500 | 
> | 
          dynamic_cast<Accumulator *>(data_[i].accumulator)->add(snap->getTorsionPotential()); | 
| 501 | 
  | 
          break; | 
| 502 | 
  | 
        case INVERSION_POTENTIAL: | 
| 503 | 
< | 
          data_[i].accumulator->add(snap->getInversionPotential()); | 
| 503 | 
> | 
          dynamic_cast<Accumulator *>(data_[i].accumulator)->add(snap->getInversionPotential()); | 
| 504 | 
  | 
          break; | 
| 505 | 
  | 
        case RAW_POTENTIAL: | 
| 506 | 
< | 
          data_[i].accumulator->add(snap->getRawPotential()); | 
| 506 | 
> | 
          dynamic_cast<Accumulator *>(data_[i].accumulator)->add(snap->getRawPotential()); | 
| 507 | 
  | 
          break; | 
| 508 | 
  | 
        case RESTRAINT_POTENTIAL: | 
| 509 | 
< | 
          data_[i].accumulator->add(snap->getRestraintPotential()); | 
| 509 | 
> | 
          dynamic_cast<Accumulator *>(data_[i].accumulator)->add(snap->getRestraintPotential()); | 
| 510 | 
  | 
          break; | 
| 511 | 
  | 
        case TAGGED_PAIR_DISTANCE: | 
| 512 | 
< | 
          data_[i].accumulator->add(thermo.getTaggedAtomPairDistance()); | 
| 512 | 
> | 
          dynamic_cast<Accumulator *>(data_[i].accumulator)->add(thermo.getTaggedAtomPairDistance()); | 
| 513 | 
  | 
          break; | 
| 514 | 
+ | 
        case ELECTRONIC_TEMPERATURE: | 
| 515 | 
+ | 
          dynamic_cast<Accumulator *>(data_[i].accumulator)->add(thermo.getElectronicTemperature()); | 
| 516 | 
+ | 
          break;  | 
| 517 | 
+ | 
        case COM: | 
| 518 | 
+ | 
          dynamic_cast<VectorAccumulator *>(data_[i].accumulator)->add(thermo.getCom()); | 
| 519 | 
+ | 
          break; | 
| 520 | 
+ | 
        case COM_VELOCITY: | 
| 521 | 
+ | 
          dynamic_cast<VectorAccumulator *>(data_[i].accumulator)->add(thermo.getComVel()); | 
| 522 | 
+ | 
          break; | 
| 523 | 
+ | 
        case ANGULAR_MOMENTUM: | 
| 524 | 
+ | 
          dynamic_cast<VectorAccumulator *>(data_[i].accumulator)->add(thermo.getAngularMomentum()); | 
| 525 | 
+ | 
          break; | 
| 526 | 
  | 
          /* | 
| 527 | 
  | 
        case SHADOWH: | 
| 528 | 
< | 
          data_[i].accumulator->add(thermo.getShadowHamiltionian()); | 
| 528 | 
> | 
          dynamic_cast<Accumulator *>(data_[i].accumulator)->add(thermo.getShadowHamiltionian()); | 
| 529 | 
  | 
          break; | 
| 530 | 
  | 
        case HELFANDMOMENT: | 
| 531 | 
< | 
          data_[i].accumulator->add(thermo.getHelfandMoment()); | 
| 531 | 
> | 
          dynamic_cast<Accumulator *>(data_[i].accumulator)->add(thermo.getHelfandMoment()); | 
| 532 | 
  | 
          break; | 
| 533 | 
  | 
          */ | 
| 497 | 
– | 
        case ELECTRONIC_TEMPERATURE: | 
| 498 | 
– | 
          data_[i].accumulator->add(thermo.getElectronicTemperature()); | 
| 499 | 
– | 
          break;  | 
| 534 | 
  | 
        } | 
| 535 | 
  | 
      } | 
| 536 | 
  | 
    } | 
| 539 | 
  | 
  int Stats::getIntData(int index) {  | 
| 540 | 
  | 
    assert(index >=0 && index < ENDINDEX); | 
| 541 | 
  | 
    RealType value; | 
| 542 | 
< | 
    data_[index].accumulator->getLastValue(value); | 
| 542 | 
> | 
    dynamic_cast<Accumulator *>(data_[index].accumulator)->getLastValue(value); | 
| 543 | 
  | 
    return (int) value; | 
| 544 | 
  | 
  } | 
| 545 | 
  | 
  RealType Stats::getRealData(int index) { | 
| 546 | 
  | 
    assert(index >=0 && index < ENDINDEX); | 
| 547 | 
  | 
    RealType value(0.0); | 
| 548 | 
< | 
    data_[index].accumulator->getLastValue(value); | 
| 548 | 
> | 
    dynamic_cast<Accumulator *>(data_[index].accumulator)->getLastValue(value); | 
| 549 | 
  | 
    return value; | 
| 550 | 
  | 
  } | 
| 551 | 
  | 
  Vector3d Stats::getVectorData(int index) { |