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

Comparing trunk/src/io/DumpWriter.cpp (file contents):
Revision 1609 by chuckv, Wed May 18 19:28:52 2011 UTC vs.
Revision 1610 by gezelter, Fri Aug 12 14:37:25 2011 UTC

# Line 60 | Line 60 | namespace OpenMD {
60      Globals* simParams = info->getSimParams();
61      needCompression_ = simParams->getCompressDumpFile();
62      needForceVector_ = simParams->getOutputForceVector();
63 +    needParticlePot_ = simParams->getOutputParticlePotential();
64      createDumpFile_ = true;
65   #ifdef HAVE_LIBZ
66      if (needCompression_) {
# Line 99 | Line 100 | namespace OpenMD {
100  
101      needCompression_ = simParams->getCompressDumpFile();
102      needForceVector_ = simParams->getOutputForceVector();
103 +    needParticlePot_ = simParams->getOutputParticlePotential();
104      createDumpFile_ = true;
105   #ifdef HAVE_LIBZ
106      if (needCompression_) {
# Line 138 | Line 140 | namespace OpenMD {
140      
141      needCompression_ = simParams->getCompressDumpFile();
142      needForceVector_ = simParams->getOutputForceVector();
143 +    needParticlePot_ = simParams->getOutputParticlePotential();
144      
145   #ifdef HAVE_LIBZ
146      if (needCompression_) {
# Line 465 | Line 468 | namespace OpenMD {
468          line += tempBuffer;
469        }      
470      }
471 +    if (needParticlePot_) {
472 +      type += "u";
473 +      RealType particlePot;
474 +
475 +      particlePot = integrableObject->getParticlePot();
476 +
477 +      if (isinf(particlePot) || isnan(particlePot)) {      
478 +        sprintf( painCave.errMsg,
479 +                 "DumpWriter detected a numerical error writing the particle "
480 +                 " potential for object %d", index);      
481 +        painCave.isFatal = 1;
482 +        simError();
483 +      }
484 +      sprintf(tempBuffer, " %13e", particlePot);
485 +      line += tempBuffer;
486 +    }
487      
488      sprintf(tempBuffer, "%10d %7s %s\n", index, type.c_str(), line.c_str());
489      return std::string(tempBuffer);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines