Skip to content

Commit 53ddeb7

Browse files
add B to kwargs
1 parent c030852 commit 53ddeb7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/precs.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@
44
Return callable object constructing a left smoothed aggregation algebraic multigrid preconditioner
55
to be used with the `precs` API of LinearSolve.
66
"""
7-
struct SmoothedAggregationPreconBuilder{Tk,TB<:Union{Nothing,<:AbstractArray}}
7+
struct SmoothedAggregationPreconBuilder{Tk}
88
blocksize::Int
9-
B::TB # near null space basis
109
kwargs::Tk
1110
end
1211

13-
function SmoothedAggregationPreconBuilder(; blocksize = 1,B = nothing, kwargs...)
14-
return SmoothedAggregationPreconBuilder(blocksize,B, kwargs)
12+
function SmoothedAggregationPreconBuilder(; blocksize = 1, kwargs...)
13+
return SmoothedAggregationPreconBuilder(blocksize, kwargs)
1514
end
1615

1716
function (b::SmoothedAggregationPreconBuilder)(A::AbstractSparseMatrixCSC, p)
18-
return (aspreconditioner(smoothed_aggregation(SparseMatrixCSC(A),b.B, Val{b.blocksize}; b.kwargs...)), I)
17+
B = get(b.kwargs, :B, nothing) # extract nns from kwargs, default to `nothing`
18+
return (aspreconditioner(smoothed_aggregation(SparseMatrixCSC(A), B, Val{b.blocksize}; b.kwargs...)),I)
1919
end
2020

2121

0 commit comments

Comments
 (0)