ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/trunk/src/rnemd/RNEMD.cpp
(Generate patch)

Comparing:
branches/development/src/rnemd/RNEMD.cpp (file contents), Revision 1777 by gezelter, Thu Aug 9 18:35:09 2012 UTC vs.
trunk/src/rnemd/RNEMD.cpp (file contents), Revision 1793 by gezelter, Fri Aug 31 21:16:10 2012 UTC

# Line 53 | Line 53
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
62  
63   using namespace std;
# Line 65 | Line 70 | namespace OpenMD {
70      failTrialCount_ = 0;
71      failRootCount_ = 0;
72  
68    int seedValue;
73      Globals * simParams = info->getSimParams();
74      RNEMDParameters* rnemdParams = simParams->getRNEMDParameters();
75  
# Line 305 | Line 309 | namespace OpenMD {
309      z.title =  "Z";
310      z.dataType = "RealType";
311      z.accumulator.reserve(nBins_);
312 <    for (unsigned int i = 0; i < nBins_; i++)
312 >    for (int i = 0; i < nBins_; i++)
313        z.accumulator.push_back( new Accumulator() );
314      data_[Z] = z;
315      outputMap_["Z"] =  Z;
# Line 315 | Line 319 | namespace OpenMD {
319      temperature.title =  "Temperature";
320      temperature.dataType = "RealType";
321      temperature.accumulator.reserve(nBins_);
322 <    for (unsigned int i = 0; i < nBins_; i++)
322 >    for (int i = 0; i < nBins_; i++)
323        temperature.accumulator.push_back( new Accumulator() );
324      data_[TEMPERATURE] = temperature;
325      outputMap_["TEMPERATURE"] =  TEMPERATURE;
# Line 325 | Line 329 | namespace OpenMD {
329      velocity.title =  "Velocity";  
330      velocity.dataType = "Vector3d";
331      velocity.accumulator.reserve(nBins_);
332 <    for (unsigned int i = 0; i < nBins_; i++)
332 >    for (int i = 0; i < nBins_; i++)
333        velocity.accumulator.push_back( new VectorAccumulator() );
334      data_[VELOCITY] = velocity;
335      outputMap_["VELOCITY"] = VELOCITY;
# Line 335 | Line 339 | namespace OpenMD {
339      density.title =  "Density";
340      density.dataType = "RealType";
341      density.accumulator.reserve(nBins_);
342 <    for (unsigned int i = 0; i < nBins_; i++)
342 >    for (int i = 0; i < nBins_; i++)
343        density.accumulator.push_back( new Accumulator() );
344      data_[DENSITY] = density;
345      outputMap_["DENSITY"] =  DENSITY;
# Line 447 | Line 451 | namespace OpenMD {
451  
452      int selei;
453      StuntDouble* sd;
450    int idx;
454  
455      RealType min_val;
456      bool min_found = false;  
# Line 460 | Line 463 | namespace OpenMD {
463      for (sd = seleMan_.beginSelected(selei); sd != NULL;
464           sd = seleMan_.nextSelected(selei)) {
465  
463      idx = sd->getLocalIndex();
464
466        Vector3d pos = sd->getPos();
467  
468        // wrap the stuntdouble's position back into the box:
# Line 539 | Line 540 | namespace OpenMD {
540        }
541      }
542      
543 < #ifdef IS_MPI
544 <    int nProc, worldRank;
543 > #ifdef IS_MPI    
544 >    int worldRank = MPI::COMM_WORLD.Get_rank();
545      
545    nProc = MPI::COMM_WORLD.Get_size();
546    worldRank = MPI::COMM_WORLD.Get_rank();
547
546      bool my_min_found = min_found;
547      bool my_max_found = max_found;
548  
# Line 777 | Line 775 | namespace OpenMD {
775  
776      int selei;
777      StuntDouble* sd;
780    int idx;
778  
779      vector<StuntDouble*> hotBin, coldBin;
780  
# Line 799 | Line 796 | namespace OpenMD {
796      for (sd = seleMan_.beginSelected(selei); sd != NULL;
797           sd = seleMan_.nextSelected(selei)) {
798  
802      idx = sd->getLocalIndex();
803
799        Vector3d pos = sd->getPos();
800  
801        // wrap the stuntdouble's position back into the box:
# Line 1227 | Line 1222 | namespace OpenMD {
1222  
1223      int selei;
1224      StuntDouble* sd;
1230    int idx;
1225  
1226      vector<StuntDouble*> hotBin, coldBin;
1227  
# Line 1242 | Line 1236 | namespace OpenMD {
1236      for (sd = seleMan_.beginSelected(selei); sd != NULL;
1237           sd = seleMan_.nextSelected(selei)) {
1238  
1245      idx = sd->getLocalIndex();
1246
1239        Vector3d pos = sd->getPos();
1240  
1241        // wrap the stuntdouble's position back into the box:
# Line 1425 | Line 1417 | namespace OpenMD {
1417  
1418      int selei;
1419      StuntDouble* sd;
1428    int idx;
1420  
1421      vector<RealType> binMass(nBins_, 0.0);
1422      vector<RealType> binPx(nBins_, 0.0);
# Line 1450 | Line 1441 | namespace OpenMD {
1441               sd = mol->nextIntegrableObject(iiter))
1442      */
1443      for (sd = seleMan_.beginSelected(selei); sd != NULL;
1444 <         sd = seleMan_.nextSelected(selei)) {
1444 >         sd = seleMan_.nextSelected(selei)) {    
1445        
1455      idx = sd->getLocalIndex();
1456      
1446        Vector3d pos = sd->getPos();
1447  
1448        // wrap the stuntdouble's position back into the box:
# Line 1537 | Line 1526 | namespace OpenMD {
1526          if(outputMask_[j]) {
1527            switch(j) {
1528            case Z:
1529 <            (data_[j].accumulator[i])->add(z);
1529 >            dynamic_cast<Accumulator *>(data_[j].accumulator[i])->add(z);
1530              break;
1531            case TEMPERATURE:
1532 <            data_[j].accumulator[i]->add(temp);
1532 >            dynamic_cast<Accumulator *>(data_[j].accumulator[i])->add(temp);
1533              break;
1534            case VELOCITY:
1535              dynamic_cast<VectorAccumulator *>(data_[j].accumulator[i])->add(vel);
1536              break;
1537            case DENSITY:
1538 <            data_[j].accumulator[i]->add(den);
1538 >            dynamic_cast<Accumulator *>(data_[j].accumulator[i])->add(den);
1539              break;
1540            }
1541          }
# Line 1681 | Line 1670 | namespace OpenMD {
1670        
1671        rnemdFile_.precision(8);
1672        
1673 <      for (unsigned int j = 0; j < nBins_; j++) {        
1673 >      for (int j = 0; j < nBins_; j++) {        
1674          
1675          for (unsigned int i = 0; i < outputMask_.size(); ++i) {
1676            if (outputMask_[i]) {
# Line 1707 | Line 1696 | namespace OpenMD {
1696        rnemdFile_ << "#######################################################\n";
1697  
1698  
1699 <      for (unsigned int j = 0; j < nBins_; j++) {        
1699 >      for (int j = 0; j < nBins_; j++) {        
1700          rnemdFile_ << "#";
1701          for (unsigned int i = 0; i < outputMask_.size(); ++i) {
1702            if (outputMask_[i]) {
# Line 1743 | Line 1732 | namespace OpenMD {
1732      assert(bin < nBins_);
1733      RealType s;
1734      
1735 <    data_[index].accumulator[bin]->getAverage(s);
1735 >    dynamic_cast<Accumulator *>(data_[index].accumulator[bin])->getAverage(s);
1736      
1737      if (! isinf(s) && ! isnan(s)) {
1738        rnemdFile_ << "\t" << s;
# Line 1781 | Line 1770 | namespace OpenMD {
1770      assert(bin < nBins_);
1771      RealType s;
1772      
1773 <    data_[index].accumulator[bin]->getStdDev(s);
1773 >    dynamic_cast<Accumulator *>(data_[index].accumulator[bin])->getStdDev(s);
1774      
1775      if (! isinf(s) && ! isnan(s)) {
1776        rnemdFile_ << "\t" << s;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines