Skip to content

Commit 9ae85b1

Browse files
committed
Fix piracy issue
1 parent 94075a6 commit 9ae85b1

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

lib/BoundaryValueDiffEqMIRK/src/interpolation.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ end
202202

203203
# Intermediate solution for evaluating boundary conditions
204204
# basically simplified version of the interpolation for MIRK
205-
function (s::EvalSol{C})(tval::Number) where {C <: AbstractBoundaryValueDiffEqCache}
205+
function (s::EvalSol{C})(tval::Number) where {C <: MIRKCache}
206206
(; t, u, cache) = s
207207
(; alg, stage, k_discrete, k_interp, M) = cache
208208
# Quick handle for the case where tval is at the boundary
@@ -234,7 +234,7 @@ function (s::EvalSol{C})(tval::Number) where {C <: AbstractBoundaryValueDiffEqCa
234234
end
235235

236236
# Interpolate intermediate solution at multiple points
237-
function (s::EvalSol{C})(tvals::AbstractArray{<:Number}) where {C <: AbstractBoundaryValueDiffEqCache}
237+
function (s::EvalSol{C})(tvals::AbstractArray{<:Number}) where {C <: MIRKCache}
238238
(; t, u, cache) = s
239239
(; alg, stage, k_discrete, mesh_dt, M) = cache
240240
# Quick handle for the case where tval is at the boundary
@@ -352,7 +352,7 @@ end
352352
353353
Update the intermediate solution `eval_sol` with the new flattened solution `y_` and the cache. When evaluating boundary conditions with new solution during nonlinear solving, we should always update the intermediate solution with discrete solution + discrete stages + new stages(Continuous MIRK: u(meshᵢ + τ*dt) = yᵢ + dt sum br(τ)*kr).
354354
"""
355-
@views function update_eval_sol!(eval_sol::EvalSol, y_, cache::AbstractBoundaryValueDiffEqCache)
355+
@views function update_eval_sol!(eval_sol::EvalSol, y_, cache::MIRKCache)
356356
eval_sol.u[1:end] .= __restructure_sol(y_, cache.in_size)
357357
eval_sol.cache.k_discrete[1:end] .= cache.k_discrete
358358
eval_sol.cache.k_interp.u[1:end] .= cache.k_interp.u
@@ -361,7 +361,7 @@ Update the intermediate solution `eval_sol` with the new flattened solution `y_`
361361
end
362362

363363
# Intermediate derivative solution for evaluating derivative boundary conditions
364-
function (s::EvalSol{C})(tval::Number, ::Type{Val{1}}) where {C <: AbstractBoundaryValueDiffEqCache}
364+
function (s::EvalSol{C})(tval::Number, ::Type{Val{1}}) where {C <: MIRKCache}
365365
(; t, u, cache) = s
366366
(; alg, stage, k_discrete, mesh_dt) = cache
367367
z′ = zero(last(u))
@@ -378,7 +378,7 @@ Construct n root-finding problems and solve them to find the critical points wit
378378
"""
379379
function __construct_then_solve_root_problem(sol::EvalSol{C}, tspan::Tuple) where {
380380
C <:
381-
AbstractBoundaryValueDiffEqCache,
381+
MIRKCache,
382382
}
383383
(; alg) = sol.cache
384384
n = first(size(sol))
@@ -402,7 +402,7 @@ end
402402
403403
Find the maximum of the solution over the time span `tspan`.
404404
"""
405-
function maxsol(sol::EvalSol{C}, tspan::Tuple) where {C <: AbstractBoundaryValueDiffEqCache}
405+
function maxsol(sol::EvalSol{C}, tspan::Tuple) where {C <: MIRKCache}
406406
nlsols = __construct_then_solve_root_problem(sol, tspan)
407407
tvals = map(nlsol -> (SciMLBase.successful_retcode(nlsol); return nlsol.u), nlsols)
408408
u = sol(tvals)
@@ -414,7 +414,7 @@ end
414414
415415
Find the minimum of the solution over the time span `tspan`.
416416
"""
417-
function minsol(sol::EvalSol{C}, tspan::Tuple) where {C <: AbstractBoundaryValueDiffEqCache}
417+
function minsol(sol::EvalSol{C}, tspan::Tuple) where {C <: MIRKCache}
418418
nlsols = __construct_then_solve_root_problem(sol, tspan)
419419
tvals = map(nlsol -> (SciMLBase.successful_retcode(nlsol); return nlsol.u), nlsols)
420420
u = sol(tvals)

lib/BoundaryValueDiffEqMIRK/test/mirk_basic_tests.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -292,17 +292,17 @@ end
292292

293293
@testset "Interpolation for adaptive MIRK$order" for order in (2, 3, 4, 5, 6)
294294
sol = solve(prob_mp, mirk_solver(Val(order)); dt = 0.001)
295-
sol_analytic_1 = prob_mp_analytic(nothing, pi / 6)
296-
sol_analytic_2 = prob_mp_analytic(nothing, pi / 3)
295+
sol_analytic_1 = prob_mp_analytic(nothing, nothing, pi / 6)
296+
sol_analytic_2 = prob_mp_analytic(nothing, nothing, pi / 3)
297297

298298
@test sol(pi / 6) sol_analytic_1 atol = testTol
299299
@test sol(pi / 3) sol_analytic_2 atol = testTol
300300
end
301301

302302
@testset "Interpolation for non-adaptive MIRK$order" for order in (2, 3, 4, 5, 6)
303303
sol = solve(prob_mp, mirk_solver(Val(order)); dt = 0.001, adaptive = false)
304-
sol_analytic_1 = prob_mp_analytic(nothing, pi / 6)
305-
sol_analytic_2 = prob_mp_analytic(nothing, pi / 3)
304+
sol_analytic_1 = prob_mp_analytic(nothing, nothing, pi / 6)
305+
sol_analytic_2 = prob_mp_analytic(nothing, nothing, pi / 3)
306306

307307
@test sol(pi / 6) sol_analytic_1 atol = testTol
308308
@test sol(pi / 3) sol_analytic_2 atol = testTol

0 commit comments

Comments
 (0)