# | Line 221 | Line 221 | namespace OpenMD { | |
---|---|---|
221 | int n = dat->accumulator[bin]->count(); | |
222 | if (n == 0) return; | |
223 | ||
224 | – | RealType r; |
225 | – | Vector3d v; |
226 | – | |
224 | if( dat->dataType == odtReal ) { | |
225 | + | RealType r; |
226 | dynamic_cast<Accumulator*>(dat->accumulator[bin])->getAverage(r); | |
227 | if (isinf(r) || isnan(r) ) { | |
228 | sprintf( painCave.errMsg, | |
229 | "SpatialStatistics detected a numerical error writing:\n" | |
230 | < | "\t%s for bin %d", |
230 | > | "\t%s for bin %u", |
231 | dat->title.c_str(), bin); | |
232 | painCave.isFatal = 1; | |
233 | simError(); | |
# | Line 238 | Line 236 | namespace OpenMD { | |
236 | os << "\t" << r; | |
237 | ||
238 | } else if ( dat->dataType == odtVector3 ) { | |
239 | + | Vector3d v; |
240 | dynamic_cast<VectorAccumulator*>(dat->accumulator[bin])->getAverage(v); | |
241 | if (isinf(v[0]) || isnan(v[0]) || | |
242 | isinf(v[1]) || isnan(v[1]) || | |
243 | isinf(v[2]) || isnan(v[2]) ) { | |
244 | sprintf( painCave.errMsg, | |
245 | "SpatialStatistics detected a numerical error writing:\n" | |
246 | < | "\t%s for bin %d", |
246 | > | "\t%s for bin %u", |
247 | dat->title.c_str(), bin); | |
248 | painCave.isFatal = 1; | |
249 | simError(); | |
# | Line 260 | Line 259 | namespace OpenMD { | |
259 | int n = dat->accumulator[bin]->count(); | |
260 | if (n == 0) return; | |
261 | ||
263 | – | RealType r; |
264 | – | Vector3d v; |
265 | – | |
262 | if( dat->dataType == odtReal ) { | |
263 | + | RealType r; |
264 | dynamic_cast<Accumulator*>(dat->accumulator[bin])->getStdDev(r); | |
265 | if (isinf(r) || isnan(r) ) { | |
266 | sprintf( painCave.errMsg, | |
267 | "SpatialStatistics detected a numerical error writing:\n" | |
268 | < | "\tstandard deviation of %s for bin %d", |
268 | > | "\tstandard deviation of %s for bin %u", |
269 | dat->title.c_str(), bin); | |
270 | painCave.isFatal = 1; | |
271 | simError(); | |
# | Line 277 | Line 274 | namespace OpenMD { | |
274 | os << "\t" << r; | |
275 | ||
276 | } else if ( dat->dataType == odtVector3 ) { | |
277 | + | Vector3d v; |
278 | dynamic_cast<VectorAccumulator*>(dat->accumulator[bin])->getStdDev(v); | |
279 | if (isinf(v[0]) || isnan(v[0]) || | |
280 | isinf(v[1]) || isnan(v[1]) || | |
281 | isinf(v[2]) || isnan(v[2]) ) { | |
282 | sprintf( painCave.errMsg, | |
283 | "SpatialStatistics detected a numerical error writing:\n" | |
284 | < | "\tstandard deviation of %s for bin %d", |
284 | > | "\tstandard deviation of %s for bin %u", |
285 | dat->title.c_str(), bin); | |
286 | painCave.isFatal = 1; | |
287 | simError(); | |
# | Line 349 | Line 347 | namespace OpenMD { | |
347 | ||
348 | ShellStatistics::ShellStatistics(SimInfo* info, const string& filename, | |
349 | const string& sele, int nbins) : | |
350 | < | SpatialStatistics(info, filename, sele, nbins){ |
350 | > | SpatialStatistics(info, filename, sele, nbins), coordinateOrigin_(V3Zero) { |
351 | ||
354 | – | coordinateOrigin_ = V3Zero; |
352 | binWidth_ = 1.0; | |
353 | < | |
353 | > | |
354 | r_ = new OutputData; | |
355 | r_->units = "Angstroms"; | |
356 | r_->title = "R"; |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |