Skip to content

Commit aca1dc9

Browse files
fix for v0.7
1 parent d0657b9 commit aca1dc9

File tree

3 files changed

+8
-14
lines changed

3 files changed

+8
-14
lines changed

REQUIRE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
julia 0.7-beta2
1+
julia 0.7
22
DiffEqBase 3.0.0
33
OrdinaryDiffEq 3.0.0
44
Reexport
55
StaticArrays
66
RecursiveArrayTools
77
RecipesBase
88
DiffEqCallbacks
9-
FileIO
9+
FileIO

src/boundary_conditions.jl

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,16 @@ end
77

88
PeriodicBoundaryConditions(L::Real) = PeriodicBoundaryConditions(SVector(0, L, 0, L, 0, L))
99

10-
Base.start(::PeriodicBoundaryConditions) = 1
11-
12-
Base.done(pbc::PeriodicBoundaryConditions, state) = state > length(pbc.boundary)
13-
14-
function Base.next(pbc::PeriodicBoundaryConditions, state)
15-
pbc.boundary[state], state + 1
10+
function Base.iterate(pbc::PeriodicBoundaryConditions,state=1)
11+
state > length(pbc.boundary) && return nothing
12+
pbc.boundary[state], state + 1
1613
end
1714

1815
function Base.getindex(pbc::PeriodicBoundaryConditions, i::Integer)
1916
1 <= i <= length(pbc.boundary) || throw(BoundsError(pbc, i))
2017
pbc.boundary[i]
2118
end
2219

23-
2420
struct InfiniteBox{cType <: Real} <: BoundaryConditions
2521
boundary::SVector{6,<:cType}
2622
end

src/nbody_simulation_result.jl

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,10 @@ end
2222

2323
# This iterator interface is implemented specifically for making animation.
2424
# Probably, there will be a wrapper for this in the future.
25-
Base.start(::SimulationResult) = 1
2625

27-
Base.done(sr::SimulationResult, state) = state > length(sr.solution.t)
28-
29-
function Base.next(sr::SimulationResult, state)
30-
(sr, sr.solution.t[state]), state + 1
26+
function Base.iterate(sr::SimulationResult,state=1)
27+
state > length(sr.solution.t) && return nothing
28+
(sr, sr.solution.t[state]), state + 1
3129
end
3230

3331
function get_velocity(sr::SimulationResult, time::Real, i::Integer=0)

0 commit comments

Comments
 (0)