| 1521 |  | den = binMass[i] * nBins_ * PhysicalConstants::densityConvert | 
| 1522 |  | / currentSnap_->getVolume() ; | 
| 1523 |  |  | 
| 1524 | < | temp = 2.0 * binKE[i] / (binDOF[i] * PhysicalConstants::kb * | 
| 1525 | < | PhysicalConstants::energyConvert); | 
| 1526 | < |  | 
| 1527 | < | for (unsigned int j = 0; j < outputMask_.size(); ++j) { | 
| 1528 | < | if(outputMask_[j]) { | 
| 1529 | < | switch(j) { | 
| 1530 | < | case Z: | 
| 1531 | < | (data_[j].accumulator[i])->add(z); | 
| 1532 | < | break; | 
| 1533 | < | case TEMPERATURE: | 
| 1534 | < | data_[j].accumulator[i]->add(temp); | 
| 1535 | < | break; | 
| 1536 | < | case VELOCITY: | 
| 1537 | < | dynamic_cast<VectorAccumulator *>(data_[j].accumulator[i])->add(vel); | 
| 1538 | < | break; | 
| 1539 | < | case DENSITY: | 
| 1540 | < | data_[j].accumulator[i]->add(den); | 
| 1541 | < | break; | 
| 1524 | > | if (binCount[i] > 0) { | 
| 1525 | > | // only add values if there are things to add | 
| 1526 | > | temp = 2.0 * binKE[i] / (binDOF[i] * PhysicalConstants::kb * | 
| 1527 | > | PhysicalConstants::energyConvert); | 
| 1528 | > |  | 
| 1529 | > | for (unsigned int j = 0; j < outputMask_.size(); ++j) { | 
| 1530 | > | if(outputMask_[j]) { | 
| 1531 | > | switch(j) { | 
| 1532 | > | case Z: | 
| 1533 | > | dynamic_cast<Accumulator *>(data_[j].accumulator[i])->add(z); | 
| 1534 | > | break; | 
| 1535 | > | case TEMPERATURE: | 
| 1536 | > | dynamic_cast<Accumulator *>(data_[j].accumulator[i])->add(temp); | 
| 1537 | > | break; | 
| 1538 | > | case VELOCITY: | 
| 1539 | > | dynamic_cast<VectorAccumulator *>(data_[j].accumulator[i])->add(vel); | 
| 1540 | > | break; | 
| 1541 | > | case DENSITY: | 
| 1542 | > | dynamic_cast<Accumulator *>(data_[j].accumulator[i])->add(den); | 
| 1543 | > | break; | 
| 1544 | > | } | 
| 1545 |  | } | 
| 1546 |  | } | 
| 1547 |  | } |