Skip to content

Commit 4dfab40

Browse files
committed
initialize on step = 0
1 parent 9b496df commit 4dfab40

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/loggers.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -996,6 +996,12 @@ Base.values(dl::DisplacementLogger) = dl.displacements
996996

997997
function log_property!(dl::DisplacementLogger, s::System, neighbors=nothing,
998998
step_n::Integer=0; kwargs...)
999+
1000+
# Initialize the logger at step 0
1001+
if step_n == 0
1002+
dl.last_coords = copy(s.coords)
1003+
dl.last_displacements = zero(s.coords)
1004+
end
9991005

10001006
if (step_n % dl.n_update) == 0
10011007
dl.last_displacements .+= vector.(dl.last_coords, s.coords, s.boundary)

0 commit comments

Comments
 (0)