From c88a15ecc7c32f4b3559322805261fdaec4b4169 Mon Sep 17 00:00:00 2001 From: Bart de Koning Date: Mon, 2 Sep 2024 05:51:23 +0200 Subject: [PATCH 1/3] Attempt at using NonlinearSolveAlg --- Manifest.toml | 16 +++++++++++----- core/Project.toml | 1 + core/src/config.jl | 12 +++++++++--- core/src/solve.jl | 6 +++--- 4 files changed, 24 insertions(+), 11 deletions(-) diff --git a/Manifest.toml b/Manifest.toml index 1413e6984..2777ff3b3 100644 --- a/Manifest.toml +++ b/Manifest.toml @@ -2,12 +2,12 @@ julia_version = "1.10.4" manifest_format = "2.0" -project_hash = "a410a350a7b0c63bc6696029509aa68c14023275" +project_hash = "ca41f42d61c31f9dbfe0063ba67b3923bfe2af49" [[deps.ADTypes]] -git-tree-sha1 = "6778bcc27496dae5723ff37ee30af451db8b35fe" +git-tree-sha1 = "99a6f5d0ce1c7c6afdb759daa30226f71c54f6b0" uuid = "47edcb42-4c32-4615-8424-f2b9edc5f35b" -version = "1.6.2" +version = "1.7.1" weakdeps = ["ChainRulesCore", "EnzymeCore"] [deps.ADTypes.extensions] @@ -1070,7 +1070,7 @@ uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908" version = "1.2.0" [[deps.NonlinearSolve]] -deps = ["ADTypes", "ArrayInterface", "ConcreteStructs", "DiffEqBase", "FastBroadcast", "FastClosures", "FiniteDiff", "ForwardDiff", "LazyArrays", "LineSearches", "LinearAlgebra", "LinearSolve", "MaybeInplace", "PrecompileTools", "Preferences", "Printf", "RecursiveArrayTools", "Reexport", "SciMLBase", "SimpleNonlinearSolve", "SparseArrays", "SparseDiffTools", "StaticArraysCore", "SymbolicIndexingInterface"] +deps = ["ADTypes", "ArrayInterface", "ConcreteStructs", "DiffEqBase", "FastBroadcast", "FastClosures", "FiniteDiff", "ForwardDiff", "LazyArrays", "LineSearches", "LinearAlgebra", "LinearSolve", "MaybeInplace", "PrecompileTools", "Preferences", "Printf", "RecursiveArrayTools", "Reexport", "SciMLBase", "SimpleNonlinearSolve", "SparseArrays", "SparseDiffTools", "StaticArraysCore", "SymbolicIndexingInterface", "TimerOutputs"] git-tree-sha1 = "3adb1e5945b5a6b1eaee754077f25ccc402edd7f" uuid = "8913a72c-1f9b-4ce2-8d82-65094dcecaec" version = "3.13.1" @@ -1302,7 +1302,7 @@ uuid = "295af30f-e4ad-537b-8983-00126c2a3abe" version = "3.5.18" [[deps.Ribasim]] -deps = ["Accessors", "Arrow", "BasicModelInterface", "CodecZstd", "ComponentArrays", "Configurations", "DBInterface", "DataInterpolations", "DataStructures", "Dates", "DiffEqCallbacks", "EnumX", "FiniteDiff", "ForwardDiff", "Graphs", "HiGHS", "IterTools", "JuMP", "Legolas", "LineSearches", "LinearSolve", "Logging", "LoggingExtras", "MetaGraphsNext", "OrdinaryDiffEq", "PreallocationTools", "SQLite", "SciMLBase", "SparseArrays", "SparseConnectivityTracer", "StructArrays", "Tables", "TerminalLoggers", "TranscodingStreams"] +deps = ["ADTypes", "Accessors", "Arrow", "BasicModelInterface", "CodecZstd", "ComponentArrays", "Configurations", "DBInterface", "DataInterpolations", "DataStructures", "Dates", "DiffEqCallbacks", "EnumX", "FiniteDiff", "ForwardDiff", "Graphs", "HiGHS", "IterTools", "JuMP", "Legolas", "LineSearches", "LinearSolve", "Logging", "LoggingExtras", "MetaGraphsNext", "OrdinaryDiffEq", "PreallocationTools", "SQLite", "SciMLBase", "SparseArrays", "SparseConnectivityTracer", "StructArrays", "Tables", "TerminalLoggers", "TranscodingStreams"] path = "core" uuid = "aac5e3d9-0b8f-4d4f-8241-b1a7a9632635" version = "2024.10.0" @@ -1669,6 +1669,12 @@ weakdeps = ["RecipesBase"] [deps.TimeZones.extensions] TimeZonesRecipesBaseExt = "RecipesBase" +[[deps.TimerOutputs]] +deps = ["ExprTools", "Printf"] +git-tree-sha1 = "5a13ae8a41237cff5ecf34f73eb1b8f42fff6531" +uuid = "a759f4b9-e2f1-59dc-863e-4aeb61b1ea8f" +version = "0.5.24" + [[deps.TranscodingStreams]] git-tree-sha1 = "d73336d81cafdc277ff45558bb7eaa2b04a8e472" uuid = "3bb67fe8-82b1-5028-8e26-92a6c54297fa" diff --git a/core/Project.toml b/core/Project.toml index cf25cc035..fac72074c 100644 --- a/core/Project.toml +++ b/core/Project.toml @@ -5,6 +5,7 @@ manifest = "../Manifest.toml" version = "2024.10.0" [deps] +ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b" Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697" Arrow = "69666777-d1a9-59fb-9406-91d4454c9d45" BasicModelInterface = "59605e27-edc0-445a-b93d-c09a3a50b330" diff --git a/core/src/config.jl b/core/src/config.jl index bb024cd0f..09876692c 100644 --- a/core/src/config.jl +++ b/core/src/config.jl @@ -16,7 +16,8 @@ using ..Ribasim: Ribasim, isnode, nodetype using OrdinaryDiffEq: OrdinaryDiffEqAlgorithm, OrdinaryDiffEqNewtonAdaptiveAlgorithm, - NLNewton, + NonlinearSolveAlg, + NewtonRaphson, Euler, ImplicitEuler, KenCarp4, @@ -26,6 +27,8 @@ using OrdinaryDiffEq: Rosenbrock23, TRBDF2, Tsit5 +using LineSearches: BackTracking +using ADTypes: AutoForwardDiff export Config, Solver, Results, Logging, Toml export algorithm, @@ -239,8 +242,11 @@ function algorithm(solver::Solver; u0 = [])::OrdinaryDiffEqAlgorithm end kwargs = Dict{Symbol, Any}() if algotype <: OrdinaryDiffEqNewtonAdaptiveAlgorithm - kwargs[:nlsolve] = NLNewton(; - relax = Ribasim.MonitoredBackTracking(; z_tmp = copy(u0), dz_tmp = copy(u0)), + # kwargs[:nlsolve] = NLNewton(; + # relax = Ribasim.MonitoredBackTracking(; z_tmp = copy(u0), dz_tmp = copy(u0)), + # ) + kwargs[:nlsolve] = NonlinearSolveAlg( + NewtonRaphson(; linesearch = BackTracking(), autodiff = AutoForwardDiff()), ) end # not all algorithms support this keyword diff --git a/core/src/solve.jl b/core/src/solve.jl index 04aea58a7..e059d7294 100644 --- a/core/src/solve.jl +++ b/core/src/solve.jl @@ -2,11 +2,11 @@ The right hand side function of the system of ODEs set up by Ribasim. """ function water_balance!( - du::ComponentVector, - u::ComponentVector, + du::V, + u::V, p::Parameters, t::Number, -)::Nothing +)::Nothing where {V <: ComponentVector} (; graph, basin, pid_control) = p du .= 0.0 From e686c722379920b6e604c949121bc199d468c254 Mon Sep 17 00:00:00 2001 From: Bart de Koning Date: Mon, 2 Sep 2024 07:57:39 +0200 Subject: [PATCH 2/3] Adapt to OrdinaryDiffEq main branch --- Manifest.toml | 427 ++++++++++++++++++++++++++++++++------------ core/Project.toml | 3 + core/src/Ribasim.jl | 12 +- core/src/config.jl | 4 +- core/src/util.jl | 2 +- 5 files changed, 320 insertions(+), 128 deletions(-) diff --git a/Manifest.toml b/Manifest.toml index 2777ff3b3..29c6fec26 100644 --- a/Manifest.toml +++ b/Manifest.toml @@ -2,7 +2,7 @@ julia_version = "1.10.4" manifest_format = "2.0" -project_hash = "ca41f42d61c31f9dbfe0063ba67b3923bfe2af49" +project_hash = "3ead3b6402176c78a03f8f9fc3df06ad3429ad56" [[deps.ADTypes]] git-tree-sha1 = "99a6f5d0ce1c7c6afdb759daa30226f71c54f6b0" @@ -67,9 +67,9 @@ version = "0.4.0" [[deps.ArrayInterface]] deps = ["Adapt", "LinearAlgebra"] -git-tree-sha1 = "f54c23a5d304fb87110de62bace7777d59088c34" +git-tree-sha1 = "3640d077b6dafd64ceb8fd5c1ec76f7ca53bcf76" uuid = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9" -version = "7.15.0" +version = "7.16.0" [deps.ArrayInterface.extensions] ArrayInterfaceBandedMatricesExt = "BandedMatrices" @@ -97,9 +97,9 @@ version = "7.15.0" [[deps.ArrayLayouts]] deps = ["FillArrays", "LinearAlgebra"] -git-tree-sha1 = "ce2ca959f932f5dad70697dd93133d1167cf1e4e" +git-tree-sha1 = "0dd7edaff278e346eb0ca07a7e75c9438408a3ce" uuid = "4c555306-a7a7-4459-81d9-ec55ddd5c99a" -version = "1.10.2" +version = "1.10.3" weakdeps = ["SparseArrays"] [deps.ArrayLayouts.extensions] @@ -107,9 +107,9 @@ weakdeps = ["SparseArrays"] [[deps.Arrow]] deps = ["ArrowTypes", "BitIntegers", "CodecLz4", "CodecZstd", "ConcurrentUtilities", "DataAPI", "Dates", "EnumX", "LoggingExtras", "Mmap", "PooledArrays", "SentinelArrays", "Tables", "TimeZones", "TranscodingStreams", "UUIDs"] -git-tree-sha1 = "f8d411d1b45459368567dc51f683ed78a919d795" +git-tree-sha1 = "4ece4573f169d64b1508b0c8dd38c7919ae7a907" uuid = "69666777-d1a9-59fb-9406-91d4454c9d45" -version = "2.7.2" +version = "2.7.3" [[deps.ArrowTypes]] deps = ["Sockets", "UUIDs"] @@ -181,28 +181,28 @@ uuid = "da1fd8a2-8d9e-5ec2-8556-3022fb5608a2" version = "1.3.6" [[deps.CodecBzip2]] -deps = ["Bzip2_jll", "Libdl", "TranscodingStreams"] -git-tree-sha1 = "f8889d1770addf59d0a015c49a473fa2bdb9f809" +deps = ["Bzip2_jll", "TranscodingStreams"] +git-tree-sha1 = "e7c529cc31bb85b97631b922fa2e6baf246f5905" uuid = "523fee87-0ab8-5b00-afb7-3ecf72e48cfd" -version = "0.8.3" +version = "0.8.4" [[deps.CodecLz4]] deps = ["Lz4_jll", "TranscodingStreams"] -git-tree-sha1 = "42494e2756fe6f775d6da57aac6762d2e11a95ce" +git-tree-sha1 = "0db0c70ca94c0a79cadad269497f25ca88b9fa91" uuid = "5ba52731-8f18-5e0d-9241-30f10d1ec561" -version = "0.4.4" +version = "0.4.5" [[deps.CodecZlib]] deps = ["TranscodingStreams", "Zlib_jll"] -git-tree-sha1 = "b8fe8546d52ca154ac556809e10c75e6e7430ac8" +git-tree-sha1 = "bce6804e5e6044c6daab27bb533d1295e4a2e759" uuid = "944b1d66-785c-5afd-91f1-9de20f533193" -version = "0.7.5" +version = "0.7.6" [[deps.CodecZstd]] deps = ["TranscodingStreams", "Zstd_jll"] -git-tree-sha1 = "ed0be9a9c1a6b6dec7aac15f8977f16ad6a9796c" +git-tree-sha1 = "5e41a52bec3b0881a7eb54f5391b779994504186" uuid = "6b39b394-51ab-5f42-8807-6242bab2b4c2" -version = "0.8.4" +version = "0.8.5" [[deps.CommonSolve]] git-tree-sha1 = "0eee5eb66b1cf62cd6ad1b460238e60e4b09400c" @@ -210,10 +210,10 @@ uuid = "38540f10-b2f7-11e9-35d8-d573e4eb0ff2" version = "0.2.4" [[deps.CommonSubexpressions]] -deps = ["MacroTools", "Test"] -git-tree-sha1 = "7b8a93dba8af7e3b42fecabf646260105ac373f7" +deps = ["MacroTools"] +git-tree-sha1 = "cda2cfaebb4be89c9084adaca7dd7333369715c5" uuid = "bbf7d656-a473-5ed7-a52c-81e309532950" -version = "0.3.0" +version = "0.3.1" [[deps.CommonWorldInvalidations]] git-tree-sha1 = "ae52d1c52048455e85a387fbee9be553ec2b68d0" @@ -222,9 +222,9 @@ version = "1.0.0" [[deps.Compat]] deps = ["TOML", "UUIDs"] -git-tree-sha1 = "b1c55339b7c6c350ee89f2c1604299660525b248" +git-tree-sha1 = "8ae8d32e09f0dcf42a36b90d4e17f5dd2e4c4215" uuid = "34da2185-b29b-5c13-b0c7-acf172513d20" -version = "4.15.0" +version = "4.16.0" weakdeps = ["Dates", "LinearAlgebra"] [deps.Compat.extensions] @@ -299,9 +299,9 @@ version = "0.17.6" [[deps.ConstructionBase]] deps = ["LinearAlgebra"] -git-tree-sha1 = "d8a9c0b6ac2d9081bf76324b39c78ca3ce4f0c98" +git-tree-sha1 = "a33b7ced222c6165f624a3f2b55945fac5a598d9" uuid = "187b0558-2788-49d3-abe0-74a17ed4e7c9" -version = "1.5.6" +version = "1.5.7" [deps.ConstructionBase.extensions] ConstructionBaseIntervalSetsExt = "IntervalSets" @@ -340,9 +340,9 @@ version = "1.6.1" [[deps.DataInterpolations]] deps = ["FindFirstFunctions", "ForwardDiff", "LinearAlgebra", "PrettyTables", "RecipesBase", "Reexport"] -git-tree-sha1 = "9cc1cf079b42b5b6392c6b1df4bfc3e2a852b597" +git-tree-sha1 = "10b07a0c9edca784875c782206f66a4b68ac403f" uuid = "82cc6244-b520-54b8-b5a6-8a565e85f1d0" -version = "6.1.0" +version = "6.4.0" [deps.DataInterpolations.extensions] DataInterpolationsChainRulesCoreExt = "ChainRulesCore" @@ -374,9 +374,9 @@ uuid = "ade2ca70-3891-5945-98fb-dc099432e06a" [[deps.DiffEqBase]] deps = ["ArrayInterface", "ConcreteStructs", "DataStructures", "DocStringExtensions", "EnumX", "EnzymeCore", "FastBroadcast", "FastClosures", "ForwardDiff", "FunctionWrappers", "FunctionWrappersWrappers", "LinearAlgebra", "Logging", "Markdown", "MuladdMacro", "Parameters", "PreallocationTools", "PrecompileTools", "Printf", "RecursiveArrayTools", "Reexport", "SciMLBase", "SciMLOperators", "Setfield", "Static", "StaticArraysCore", "Statistics", "Tricks", "TruncatedStacktraces"] -git-tree-sha1 = "72950e082d2241a1da1c924147943e2918471af9" +git-tree-sha1 = "4cb796ab54311147b9c7191d34d502693b603a22" uuid = "2b5f629d-d688-5b77-993f-72d75c75574e" -version = "6.152.2" +version = "6.154.0" [deps.DiffEqBase.extensions] DiffEqBaseCUDAExt = "CUDA" @@ -408,9 +408,9 @@ version = "6.152.2" [[deps.DiffEqCallbacks]] deps = ["DataStructures", "DiffEqBase", "ForwardDiff", "Functors", "LinearAlgebra", "Markdown", "NonlinearSolve", "Parameters", "RecipesBase", "RecursiveArrayTools", "SciMLBase", "StaticArraysCore"] -git-tree-sha1 = "91e10deadcf1e33168bac3140eb0ea8cc4dfa5d7" +git-tree-sha1 = "9c802bf34741e2b4942912709321e87b7cbed023" uuid = "459566f4-90b8-5000-8ac3-15dfb0a30def" -version = "3.7.0" +version = "3.9.0" [deps.DiffEqCallbacks.weakdeps] OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed" @@ -430,9 +430,9 @@ version = "1.15.1" [[deps.DifferentiationInterface]] deps = ["ADTypes", "Compat", "DocStringExtensions", "FillArrays", "LinearAlgebra", "PackageExtensionCompat", "SparseArrays", "SparseMatrixColorings"] -git-tree-sha1 = "6bd550abccb7aa156141e10d5367c580af9128af" +git-tree-sha1 = "e53e4eb7f8e7b25656ea17263b0c22f129091eeb" uuid = "a0c0ee7d-e4b9-4e03-894e-1c5f64a51d63" -version = "0.5.11" +version = "0.5.15" [deps.DifferentiationInterface.extensions] DifferentiationInterfaceChainRulesCoreExt = "ChainRulesCore" @@ -490,9 +490,9 @@ uuid = "4e289a0a-7415-4d19-859d-a7e5c4648b56" version = "1.0.4" [[deps.EnzymeCore]] -git-tree-sha1 = "d445df66dd8761a4c27df950db89c6a3a0629fe7" +git-tree-sha1 = "8f205a601760f4798a10f138c3940f0451d95188" uuid = "f151be2c-9106-41f4-ab19-57ee4f262869" -version = "0.7.7" +version = "0.7.8" weakdeps = ["Adapt"] [deps.EnzymeCore.extensions] @@ -516,9 +516,9 @@ uuid = "6b7a57c9-7cc1-4fdf-b7f5-e857abae3636" version = "0.8.5" [[deps.ExproniconLite]] -git-tree-sha1 = "1095361e35ea8ad9c660560df4c03c06d5244956" +git-tree-sha1 = "4c9ed87a6b3cd90acf24c556f2119533435ded38" uuid = "55351af7-c7e9-48d6-89ff-24e801d99491" -version = "0.10.11" +version = "0.10.13" [[deps.FastBroadcast]] deps = ["ArrayInterface", "LinearAlgebra", "Polyester", "Static", "StaticArrayInterface", "StrideArraysCore"] @@ -548,9 +548,9 @@ uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee" [[deps.FillArrays]] deps = ["LinearAlgebra"] -git-tree-sha1 = "0653c0a2396a6da5bc4766c43041ef5fd3efbe57" +git-tree-sha1 = "6a70198746448456524cb442b8af316927ff3e1a" uuid = "1a297f60-69ca-5386-bcde-b61e274b549b" -version = "1.11.0" +version = "1.13.0" [deps.FillArrays.extensions] FillArraysPDMatsExt = "PDMats" @@ -568,10 +568,10 @@ uuid = "64ca27bc-2ba2-4a57-88aa-44e436879224" version = "1.3.0" [[deps.FiniteDiff]] -deps = ["ArrayInterface", "LinearAlgebra", "Requires", "Setfield", "SparseArrays"] -git-tree-sha1 = "2de436b72c3422940cbe1367611d137008af7ec3" +deps = ["ArrayInterface", "LinearAlgebra", "Setfield", "SparseArrays"] +git-tree-sha1 = "f9219347ebf700e77ca1d48ef84e4a82a6701882" uuid = "6a86dc24-6348-571c-b903-95158fe2bd41" -version = "2.23.1" +version = "2.24.0" [deps.FiniteDiff.extensions] FiniteDiffBandedMatricesExt = "BandedMatrices" @@ -694,24 +694,24 @@ weakdeps = ["ArrowTypes", "Parsers"] ParsersExt = "Parsers" [[deps.IntelOpenMP_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "14eb2b542e748570b56446f4c50fbfb2306ebc45" +deps = ["Artifacts", "JLLWrappers", "LazyArtifacts", "Libdl"] +git-tree-sha1 = "10bd689145d2c3b2a9844005d01087cc1194e79e" uuid = "1d5cc7b8-4909-519e-a0f8-d0f5ad9712d0" -version = "2024.2.0+0" +version = "2024.2.1+0" [[deps.InteractiveUtils]] deps = ["Markdown"] uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" [[deps.InverseFunctions]] -deps = ["Test"] -git-tree-sha1 = "18c59411ece4838b18cd7f537e56cf5e41ce5bfd" +git-tree-sha1 = "2787db24f4e03daf859c6509ff87764e4182f7d1" uuid = "3587e190-3f89-42d0-90ee-14403ec27112" -version = "0.1.15" -weakdeps = ["Dates"] +version = "0.1.16" +weakdeps = ["Dates", "Test"] [deps.InverseFunctions.extensions] - DatesExt = "Dates" + InverseFunctionsDatesExt = "Dates" + InverseFunctionsTestExt = "Test" [[deps.InvertedIndices]] git-tree-sha1 = "0dc7b50b8d436461be01300fd8cd45aa0274b038" @@ -734,16 +734,16 @@ uuid = "82899510-4779-5014-852e-03e436cf321d" version = "1.0.0" [[deps.JLD2]] -deps = ["FileIO", "MacroTools", "Mmap", "OrderedCollections", "PrecompileTools", "Reexport", "Requires", "TranscodingStreams", "UUIDs", "Unicode"] -git-tree-sha1 = "67d4690d32c22e28818a434b293a374cc78473d3" +deps = ["FileIO", "MacroTools", "Mmap", "OrderedCollections", "PrecompileTools", "Requires", "TranscodingStreams"] +git-tree-sha1 = "a0746c21bdc986d0dc293efa6b1faee112c37c28" uuid = "033835bb-8acc-5ee8-8aae-3f567f8a3819" -version = "0.4.51" +version = "0.4.53" [[deps.JLLWrappers]] deps = ["Artifacts", "Preferences"] -git-tree-sha1 = "7e5d6779a1e09a36db2a7b6cff50942a0a7d0fca" +git-tree-sha1 = "f389674c99bfcde17dc57454011aa44d5a260a40" uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210" -version = "1.5.0" +version = "1.6.0" [[deps.JSON]] deps = ["Dates", "Mmap", "Parsers", "Unicode"] @@ -763,9 +763,9 @@ weakdeps = ["ArrowTypes"] [[deps.JuMP]] deps = ["LinearAlgebra", "MacroTools", "MathOptInterface", "MutableArithmetics", "OrderedCollections", "PrecompileTools", "Printf", "SparseArrays"] -git-tree-sha1 = "7e10a0d8b534f2d8e9f712b33488584254624fb1" +git-tree-sha1 = "82bc707a67639be45ec9abf3a7640af19c4172fe" uuid = "4076af6c-e467-56ae-b986-b466b2749572" -version = "1.22.2" +version = "1.23.1" [deps.JuMP.extensions] JuMPDimensionalDataExt = "DimensionalData" @@ -775,9 +775,9 @@ version = "1.22.2" [[deps.JuliaInterpreter]] deps = ["CodeTracking", "InteractiveUtils", "Random", "UUIDs"] -git-tree-sha1 = "5d3a5a206297af3868151bb4a2cf27ebce46f16d" +git-tree-sha1 = "4b415b6cccb9ab61fec78a621572c82ac7fa5776" uuid = "aa1ae85d-cabe-5617-a682-6adf51b2e16a" -version = "0.9.33" +version = "0.9.35" [[deps.KLU]] deps = ["LinearAlgebra", "SparseArrays", "SuiteSparse_jll"] @@ -804,9 +804,9 @@ version = "0.1.17" [[deps.LazyArrays]] deps = ["ArrayLayouts", "FillArrays", "LinearAlgebra", "MacroTools", "SparseArrays"] -git-tree-sha1 = "b8ea0abe6cc872996e87356951d286d25d485aba" +git-tree-sha1 = "507b423197fdd9e77b74aa2532c0a05eb7eb4004" uuid = "5078a376-72f3-5289-bfd5-ec5146d43c02" -version = "2.1.9" +version = "2.2.0" [deps.LazyArrays.extensions] LazyArraysBandedMatricesExt = "BandedMatrices" @@ -832,9 +832,9 @@ version = "0.2.0" [[deps.Legolas]] deps = ["Arrow", "ArrowTypes", "Tables", "UUIDs"] -git-tree-sha1 = "4e8fdd0160dd10220ce5cc537e7b34965400a58d" +git-tree-sha1 = "d02f53055c6e88df61de357cdaeef05a71784d84" uuid = "741b9549-f6ed-4911-9fbf-4a1c0c97f0cd" -version = "0.5.19" +version = "0.5.21" weakdeps = ["ConstructionBase"] [deps.Legolas.extensions] @@ -878,10 +878,10 @@ deps = ["Libdl", "OpenBLAS_jll", "libblastrampoline_jll"] uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" [[deps.LinearSolve]] -deps = ["ArrayInterface", "ChainRulesCore", "ConcreteStructs", "CpuId", "DocStringExtensions", "EnumX", "FastLapackInterface", "GPUArraysCore", "InteractiveUtils", "KLU", "Krylov", "LazyArrays", "Libdl", "LinearAlgebra", "MKL_jll", "Markdown", "PrecompileTools", "Preferences", "RecursiveFactorization", "Reexport", "SciMLBase", "SciMLOperators", "Setfield", "SparseArrays", "Sparspak", "StaticArraysCore", "UnPack"] -git-tree-sha1 = "00d9dc2ef7abb0575ec2b59fedbbc5685127e6ea" +deps = ["ArrayInterface", "ChainRulesCore", "ConcreteStructs", "DocStringExtensions", "EnumX", "FastLapackInterface", "GPUArraysCore", "InteractiveUtils", "KLU", "Krylov", "LazyArrays", "Libdl", "LinearAlgebra", "MKL_jll", "Markdown", "PrecompileTools", "Preferences", "RecursiveFactorization", "Reexport", "SciMLBase", "SciMLOperators", "Setfield", "SparseArrays", "Sparspak", "StaticArraysCore", "UnPack"] +git-tree-sha1 = "6c5e4555ac2bc449a28604e184f759d18fc08420" uuid = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae" -version = "2.31.2" +version = "2.34.0" [deps.LinearSolve.extensions] LinearSolveBandedMatricesExt = "BandedMatrices" @@ -996,15 +996,19 @@ version = "1.1.0" [[deps.MathOptInterface]] deps = ["BenchmarkTools", "CodecBzip2", "CodecZlib", "DataStructures", "ForwardDiff", "JSON", "LinearAlgebra", "MutableArithmetics", "NaNMath", "OrderedCollections", "PrecompileTools", "Printf", "SparseArrays", "SpecialFunctions", "Test", "Unicode"] -git-tree-sha1 = "91b08d27a27d83cf1e63e50837403e7f53a0fd74" +git-tree-sha1 = "5b246fca5420ae176d65ed43a2d0ee5897775216" uuid = "b8f27783-ece8-5eb3-8dc8-9495eed66fee" -version = "1.31.0" +version = "1.31.2" [[deps.MaybeInplace]] -deps = ["ArrayInterface", "LinearAlgebra", "MacroTools", "SparseArrays"] -git-tree-sha1 = "1b9e613f2ca3b6cdcbfe36381e17ca2b66d4b3a1" +deps = ["ArrayInterface", "LinearAlgebra", "MacroTools"] +git-tree-sha1 = "54e2fdc38130c05b42be423e90da3bade29b74bd" uuid = "bb5d69b7-63fc-4a16-80bd-7e42200c7bdb" -version = "0.1.3" +version = "0.1.4" +weakdeps = ["SparseArrays"] + + [deps.MaybeInplace.extensions] + MaybeInplaceSparseArraysExt = "SparseArrays" [[deps.MbedTLS]] deps = ["Dates", "MbedTLS_jll", "MozillaCACerts_jll", "NetworkOptions", "Random", "Sockets"] @@ -1034,9 +1038,9 @@ uuid = "a63ad114-7e13-5084-954f-fe012c677804" [[deps.Mocking]] deps = ["Compat", "ExprTools"] -git-tree-sha1 = "c74e5e7c5f83ccb0bca0377d316d966d296106d4" +git-tree-sha1 = "2c140d60d7cb82badf06d8783800d0bcd1a7daa2" uuid = "78c3b35d-d492-501b-9361-3d52fe80e533" -version = "0.7.9" +version = "0.8.1" [[deps.MozillaCACerts_jll]] uuid = "14a3606d-f60d-562e-9121-12d972cd8159" @@ -1071,9 +1075,9 @@ version = "1.2.0" [[deps.NonlinearSolve]] deps = ["ADTypes", "ArrayInterface", "ConcreteStructs", "DiffEqBase", "FastBroadcast", "FastClosures", "FiniteDiff", "ForwardDiff", "LazyArrays", "LineSearches", "LinearAlgebra", "LinearSolve", "MaybeInplace", "PrecompileTools", "Preferences", "Printf", "RecursiveArrayTools", "Reexport", "SciMLBase", "SimpleNonlinearSolve", "SparseArrays", "SparseDiffTools", "StaticArraysCore", "SymbolicIndexingInterface", "TimerOutputs"] -git-tree-sha1 = "3adb1e5945b5a6b1eaee754077f25ccc402edd7f" +git-tree-sha1 = "bcd8812e751326ff1d4b2dd50764b93df51f143b" uuid = "8913a72c-1f9b-4ce2-8d82-65094dcecaec" -version = "3.13.1" +version = "3.14.0" [deps.NonlinearSolve.extensions] NonlinearSolveBandedMatricesExt = "BandedMatrices" @@ -1132,16 +1136,202 @@ uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" version = "1.6.3" [[deps.OrdinaryDiffEq]] -deps = ["ADTypes", "Adapt", "ArrayInterface", "DataStructures", "DiffEqBase", "DocStringExtensions", "EnumX", "ExponentialUtilities", "FastBroadcast", "FastClosures", "FillArrays", "FiniteDiff", "ForwardDiff", "FunctionWrappersWrappers", "IfElse", "InteractiveUtils", "LineSearches", "LinearAlgebra", "LinearSolve", "Logging", "MacroTools", "MuladdMacro", "NonlinearSolve", "Polyester", "PreallocationTools", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "SciMLBase", "SciMLOperators", "SciMLStructures", "SimpleNonlinearSolve", "SimpleUnPack", "SparseArrays", "SparseDiffTools", "Static", "StaticArrayInterface", "StaticArrays", "TruncatedStacktraces"] -git-tree-sha1 = "a8b2d333cd90562b58b977b4033739360b37fb1f" +deps = ["ADTypes", "Adapt", "ArrayInterface", "DataStructures", "DiffEqBase", "DocStringExtensions", "EnumX", "ExponentialUtilities", "FastBroadcast", "FastClosures", "FillArrays", "FiniteDiff", "ForwardDiff", "FunctionWrappersWrappers", "InteractiveUtils", "LineSearches", "LinearAlgebra", "LinearSolve", "Logging", "MacroTools", "MuladdMacro", "NonlinearSolve", "OrdinaryDiffEqAdamsBashforthMoulton", "OrdinaryDiffEqBDF", "OrdinaryDiffEqCore", "OrdinaryDiffEqDefault", "OrdinaryDiffEqDifferentiation", "OrdinaryDiffEqExplicitRK", "OrdinaryDiffEqExponentialRK", "OrdinaryDiffEqExtrapolation", "OrdinaryDiffEqFIRK", "OrdinaryDiffEqFeagin", "OrdinaryDiffEqFunctionMap", "OrdinaryDiffEqHighOrderRK", "OrdinaryDiffEqIMEXMultistep", "OrdinaryDiffEqLinear", "OrdinaryDiffEqLowOrderRK", "OrdinaryDiffEqLowStorageRK", "OrdinaryDiffEqNonlinearSolve", "OrdinaryDiffEqNordsieck", "OrdinaryDiffEqPDIRK", "OrdinaryDiffEqPRK", "OrdinaryDiffEqQPRK", "OrdinaryDiffEqRKN", "OrdinaryDiffEqRosenbrock", "OrdinaryDiffEqSDIRK", "OrdinaryDiffEqSSPRK", "OrdinaryDiffEqStabilizedIRK", "OrdinaryDiffEqStabilizedRK", "OrdinaryDiffEqSymplecticRK", "OrdinaryDiffEqTsit5", "OrdinaryDiffEqVerner", "Polyester", "PreallocationTools", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "SciMLBase", "SciMLOperators", "SciMLStructures", "SimpleNonlinearSolve", "SimpleUnPack", "SparseArrays", "SparseDiffTools", "Static", "StaticArrayInterface", "StaticArrays", "TruncatedStacktraces"] +git-tree-sha1 = "883fb1243eb83236f7ed9006d60a8ce0dcb108c3" +repo-rev = "master" +repo-url = "https://github.com/SciML/OrdinaryDiffEq.jl" uuid = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed" -version = "6.87.0" +version = "6.89.0" + +[[deps.OrdinaryDiffEqAdamsBashforthMoulton]] +deps = ["ADTypes", "DiffEqBase", "FastBroadcast", "MuladdMacro", "OrdinaryDiffEqCore", "OrdinaryDiffEqLowOrderRK", "Polyester", "RecursiveArrayTools", "Reexport", "Static"] +git-tree-sha1 = "8e3c5978d0531a961f70d2f2730d1d16ed3bbd12" +uuid = "89bda076-bce5-4f1c-845f-551c83cdda9a" +version = "1.1.0" + +[[deps.OrdinaryDiffEqBDF]] +deps = ["ArrayInterface", "DiffEqBase", "FastBroadcast", "LinearAlgebra", "MacroTools", "MuladdMacro", "OrdinaryDiffEqCore", "OrdinaryDiffEqDifferentiation", "OrdinaryDiffEqNonlinearSolve", "OrdinaryDiffEqSDIRK", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "StaticArrays", "TruncatedStacktraces"] +git-tree-sha1 = "f24c26cab671309428636643f0f540fb7360bbaa" +uuid = "6ad6398a-0878-4a85-9266-38940aa047c8" +version = "1.1.1" + +[[deps.OrdinaryDiffEqCore]] +deps = ["ADTypes", "Adapt", "ArrayInterface", "DataStructures", "DiffEqBase", "DocStringExtensions", "EnumX", "FastBroadcast", "FastClosures", "FillArrays", "FunctionWrappersWrappers", "InteractiveUtils", "LinearAlgebra", "Logging", "MacroTools", "MuladdMacro", "Polyester", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "SciMLBase", "SciMLOperators", "SciMLStructures", "SimpleUnPack", "Static", "StaticArrayInterface", "StaticArraysCore", "TruncatedStacktraces"] +git-tree-sha1 = "bc70a38874c801549d415c16a23ec632ad91afd1" +uuid = "bbf590c4-e513-4bbe-9b18-05decba2e5d8" +version = "1.4.0" +weakdeps = ["EnzymeCore"] + + [deps.OrdinaryDiffEqCore.extensions] + OrdinaryDiffEqCoreEnzymeCoreExt = "EnzymeCore" + +[[deps.OrdinaryDiffEqDefault]] +deps = ["DiffEqBase", "EnumX", "LinearAlgebra", "LinearSolve", "OrdinaryDiffEqBDF", "OrdinaryDiffEqCore", "OrdinaryDiffEqRosenbrock", "OrdinaryDiffEqTsit5", "OrdinaryDiffEqVerner", "PrecompileTools", "Preferences", "Reexport"] +git-tree-sha1 = "c8223e487d58bef28a3535b33ddf8ffdb44f46fb" +uuid = "50262376-6c5a-4cf5-baba-aaf4f84d72d7" +version = "1.1.0" + +[[deps.OrdinaryDiffEqDifferentiation]] +deps = ["ADTypes", "ArrayInterface", "DiffEqBase", "FastBroadcast", "FiniteDiff", "ForwardDiff", "FunctionWrappersWrappers", "LinearAlgebra", "LinearSolve", "OrdinaryDiffEqCore", "SciMLBase", "SparseArrays", "SparseDiffTools", "StaticArrayInterface", "StaticArrays"] +git-tree-sha1 = "e63ec633b1efa99e3caa2e26a01faaa88ba6cef9" +uuid = "4302a76b-040a-498a-8c04-15b101fed76b" +version = "1.1.0" + +[[deps.OrdinaryDiffEqExplicitRK]] +deps = ["DiffEqBase", "FastBroadcast", "LinearAlgebra", "MuladdMacro", "OrdinaryDiffEqCore", "RecursiveArrayTools", "Reexport", "TruncatedStacktraces"] +git-tree-sha1 = "4dbce3f9e6974567082ce5176e21aab0224a69e9" +uuid = "9286f039-9fbf-40e8-bf65-aa933bdc4db0" +version = "1.1.0" + +[[deps.OrdinaryDiffEqExponentialRK]] +deps = ["DiffEqBase", "ExponentialUtilities", "FastBroadcast", "LinearAlgebra", "MuladdMacro", "OrdinaryDiffEqCore", "OrdinaryDiffEqDifferentiation", "OrdinaryDiffEqSDIRK", "OrdinaryDiffEqVerner", "RecursiveArrayTools", "Reexport", "SciMLBase"] +git-tree-sha1 = "f63938b8e9e5d3a05815defb3ebdbdcf61ec0a74" +uuid = "e0540318-69ee-4070-8777-9e2de6de23de" +version = "1.1.0" + +[[deps.OrdinaryDiffEqExtrapolation]] +deps = ["DiffEqBase", "FastBroadcast", "LinearSolve", "MuladdMacro", "OrdinaryDiffEqCore", "OrdinaryDiffEqDifferentiation", "Polyester", "RecursiveArrayTools", "Reexport"] +git-tree-sha1 = "fea595528a160ed5cade9eee217a9691b1d97714" +uuid = "becaefa8-8ca2-5cf9-886d-c06f3d2bd2c4" +version = "1.1.0" + +[[deps.OrdinaryDiffEqFIRK]] +deps = ["DiffEqBase", "FastBroadcast", "LinearAlgebra", "LinearSolve", "MuladdMacro", "OrdinaryDiffEqCore", "OrdinaryDiffEqDifferentiation", "OrdinaryDiffEqNonlinearSolve", "RecursiveArrayTools", "Reexport", "SciMLOperators"] +git-tree-sha1 = "92deb4a8e4a2bc011fd3b919e858d7a16568d3b1" +uuid = "5960d6e9-dd7a-4743-88e7-cf307b64f125" +version = "1.1.0" + +[[deps.OrdinaryDiffEqFeagin]] +deps = ["DiffEqBase", "FastBroadcast", "MuladdMacro", "OrdinaryDiffEqCore", "Polyester", "RecursiveArrayTools", "Reexport", "Static"] +git-tree-sha1 = "a7cc74d3433db98e59dc3d58bc28174c6c290adf" +uuid = "101fe9f7-ebb6-4678-b671-3a81e7194747" +version = "1.1.0" + +[[deps.OrdinaryDiffEqFunctionMap]] +deps = ["DiffEqBase", "FastBroadcast", "MuladdMacro", "OrdinaryDiffEqCore", "RecursiveArrayTools", "Reexport", "SciMLBase", "Static"] +git-tree-sha1 = "925a91583d1ab84f1f0fea121be1abf1179c5926" +uuid = "d3585ca7-f5d3-4ba6-8057-292ed1abd90f" +version = "1.1.1" + +[[deps.OrdinaryDiffEqHighOrderRK]] +deps = ["DiffEqBase", "FastBroadcast", "MuladdMacro", "OrdinaryDiffEqCore", "RecursiveArrayTools", "Reexport", "Static"] +git-tree-sha1 = "103e017ff186ac39d731904045781c9bacfca2b0" +uuid = "d28bc4f8-55e1-4f49-af69-84c1a99f0f58" +version = "1.1.0" + +[[deps.OrdinaryDiffEqIMEXMultistep]] +deps = ["DiffEqBase", "FastBroadcast", "OrdinaryDiffEqCore", "OrdinaryDiffEqDifferentiation", "OrdinaryDiffEqNonlinearSolve", "Reexport"] +git-tree-sha1 = "9f8f52aad2399d7714b400ff9d203254b0a89c4a" +uuid = "9f002381-b378-40b7-97a6-27a27c83f129" +version = "1.1.0" + +[[deps.OrdinaryDiffEqLinear]] +deps = ["DiffEqBase", "ExponentialUtilities", "LinearAlgebra", "OrdinaryDiffEqCore", "OrdinaryDiffEqTsit5", "OrdinaryDiffEqVerner", "RecursiveArrayTools", "Reexport", "SciMLBase", "SciMLOperators"] +git-tree-sha1 = "0f81a77ede3da0dc714ea61e81c76b25db4ab87a" +uuid = "521117fe-8c41-49f8-b3b6-30780b3f0fb5" +version = "1.1.0" + +[[deps.OrdinaryDiffEqLowOrderRK]] +deps = ["DiffEqBase", "FastBroadcast", "LinearAlgebra", "MuladdMacro", "OrdinaryDiffEqCore", "RecursiveArrayTools", "Reexport", "SciMLBase", "Static"] +git-tree-sha1 = "1938fd639ae6688a46d606a5435e523dfdd80776" +uuid = "1344f307-1e59-4825-a18e-ace9aa3fa4c6" +version = "1.1.0" + +[[deps.OrdinaryDiffEqLowStorageRK]] +deps = ["Adapt", "DiffEqBase", "FastBroadcast", "MuladdMacro", "OrdinaryDiffEqCore", "Polyester", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "Static", "StaticArrays"] +git-tree-sha1 = "590561f3af623d5485d070b4d7044f8854535f5a" +uuid = "b0944070-b475-4768-8dec-fb6eb410534d" +version = "1.2.1" + +[[deps.OrdinaryDiffEqNonlinearSolve]] +deps = ["ADTypes", "ArrayInterface", "DiffEqBase", "FastBroadcast", "FastClosures", "ForwardDiff", "LinearAlgebra", "LinearSolve", "MuladdMacro", "NonlinearSolve", "OrdinaryDiffEqCore", "OrdinaryDiffEqDifferentiation", "PreallocationTools", "RecursiveArrayTools", "SciMLBase", "SciMLOperators", "SciMLStructures", "SimpleNonlinearSolve", "StaticArrays"] +git-tree-sha1 = "dab59b48708c15b0713d131759309c98ec9bac07" +uuid = "127b3ac7-2247-4354-8eb6-78cf4e7c58e8" +version = "1.1.0" + +[[deps.OrdinaryDiffEqNordsieck]] +deps = ["DiffEqBase", "FastBroadcast", "LinearAlgebra", "MuladdMacro", "OrdinaryDiffEqCore", "OrdinaryDiffEqTsit5", "Polyester", "RecursiveArrayTools", "Reexport", "Static"] +git-tree-sha1 = "ef44754f10e0dfb9bb55ded382afed44cd94ab57" +uuid = "c9986a66-5c92-4813-8696-a7ec84c806c8" +version = "1.1.0" + +[[deps.OrdinaryDiffEqPDIRK]] +deps = ["DiffEqBase", "FastBroadcast", "MuladdMacro", "OrdinaryDiffEqCore", "OrdinaryDiffEqDifferentiation", "OrdinaryDiffEqNonlinearSolve", "Polyester", "Reexport", "StaticArrays"] +git-tree-sha1 = "a8b7f8107c477e07c6a6c00d1d66cac68b801bbc" +uuid = "5dd0a6cf-3d4b-4314-aa06-06d4e299bc89" +version = "1.1.0" + +[[deps.OrdinaryDiffEqPRK]] +deps = ["DiffEqBase", "FastBroadcast", "MuladdMacro", "OrdinaryDiffEqCore", "Polyester", "Reexport"] +git-tree-sha1 = "da525d277962a1b76102c79f30cb0c31e13fe5b9" +uuid = "5b33eab2-c0f1-4480-b2c3-94bc1e80bda1" +version = "1.1.0" + +[[deps.OrdinaryDiffEqQPRK]] +deps = ["DiffEqBase", "FastBroadcast", "MuladdMacro", "OrdinaryDiffEqCore", "RecursiveArrayTools", "Reexport", "Static"] +git-tree-sha1 = "332f9d17d0229218f66a73492162267359ba85e9" +uuid = "04162be5-8125-4266-98ed-640baecc6514" +version = "1.1.0" + +[[deps.OrdinaryDiffEqRKN]] +deps = ["DiffEqBase", "FastBroadcast", "MuladdMacro", "OrdinaryDiffEqCore", "Polyester", "RecursiveArrayTools", "Reexport"] +git-tree-sha1 = "41c09d9c20877546490f907d8dffdd52690dd65f" +uuid = "af6ede74-add8-4cfd-b1df-9a4dbb109d7a" +version = "1.1.0" + +[[deps.OrdinaryDiffEqRosenbrock]] +deps = ["ADTypes", "DiffEqBase", "FastBroadcast", "FiniteDiff", "ForwardDiff", "LinearAlgebra", "LinearSolve", "MacroTools", "MuladdMacro", "OrdinaryDiffEqCore", "OrdinaryDiffEqDifferentiation", "OrdinaryDiffEqNonlinearSolve", "Polyester", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "Static"] +git-tree-sha1 = "6810d539de1deb6e74f2d4ecc7e21b199cc3fd64" +uuid = "43230ef6-c299-4910-a778-202eb28ce4ce" +version = "1.1.1" + +[[deps.OrdinaryDiffEqSDIRK]] +deps = ["DiffEqBase", "FastBroadcast", "LinearAlgebra", "MacroTools", "MuladdMacro", "OrdinaryDiffEqCore", "OrdinaryDiffEqDifferentiation", "OrdinaryDiffEqNonlinearSolve", "RecursiveArrayTools", "Reexport", "SciMLBase", "TruncatedStacktraces"] +git-tree-sha1 = "f6683803a58de600ab7a26d2f49411c9923e9721" +uuid = "2d112036-d095-4a1e-ab9a-08536f3ecdbf" +version = "1.1.0" + +[[deps.OrdinaryDiffEqSSPRK]] +deps = ["DiffEqBase", "FastBroadcast", "MuladdMacro", "OrdinaryDiffEqCore", "Polyester", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "Static", "StaticArrays"] +git-tree-sha1 = "7dbe4ac56f930df5e9abd003cedb54e25cbbea86" +uuid = "669c94d9-1f4b-4b64-b377-1aa079aa2388" +version = "1.2.0" + +[[deps.OrdinaryDiffEqStabilizedIRK]] +deps = ["DiffEqBase", "FastBroadcast", "MuladdMacro", "OrdinaryDiffEqCore", "OrdinaryDiffEqDifferentiation", "OrdinaryDiffEqNonlinearSolve", "RecursiveArrayTools", "Reexport", "StaticArrays"] +git-tree-sha1 = "348fd6def9a88518715425025eadd58517017325" +uuid = "e3e12d00-db14-5390-b879-ac3dd2ef6296" +version = "1.1.0" + +[[deps.OrdinaryDiffEqStabilizedRK]] +deps = ["DiffEqBase", "FastBroadcast", "MuladdMacro", "OrdinaryDiffEqCore", "RecursiveArrayTools", "Reexport", "StaticArrays"] +git-tree-sha1 = "1b0d894c880e25f7d0b022d7257638cf8ce5b311" +uuid = "358294b1-0aab-51c3-aafe-ad5ab194a2ad" +version = "1.1.0" + +[[deps.OrdinaryDiffEqSymplecticRK]] +deps = ["DiffEqBase", "FastBroadcast", "MuladdMacro", "OrdinaryDiffEqCore", "Polyester", "RecursiveArrayTools", "Reexport"] +git-tree-sha1 = "4e8b8c8b81df3df17e2eb4603115db3b30a88235" +uuid = "fa646aed-7ef9-47eb-84c4-9443fc8cbfa8" +version = "1.1.0" + +[[deps.OrdinaryDiffEqTsit5]] +deps = ["DiffEqBase", "FastBroadcast", "LinearAlgebra", "MuladdMacro", "OrdinaryDiffEqCore", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "Static", "TruncatedStacktraces"] +git-tree-sha1 = "96552f7d4619fabab4038a29ed37dd55e9eb513a" +uuid = "b1df2697-797e-41e3-8120-5422d3b24e4a" +version = "1.1.0" + +[[deps.OrdinaryDiffEqVerner]] +deps = ["DiffEqBase", "FastBroadcast", "LinearAlgebra", "MuladdMacro", "OrdinaryDiffEqCore", "Polyester", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "Static", "TruncatedStacktraces"] +git-tree-sha1 = "81d7841e73e385b9925d5c8e4427f2adcdda55db" +uuid = "79d7bb75-1356-48c1-b8c0-6832512096c2" +version = "1.1.1" [[deps.OteraEngine]] deps = ["Markdown", "Pkg", "TOML"] -git-tree-sha1 = "f20abf8f4ffc0b8c00fea227b514dd3164676327" +git-tree-sha1 = "f597212cd7e985f68db46f617aaf71b5f89eaa03" uuid = "b2d7f28f-acd6-4007-8b26-bc27716e5513" -version = "0.5.4" +version = "0.5.5" [[deps.PackageCompiler]] deps = ["Artifacts", "Glob", "LazyArtifacts", "Libdl", "Pkg", "Printf", "RelocatableFolders", "TOML", "UUIDs", "p7zip_jll"] @@ -1173,10 +1363,10 @@ uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" version = "1.10.0" [[deps.Polyester]] -deps = ["ArrayInterface", "BitTwiddlingConvenienceFunctions", "CPUSummary", "IfElse", "ManualMemory", "PolyesterWeave", "Requires", "Static", "StaticArrayInterface", "StrideArraysCore", "ThreadingUtilities"] -git-tree-sha1 = "9ff799e8fb8ed6717710feee3be3bc20645daa97" +deps = ["ArrayInterface", "BitTwiddlingConvenienceFunctions", "CPUSummary", "IfElse", "ManualMemory", "PolyesterWeave", "Static", "StaticArrayInterface", "StrideArraysCore", "ThreadingUtilities"] +git-tree-sha1 = "6d38fea02d983051776a856b7df75b30cf9a3c1f" uuid = "f517fe37-dbe3-4b94-8317-1923a5111588" -version = "0.7.15" +version = "0.7.16" [[deps.PolyesterWeave]] deps = ["BitTwiddlingConvenienceFunctions", "CPUSummary", "IfElse", "Static", "ThreadingUtilities"] @@ -1192,9 +1382,9 @@ version = "1.4.3" [[deps.PreallocationTools]] deps = ["Adapt", "ArrayInterface", "ForwardDiff"] -git-tree-sha1 = "d7f3f63331c7c8c81245b4ee2815b7d496365833" +git-tree-sha1 = "6c62ce45f268f3f958821a1e5192cf91c75ae89c" uuid = "d236fae5-4411-538c-8e31-a6e3d9e00b46" -version = "0.4.23" +version = "0.4.24" [deps.PreallocationTools.extensions] PreallocationToolsReverseDiffExt = "ReverseDiff" @@ -1249,10 +1439,10 @@ uuid = "3cdcf5f2-1ef4-517c-9805-6587b60abb01" version = "1.3.4" [[deps.RecursiveArrayTools]] -deps = ["Adapt", "ArrayInterface", "DocStringExtensions", "GPUArraysCore", "IteratorInterfaceExtensions", "LinearAlgebra", "RecipesBase", "SparseArrays", "StaticArraysCore", "Statistics", "SymbolicIndexingInterface", "Tables"] -git-tree-sha1 = "b450d967a770fb13d0e26358f58375e20361cf9c" +deps = ["Adapt", "ArrayInterface", "DocStringExtensions", "GPUArraysCore", "IteratorInterfaceExtensions", "LinearAlgebra", "RecipesBase", "StaticArraysCore", "Statistics", "SymbolicIndexingInterface", "Tables"] +git-tree-sha1 = "b034171b93aebc81b3e1890a036d13a9c4a9e3e0" uuid = "731186ca-8d62-57ce-b412-fbd966d074cd" -version = "3.26.0" +version = "3.27.0" [deps.RecursiveArrayTools.extensions] RecursiveArrayToolsFastBroadcastExt = "FastBroadcast" @@ -1260,6 +1450,7 @@ version = "3.26.0" RecursiveArrayToolsMeasurementsExt = "Measurements" RecursiveArrayToolsMonteCarloMeasurementsExt = "MonteCarloMeasurements" RecursiveArrayToolsReverseDiffExt = ["ReverseDiff", "Zygote"] + RecursiveArrayToolsSparseArraysExt = ["SparseArrays"] RecursiveArrayToolsTrackerExt = "Tracker" RecursiveArrayToolsZygoteExt = "Zygote" @@ -1269,6 +1460,7 @@ version = "3.26.0" Measurements = "eff96d63-e80a-5855-80a2-b1b0885c5ab7" MonteCarloMeasurements = "0987c9cc-fe09-11e8-30f0-b96dd679fdca" ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267" + SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c" Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f" @@ -1302,7 +1494,7 @@ uuid = "295af30f-e4ad-537b-8983-00126c2a3abe" version = "3.5.18" [[deps.Ribasim]] -deps = ["ADTypes", "Accessors", "Arrow", "BasicModelInterface", "CodecZstd", "ComponentArrays", "Configurations", "DBInterface", "DataInterpolations", "DataStructures", "Dates", "DiffEqCallbacks", "EnumX", "FiniteDiff", "ForwardDiff", "Graphs", "HiGHS", "IterTools", "JuMP", "Legolas", "LineSearches", "LinearSolve", "Logging", "LoggingExtras", "MetaGraphsNext", "OrdinaryDiffEq", "PreallocationTools", "SQLite", "SciMLBase", "SparseArrays", "SparseConnectivityTracer", "StructArrays", "Tables", "TerminalLoggers", "TranscodingStreams"] +deps = ["ADTypes", "Accessors", "Arrow", "BasicModelInterface", "CodecZstd", "ComponentArrays", "Configurations", "DBInterface", "DataInterpolations", "DataStructures", "Dates", "DiffEqCallbacks", "EnumX", "FiniteDiff", "ForwardDiff", "Graphs", "HiGHS", "IterTools", "JuMP", "Legolas", "LineSearches", "LinearSolve", "Logging", "LoggingExtras", "MetaGraphsNext", "OrdinaryDiffEq", "OrdinaryDiffEqCore", "OrdinaryDiffEqNonlinearSolve", "OrdinaryDiffEqRosenbrock", "PreallocationTools", "SQLite", "SciMLBase", "SparseArrays", "SparseConnectivityTracer", "StructArrays", "Tables", "TerminalLoggers", "TranscodingStreams"] path = "core" uuid = "aac5e3d9-0b8f-4d4f-8241-b1a7a9632635" version = "2024.10.0" @@ -1349,9 +1541,9 @@ version = "3.45.3+0" [[deps.SciMLBase]] deps = ["ADTypes", "Accessors", "ArrayInterface", "CommonSolve", "ConstructionBase", "Distributed", "DocStringExtensions", "EnumX", "Expronicon", "FunctionWrappersWrappers", "IteratorInterfaceExtensions", "LinearAlgebra", "Logging", "Markdown", "PrecompileTools", "Preferences", "Printf", "RecipesBase", "RecursiveArrayTools", "Reexport", "RuntimeGeneratedFunctions", "SciMLOperators", "SciMLStructures", "StaticArraysCore", "Statistics", "SymbolicIndexingInterface", "Tables"] -git-tree-sha1 = "7f0e208db50f5fee2386b6d8dc9608d580059331" +git-tree-sha1 = "8001043f80051c86f264fd6e936d97e6b9eff401" uuid = "0bca4576-84f4-4d90-8ffe-ffa030f20462" -version = "2.48.1" +version = "2.52.0" [deps.SciMLBase.extensions] SciMLBaseChainRulesCoreExt = "ChainRulesCore" @@ -1373,16 +1565,21 @@ version = "2.48.1" Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f" [[deps.SciMLOperators]] -deps = ["ArrayInterface", "DocStringExtensions", "LinearAlgebra", "MacroTools", "Setfield", "SparseArrays", "StaticArraysCore"] -git-tree-sha1 = "10499f619ef6e890f3f4a38914481cc868689cd5" +deps = ["Accessors", "ArrayInterface", "DocStringExtensions", "LinearAlgebra", "MacroTools"] +git-tree-sha1 = "e39c5f217f9aca640c8e27ab21acf557a3967db5" uuid = "c0aeaf25-5076-4817-a8d5-81caf7dfa961" -version = "0.3.8" +version = "0.3.10" +weakdeps = ["SparseArrays", "StaticArraysCore"] + + [deps.SciMLOperators.extensions] + SciMLOperatorsSparseArraysExt = "SparseArrays" + SciMLOperatorsStaticArraysCoreExt = "StaticArraysCore" [[deps.SciMLStructures]] deps = ["ArrayInterface"] -git-tree-sha1 = "20ad3e7c137156c50c93c888d0f2bc5b7883c729" +git-tree-sha1 = "25514a6f200219cd1073e4ff23a6324e4a7efe64" uuid = "53ae85a6-f571-4167-b2af-e1d143709226" -version = "1.4.2" +version = "1.5.0" [[deps.Scratch]] deps = ["Dates"] @@ -1411,9 +1608,9 @@ uuid = "1a1011a3-84de-559e-8e89-a11a2f7dc383" [[deps.SimpleNonlinearSolve]] deps = ["ADTypes", "ArrayInterface", "ConcreteStructs", "DiffEqBase", "DiffResults", "DifferentiationInterface", "FastClosures", "FiniteDiff", "ForwardDiff", "LinearAlgebra", "MaybeInplace", "PrecompileTools", "Reexport", "SciMLBase", "Setfield", "StaticArraysCore"] -git-tree-sha1 = "03c21a4c373c7c3aa77611430068badaa073d740" +git-tree-sha1 = "4d7a7c177bcb4c6dc465f09db91bfdb28c578919" uuid = "727e6d20-b764-4bd8-a329-72de5adea6c7" -version = "1.11.0" +version = "1.12.0" [deps.SimpleNonlinearSolve.extensions] SimpleNonlinearSolveChainRulesCoreExt = "ChainRulesCore" @@ -1459,10 +1656,10 @@ uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" version = "1.10.0" [[deps.SparseConnectivityTracer]] -deps = ["ADTypes", "Compat", "DocStringExtensions", "FillArrays", "LinearAlgebra", "Random", "Requires", "SparseArrays"] -git-tree-sha1 = "73319ffcb025f603513c32878bac5bded9a1975f" +deps = ["ADTypes", "DocStringExtensions", "FillArrays", "LinearAlgebra", "Random", "Requires", "SparseArrays"] +git-tree-sha1 = "1c2c4fe587a804116d409d8964efda83dfa156ab" uuid = "9f842d2f-2579-4b1d-911e-f412cf18a3f5" -version = "0.6.1" +version = "0.6.2" [deps.SparseConnectivityTracer.extensions] SparseConnectivityTracerNNlibExt = "NNlib" @@ -1474,9 +1671,9 @@ version = "0.6.1" [[deps.SparseDiffTools]] deps = ["ADTypes", "Adapt", "ArrayInterface", "Compat", "DataStructures", "FiniteDiff", "ForwardDiff", "Graphs", "LinearAlgebra", "PackageExtensionCompat", "Random", "Reexport", "SciMLOperators", "Setfield", "SparseArrays", "StaticArrayInterface", "StaticArrays", "Tricks", "UnPack", "VertexSafeGraphs"] -git-tree-sha1 = "469f51f8c4741ce944be2c0b65423b518b1405b0" +git-tree-sha1 = "c9e5d7ee75cf6a1ca3a22c9a6a4ef451792cf62b" uuid = "47a9eef4-7e08-11e9-0b38-333d64bd3804" -version = "2.19.0" +version = "2.20.0" [deps.SparseDiffTools.extensions] SparseDiffToolsEnzymeExt = "Enzyme" @@ -1493,10 +1690,10 @@ version = "2.19.0" Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f" [[deps.SparseMatrixColorings]] -deps = ["ADTypes", "Compat", "DocStringExtensions", "LinearAlgebra", "Random", "SparseArrays"] -git-tree-sha1 = "ad048e784b816e4de5553a13f1daf148412f3dbd" +deps = ["ADTypes", "Compat", "DataStructures", "DocStringExtensions", "LinearAlgebra", "Random", "SparseArrays"] +git-tree-sha1 = "996dff77d814c45c3f2342fa0113e4ad31e712e8" uuid = "0a514795-09f3-496d-8182-132a7b665d35" -version = "0.3.6" +version = "0.4.0" [[deps.Sparspak]] deps = ["Libdl", "LinearAlgebra", "Logging", "OffsetArrays", "Printf", "SparseArrays", "Test"] @@ -1521,10 +1718,10 @@ uuid = "aedffcd0-7271-4cad-89d0-dc628f76c6d3" version = "1.1.1" [[deps.StaticArrayInterface]] -deps = ["ArrayInterface", "Compat", "IfElse", "LinearAlgebra", "PrecompileTools", "Requires", "SparseArrays", "Static", "SuiteSparse"] -git-tree-sha1 = "8963e5a083c837531298fc41599182a759a87a6d" +deps = ["ArrayInterface", "Compat", "IfElse", "LinearAlgebra", "PrecompileTools", "Static"] +git-tree-sha1 = "96381d50f1ce85f2663584c8e886a6ca97e60554" uuid = "0d7ed370-da01-4f52-bd93-41d350b8b718" -version = "1.5.1" +version = "1.8.0" weakdeps = ["OffsetArrays", "StaticArrays"] [deps.StaticArrayInterface.extensions] @@ -1579,13 +1776,9 @@ weakdeps = ["Adapt", "GPUArraysCore", "SparseArrays", "StaticArrays"] [[deps.StructTypes]] deps = ["Dates", "UUIDs"] -git-tree-sha1 = "ca4bccb03acf9faaf4137a9abc1881ed1841aa70" +git-tree-sha1 = "159331b30e94d7b11379037feeb9b690950cace8" uuid = "856f2bd8-1eba-4b0a-8007-ebc267875bd4" -version = "1.10.0" - -[[deps.SuiteSparse]] -deps = ["Libdl", "LinearAlgebra", "Serialization", "SparseArrays"] -uuid = "4607b0f0-06f3-5cda-b6b1-a6196a1729e9" +version = "1.11.0" [[deps.SuiteSparse_jll]] deps = ["Artifacts", "Libdl", "libblastrampoline_jll"] @@ -1594,9 +1787,9 @@ version = "7.2.1+1" [[deps.SymbolicIndexingInterface]] deps = ["Accessors", "ArrayInterface", "RuntimeGeneratedFunctions", "StaticArraysCore"] -git-tree-sha1 = "2dd32da03adaf43fd91494e38ef3df0ab2e6c20e" +git-tree-sha1 = "c9fce29fb41a10677e24f74421ebe31220b81ad0" uuid = "2efcf032-c050-4f8e-a9bb-153293bab1f5" -version = "0.3.27" +version = "0.3.28" [[deps.TOML]] deps = ["Dates"] @@ -1661,9 +1854,9 @@ version = "0.5.2" [[deps.TimeZones]] deps = ["Dates", "Downloads", "InlineStrings", "Mocking", "Printf", "Scratch", "TZJData", "Unicode", "p7zip_jll"] -git-tree-sha1 = "a6ae8d7a27940c33624f8c7bde5528de21ba730d" +git-tree-sha1 = "b92aebdd3555f3a7e3267cf17702033c2814ef48" uuid = "f269a46b-ccf7-5d73-abea-4c690281aa53" -version = "1.17.0" +version = "1.18.0" weakdeps = ["RecipesBase"] [deps.TimeZones.extensions] diff --git a/core/Project.toml b/core/Project.toml index fac72074c..4348cff1b 100644 --- a/core/Project.toml +++ b/core/Project.toml @@ -31,6 +31,9 @@ Logging = "56ddb016-857b-54e1-b83d-db4d58db5568" LoggingExtras = "e6f89c97-d47a-5376-807f-9c37f3926c36" MetaGraphsNext = "fa8bd995-216d-47f1-8a91-f3b68fbeb377" OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed" +OrdinaryDiffEqCore = "bbf590c4-e513-4bbe-9b18-05decba2e5d8" +OrdinaryDiffEqNonlinearSolve = "127b3ac7-2247-4354-8eb6-78cf4e7c58e8" +OrdinaryDiffEqRosenbrock = "43230ef6-c299-4910-a778-202eb28ce4ce" PreallocationTools = "d236fae5-4411-538c-8e31-a6e3d9e00b46" SQLite = "0aa819cd-b072-5ff4-a722-6bc24af294d9" SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462" diff --git a/core/src/Ribasim.jl b/core/src/Ribasim.jl index 01d735dd2..ef12a3351 100644 --- a/core/src/Ribasim.jl +++ b/core/src/Ribasim.jl @@ -15,14 +15,10 @@ For more granular access, see: module Ribasim # Algorithms for solving ODEs. -using OrdinaryDiffEq: - OrdinaryDiffEq, - OrdinaryDiffEqRosenbrockAdaptiveAlgorithm, - get_du, - AbstractNLSolver, - relax!, - _compute_rhs!, - calculate_residuals! +using OrdinaryDiffEq: OrdinaryDiffEq, get_du, AbstractNLSolver +using OrdinaryDiffEqRosenbrock: OrdinaryDiffEqRosenbrockAdaptiveAlgorithm +using OrdinaryDiffEqNonlinearSolve: + OrdinaryDiffEqNonlinearSolve, relax!, _compute_rhs!, calculate_residuals! using LineSearches: BackTracking # Interface for defining and solving the ODE problem of the physical layer. diff --git a/core/src/config.jl b/core/src/config.jl index 09876692c..ec4e8137a 100644 --- a/core/src/config.jl +++ b/core/src/config.jl @@ -15,9 +15,7 @@ using Logging: LogLevel, Debug, Info, Warn, Error using ..Ribasim: Ribasim, isnode, nodetype using OrdinaryDiffEq: OrdinaryDiffEqAlgorithm, - OrdinaryDiffEqNewtonAdaptiveAlgorithm, NonlinearSolveAlg, - NewtonRaphson, Euler, ImplicitEuler, KenCarp4, @@ -27,6 +25,8 @@ using OrdinaryDiffEq: Rosenbrock23, TRBDF2, Tsit5 +using OrdinaryDiffEqCore: OrdinaryDiffEqNewtonAdaptiveAlgorithm +using OrdinaryDiffEqNonlinearSolve: NewtonRaphson using LineSearches: BackTracking using ADTypes: AutoForwardDiff diff --git a/core/src/util.jl b/core/src/util.jl index 90d197cf3..7bc301163 100644 --- a/core/src/util.jl +++ b/core/src/util.jl @@ -939,7 +939,7 @@ end MonitoredBackTracing is a thin wrapper of BackTracking, making sure that the BackTracking relaxation is rejected if it results in a residual increase """ -function OrdinaryDiffEq.relax!( +function OrdinaryDiffEqNonlinearSolve.relax!( dz, nlsolver::AbstractNLSolver, integrator::DEIntegrator, From 2e67d59bbd89c35477be0d811b6a661dd9b05494 Mon Sep 17 00:00:00 2001 From: Bart de Koning Date: Fri, 25 Oct 2024 16:51:53 +0200 Subject: [PATCH 3/3] Cleanup --- core/src/Ribasim.jl | 2 -- core/src/config.jl | 5 +--- core/src/util.jl | 65 --------------------------------------------- 3 files changed, 1 insertion(+), 71 deletions(-) diff --git a/core/src/Ribasim.jl b/core/src/Ribasim.jl index f7e67fa32..83a0ab56b 100644 --- a/core/src/Ribasim.jl +++ b/core/src/Ribasim.jl @@ -22,8 +22,6 @@ using OrdinaryDiffEqCore: AbstractNLSolver, calculate_residuals! using DiffEqBase: DiffEqBase -using OrdinaryDiffEqNonlinearSolve: OrdinaryDiffEqNonlinearSolve, relax!, _compute_rhs! -using DiffEqBase: remake # Interface for defining and solving the ODE problem of the physical layer. using SciMLBase: diff --git a/core/src/config.jl b/core/src/config.jl index 0c3b7d1d5..a49ad3ae7 100644 --- a/core/src/config.jl +++ b/core/src/config.jl @@ -16,7 +16,7 @@ using LineSearch: BackTracking using Logging: LogLevel, Debug, Info, Warn, Error using ..Ribasim: Ribasim, isnode, nodetype using OrdinaryDiffEqCore: OrdinaryDiffEqAlgorithm, OrdinaryDiffEqNewtonAdaptiveAlgorithm -using OrdinaryDiffEqNonlinearSolve: NLNewton, NonlinearSolveAlg, NewtonRaphson +using OrdinaryDiffEqNonlinearSolve: NonlinearSolveAlg, NewtonRaphson using OrdinaryDiffEqLowOrderRK: Euler, RK4 using OrdinaryDiffEqTsit5: Tsit5 using OrdinaryDiffEqSDIRK: ImplicitEuler, KenCarp4, TRBDF2 @@ -289,9 +289,6 @@ function algorithm(solver::Solver; u0 = [])::OrdinaryDiffEqAlgorithm kwargs = Dict{Symbol, Any}() if algotype <: OrdinaryDiffEqNewtonAdaptiveAlgorithm - # kwargs[:nlsolve] = NLNewton(; - # relax = Ribasim.MonitoredBackTracking(; z_tmp = copy(u0), dz_tmp = copy(u0)), - # ) kwargs[:nlsolve] = NonlinearSolveAlg( NewtonRaphson(; linesearch = BackTracking(), autodiff = AutoFiniteDiff()), ) diff --git a/core/src/util.jl b/core/src/util.jl index d12498c9b..27051bd85 100644 --- a/core/src/util.jl +++ b/core/src/util.jl @@ -859,71 +859,6 @@ relaxed_root(x::GradientTracer, threshold::Real) = x get_level_from_storage(basin::Basin, state_idx::Int, storage::GradientTracer) = storage stop_declining_negative_storage!(du, u::ComponentVector{<:GradientTracer}) = nothing -@kwdef struct MonitoredBackTracking{B, V} - linesearch::B = BackTracking() - dz_tmp::V = [] - z_tmp::V = [] -end - -""" -Compute the residual of the non-linear solver, i.e. a measure of the -error in the solution to the implicit equation defined by the solver algorithm -""" -function residual(z, integrator, nlsolver, f) - (; uprev, t, p, dt, opts, isdae) = integrator - (; tmp, ztmp, γ, α, cache, method) = nlsolver - (; ustep, atmp, tstep, k, invγdt, tstep, k, invγdt) = cache - if isdae - _uprev = get_dae_uprev(integrator, uprev) - b, ustep2 = - _compute_rhs!(tmp, ztmp, ustep, α, tstep, k, invγdt, p, _uprev, f::TF, z) - else - b, ustep2 = - _compute_rhs!(tmp, ztmp, ustep, γ, α, tstep, k, invγdt, method, p, dt, f, z) - end - calculate_residuals!( - atmp, - b, - uprev, - ustep2, - opts.abstol, - opts.reltol, - opts.internalnorm, - t, - ) - ndz = opts.internalnorm(atmp, t) - return ndz -end - -""" -MonitoredBackTracing is a thin wrapper of BackTracking, making sure that -the BackTracking relaxation is rejected if it results in a residual increase -""" -function OrdinaryDiffEqNonlinearSolve.relax!( - dz, - nlsolver::AbstractNLSolver, - integrator::DEIntegrator, - f, - linesearch::MonitoredBackTracking, -) - (; linesearch, dz_tmp, z_tmp) = linesearch - - # Store step before relaxation - @. dz_tmp = dz - - # Apply relaxation and measure the residual change - @. z_tmp = nlsolver.z + dz - resid_before = residual(z_tmp, integrator, nlsolver, f) - relax!(dz, nlsolver, integrator, f, linesearch) - @. z_tmp = nlsolver.z + dz - resid_after = residual(z_tmp, integrator, nlsolver, f) - - # If the residual increased due to the relaxation, reject it - if resid_after > resid_before - @. dz = dz_tmp - end -end - function build_state_vector(p::Parameters) # It is assumed that the horizontal flow states come first in # p.state_inflow_edge and p.state_outflow_edge