Skip to content

Commit 0757cd2

Browse files
pkofodanriseth
authored andcommitted
Fix InitialConstantChange (#122)
1 parent c3d0763 commit 0757cd2

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/initialguess.jl

+1
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ function (is::InitialConstantChange{T})(ls, state, phi_0, dphi_0, df) where T
148148
αguess = one(state.alpha)
149149
end
150150
end
151+
is.dϕ_0_previous[] = dphi_0
151152
state.alpha = αguess
152153
end
153154

test/initial.jl

+4
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,10 @@
120120
is = InitialConstantChange(snap2one=(0.25,1.0))
121121
is.dϕ_0_previous[] = 0.1*dphi_0
122122
is(ls, state, phi_0, dphi_0, df)
123+
@test is.dϕ_0_previous[] == dphi_0
123124
@test state.alpha == 1.0
124125
@test ls.mayterminate[] == false
126+
dϕ_0_rand = rand()
127+
is(ls, state, phi_0, dϕ_0_rand, df)
128+
@test is.dϕ_0_previous[] == dϕ_0_rand
125129
end

0 commit comments

Comments
 (0)