Skip to content

Commit 6de81e2

Browse files
committed
Update package compat versions
Also replaces the apparently now defunct SimpleNonlinearSolve with NonlinearSolve.
1 parent cc670e6 commit 6de81e2

File tree

7 files changed

+14
-13
lines changed

7 files changed

+14
-13
lines changed

Project.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ LinearSolve = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae"
2525
LoopVectorization = "bdcacae8-1622-11e9-2a5c-532679323890"
2626
ModelParameters = "4744a3fa-6c31-4707-899e-a3298e4618ad"
2727
NCDatasets = "85f8d34a-cbdd-5861-8df4-14fed0d494ab"
28+
NonlinearSolve = "8913a72c-1f9b-4ce2-8d82-65094dcecaec"
2829
PreallocationTools = "d236fae5-4411-538c-8e31-a6e3d9e00b46"
2930
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
3031
RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"
@@ -33,7 +34,6 @@ Requires = "ae029012-a4dd-5104-9daa-d747884805df"
3334
ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267"
3435
SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
3536
Setfield = "efcf1570-3423-57d1-acb7-fd33fddbac46"
36-
SimpleNonlinearSolve = "727e6d20-b764-4bd8-a329-72de5adea6c7"
3737
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
3838
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
3939
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
@@ -53,7 +53,7 @@ ConstructionBase = "1.4"
5353
DataStructures = "0.18"
5454
Dates = "1"
5555
DiffEqBase = "6"
56-
DiffEqCallbacks = "2, 3"
56+
DiffEqCallbacks = "2, 3, 4"
5757
DimensionalData = "0.19, 0.20, 0.21, 0.24, 0.25, 0.26, 0.27, 0.28"
5858
Downloads = "1"
5959
Flatten = "0.4"
@@ -68,6 +68,7 @@ LinearSolve = "1, 2"
6868
LoopVectorization = "0.12"
6969
ModelParameters = "0.3, 0.4"
7070
NCDatasets = "0.12, 0.13, 0.14"
71+
NonlinearSolve = "4"
7172
OrdinaryDiffEq = "6"
7273
PreallocationTools = "0.4"
7374
RecursiveArrayTools = "2, 3"
@@ -76,7 +77,6 @@ Requires = "1"
7677
ReverseDiff = "1"
7778
SciMLBase = "1, 2"
7879
Setfield = "0.8,1"
79-
SimpleNonlinearSolve = "0.1,1"
8080
SpecialFunctions = "2"
8181
StaticArrays = "1"
8282
Statistics = "1"

examples/heat_sfcc_samoylov.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ lowerbc = GeothermalHeatFlux(0.053u"W/m^2")
1616
tile = CryoGrid.SoilHeatTile(upperbc, lowerbc, soilprofile, forcings, initT; grid=grid)
1717
tspan = (DateTime(2010,10,30),DateTime(2011,10,30))
1818
u0, du0 = @time initialcondition!(tile, tspan)
19-
prob = CryoGridProblem(tile, u0, tspan, saveat=3*3600.0, savevars=(:T,));
19+
prob = CryoGridProblem(tile, u0, tspan, saveat=3*3600.0, savevars=(:T,:H,:C,:θw,:∂H∂T));
2020

2121
# ... then solve it with the built-in forward Euler integrator.
2222
sol = @time solve(prob);

src/Physics/Heat/analytic/stefan_analytic.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ using ComponentArrays
22
using SpecialFunctions
33
using UnPack
44

5-
import SimpleNonlinearSolve
5+
import NonlinearSolve
66
import SciMLBase
77

88
const DefaultHeatProperties = HeatBalanceProperties()
@@ -103,12 +103,12 @@ function (sol::StefanSolution)(x, t)
103103
IfElse.ifelse(x >= x_m, uconvert(u"°C", T_s), uconvert(u"°C", T_l))
104104
end
105105
end
106-
function SciMLBase.solve(prob::StefanProblem, alg=SimpleNonlinearSolve.SimpleNewtonRaphson(); p=prob.p, x0=prob.x0, t0=prob.t0)
106+
function SciMLBase.solve(prob::StefanProblem, alg=NonlinearSolve.SimpleNewtonRaphson(); p=prob.p, x0=prob.x0, t0=prob.t0)
107107
pvec = ComponentVector(values(p))
108108
prob = StefanProblem(StefanParameters(;pvec...), x0, t0)
109109
f(u,p) = stefan_residual(u, p.T_m, p.T_l, p.T_s, p.k_l, p.c_l, p.k_s, p.c_s, p.ρ, p.θwi, p.Lf)
110110
λ₀ = 1/(pvec.Lf*pvec.θwi)
111-
nlprob = SimpleNonlinearSolve.NonlinearProblem(f, ustrip(λ₀), ustrip.(pvec))
111+
nlprob = NonlinearSolve.NonlinearProblem(f, ustrip(λ₀), ustrip.(pvec))
112112
nlsol = SciMLBase.solve(nlprob, alg)
113113
λ = nlsol.u*one(λ₀)
114114
return StefanSolution(prob, nlsol, λ)

src/Physics/Surface/SEB/seb_solve.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
function SimpleNonlinearSolve.solve(seb::SurfaceEnergyBalance{<:Numerical}, initialstate::SEBState)
1+
function NonlinearSolve.solve(seb::SurfaceEnergyBalance{<:Numerical}, initialstate::SEBState)
22
function resid(u, p)
33
state = SEBState(;
44
Qh=u[1],

src/Physics/Surface/Surface.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ using CryoGrid.Numerics
99
using CryoGrid.Utils
1010

1111
using Setfield
12-
using SimpleNonlinearSolve
12+
using NonlinearSolve
1313
using StaticArrays: @SVector
1414
using Unitful
1515

src/problem.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ function CryoGridProblem(
7474
# remove units
7575
tile = stripunits(tile)
7676
# set up saving callback
77-
stateproto = getsavestate(tile, u0, du0)
78-
savevals = SavedValues(Float64, typeof(stateproto))
77+
# stateproto = getsavestate(tile, u0, du0)
78+
savevals = SavedValues(Float64, Any)
7979
saveat = expandtstep(saveat, tspan)
8080
savingcallback = SavingCallback(savefunc, savevals; saveat=saveat, save_start=save_start, save_end=save_end, save_everystep=save_everystep)
8181
diagnostic_step_callback = PresetTimeCallback(tspan[1]:diagnostic_stepsize:tspan[end], diagnosticstep!)
@@ -115,7 +115,8 @@ function SciMLBase.remake(
115115
kwargs=prob.kwargs,
116116
) where iip
117117
# always re-run initialcondition! with the given tspan and parameters
118-
_u0, du0 = initialcondition!(Tile(f), tspan, p)
118+
tile = Tile(f)
119+
_u0, du0 = initialcondition!(tile, tspan, p)
119120
# if u0 was explicitly given, use it instead of the computed value
120121
if !isnothing(u0)
121122
# evaluate Tile on new initial state

test/Physics/Surface/runtests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ using CryoGrid.Hydrology
33
using CryoGrid.Surface
44
using CryoGrid.Utils
55

6-
using SimpleNonlinearSolve
6+
using NonlinearSolve
77
using Test
88

99
include("seb_tests.jl")

0 commit comments

Comments
 (0)