"vscode:/vscode.git/clone" did not exist on "983513e6635ad904fbc06d7710b4d3248880abe9"
Commit 1e0d6e3e authored by peastman's avatar peastman
Browse files

Merge pull request #382 from peastman/master

Fixed a potential divide by zero
parents 306fe04e 24cb7109
......@@ -201,9 +201,12 @@ class StateDataReporter(object):
if self._density:
values.append((self._totalMass/volume).value_in_unit(unit.gram/unit.item/unit.milliliter))
if self._speed:
elapsedDays = (clockTime-self._initialClockTime)/86400
elapsedDays = (clockTime-self._initialClockTime)/86400.0
elapsedNs = (state.getTime()-self._initialSimulationTime).value_in_unit(unit.nanosecond)
values.append('%.3g' % (elapsedNs/elapsedDays))
if elapsedDays > 0.0:
values.append('%.3g' % (elapsedNs/elapsedDays))
else:
values.append('--')
if self._remainingTime:
elapsedSeconds = clockTime-self._initialClockTime
elapsedSteps = simulation.currentStep-self._initialSteps
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment