Skip to content

Commit dd8da7f

Browse files
committed
Documentation update on preconditioners
1 parent c6c86ca commit dd8da7f

File tree

4 files changed

+118
-2
lines changed

4 files changed

+118
-2
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "ExtendableSparse"
22
uuid = "95c220a8-a1cf-11e9-0c77-dbfce5f500b3"
33
authors = ["Juergen Fuhrmann <juergen.fuhrmann@wias-berlin.de>"]
4-
version = "0.6.0"
4+
version = "0.6.1"
55

66
[deps]
77
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ Any linear algebra method on `ExtendableSparseMatrix` starts with a `flush!` met
1616

1717
`ExtendableSparseMatrix` is aimed to work as a drop-in replacement to `SparseMatrixCSC` in finite element and finite volume codes especally in those cases where the sparsity structure is hard to detect a priori and where working with an intermediadte COO representation appears to be not convenient.
1818

19+
20+
1921
## Caveat
2022

2123
This package assumes that a $m \times n$ matrix is sparse if *each* row and *each* column have less than $C$ entries with
@@ -50,5 +52,18 @@ See [Julia issue #15630](https://github.com/JuliaLang/julia/issues/15630) for a
5052

5153

5254

55+
## Preconditioners
56+
The package provides a common API for factorizations and preconditioners supporting
57+
series of solutions as during nonlinear and transient solves.
58+
For details, see the [corresponding documentation](https://j-fu.github.io/ExtendableSparse.jl/stable/iter/).
59+
60+
## Interfaces to other packages
61+
The package provides interfaces to other sparse matrix solvers and preconditioners. Dependencies on these
62+
packages are handeled via [Requires.jl](https://github.com/JuliaPackaging/Requires.jl).
63+
Currently, support includes:
5364

65+
- [Pardiso.jl](https://github.com/JuliaSparse/Pardiso.jl) (both ["project Pardiso"](https://pardiso-project.org)
66+
and [MKL Pardiso](https://software.intel.com/content/www/us/en/develop/documentation/onemkl-developer-reference-fortran/top/sparse-solver-routines/onemkl-pardiso-parallel-direct-sparse-solver-interface.html))
67+
- [IncompleteLU.jl](https://github.com/haampie/IncompleteLU.jl)
68+
- [AlgebraicMultigrid.jl](https://github.com/JuliaLinearAlgebra/AlgebraicMultigrid.jl) (Ruge-Stüben AMG)
5469

docs/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
[deps]
2-
AlgebraicMultigrid = "2169fc97-5a83-5252-b627-83903c6c433c"
32
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
43
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
54
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
65
DocumenterTools = "35a29f4d-8980-5a13-9543-d66fff28ecb8"
76
ExtendableSparse = "95c220a8-a1cf-11e9-0c77-dbfce5f500b3"
87
IncompleteLU = "40713840-3770-5561-ab4c-a76e7d0d7895"
8+
IterativeSolvers = "42fd0dbc-a981-5370-80f2-aaf504508153"
99
Pardiso = "46dd5b70-b6fb-5a00-ae2d-e8fea33afaf2"

docs/src/iter.md

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,113 @@ Private = false
1515
```
1616

1717
## LU Factorizations
18+
Handling of the LU factorizations is meant to support
19+
a workflow where sequences of problems are solved based
20+
on the same matrix, where one possibly wants to re-use
21+
existing symbolic factorization data.
22+
23+
The support comes in two flavors.
24+
25+
- Using [`factorize!`](@ref) which can work as a drop-in replacement for `lu!`:
26+
27+
```@example
28+
using ExtendableSparse, LinearAlgebra
29+
using Pardiso
30+
A=fdrand(20,20,1,matrixtype=ExtendableSparseMatrix)
31+
n=size(A,1)
32+
b=rand(n)
33+
factorization=MKLPardisoLU()
34+
factorize!(factorization,A)
35+
nm1=norm(factorization\b)
36+
37+
# mock update from Newton etc.
38+
for i=4:n-3
39+
A[i,i+3]-=1.0e-4
40+
end
41+
factorize!(factorization,A)
42+
nm2=norm(factorization\b)
43+
nm1,nm2
44+
```
45+
46+
- Using [`update!`](@ref), where the matrix only needs to be given at construction time:
47+
```@example
48+
using ExtendableSparse, LinearAlgebra
49+
A=fdrand(20,20,1,matrixtype=ExtendableSparseMatrix)
50+
n=size(A,1)
51+
b=rand(n)
52+
factorization=CholeskyFactorization(A)
53+
nm1=norm(factorization\b)
54+
55+
# mock update from Newton etc.
56+
for i=4:n-3
57+
A[i,i+3]-=1.0e-4
58+
A[i-3,i]-=1.0e-4
59+
end
60+
update!(factorization)
61+
nm2=norm(factorization\b)
62+
nm1,nm2
63+
```
64+
65+
66+
### API
1867
```@autodocs
1968
Modules = [ExtendableSparse]
2069
Pages = ["umfpack_lu.jl", "pardiso_lu.jl"]
2170
```
2271

2372
## Preconditioners
73+
74+
The API is similar to that for LU factorizations.
75+
76+
77+
The support comes in two flavors.
78+
79+
- Using [`factorize!`](@ref):
80+
81+
82+
```@example
83+
using ExtendableSparse, LinearAlgebra
84+
using IterativeSolvers,IncompleteLU
85+
A=fdrand(20,20,1,matrixtype=ExtendableSparseMatrix)
86+
n=size(A,1)
87+
b=rand(n)
88+
preconditioner=ILUTPreconditioner(droptol=1.0e-2)
89+
factorize!(preconditioner,A)
90+
91+
# mock update from Newton etc.
92+
nm1=norm(bicgstabl(A,b,1,Pl=preconditioner))
93+
for i=4:n-3
94+
A[i,i+3]-=1.0e-4
95+
end
96+
factorize!(preconditioner,A)
97+
nm2=norm(bicgstabl(A,b,1,Pl=preconditioner))
98+
nm1,nm2
99+
```
100+
101+
- Using [`update!`](@ref):
102+
103+
```@example
104+
using ExtendableSparse, LinearAlgebra
105+
using IterativeSolvers
106+
A=fdrand(20,20,1,matrixtype=ExtendableSparseMatrix)
107+
n=size(A,1)
108+
b=rand(n)
109+
preconditioner=ILU0Preconditioner(A)
110+
nm1=norm(cg(A,b,Pl=preconditioner))
111+
112+
# mock update from Newton etc.
113+
for i=4:n-3
114+
A[i,i+3]-=1.0e-4
115+
A[i-3,i]-=1.0e-4
116+
end
117+
update!(preconditioner)
118+
nm2=norm(cg(A,b,Pl=preconditioner))
119+
nm1,nm2
120+
```
121+
122+
123+
### API
124+
24125
```@autodocs
25126
Modules = [ExtendableSparse]
26127
Pages = ["jacobi.jl","ilu0.jl","parallel_jacobi.jl","ilut.jl","amg.jl"]

0 commit comments

Comments
 (0)