-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1364: Refactor SchurComplementW for ClimaTimesteppers r=charleskawczynski a=charleskawczynski This PR is a peel off from #1358. This PR adds `temp1` and `temp2` to `SchurComplementW`, and defines ```julia linsolve!(::Type{Val{:init}}, f, u0; kwargs...) = _linsolve! _linsolve!(x, A, b, update_matrix = false; kwargs...) = LinearAlgebra.ldiv!(x, A, b) # Function required by Krylov.jl (x and b can be AbstractVectors) # See JuliaSmoothOptimizers/Krylov.jl#605 for a # related issue that requires the same workaround. function LinearAlgebra.ldiv!(x, A::SchurComplementW, b) A.temp1 .= b LinearAlgebra.ldiv!(A.temp2, A, A.temp1) x .= A.temp2 end ``` and the original `_linsolve` contents are in ```julia function LinearAlgebra.ldiv!( x::Fields.FieldVector, A::SchurComplementW, b::Fields.FieldVector, ) ``` (the pattern used in ClimaAtmos). It also renames `_linsolve!` to `test_linsolve!` to avoid a name collision in the test suite. It's a much smaller PR than it appears, due to indenting. Co-authored-by: Charles Kawczynski <kawczynski.charles@gmail.com>
- Loading branch information
Showing
2 changed files
with
109 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters