Skip to content

Commit

Permalink
Merge pull request #67 from SciML/dep_reduce
Browse files Browse the repository at this point in the history
Reduce and modernize dependency set
  • Loading branch information
ChrisRackauckas authored Jul 18, 2024
2 parents e08ebf5 + a753160 commit 6ed324a
Show file tree
Hide file tree
Showing 7 changed files with 196 additions and 189 deletions.
4 changes: 1 addition & 3 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,14 @@ version = "0.2.7"

[deps]
DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e"
FastBroadcast = "7034ab61-46d4-4ed7-9d0f-46aef9175898"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
Parameters = "d96e819e-fc66-5662-9728-84c9c7592b0a"
RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"

[compat]
DiffEqBase = "6.144"
OrdinaryDiffEq = "6"
Parameters = "0.12"
RecursiveArrayTools = "3"
Reexport = "1.0"
Expand Down
16 changes: 8 additions & 8 deletions src/IRKGL16Solver.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ abstract type IRKAlgorithm{
mixed_precision,
low_prec_type,
nrmbits
} <: OrdinaryDiffEqAlgorithm end
} <: SciMLBase.AbstractODEAlgorithm end
struct IRKGL16{
mstep,
maxtrials,
Expand Down Expand Up @@ -100,8 +100,8 @@ function IRKGL16(;
}()
end

function DiffEqBase.__solve(
prob::DiffEqBase.AbstractODEProblem{
function SciMLBase.__solve(
prob::SciMLBase.AbstractODEProblem{
uType,
tspanType,
isinplace
Expand Down Expand Up @@ -137,7 +137,7 @@ function DiffEqBase.__solve(
nrmbits
}
s = 8
stats = DiffEqBase.Stats(0)
stats = SciMLBase.DEStats(0)

if (prob.f isa DynamicalODEFunction)
@unpack tspan, p = prob
Expand All @@ -150,7 +150,7 @@ function DiffEqBase.__solve(
@unpack f, u0, tspan, p = prob
else
println("Error: incorrect ODEFunction")
sol = DiffEqBase.build_solution(prob, alg, [], [], retcode = ReturnCode.Failure)
sol = SciMLBase.build_solution(prob, alg, [], [], retcode = ReturnCode.Failure)
return (sol)
end

Expand Down Expand Up @@ -390,7 +390,7 @@ function DiffEqBase.__solve(

if (status == "Failure")
# println("Fail")
sol = DiffEqBase.build_solution(prob, alg, tt, uu,
sol = SciMLBase.build_solution(prob, alg, tt, uu,
retcode = ReturnCode.Failure)
return (sol)
end
Expand Down Expand Up @@ -454,7 +454,7 @@ function DiffEqBase.__solve(

if (status == "Failure")
# println("Fail")
sol = DiffEqBase.build_solution(prob, alg, tt, uu,
sol = SciMLBase.build_solution(prob, alg, tt, uu,
retcode = ReturnCode.Failure)
return (sol)
end
Expand Down Expand Up @@ -486,7 +486,7 @@ function DiffEqBase.__solve(
end
end

sol = DiffEqBase.build_solution(prob, alg, tt, uu, stats = stats,
sol = SciMLBase.build_solution(prob, alg, tt, uu, stats = stats,
retcode = ReturnCode.Success)

sol.stats.nf = nfcn[1]
Expand Down
88 changes: 44 additions & 44 deletions src/IRKGL16step_adaptive_par.jl
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,15 @@ function IRKstep_par_adaptive!(s,
@inbounds begin
for is in 1:s
Uz[is] .= U[is]
DiffEqBase.@.. U[is] = uj + (ej +
mu[is, 1] * L[1] +
mu[is, 2] * L[2] +
mu[is, 3] * L[3] +
mu[is, 4] * L[4] +
mu[is, 5] * L[5] +
mu[is, 6] * L[6] +
mu[is, 7] * L[7] +
mu[is, 8] * L[8])
FastBroadcast.@.. U[is] = uj + (ej +
mu[is, 1] * L[1] +
mu[is, 2] * L[2] +
mu[is, 3] * L[3] +
mu[is, 4] * L[4] +
mu[is, 5] * L[5] +
mu[is, 6] * L[6] +
mu[is, 7] * L[7] +
mu[is, 8] * L[8])
end
end #inbound

Expand Down Expand Up @@ -351,15 +351,15 @@ function IRKstep_par_adaptive_Mix!(s,
@inbounds begin
for is in 1:s
Uz[is] .= U[is]
DiffEqBase.@.. U[is] = uj + (ej +
mu[is, 1] * L[1] +
mu[is, 2] * L[2] +
mu[is, 3] * L[3] +
mu[is, 4] * L[4] +
mu[is, 5] * L[5] +
mu[is, 6] * L[6] +
mu[is, 7] * L[7] +
mu[is, 8] * L[8])
FastBroadcast.@.. U[is] = uj + (ej +
mu[is, 1] * L[1] +
mu[is, 2] * L[2] +
mu[is, 3] * L[3] +
mu[is, 4] * L[4] +
mu[is, 5] * L[5] +
mu[is, 6] * L[6] +
mu[is, 7] * L[7] +
mu[is, 8] * L[8])
Ulow[is] .= U[is]
normU[is] = copy(norm(Ulow[is]))
end
Expand Down Expand Up @@ -402,14 +402,14 @@ function IRKstep_par_adaptive_Mix!(s,
for l in 1:lmax
for is in 1:s
if (Eval[is] == true)
DiffEqBase.@.. DU[is] = lmu[is, 1] * DL[1] +
lmu[is, 2] * DL[2] +
lmu[is, 3] * DL[3] +
lmu[is, 4] * DL[4] +
lmu[is, 5] * DL[5] +
lmu[is, 6] * DL[6] +
lmu[is, 7] * DL[7] +
lmu[is, 8] * DL[8]
FastBroadcast.@.. DU[is] = lmu[is, 1] * DL[1] +
lmu[is, 2] * DL[2] +
lmu[is, 3] * DL[3] +
lmu[is, 4] * DL[4] +
lmu[is, 5] * DL[5] +
lmu[is, 6] * DL[6] +
lmu[is, 7] * DL[7] +
lmu[is, 8] * DL[8]
end
end

Expand Down Expand Up @@ -606,15 +606,15 @@ function IRKstepDynODE_par_adaptive!(s,
@inbounds begin
for is in 1:s
Uz[is].x[1] .= U[is].x[1]
DiffEqBase.@.. U[is].x[1] = uj.x[1] + (ej.x[1] +
mu[is, 1] * L[1].x[1] +
mu[is, 2] * L[2].x[1] +
mu[is, 3] * L[3].x[1] +
mu[is, 4] * L[4].x[1] +
mu[is, 5] * L[5].x[1] +
mu[is, 6] * L[6].x[1] +
mu[is, 7] * L[7].x[1] +
mu[is, 8] * L[8].x[1])
FastBroadcast.@.. U[is].x[1] = uj.x[1] + (ej.x[1] +
mu[is, 1] * L[1].x[1] +
mu[is, 2] * L[2].x[1] +
mu[is, 3] * L[3].x[1] +
mu[is, 4] * L[4].x[1] +
mu[is, 5] * L[5].x[1] +
mu[is, 6] * L[6].x[1] +
mu[is, 7] * L[7].x[1] +
mu[is, 8] * L[8].x[1])
end
end #inbound

Expand Down Expand Up @@ -647,15 +647,15 @@ function IRKstepDynODE_par_adaptive!(s,
@inbounds begin
for is in 1:s
Uz[is].x[2] .= U[is].x[2]
DiffEqBase.@.. U[is].x[2] = uj.x[2] + (ej.x[2] +
mu[is, 1] * L[1].x[2] +
mu[is, 2] * L[2].x[2] +
mu[is, 3] * L[3].x[2] +
mu[is, 4] * L[4].x[2] +
mu[is, 5] * L[5].x[2] +
mu[is, 6] * L[6].x[2] +
mu[is, 7] * L[7].x[2] +
mu[is, 8] * L[8].x[2])
FastBroadcast.@.. U[is].x[2] = uj.x[2] + (ej.x[2] +
mu[is, 1] * L[1].x[2] +
mu[is, 2] * L[2].x[2] +
mu[is, 3] * L[3].x[2] +
mu[is, 4] * L[4].x[2] +
mu[is, 5] * L[5].x[2] +
mu[is, 6] * L[6].x[2] +
mu[is, 7] * L[7].x[2] +
mu[is, 8] * L[8].x[2])
end
end #inbound

Expand Down
88 changes: 44 additions & 44 deletions src/IRKGL16step_adaptive_seq.jl
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,15 @@ function IRKstep_adaptive!(s,
@inbounds begin
for is in 1:s
Uz[is] .= U[is]
DiffEqBase.@.. U[is] = uj + (ej +
mu[is, 1] * L[1] +
mu[is, 2] * L[2] +
mu[is, 3] * L[3] +
mu[is, 4] * L[4] +
mu[is, 5] * L[5] +
mu[is, 6] * L[6] +
mu[is, 7] * L[7] +
mu[is, 8] * L[8])
FastBroadcast.@.. U[is] = uj + (ej +
mu[is, 1] * L[1] +
mu[is, 2] * L[2] +
mu[is, 3] * L[3] +
mu[is, 4] * L[4] +
mu[is, 5] * L[5] +
mu[is, 6] * L[6] +
mu[is, 7] * L[7] +
mu[is, 8] * L[8])
end
end #inbound

Expand Down Expand Up @@ -353,15 +353,15 @@ function IRKstep_adaptive_Mix!(s,
@inbounds begin
for is in 1:s
Uz[is] .= U[is]
DiffEqBase.@.. U[is] = uj + (ej +
mu[is, 1] * L[1] +
mu[is, 2] * L[2] +
mu[is, 3] * L[3] +
mu[is, 4] * L[4] +
mu[is, 5] * L[5] +
mu[is, 6] * L[6] +
mu[is, 7] * L[7] +
mu[is, 8] * L[8])
FastBroadcast.@.. U[is] = uj + (ej +
mu[is, 1] * L[1] +
mu[is, 2] * L[2] +
mu[is, 3] * L[3] +
mu[is, 4] * L[4] +
mu[is, 5] * L[5] +
mu[is, 6] * L[6] +
mu[is, 7] * L[7] +
mu[is, 8] * L[8])
Ulow[is] .= U[is]
normU[is] = copy(norm(Ulow[is]))
end
Expand Down Expand Up @@ -404,14 +404,14 @@ function IRKstep_adaptive_Mix!(s,
for l in 1:lmax
for is in 1:s
if (Eval[is] == true)
DiffEqBase.@.. DU[is] = lmu[is, 1] * DL[1] +
lmu[is, 2] * DL[2] +
lmu[is, 3] * DL[3] +
lmu[is, 4] * DL[4] +
lmu[is, 5] * DL[5] +
lmu[is, 6] * DL[6] +
lmu[is, 7] * DL[7] +
lmu[is, 8] * DL[8]
FastBroadcast.@.. DU[is] = lmu[is, 1] * DL[1] +
lmu[is, 2] * DL[2] +
lmu[is, 3] * DL[3] +
lmu[is, 4] * DL[4] +
lmu[is, 5] * DL[5] +
lmu[is, 6] * DL[6] +
lmu[is, 7] * DL[7] +
lmu[is, 8] * DL[8]
end
end

Expand Down Expand Up @@ -608,15 +608,15 @@ function IRKstepDynODE_adaptive!(s,
@inbounds begin
for is in 1:s
Uz[is].x[1] .= U[is].x[1]
DiffEqBase.@.. U[is].x[1] = uj.x[1] + (ej.x[1] +
mu[is, 1] * L[1].x[1] +
mu[is, 2] * L[2].x[1] +
mu[is, 3] * L[3].x[1] +
mu[is, 4] * L[4].x[1] +
mu[is, 5] * L[5].x[1] +
mu[is, 6] * L[6].x[1] +
mu[is, 7] * L[7].x[1] +
mu[is, 8] * L[8].x[1])
FastBroadcast.@.. U[is].x[1] = uj.x[1] + (ej.x[1] +
mu[is, 1] * L[1].x[1] +
mu[is, 2] * L[2].x[1] +
mu[is, 3] * L[3].x[1] +
mu[is, 4] * L[4].x[1] +
mu[is, 5] * L[5].x[1] +
mu[is, 6] * L[6].x[1] +
mu[is, 7] * L[7].x[1] +
mu[is, 8] * L[8].x[1])
end
end #inbound

Expand Down Expand Up @@ -649,15 +649,15 @@ function IRKstepDynODE_adaptive!(s,
@inbounds begin
for is in 1:s
Uz[is].x[2] .= U[is].x[2]
DiffEqBase.@.. U[is].x[2] = uj.x[2] + (ej.x[2] +
mu[is, 1] * L[1].x[2] +
mu[is, 2] * L[2].x[2] +
mu[is, 3] * L[3].x[2] +
mu[is, 4] * L[4].x[2] +
mu[is, 5] * L[5].x[2] +
mu[is, 6] * L[6].x[2] +
mu[is, 7] * L[7].x[2] +
mu[is, 8] * L[8].x[2])
FastBroadcast.@.. U[is].x[2] = uj.x[2] + (ej.x[2] +
mu[is, 1] * L[1].x[2] +
mu[is, 2] * L[2].x[2] +
mu[is, 3] * L[3].x[2] +
mu[is, 4] * L[4].x[2] +
mu[is, 5] * L[5].x[2] +
mu[is, 6] * L[6].x[2] +
mu[is, 7] * L[7].x[2] +
mu[is, 8] * L[8].x[2])
end
end #inbound

Expand Down
Loading

0 comments on commit 6ed324a

Please sign in to comment.