Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
openmm
Commits
24cb7109
Commit
24cb7109
authored
Mar 27, 2014
by
peastman
Browse files
Fixed a potential divide by zero
parent
e8718a1f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
wrappers/python/simtk/openmm/app/statedatareporter.py
wrappers/python/simtk/openmm/app/statedatareporter.py
+5
-2
No files found.
wrappers/python/simtk/openmm/app/statedatareporter.py
View file @
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment