From abaf747734434ac4ccb07f3a4d56f494ac486194 Mon Sep 17 00:00:00 2001 From: yonatanwesen Date: Tue, 31 Oct 2023 16:42:05 -0400 Subject: [PATCH] address comments and add compat for FastBroadcast --- Project.toml | 1 + src/NonlinearSolve.jl | 2 +- src/pseudotransient.jl | 4 +--- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Project.toml b/Project.toml index 35159532c..078c37f3b 100644 --- a/Project.toml +++ b/Project.toml @@ -43,6 +43,7 @@ ConcreteStructs = "0.2" DiffEqBase = "6.130" EnumX = "1" Enzyme = "0.11" +FastBroadcast = "0.1.9, 0.2" FastLevenbergMarquardt = "0.1" FiniteDiff = "2" ForwardDiff = "0.10.3" diff --git a/src/NonlinearSolve.jl b/src/NonlinearSolve.jl index 16b7e4a82..0f8626314 100644 --- a/src/NonlinearSolve.jl +++ b/src/NonlinearSolve.jl @@ -9,7 +9,7 @@ import PrecompileTools PrecompileTools.@recompile_invalidations begin using DiffEqBase, LinearAlgebra, LinearSolve, SparseArrays, SparseDiffTools - using FastBroadcast: @.., True, False + using FastBroadcast: @.. import ArrayInterface: restructure import ADTypes: AbstractFiniteDifferencesMode diff --git a/src/pseudotransient.jl b/src/pseudotransient.jl index 4c8ee40e7..ca7cbcdbb 100644 --- a/src/pseudotransient.jl +++ b/src/pseudotransient.jl @@ -167,9 +167,7 @@ function perform_step!(cache::PseudoTransientCache{false}) if linsolve === nothing cache.du = fu1 / cache.J else - linres = dolinsolve(alg.precs, linsolve; A = cache.J, - b = _vec(fu1), - linu = _vec(cache.du), p, reltol = cache.abstol) + linres = dolinsolve(alg.precs, linsolve; A = cache.J,b = _vec(fu1),linu = _vec(cache.du), p, reltol = cache.abstol) cache.linsolve = linres.cache end cache.u = @. u - cache.du # `u` might not support mutation