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

Comparing trunk/src/rnemd/RNEMD.cpp (file contents):
Revision 1979 by gezelter, Sat Apr 5 20:56:01 2014 UTC vs.
Revision 2068 by gezelter, Thu Mar 5 15:40:58 2015 UTC

# Line 291 | Line 291 | namespace OpenMD {
291        kineticFlux_ = 0.0;
292      }
293      if (hasMomentumFluxVector) {
294 <      momentumFluxVector_ = rnemdParams->getMomentumFluxVector();
294 >      std::vector<RealType> mf = rnemdParams->getMomentumFluxVector();
295 >      if (mf.size() != 3) {
296 >          sprintf(painCave.errMsg,
297 >                  "RNEMD: Incorrect number of parameters specified for momentumFluxVector.\n"
298 >                  "\tthere should be 3 parameters, but %lu were specified.\n",
299 >                  mf.size());
300 >          painCave.isFatal = 1;
301 >          simError();      
302 >      }
303 >      momentumFluxVector_.x() = mf[0];
304 >      momentumFluxVector_.y() = mf[1];
305 >      momentumFluxVector_.z() = mf[2];
306      } else {
307        momentumFluxVector_ = V3Zero;
308        if (hasMomentumFlux) {
# Line 316 | Line 327 | namespace OpenMD {
327            break;
328          }
329        }
330 <      if (hasAngularMomentumFluxVector) {
331 <        angularMomentumFluxVector_ = rnemdParams->getAngularMomentumFluxVector();
332 <      } else {
333 <        angularMomentumFluxVector_ = V3Zero;
334 <        if (hasAngularMomentumFlux) {
335 <          RealType angularMomentumFlux = rnemdParams->getAngularMomentumFlux();
336 <          switch (rnemdFluxType_) {
337 <          case rnemdLx:
338 <            angularMomentumFluxVector_.x() = angularMomentumFlux;
339 <            break;
329 <          case rnemdLy:
330 <            angularMomentumFluxVector_.y() = angularMomentumFlux;
331 <            break;
332 <          case rnemdLz:
333 <            angularMomentumFluxVector_.z() = angularMomentumFlux;
334 <            break;
335 <          case rnemdKeLx:
336 <            angularMomentumFluxVector_.x() = angularMomentumFlux;
337 <            break;
338 <          case rnemdKeLy:
339 <            angularMomentumFluxVector_.y() = angularMomentumFlux;
340 <            break;
341 <          case rnemdKeLz:
342 <            angularMomentumFluxVector_.z() = angularMomentumFlux;
343 <            break;
344 <          default:
345 <            break;
346 <          }
347 <        }        
348 <      }
349 <
350 <      if (hasCoordinateOrigin) {
351 <        coordinateOrigin_ = rnemdParams->getCoordinateOrigin();
352 <      } else {
353 <        coordinateOrigin_ = V3Zero;
354 <      }
355 <
356 <      // do some sanity checking
357 <
358 <      int selectionCount = seleMan_.getSelectionCount();
359 <
360 <      int nIntegrable = info->getNGlobalIntegrableObjects();
361 <
362 <      if (selectionCount > nIntegrable) {
363 <        sprintf(painCave.errMsg,
364 <                "RNEMD: The current objectSelection,\n"
365 <                "\t\t%s\n"
366 <                "\thas resulted in %d selected objects.  However,\n"
367 <                "\tthe total number of integrable objects in the system\n"
368 <                "\tis only %d.  This is almost certainly not what you want\n"
369 <                "\tto do.  A likely cause of this is forgetting the _RB_0\n"
370 <                "\tselector in the selection script!\n",
371 <                rnemdObjectSelection_.c_str(),
372 <                selectionCount, nIntegrable);
373 <        painCave.isFatal = 0;
374 <        painCave.severity = OPENMD_WARNING;
375 <        simError();
330 >    }
331 >    if (hasAngularMomentumFluxVector) {
332 >      std::vector<RealType> amf = rnemdParams->getAngularMomentumFluxVector();
333 >      if (amf.size() != 3) {
334 >        sprintf(painCave.errMsg,
335 >                "RNEMD: Incorrect number of parameters specified for angularMomentumFluxVector.\n"
336 >                "\tthere should be 3 parameters, but %lu were specified.\n",
337 >                amf.size());
338 >        painCave.isFatal = 1;
339 >        simError();      
340        }
341 <
342 <      areaAccumulator_ = new Accumulator();
343 <
344 <      nBins_ = rnemdParams->getOutputBins();
345 <      binWidth_ = rnemdParams->getOutputBinWidth();
346 <
347 <      data_.resize(RNEMD::ENDINDEX);
384 <      OutputData z;
385 <      z.units =  "Angstroms";
386 <      z.title =  "Z";
387 <      z.dataType = "RealType";
388 <      z.accumulator.reserve(nBins_);
389 <      for (int i = 0; i < nBins_; i++)
390 <        z.accumulator.push_back( new Accumulator() );
391 <      data_[Z] = z;
392 <      outputMap_["Z"] =  Z;
393 <
394 <      OutputData r;
395 <      r.units =  "Angstroms";
396 <      r.title =  "R";
397 <      r.dataType = "RealType";
398 <      r.accumulator.reserve(nBins_);
399 <      for (int i = 0; i < nBins_; i++)
400 <        r.accumulator.push_back( new Accumulator() );
401 <      data_[R] = r;
402 <      outputMap_["R"] =  R;
403 <
404 <      OutputData temperature;
405 <      temperature.units =  "K";
406 <      temperature.title =  "Temperature";
407 <      temperature.dataType = "RealType";
408 <      temperature.accumulator.reserve(nBins_);
409 <      for (int i = 0; i < nBins_; i++)
410 <        temperature.accumulator.push_back( new Accumulator() );
411 <      data_[TEMPERATURE] = temperature;
412 <      outputMap_["TEMPERATURE"] =  TEMPERATURE;
413 <
414 <      OutputData velocity;
415 <      velocity.units = "angstroms/fs";
416 <      velocity.title =  "Velocity";  
417 <      velocity.dataType = "Vector3d";
418 <      velocity.accumulator.reserve(nBins_);
419 <      for (int i = 0; i < nBins_; i++)
420 <        velocity.accumulator.push_back( new VectorAccumulator() );
421 <      data_[VELOCITY] = velocity;
422 <      outputMap_["VELOCITY"] = VELOCITY;
423 <
424 <      OutputData angularVelocity;
425 <      angularVelocity.units = "angstroms^2/fs";
426 <      angularVelocity.title =  "AngularVelocity";  
427 <      angularVelocity.dataType = "Vector3d";
428 <      angularVelocity.accumulator.reserve(nBins_);
429 <      for (int i = 0; i < nBins_; i++)
430 <        angularVelocity.accumulator.push_back( new VectorAccumulator() );
431 <      data_[ANGULARVELOCITY] = angularVelocity;
432 <      outputMap_["ANGULARVELOCITY"] = ANGULARVELOCITY;
433 <
434 <      OutputData density;
435 <      density.units =  "g cm^-3";
436 <      density.title =  "Density";
437 <      density.dataType = "RealType";
438 <      density.accumulator.reserve(nBins_);
439 <      for (int i = 0; i < nBins_; i++)
440 <        density.accumulator.push_back( new Accumulator() );
441 <      data_[DENSITY] = density;
442 <      outputMap_["DENSITY"] =  DENSITY;
443 <
444 <      if (hasOutputFields) {
445 <        parseOutputFileFormat(rnemdParams->getOutputFields());
446 <      } else {
447 <        if (usePeriodicBoundaryConditions_)
448 <          outputMask_.set(Z);
449 <        else
450 <          outputMask_.set(R);
341 >      angularMomentumFluxVector_.x() = amf[0];
342 >      angularMomentumFluxVector_.y() = amf[1];
343 >      angularMomentumFluxVector_.z() = amf[2];
344 >    } else {
345 >      angularMomentumFluxVector_ = V3Zero;
346 >      if (hasAngularMomentumFlux) {
347 >        RealType angularMomentumFlux = rnemdParams->getAngularMomentumFlux();
348          switch (rnemdFluxType_) {
452        case rnemdKE:
453        case rnemdRotKE:
454        case rnemdFullKE:
455          outputMask_.set(TEMPERATURE);
456          break;
457        case rnemdPx:
458        case rnemdPy:
459          outputMask_.set(VELOCITY);
460          break;
461        case rnemdPz:        
462        case rnemdPvector:
463          outputMask_.set(VELOCITY);
464          outputMask_.set(DENSITY);
465          break;
349          case rnemdLx:
350 +          angularMomentumFluxVector_.x() = angularMomentumFlux;
351 +          break;
352          case rnemdLy:
353 +          angularMomentumFluxVector_.y() = angularMomentumFlux;
354 +          break;
355          case rnemdLz:
356 <        case rnemdLvector:
470 <          outputMask_.set(ANGULARVELOCITY);
356 >          angularMomentumFluxVector_.z() = angularMomentumFlux;
357            break;
358          case rnemdKeLx:
359 +          angularMomentumFluxVector_.x() = angularMomentumFlux;
360 +          break;
361          case rnemdKeLy:
362 +          angularMomentumFluxVector_.y() = angularMomentumFlux;
363 +          break;
364          case rnemdKeLz:
365 <        case rnemdKeLvector:
476 <          outputMask_.set(TEMPERATURE);
477 <          outputMask_.set(ANGULARVELOCITY);
365 >          angularMomentumFluxVector_.z() = angularMomentumFlux;
366            break;
479        case rnemdKePx:
480        case rnemdKePy:
481          outputMask_.set(TEMPERATURE);
482          outputMask_.set(VELOCITY);
483          break;
484        case rnemdKePvector:
485          outputMask_.set(TEMPERATURE);
486          outputMask_.set(VELOCITY);
487          outputMask_.set(DENSITY);        
488          break;
367          default:
368            break;
369          }
370 <      }
371 <      
494 <      if (hasOutputFileName) {
495 <        rnemdFileName_ = rnemdParams->getOutputFileName();
496 <      } else {
497 <        rnemdFileName_ = getPrefix(info->getFinalConfigFileName()) + ".rnemd";
498 <      }          
370 >      }        
371 >    }
372  
373 <      exchangeTime_ = rnemdParams->getExchangeTime();
374 <
375 <      Snapshot* currentSnap_ = info->getSnapshotManager()->getCurrentSnapshot();
376 <      // total exchange sums are zeroed out at the beginning:
377 <
378 <      kineticExchange_ = 0.0;
379 <      momentumExchange_ = V3Zero;
380 <      angularMomentumExchange_ = V3Zero;
381 <
382 <      std::ostringstream selectionAstream;
383 <      std::ostringstream selectionBstream;
373 >    if (hasCoordinateOrigin) {
374 >      std::vector<RealType> co = rnemdParams->getCoordinateOrigin();
375 >      if (co.size() != 3) {
376 >        sprintf(painCave.errMsg,
377 >                "RNEMD: Incorrect number of parameters specified for coordinateOrigin.\n"
378 >                "\tthere should be 3 parameters, but %lu were specified.\n",
379 >                co.size());
380 >        painCave.isFatal = 1;
381 >        simError();      
382 >      }
383 >      coordinateOrigin_.x() = co[0];
384 >      coordinateOrigin_.y() = co[1];
385 >      coordinateOrigin_.z() = co[2];
386 >    } else {
387 >      coordinateOrigin_ = V3Zero;
388 >    }
389      
390 <      if (hasSelectionA_) {
391 <        selectionA_ = rnemdParams->getSelectionA();
392 <      } else {
393 <        if (usePeriodicBoundaryConditions_) {    
394 <          Mat3x3d hmat = currentSnap_->getHmat();
395 <        
396 <          if (hasSlabWidth)
397 <            slabWidth_ = rnemdParams->getSlabWidth();
398 <          else
399 <            slabWidth_ = hmat(2,2) / 10.0;
400 <        
401 <          if (hasSlabACenter)
402 <            slabACenter_ = rnemdParams->getSlabACenter();
403 <          else
404 <            slabACenter_ = 0.0;
405 <        
406 <          selectionAstream << "select wrappedz > "
407 <                           << slabACenter_ - 0.5*slabWidth_
408 <                           <<  " && wrappedz < "
409 <                           << slabACenter_ + 0.5*slabWidth_;
410 <          selectionA_ = selectionAstream.str();
411 <        } else {
412 <          if (hasSphereARadius)
413 <            sphereARadius_ = rnemdParams->getSphereARadius();
414 <          else {
415 <            // use an initial guess to the size of the inner slab to be 1/10 the
416 <            // radius of an approximately spherical hull:
417 <            Thermo thermo(info);
418 <            RealType hVol = thermo.getHullVolume();
419 <            sphereARadius_ = 0.1 * pow((3.0 * hVol / (4.0 * M_PI)), 1.0/3.0);
420 <          }
421 <          selectionAstream << "select r < " << sphereARadius_;
422 <          selectionA_ = selectionAstream.str();
423 <        }
390 >    // do some sanity checking
391 >    
392 >    int selectionCount = seleMan_.getSelectionCount();    
393 >    int nIntegrable = info->getNGlobalIntegrableObjects();
394 >    if (selectionCount > nIntegrable) {
395 >      sprintf(painCave.errMsg,
396 >              "RNEMD: The current objectSelection,\n"
397 >              "\t\t%s\n"
398 >              "\thas resulted in %d selected objects.  However,\n"
399 >              "\tthe total number of integrable objects in the system\n"
400 >              "\tis only %d.  This is almost certainly not what you want\n"
401 >              "\tto do.  A likely cause of this is forgetting the _RB_0\n"
402 >              "\tselector in the selection script!\n",
403 >              rnemdObjectSelection_.c_str(),
404 >              selectionCount, nIntegrable);
405 >      painCave.isFatal = 0;
406 >      painCave.severity = OPENMD_WARNING;
407 >      simError();
408 >    }
409 >    
410 >    areaAccumulator_ = new Accumulator();
411 >    
412 >    nBins_ = rnemdParams->getOutputBins();
413 >    binWidth_ = rnemdParams->getOutputBinWidth();
414 >    
415 >    data_.resize(RNEMD::ENDINDEX);
416 >    OutputData z;
417 >    z.units =  "Angstroms";
418 >    z.title =  "Z";
419 >    z.dataType = "RealType";
420 >    z.accumulator.reserve(nBins_);
421 >    for (int i = 0; i < nBins_; i++)
422 >      z.accumulator.push_back( new Accumulator() );
423 >    data_[Z] = z;
424 >    outputMap_["Z"] =  Z;
425 >    
426 >    OutputData r;
427 >    r.units =  "Angstroms";
428 >    r.title =  "R";
429 >    r.dataType = "RealType";
430 >    r.accumulator.reserve(nBins_);
431 >    for (int i = 0; i < nBins_; i++)
432 >      r.accumulator.push_back( new Accumulator() );
433 >    data_[R] = r;
434 >    outputMap_["R"] =  R;
435 >    
436 >    OutputData temperature;
437 >    temperature.units =  "K";
438 >    temperature.title =  "Temperature";
439 >    temperature.dataType = "RealType";
440 >    temperature.accumulator.reserve(nBins_);
441 >    for (int i = 0; i < nBins_; i++)
442 >      temperature.accumulator.push_back( new Accumulator() );
443 >    data_[TEMPERATURE] = temperature;
444 >    outputMap_["TEMPERATURE"] =  TEMPERATURE;
445 >    
446 >    OutputData velocity;
447 >    velocity.units = "angstroms/fs";
448 >    velocity.title =  "Velocity";  
449 >    velocity.dataType = "Vector3d";
450 >    velocity.accumulator.reserve(nBins_);
451 >    for (int i = 0; i < nBins_; i++)
452 >      velocity.accumulator.push_back( new VectorAccumulator() );
453 >    data_[VELOCITY] = velocity;
454 >    outputMap_["VELOCITY"] = VELOCITY;
455 >    
456 >    OutputData angularVelocity;
457 >    angularVelocity.units = "angstroms^2/fs";
458 >    angularVelocity.title =  "AngularVelocity";  
459 >    angularVelocity.dataType = "Vector3d";
460 >    angularVelocity.accumulator.reserve(nBins_);
461 >    for (int i = 0; i < nBins_; i++)
462 >      angularVelocity.accumulator.push_back( new VectorAccumulator() );
463 >    data_[ANGULARVELOCITY] = angularVelocity;
464 >    outputMap_["ANGULARVELOCITY"] = ANGULARVELOCITY;
465 >    
466 >    OutputData density;
467 >    density.units =  "g cm^-3";
468 >    density.title =  "Density";
469 >    density.dataType = "RealType";
470 >    density.accumulator.reserve(nBins_);
471 >    for (int i = 0; i < nBins_; i++)
472 >      density.accumulator.push_back( new Accumulator() );
473 >    data_[DENSITY] = density;
474 >    outputMap_["DENSITY"] =  DENSITY;
475 >    
476 >    if (hasOutputFields) {
477 >      parseOutputFileFormat(rnemdParams->getOutputFields());
478 >    } else {
479 >      if (usePeriodicBoundaryConditions_)
480 >        outputMask_.set(Z);
481 >      else
482 >        outputMask_.set(R);
483 >      switch (rnemdFluxType_) {
484 >      case rnemdKE:
485 >      case rnemdRotKE:
486 >      case rnemdFullKE:
487 >        outputMask_.set(TEMPERATURE);
488 >        break;
489 >      case rnemdPx:
490 >      case rnemdPy:
491 >        outputMask_.set(VELOCITY);
492 >        break;
493 >      case rnemdPz:        
494 >      case rnemdPvector:
495 >        outputMask_.set(VELOCITY);
496 >        outputMask_.set(DENSITY);
497 >        break;
498 >      case rnemdLx:
499 >      case rnemdLy:
500 >      case rnemdLz:
501 >      case rnemdLvector:
502 >        outputMask_.set(ANGULARVELOCITY);
503 >        break;
504 >      case rnemdKeLx:
505 >      case rnemdKeLy:
506 >      case rnemdKeLz:
507 >      case rnemdKeLvector:
508 >        outputMask_.set(TEMPERATURE);
509 >        outputMask_.set(ANGULARVELOCITY);
510 >        break;
511 >      case rnemdKePx:
512 >      case rnemdKePy:
513 >        outputMask_.set(TEMPERATURE);
514 >        outputMask_.set(VELOCITY);
515 >        break;
516 >      case rnemdKePvector:
517 >        outputMask_.set(TEMPERATURE);
518 >        outputMask_.set(VELOCITY);
519 >        outputMask_.set(DENSITY);        
520 >        break;
521 >      default:
522 >        break;
523        }
524 +    }
525      
526 <      if (hasSelectionB_) {
527 <        selectionB_ = rnemdParams->getSelectionB();
528 <
529 <      } else {
530 <        if (usePeriodicBoundaryConditions_) {    
531 <          Mat3x3d hmat = currentSnap_->getHmat();
532 <        
533 <          if (hasSlabWidth)
534 <            slabWidth_ = rnemdParams->getSlabWidth();
535 <          else
536 <            slabWidth_ = hmat(2,2) / 10.0;
537 <        
538 <          if (hasSlabBCenter)
539 <            slabBCenter_ = rnemdParams->getSlabBCenter();
540 <          else
541 <            slabBCenter_ = hmat(2,2) / 2.0;
526 >    if (hasOutputFileName) {
527 >      rnemdFileName_ = rnemdParams->getOutputFileName();
528 >    } else {
529 >      rnemdFileName_ = getPrefix(info->getFinalConfigFileName()) + ".rnemd";
530 >    }          
531 >    
532 >    exchangeTime_ = rnemdParams->getExchangeTime();
533 >    
534 >    Snapshot* currentSnap_ = info->getSnapshotManager()->getCurrentSnapshot();
535 >    // total exchange sums are zeroed out at the beginning:
536 >    
537 >    kineticExchange_ = 0.0;
538 >    momentumExchange_ = V3Zero;
539 >    angularMomentumExchange_ = V3Zero;
540 >    
541 >    std::ostringstream selectionAstream;
542 >    std::ostringstream selectionBstream;
543 >    
544 >    if (hasSelectionA_) {
545 >      selectionA_ = rnemdParams->getSelectionA();
546 >    } else {
547 >      if (usePeriodicBoundaryConditions_) {    
548 >        Mat3x3d hmat = currentSnap_->getHmat();
549          
550 <          selectionBstream << "select wrappedz > "
551 <                           << slabBCenter_ - 0.5*slabWidth_
552 <                           <<  " && wrappedz < "
553 <                           << slabBCenter_ + 0.5*slabWidth_;
550 >        if (hasSlabWidth)
551 >          slabWidth_ = rnemdParams->getSlabWidth();
552 >        else
553 >          slabWidth_ = hmat(2,2) / 10.0;
554 >        
555 >        if (hasSlabACenter)
556 >          slabACenter_ = rnemdParams->getSlabACenter();
557 >        else
558 >          slabACenter_ = 0.0;
559 >        
560 >        selectionAstream << "select wrappedz > "
561 >                         << slabACenter_ - 0.5*slabWidth_
562 >                         <<  " && wrappedz < "
563 >                         << slabACenter_ + 0.5*slabWidth_;
564 >        selectionA_ = selectionAstream.str();
565 >      } else {
566 >        if (hasSphereARadius)
567 >          sphereARadius_ = rnemdParams->getSphereARadius();
568 >        else {
569 >          // use an initial guess to the size of the inner slab to be 1/10 the
570 >          // radius of an approximately spherical hull:
571 >          Thermo thermo(info);
572 >          RealType hVol = thermo.getHullVolume();
573 >          sphereARadius_ = 0.1 * pow((3.0 * hVol / (4.0 * M_PI)), 1.0/3.0);
574 >        }
575 >        selectionAstream << "select r < " << sphereARadius_;
576 >        selectionA_ = selectionAstream.str();
577 >      }
578 >    }
579 >    
580 >    if (hasSelectionB_) {
581 >      selectionB_ = rnemdParams->getSelectionB();
582 >      
583 >    } else {
584 >      if (usePeriodicBoundaryConditions_) {    
585 >        Mat3x3d hmat = currentSnap_->getHmat();
586 >        
587 >        if (hasSlabWidth)
588 >          slabWidth_ = rnemdParams->getSlabWidth();
589 >        else
590 >          slabWidth_ = hmat(2,2) / 10.0;
591 >        
592 >        if (hasSlabBCenter)
593 >          slabBCenter_ = rnemdParams->getSlabBCenter();
594 >        else
595 >          slabBCenter_ = hmat(2,2) / 2.0;
596 >        
597 >        selectionBstream << "select wrappedz > "
598 >                         << slabBCenter_ - 0.5*slabWidth_
599 >                         <<  " && wrappedz < "
600 >                         << slabBCenter_ + 0.5*slabWidth_;
601 >        selectionB_ = selectionBstream.str();
602 >      } else {
603 >        if (hasSphereBRadius_) {
604 >          sphereBRadius_ = rnemdParams->getSphereBRadius();
605 >          selectionBstream << "select r > " << sphereBRadius_;
606            selectionB_ = selectionBstream.str();
607          } else {
608 <          if (hasSphereBRadius_) {
609 <            sphereBRadius_ = rnemdParams->getSphereBRadius();
610 <            selectionBstream << "select r > " << sphereBRadius_;
574 <            selectionB_ = selectionBstream.str();
575 <          } else {
576 <            selectionB_ = "select hull";
577 <            BisHull_ = true;
578 <            hasSelectionB_ = true;
579 <          }
608 >          selectionB_ = "select hull";
609 >          BisHull_ = true;
610 >          hasSelectionB_ = true;
611          }
612        }
613      }
614 <
614 >  
615 >  
616      // object evaluator:
617      evaluator_.loadScriptString(rnemdObjectSelection_);
618      seleMan_.setSelectionSet(evaluator_.evaluate());
# Line 622 | Line 654 | namespace OpenMD {
654  
655      StuntDouble* sd;
656  
657 <    RealType min_val;
657 >    RealType min_val(0.0);
658      int min_found = 0;  
659 <    StuntDouble* min_sd;
659 >    StuntDouble* min_sd = NULL;
660  
661 <    RealType max_val;
661 >    RealType max_val(0.0);
662      int max_found = 0;
663 <    StuntDouble* max_sd;
663 >    StuntDouble* max_sd = NULL;
664  
665      for (sd = seleManA_.beginSelected(selei); sd != NULL;
666           sd = seleManA_.nextSelected(selei)) {
# Line 857 | Line 889 | namespace OpenMD {
889            
890            Vector3d min_vel;
891            Vector3d max_vel = max_sd->getVel();
892 <          MPI_Status* status;
892 >          MPI_Status status;
893  
894            // point-to-point swap of the velocity vector
895            MPI_Sendrecv(max_vel.getArrayPointer(), 3, MPI_REALTYPE,
896                         min_vals.rank, 0,
897                         min_vel.getArrayPointer(), 3, MPI_REALTYPE,
898 <                       min_vals.rank, 0, MPI_COMM_WORLD, status);
898 >                       min_vals.rank, 0, MPI_COMM_WORLD, &status);
899            
900            switch(rnemdFluxType_) {
901            case rnemdKE :
# Line 878 | Line 910 | namespace OpenMD {
910                             MPI_REALTYPE, min_vals.rank, 1,
911                             min_angMom.getArrayPointer(), 3,
912                             MPI_REALTYPE, min_vals.rank, 1,
913 <                           MPI_COMM_WORLD, status);
913 >                           MPI_COMM_WORLD, &status);
914                
915                max_sd->setJ(min_angMom);
916              }
# Line 903 | Line 935 | namespace OpenMD {
935            
936            Vector3d max_vel;
937            Vector3d min_vel = min_sd->getVel();
938 <          MPI_Status* status;
938 >          MPI_Status status;
939            
940            // point-to-point swap of the velocity vector
941            MPI_Sendrecv(min_vel.getArrayPointer(), 3, MPI_REALTYPE,
942                         max_vals.rank, 0,
943                         max_vel.getArrayPointer(), 3, MPI_REALTYPE,
944 <                       max_vals.rank, 0, MPI_COMM_WORLD, status);
944 >                       max_vals.rank, 0, MPI_COMM_WORLD, &status);
945            
946            switch(rnemdFluxType_) {
947            case rnemdKE :
# Line 924 | Line 956 | namespace OpenMD {
956                             MPI_REALTYPE, max_vals.rank, 1,
957                             max_angMom.getArrayPointer(), 3,
958                             MPI_REALTYPE, max_vals.rank, 1,
959 <                           MPI_COMM_WORLD, status);
959 >                           MPI_COMM_WORLD, &status);
960                
961                min_sd->setJ(max_angMom);
962              }
# Line 988 | Line 1020 | namespace OpenMD {
1020      int selej;
1021  
1022      Snapshot* currentSnap_ = info_->getSnapshotManager()->getCurrentSnapshot();
991    RealType time = currentSnap_->getTime();    
1023      Mat3x3d hmat = currentSnap_->getHmat();
1024  
1025      StuntDouble* sd;
# Line 1436 | Line 1467 | namespace OpenMD {
1467      int selej;
1468  
1469      Snapshot* currentSnap_ = info_->getSnapshotManager()->getCurrentSnapshot();
1439    RealType time = currentSnap_->getTime();    
1470      Mat3x3d hmat = currentSnap_->getHmat();
1471  
1472      StuntDouble* sd;
# Line 1743 | Line 1773 | namespace OpenMD {
1773          areaA = evaluatorA_.getSurfaceArea();
1774        else {
1775          
1746        cerr << "selection A did not have surface area, recomputing\n";
1776          int isd;
1777          StuntDouble* sd;
1778          vector<StuntDouble*> aSites;
# Line 1781 | Line 1810 | namespace OpenMD {
1810      }
1811  
1812      if (hasSelectionB_) {
1813 <      if (evaluatorB_.hasSurfaceArea())
1813 >      if (evaluatorB_.hasSurfaceArea()) {
1814          areaB = evaluatorB_.getSurfaceArea();
1815 <      else {
1787 <        cerr << "selection B did not have surface area, recomputing\n";
1815 >      } else {
1816  
1817          int isd;
1818          StuntDouble* sd;
# Line 1875 | Line 1903 | namespace OpenMD {
1903    void RNEMD::collectData() {
1904      if (!doRNEMD_) return;
1905      Snapshot* currentSnap_ = info_->getSnapshotManager()->getCurrentSnapshot();
1906 <    
1906 >
1907      // collectData can be called more frequently than the doRNEMD, so use the
1908      // computed area from the last exchange time:
1909      RealType area = getDividingArea();
# Line 1990 | Line 2018 | namespace OpenMD {
2018          }
2019        }
2020      }
2021 <    
2021 >
2022   #ifdef IS_MPI
2023  
2024      for (int i = 0; i < nBins_; i++) {
# Line 2097 | Line 2125 | namespace OpenMD {
2125          painCave.severity = OPENMD_ERROR;
2126          simError();            
2127        }
2128 <    }  
2128 >    }
2129    }
2130    
2131    void RNEMD::writeOutputFile() {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines