1+ """
2+ $(TYPEDEF)
3+
4+ ILU(0) Preconditioner
5+ """
16mutable struct ILU0Preconditioner{Tv, Ti} <: AbstractExtendablePreconditioner{Tv,Ti}
27 extmatrix:: ExtendableSparseMatrix{Tv,Ti}
38 xdiag:: Array{Tv,1}
49 idiag:: Array{Ti,1}
510 pattern_timestamp:: Float64
611end
712
13+ """
14+ $(SIGNATURES)
815
16+ Constructor for ILU(0) preconditioner
17+ """
918function ILU0Preconditioner (extmatrix:: ExtendableSparseMatrix{Tv,Ti} ) where {Tv,Ti}
1019 @assert size (extmatrix,1 )== size (extmatrix,2 )
1120 flush! (extmatrix)
@@ -16,9 +25,19 @@ function ILU0Preconditioner(extmatrix::ExtendableSparseMatrix{Tv,Ti}) where {Tv,
1625 update! (precon)
1726end
1827
28+ """
29+ $(SIGNATURES)
30+
31+ Constructor for ILU(0) preconditioner
32+ """
1933ILU0Preconditioner (cscmatrix:: SparseMatrixCSC{Tv,Ti} ) where {Tv,Ti}= ILU0Preconditioner (ExtendableSparseMatrix (cscmatrix))
2034
2135
36+ """
37+ $(SIGNATURES)
38+
39+ Update ILU(0) preconditioner
40+ """
2241function update! (precon:: ILU0Preconditioner{Tv,Ti} ) where {Tv,Ti}
2342 cscmatrix= precon. extmatrix. cscmatrix
2443 colptr= cscmatrix. colptr
@@ -59,6 +78,11 @@ function update!(precon::ILU0Preconditioner{Tv,Ti}) where {Tv,Ti}
5978end
6079
6180
81+ """
82+ $(SIGNATURES)
83+
84+ Solve preconditioning system for ILU(0)
85+ """
6286function LinearAlgebra. ldiv! (u:: AbstractArray{T,1} , precon:: ILU0Preconditioner , v:: AbstractArray{T,1} ) where T
6387 cscmatrix= precon. extmatrix. cscmatrix
6488 colptr= cscmatrix. colptr
@@ -85,6 +109,11 @@ function LinearAlgebra.ldiv!(u::AbstractArray{T,1}, precon::ILU0Preconditioner,
85109 end
86110end
87111
112+ """
113+ $(SIGNATURES)
114+
115+ Inplace solve of preconditioning system for ILU(0)
116+ """
88117function LinearAlgebra. ldiv! (precon:: ILU0Preconditioner , v:: AbstractArray{T,1} where T)
89118 ldiv! (v, precon, v)
90119end
0 commit comments