Skip to content

Commit 9b496df

Browse files
committed
bug
1 parent 67f1b7a commit 9b496df

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/loggers.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -969,7 +969,7 @@ updated every `n_update` steps and saved every `n_steps` steps.
969969
970970
The logger assumes a particle does not cross 2 periodic boxes in `n_update` steps.
971971
By default `n_update` is set to one to mitigate this assumption, but it can be
972-
set to a higher value to reduce cost. `n_update` must be a multiple of `n_steps`.
972+
set to a higher value to reduce cost. `n_steps` must be a multiple of `n_update`.
973973
"""
974974
mutable struct DisplacementLogger{A, B}
975975
displacements::Vector{A}
@@ -986,8 +986,8 @@ end
986986
function DisplacementLogger(n_steps::Integer; T = typeof(one(DefaultFloat)u"nm"), n_update::Integer = 1, dims::Integer = 3)
987987
B = SArray{Tuple{dims}, T, 1, dims}
988988
A = Array{B, 1}
989-
if n_update % n_steps != 0
990-
throw(ArgumentError("DisplacementLogger: n_update ($n_update) must be a multiple of n_steps ($(n_steps)) and >= n_steps"))
989+
if n_steps % n_update != 0
990+
throw(ArgumentError("DisplacementLogger: n_steps ($n_steps) must be a multiple n_update ($(n_update)) and >= n_steps"))
991991
end
992992
return DisplacementLogger{A, B}(A[], B[], B[], n_steps, n_update)
993993
end

0 commit comments

Comments
 (0)