| 51 | 
  | 
#include "utils/Tuple.hpp" | 
| 52 | 
  | 
#ifdef IS_MPI | 
| 53 | 
  | 
#include <mpi.h> | 
| 54 | 
+ | 
#endif | 
| 55 | 
+ | 
 | 
| 56 | 
+ | 
#ifdef _MSC_VER | 
| 57 | 
+ | 
#define isnan(x) _isnan((x)) | 
| 58 | 
+ | 
#define isinf(x) (!_finite(x) && !_isnan(x)) | 
| 59 | 
  | 
#endif | 
| 60 | 
  | 
 | 
| 61 | 
  | 
#define HONKING_LARGE_VALUE 1.0e10 | 
| 70 | 
  | 
    failTrialCount_ = 0; | 
| 71 | 
  | 
    failRootCount_ = 0; | 
| 72 | 
  | 
 | 
| 68 | 
– | 
    int seedValue; | 
| 73 | 
  | 
    Globals * simParams = info->getSimParams(); | 
| 74 | 
  | 
    RNEMDParameters* rnemdParams = simParams->getRNEMDParameters(); | 
| 75 | 
  | 
 | 
| 310 | 
  | 
    z.title =  "Z"; | 
| 311 | 
  | 
    z.dataType = "RealType"; | 
| 312 | 
  | 
    z.accumulator.reserve(nBins_); | 
| 313 | 
< | 
    for (unsigned int i = 0; i < nBins_; i++)  | 
| 313 | 
> | 
    for (int i = 0; i < nBins_; i++)  | 
| 314 | 
  | 
      z.accumulator.push_back( new Accumulator() ); | 
| 315 | 
  | 
    data_[Z] = z; | 
| 316 | 
  | 
    outputMap_["Z"] =  Z; | 
| 320 | 
  | 
    temperature.title =  "Temperature"; | 
| 321 | 
  | 
    temperature.dataType = "RealType"; | 
| 322 | 
  | 
    temperature.accumulator.reserve(nBins_); | 
| 323 | 
< | 
    for (unsigned int i = 0; i < nBins_; i++)  | 
| 323 | 
> | 
    for (int i = 0; i < nBins_; i++)  | 
| 324 | 
  | 
      temperature.accumulator.push_back( new Accumulator() ); | 
| 325 | 
  | 
    data_[TEMPERATURE] = temperature; | 
| 326 | 
  | 
    outputMap_["TEMPERATURE"] =  TEMPERATURE; | 
| 330 | 
  | 
    velocity.title =  "Velocity";   | 
| 331 | 
  | 
    velocity.dataType = "Vector3d"; | 
| 332 | 
  | 
    velocity.accumulator.reserve(nBins_); | 
| 333 | 
< | 
    for (unsigned int i = 0; i < nBins_; i++)  | 
| 333 | 
> | 
    for (int i = 0; i < nBins_; i++)  | 
| 334 | 
  | 
      velocity.accumulator.push_back( new VectorAccumulator() ); | 
| 335 | 
  | 
    data_[VELOCITY] = velocity; | 
| 336 | 
  | 
    outputMap_["VELOCITY"] = VELOCITY; | 
| 340 | 
  | 
    density.title =  "Density"; | 
| 341 | 
  | 
    density.dataType = "RealType"; | 
| 342 | 
  | 
    density.accumulator.reserve(nBins_); | 
| 343 | 
< | 
    for (unsigned int i = 0; i < nBins_; i++)  | 
| 343 | 
> | 
    for (int i = 0; i < nBins_; i++)  | 
| 344 | 
  | 
      density.accumulator.push_back( new Accumulator() ); | 
| 345 | 
  | 
    data_[DENSITY] = density; | 
| 346 | 
  | 
    outputMap_["DENSITY"] =  DENSITY; | 
| 452 | 
  | 
 | 
| 453 | 
  | 
    int selei; | 
| 454 | 
  | 
    StuntDouble* sd; | 
| 451 | 
– | 
    int idx; | 
| 455 | 
  | 
 | 
| 456 | 
  | 
    RealType min_val; | 
| 457 | 
  | 
    bool min_found = false;    | 
| 464 | 
  | 
    for (sd = seleMan_.beginSelected(selei); sd != NULL;  | 
| 465 | 
  | 
         sd = seleMan_.nextSelected(selei)) { | 
| 466 | 
  | 
 | 
| 464 | 
– | 
      idx = sd->getLocalIndex(); | 
| 465 | 
– | 
 | 
| 467 | 
  | 
      Vector3d pos = sd->getPos(); | 
| 468 | 
  | 
 | 
| 469 | 
  | 
      // wrap the stuntdouble's position back into the box: | 
| 541 | 
  | 
      } | 
| 542 | 
  | 
    } | 
| 543 | 
  | 
     | 
| 544 | 
< | 
#ifdef IS_MPI | 
| 545 | 
< | 
    int nProc, worldRank; | 
| 544 | 
> | 
#ifdef IS_MPI     | 
| 545 | 
> | 
    int worldRank = MPI::COMM_WORLD.Get_rank(); | 
| 546 | 
  | 
     | 
| 546 | 
– | 
    nProc = MPI::COMM_WORLD.Get_size(); | 
| 547 | 
– | 
    worldRank = MPI::COMM_WORLD.Get_rank(); | 
| 548 | 
– | 
 | 
| 547 | 
  | 
    bool my_min_found = min_found; | 
| 548 | 
  | 
    bool my_max_found = max_found; | 
| 549 | 
  | 
 | 
| 776 | 
  | 
 | 
| 777 | 
  | 
    int selei; | 
| 778 | 
  | 
    StuntDouble* sd; | 
| 781 | 
– | 
    int idx; | 
| 779 | 
  | 
 | 
| 780 | 
  | 
    vector<StuntDouble*> hotBin, coldBin; | 
| 781 | 
  | 
 | 
| 796 | 
  | 
 | 
| 797 | 
  | 
    for (sd = seleMan_.beginSelected(selei); sd != NULL;  | 
| 798 | 
  | 
         sd = seleMan_.nextSelected(selei)) { | 
| 802 | 
– | 
 | 
| 803 | 
– | 
      idx = sd->getLocalIndex(); | 
| 799 | 
  | 
 | 
| 800 | 
  | 
      Vector3d pos = sd->getPos(); | 
| 801 | 
  | 
 | 
| 1220 | 
  | 
 | 
| 1221 | 
  | 
    int selei; | 
| 1222 | 
  | 
    StuntDouble* sd; | 
| 1228 | 
– | 
    int idx; | 
| 1223 | 
  | 
 | 
| 1224 | 
  | 
    vector<StuntDouble*> hotBin, coldBin; | 
| 1225 | 
  | 
 | 
| 1233 | 
  | 
 | 
| 1234 | 
  | 
    for (sd = seleMan_.beginSelected(selei); sd != NULL;  | 
| 1235 | 
  | 
         sd = seleMan_.nextSelected(selei)) { | 
| 1242 | 
– | 
 | 
| 1243 | 
– | 
      idx = sd->getLocalIndex(); | 
| 1236 | 
  | 
 | 
| 1237 | 
  | 
      Vector3d pos = sd->getPos(); | 
| 1238 | 
  | 
 | 
| 1408 | 
  | 
 | 
| 1409 | 
  | 
    int selei(0); | 
| 1410 | 
  | 
    StuntDouble* sd; | 
| 1419 | 
– | 
    int idx; | 
| 1411 | 
  | 
 | 
| 1412 | 
  | 
    vector<RealType> binMass(nBins_, 0.0); | 
| 1413 | 
  | 
    vector<RealType> binPx(nBins_, 0.0); | 
| 1433 | 
  | 
    */ | 
| 1434 | 
  | 
 | 
| 1435 | 
  | 
    for (sd = seleMan_.beginSelected(selei); sd != NULL;  | 
| 1436 | 
< | 
         sd = seleMan_.nextSelected(selei)) { | 
| 1436 | 
> | 
         sd = seleMan_.nextSelected(selei)) {      | 
| 1437 | 
  | 
     | 
| 1447 | 
– | 
      idx = sd->getLocalIndex(); | 
| 1448 | 
– | 
       | 
| 1438 | 
  | 
      Vector3d pos = sd->getPos(); | 
| 1439 | 
  | 
 | 
| 1440 | 
  | 
      // wrap the stuntdouble's position back into the box: | 
| 1510 | 
  | 
      den = binMass[i] * nBins_ * PhysicalConstants::densityConvert  | 
| 1511 | 
  | 
        / currentSnap_->getVolume() ; | 
| 1512 | 
  | 
 | 
| 1513 | 
< | 
      temp = 2.0 * binKE[i] / (binDOF[i] * PhysicalConstants::kb * | 
| 1514 | 
< | 
                               PhysicalConstants::energyConvert); | 
| 1515 | 
< | 
   | 
| 1516 | 
< | 
      for (unsigned int j = 0; j < outputMask_.size(); ++j) { | 
| 1517 | 
< | 
        if(outputMask_[j]) { | 
| 1518 | 
< | 
          switch(j) { | 
| 1519 | 
< | 
          case Z: | 
| 1520 | 
< | 
            (data_[j].accumulator[i])->add(z); | 
| 1521 | 
< | 
            break; | 
| 1522 | 
< | 
          case TEMPERATURE: | 
| 1523 | 
< | 
            data_[j].accumulator[i]->add(temp); | 
| 1524 | 
< | 
            break; | 
| 1525 | 
< | 
          case VELOCITY: | 
| 1526 | 
< | 
            dynamic_cast<VectorAccumulator *>(data_[j].accumulator[i])->add(vel); | 
| 1527 | 
< | 
            break; | 
| 1528 | 
< | 
          case DENSITY: | 
| 1529 | 
< | 
            data_[j].accumulator[i]->add(den); | 
| 1530 | 
< | 
            break; | 
| 1513 | 
> | 
      if (binCount[i] > 0) { | 
| 1514 | 
> | 
        // only add values if there are things to add | 
| 1515 | 
> | 
        temp = 2.0 * binKE[i] / (binDOF[i] * PhysicalConstants::kb * | 
| 1516 | 
> | 
                                 PhysicalConstants::energyConvert); | 
| 1517 | 
> | 
         | 
| 1518 | 
> | 
        for (unsigned int j = 0; j < outputMask_.size(); ++j) { | 
| 1519 | 
> | 
          if(outputMask_[j]) { | 
| 1520 | 
> | 
            switch(j) { | 
| 1521 | 
> | 
            case Z: | 
| 1522 | 
> | 
              dynamic_cast<Accumulator *>(data_[j].accumulator[i])->add(z); | 
| 1523 | 
> | 
              break; | 
| 1524 | 
> | 
            case TEMPERATURE: | 
| 1525 | 
> | 
              dynamic_cast<Accumulator *>(data_[j].accumulator[i])->add(temp); | 
| 1526 | 
> | 
              break; | 
| 1527 | 
> | 
            case VELOCITY: | 
| 1528 | 
> | 
              dynamic_cast<VectorAccumulator *>(data_[j].accumulator[i])->add(vel); | 
| 1529 | 
> | 
              break; | 
| 1530 | 
> | 
            case DENSITY: | 
| 1531 | 
> | 
              dynamic_cast<Accumulator *>(data_[j].accumulator[i])->add(den); | 
| 1532 | 
> | 
              break; | 
| 1533 | 
> | 
            } | 
| 1534 | 
  | 
          } | 
| 1535 | 
  | 
        } | 
| 1536 | 
  | 
      } | 
| 1664 | 
  | 
       | 
| 1665 | 
  | 
      rnemdFile_.precision(8); | 
| 1666 | 
  | 
       | 
| 1667 | 
< | 
      for (unsigned int j = 0; j < nBins_; j++) {         | 
| 1667 | 
> | 
      for (int j = 0; j < nBins_; j++) {         | 
| 1668 | 
  | 
         | 
| 1669 | 
  | 
        for (unsigned int i = 0; i < outputMask_.size(); ++i) { | 
| 1670 | 
  | 
          if (outputMask_[i]) { | 
| 1690 | 
  | 
      rnemdFile_ << "#######################################################\n"; | 
| 1691 | 
  | 
 | 
| 1692 | 
  | 
 | 
| 1693 | 
< | 
      for (unsigned int j = 0; j < nBins_; j++) {         | 
| 1693 | 
> | 
      for (int j = 0; j < nBins_; j++) {         | 
| 1694 | 
  | 
        rnemdFile_ << "#"; | 
| 1695 | 
  | 
        for (unsigned int i = 0; i < outputMask_.size(); ++i) { | 
| 1696 | 
  | 
          if (outputMask_[i]) { | 
| 1726 | 
  | 
    assert(bin < nBins_); | 
| 1727 | 
  | 
    RealType s; | 
| 1728 | 
  | 
     | 
| 1729 | 
< | 
    data_[index].accumulator[bin]->getAverage(s); | 
| 1729 | 
> | 
    dynamic_cast<Accumulator *>(data_[index].accumulator[bin])->getAverage(s); | 
| 1730 | 
  | 
     | 
| 1731 | 
  | 
    if (! isinf(s) && ! isnan(s)) { | 
| 1732 | 
  | 
      rnemdFile_ << "\t" << s; | 
| 1764 | 
  | 
    assert(bin < nBins_); | 
| 1765 | 
  | 
    RealType s; | 
| 1766 | 
  | 
     | 
| 1767 | 
< | 
    data_[index].accumulator[bin]->getStdDev(s); | 
| 1767 | 
> | 
    dynamic_cast<Accumulator *>(data_[index].accumulator[bin])->getStdDev(s); | 
| 1768 | 
  | 
     | 
| 1769 | 
  | 
    if (! isinf(s) && ! isnan(s)) { | 
| 1770 | 
  | 
      rnemdFile_ << "\t" << s; |