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_) { |
100 |
|
|
101 |
|
needCompression_ = simParams->getCompressDumpFile(); |
102 |
|
needForceVector_ = simParams->getOutputForceVector(); |
103 |
+ |
needParticlePot_ = simParams->getOutputParticlePotential(); |
104 |
|
createDumpFile_ = true; |
105 |
|
#ifdef HAVE_LIBZ |
106 |
|
if (needCompression_) { |
140 |
|
|
141 |
|
needCompression_ = simParams->getCompressDumpFile(); |
142 |
|
needForceVector_ = simParams->getOutputForceVector(); |
143 |
+ |
needParticlePot_ = simParams->getOutputParticlePotential(); |
144 |
|
|
145 |
|
#ifdef HAVE_LIBZ |
146 |
|
if (needCompression_) { |
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); |