From 042ab3790329edc1e036c6b4d26858e174e41974 Mon Sep 17 00:00:00 2001 From: Avik Pal Date: Wed, 1 Nov 2023 12:15:46 -0400 Subject: [PATCH] Fix Formatting --- src/NonlinearSolve.jl | 2 +- src/pseudotransient.jl | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/NonlinearSolve.jl b/src/NonlinearSolve.jl index a3b887cac..2b6ab25e4 100644 --- a/src/NonlinearSolve.jl +++ b/src/NonlinearSolve.jl @@ -14,7 +14,7 @@ PrecompileTools.@recompile_invalidations begin import ADTypes: AbstractFiniteDifferencesMode import ArrayInterface: undefmatrix, - matrix_colors, parameterless_type, ismutable, issingular,fast_scalar_indexing + matrix_colors, parameterless_type, ismutable, issingular, fast_scalar_indexing import ConcreteStructs: @concrete import EnumX: @enumx import ForwardDiff diff --git a/src/pseudotransient.jl b/src/pseudotransient.jl index 56b79bc09..5da1375d6 100644 --- a/src/pseudotransient.jl +++ b/src/pseudotransient.jl @@ -102,8 +102,8 @@ end function perform_step!(cache::PseudoTransientCache{true}) @unpack u, u_prev, fu1, f, p, alg, J, linsolve, du, alpha = cache jacobian!!(J, cache) - inv_alpha = inv(alpha) + inv_alpha = inv(alpha) if J isa SciMLBase.AbstractSciMLOperator J = J - inv_alpha * I else @@ -142,14 +142,15 @@ function perform_step!(cache::PseudoTransientCache{false}) @unpack u, u_prev, fu1, f, p, alg, linsolve, alpha = cache cache.J = jacobian!!(cache.J, cache) - inv_alpha = inv(alpha) + inv_alpha = inv(alpha) cache.J = cache.J - inv_alpha * I # u = u - J \ fu 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