Skip to content

Commit ac3e511

Browse files
authored
Merge pull request #63 from WIAS-PDELib/jf/v2
v2.0: remove almost all solver, preconditioner infrastructure in favor of LinearSolve, clean up package structure
2 parents e2e8c98 + 35f736c commit ac3e511

70 files changed

Lines changed: 1057 additions & 6082 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
# Changelog
22

3-
## [2.0.0] - Planned
3+
## [2.0.0] - 2026-01-06
44

5-
### Breaking
6-
- remove solver + precon API which is not based on precs or directly overloading `\`.
5+
- Remove solver + precon API which is not based on precs or directly overloading `\`.
76
Fully rely on LinearSolve (besides `\`)
8-
- Move AMGBuilder, ILUZeroBuilder etc. to the corresponding packages (depending on the PRs)
9-
- remove "old" SparseMatrixLNK (need to benchmark before)
7+
- Move AMGBuilder etc to corresponding packages (depending on the PRs)
8+
- Keep ILUZeroPreconBuilder, JacobiPreconBuilder
9+
- ExtendableSparseMatrix is now GenericExtendableSparseMatrix{SparseMatrixLNK}
10+
- Changes should be non-breaking if only ExtendableSparseMatrix was used, and no solvers or preconditioners
11+
For those, see LinearSolve.jl.
1012

1113
## [1.7.0] - 2025-02-06
1214
- Bump Pardiso to 1.0 and LinearSolve to 3.0

Project.toml

Lines changed: 33 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,55 @@
11
name = "ExtendableSparse"
22
uuid = "95c220a8-a1cf-11e9-0c77-dbfce5f500b3"
3+
version = "2.0.0"
34
authors = ["Juergen Fuhrmann <juergen.fuhrmann@wias-berlin.de>", "Daniel Runge"]
4-
version = "1.7.1"
55

66
[deps]
77
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
88
ILUZero = "88f59080-6952-5380-9ea5-54057fb9a43f"
99
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1010
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
11+
SciMLPublic = "431bcebd-1456-4ced-9d72-93c2757fff0b"
1112
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
1213
Sparspak = "e56a9233-b9d6-4f03-8d0f-1825330902ac"
1314
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
14-
SuiteSparse = "4607b0f0-06f3-5cda-b6b1-a6196a1729e9"
15-
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
1615

1716
[weakdeps]
18-
AMGCLWrap = "4f76b812-4ba5-496d-b042-d70715554288"
19-
AlgebraicMultigrid = "2169fc97-5a83-5252-b627-83903c6c433c"
2017
IncompleteLU = "40713840-3770-5561-ab4c-a76e7d0d7895"
2118
LinearSolve = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae"
22-
Pardiso = "46dd5b70-b6fb-5a00-ae2d-e8fea33afaf2"
2319

2420
[extensions]
25-
ExtendableSparseAMGCLWrapExt = "AMGCLWrap"
26-
ExtendableSparseAlgebraicMultigridExt = "AlgebraicMultigrid"
2721
ExtendableSparseIncompleteLUExt = "IncompleteLU"
28-
ExtendableSparsePardisoExt = "Pardiso"
2922
ExtendableSparseLinearSolveExt = "LinearSolve"
3023

24+
[compat]
25+
AMGCLWrap = "2"
26+
AlgebraicMultigrid = "0.4, 0.5, 0.6, 1"
27+
Aqua = "0.8"
28+
BenchmarkTools = "1"
29+
ChunkSplitters = "2, 3"
30+
DocStringExtensions = "0.8, 0.9"
31+
ExplicitImports = "1"
32+
ExtendableGrids = "1.9"
33+
ForwardDiff = "0.10, 1"
34+
ILUZero = "0.2"
35+
IncompleteLU = "^0.2.1"
36+
InteractiveUtils = "1.11.0"
37+
IterativeSolvers = "0.9"
38+
LinearAlgebra = "1.9"
39+
LinearSolve = "2.36.0, 3.7.1"
40+
Metis = "1"
41+
MultiFloats = "1, 2"
42+
OhMyThreads = "0.6, 0.7, 0.8"
43+
Printf = "1.9"
44+
Random = "1.9"
45+
RecursiveFactorization = "0.2"
46+
SciMLPublic = "1.0.1"
47+
SparseArrays = "1.9"
48+
Sparspak = "0.3.6"
49+
StaticArrays = "1"
50+
Test = "1.9"
51+
julia = "1.9"
52+
3153
[extras]
3254
AMGCLWrap = "4f76b812-4ba5-496d-b042-d70715554288"
3355
AlgebraicMultigrid = "2169fc97-5a83-5252-b627-83903c6c433c"
@@ -38,48 +60,15 @@ ExplicitImports = "7d51a73a-1435-4ff3-83d9-f097790105c7"
3860
ExtendableGrids = "cfc395e8-590f-11e8-1f13-43a2532b2fa8"
3961
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
4062
IncompleteLU = "40713840-3770-5561-ab4c-a76e7d0d7895"
63+
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
4164
IterativeSolvers = "42fd0dbc-a981-5370-80f2-aaf504508153"
4265
LinearSolve = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae"
4366
Metis = "2679e427-3c69-5b7f-982b-ece356f1e94b"
4467
MultiFloats = "bdf0d083-296b-4888-a5b6-7498122e68a5"
4568
OhMyThreads = "67456a42-1dca-4109-a031-0a68de7e3ad5"
46-
Pardiso = "46dd5b70-b6fb-5a00-ae2d-e8fea33afaf2"
4769
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
4870
RecursiveFactorization = "f2c3362d-daeb-58d1-803e-2bc74f2840b4"
4971
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
5072

51-
[compat]
52-
AMGCLWrap = "2"
53-
AlgebraicMultigrid = "0.4, 0.5, 0.6, 1"
54-
DocStringExtensions = "0.8, 0.9"
55-
ExtendableGrids = "1.9"
56-
ILUZero = "0.2"
57-
IncompleteLU = "^0.2.1"
58-
IterativeSolvers = "0.9"
59-
LinearSolve = "2.36.0, 3.7.1"
60-
Pardiso = "0.5.1, 1"
61-
Sparspak = "0.3.6"
62-
StaticArrays = "1.5.24"
63-
julia = "1.9"
64-
6573
[targets]
66-
test = [
67-
"AMGCLWrap",
68-
"AlgebraicMultigrid",
69-
"Aqua",
70-
"BenchmarkTools",
71-
"ChunkSplitters",
72-
"ExplicitImports",
73-
"ExtendableGrids",
74-
"ForwardDiff",
75-
"IncompleteLU",
76-
"IterativeSolvers",
77-
"LinearSolve",
78-
"Metis",
79-
"MultiFloats",
80-
"OhMyThreads",
81-
"Pardiso",
82-
"Random",
83-
"RecursiveFactorization",
84-
"Test",
85-
]
74+
test = ["AMGCLWrap", "AlgebraicMultigrid", "Aqua", "BenchmarkTools", "ChunkSplitters", "ExplicitImports", "ExtendableGrids", "ForwardDiff", "IncompleteLU", "IterativeSolvers", "LinearSolve", "Metis", "MultiFloats", "OhMyThreads", "Random", "RecursiveFactorization", "Test"]

README.md

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
[![Build status](https://github.com/WIAS-PDELib/ExtendableSparse.jl/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/WIAS-PDELib/ExtendableSparse.jl/actions/workflows/ci.yml?query=branch%3Amaster)
44
[![](https://img.shields.io/badge/docs-stable-blue.svg)](https://WIAS-PDELib.github.io/ExtendableSparse.jl/stable)
55
[![](https://img.shields.io/badge/docs-dev-blue.svg)](https://WIAS-PDELib.github.io/ExtendableSparse.jl/dev)
6+
[![Aqua QA](https://raw.githubusercontent.com/JuliaTesting/Aqua.jl/master/badge.svg)](https://github.com/JuliaTesting/Aqua.jl)
67
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3530554.svg)](https://doi.org/10.5281/zenodo.3530554)
78
[![code style: runic](https://img.shields.io/badge/code_style-%E1%9A%B1%E1%9A%A2%E1%9A%BE%E1%9B%81%E1%9A%B2-black)](https://github.com/fredrikekre/Runic.jl)
89

@@ -42,7 +43,7 @@ With the help of [Sparspak.jl](https://github.com/PetrKryslUCSD/Sparspak.jl), th
4243
`sparse(A)` creates a standard `SparseMatrixCSC` from a filled `ExtendableSparseMatrix` which can be used e.g. to create preconditioners. So one can instead perform e.g.
4344

4445
```
45-
LinearSolve.solve(p, KrylovJL_CG(); Pl = ILUZero.ilu0(sparse(A)))
46+
LinearSolve.solve(p, KrylovJL_CG(; precs=ILUZeroPreconBuilder()))
4647
```
4748

4849
## Rationale
@@ -94,27 +95,6 @@ triggering two index searches, one for `getindex!` and another one for `setindex
9495

9596
See [Julia issue #15630](https://github.com/JuliaLang/julia/issues/15630) for a discussion on this.
9697

97-
## Factorizations and Preconditioners
98-
99-
The package provides a common API for factorizations and preconditioners supporting
100-
series of solutions of similar problem as they occur during nonlinear and transient solves.
101-
For details, see the [corresponding documentation](https://WIAS-PDELib.github.io/ExtendableSparse.jl/stable/iter/).
102-
103-
With the advent of LinearSolve.jl, this functionality probably will be reduced to some core cases.
104-
105-
### Interfaces to other packages
106-
107-
The package directly provides interfaces to other sparse matrix solvers and preconditioners. Dependencies on these
108-
packages are handled via [Requires.jl](https://github.com/JuliaPackaging/Requires.jl).
109-
Currently, support includes:
110-
111-
- [Pardiso.jl](https://github.com/JuliaSparse/Pardiso.jl) (both ["project Pardiso"](https://pardiso-project.org)
112-
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))
113-
- [IncompleteLU.jl](https://github.com/haampie/IncompleteLU.jl)
114-
- [AlgebraicMultigrid.jl](https://github.com/JuliaLinearAlgebra/AlgebraicMultigrid.jl) (Ruge-Stüben AMG)
115-
116-
For a similar approach, see [Preconditioners.jl](https://github.com/mohamed82008/Preconditioners.jl)
117-
11898
## Alternatives
11999

120100
You may also evaluate alternatives to this package:

docs/Project.toml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,9 @@ DocumenterTools = "35a29f4d-8980-5a13-9543-d66fff28ecb8"
77
ExtendableSparse = "95c220a8-a1cf-11e9-0c77-dbfce5f500b3"
88
ILUZero = "88f59080-6952-5380-9ea5-54057fb9a43f"
99
IncompleteLU = "40713840-3770-5561-ab4c-a76e7d0d7895"
10+
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
1011
IterativeSolvers = "42fd0dbc-a981-5370-80f2-aaf504508153"
1112
LinearSolve = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae"
1213
MultiFloats = "bdf0d083-296b-4888-a5b6-7498122e68a5"
14+
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
1315
Sparspak = "e56a9233-b9d6-4f03-8d0f-1825330902ac"
14-
15-
[compat]
16-
Documenter = "1.0"
17-
IterativeSolvers = "0.9"
18-
LinearSolve = "2.36.0"

docs/make.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Documenter, ExtendableSparse, AlgebraicMultigrid, IncompleteLU, Sparspak, LinearAlgebra
1+
using Documenter, ExtendableSparse, AlgebraicMultigrid, IncompleteLU, Sparspak, LinearAlgebra, SparseArrays, Base, InteractiveUtils
22

33
function mkdocs()
44
return makedocs(;
@@ -10,13 +10,13 @@ function mkdocs()
1010
authors = "J. Fuhrmann",
1111
repo = "https://github.com/WIAS-PDELib/ExtendableSparse.jl",
1212
pages = [
13-
"Home" => "index.md",
13+
"Home" => "home.md",
1414
"example.md",
1515
"extsparse.md",
16+
"extensions.md",
1617
"linearsolve.md",
17-
"internal.md",
18-
"iter.md",
19-
"changes.md",
18+
"misc.md",
19+
"index.md",
2020
]
2121
)
2222
end

docs/src/extensions.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Matrix extensions
2+
3+
## AbstractSparseMatrixExtension
4+
```@docs
5+
ExtendableSparse.AbstractSparseMatrixExtension
6+
```
7+
8+
## SparseMatrixLNK
9+
10+
```@autodocs
11+
Modules = [ExtendableSparse]
12+
Pages = ["sparsematrixlnk.jl"]
13+
```
14+
15+
## SparseMatrixDILNKC
16+
17+
```@autodocs
18+
Modules = [ExtendableSparse]
19+
Pages = ["sparsematrixdilnkc.jl"]
20+
```
21+
22+
## SparseMatrixDict
23+
```@autodocs
24+
Modules = [ExtendableSparse]
25+
Pages = ["sparsematrixdict.jl"]
26+
```

docs/src/extsparse.md

Lines changed: 66 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,79 @@
1-
# Sparse matrix handling
1+
# Extendable matrices
2+
The type hierarchy of extendable matrices in this package is as follows:
23

3-
## Matrix creation and update API
4+
[`ExtendableSparse.AbstractExtendableSparseMatrixCSC`](@ref) `<: SparseArrays.AbstractSparseMatrixCSC <: SparseArrays.AbstractSparseMatrix <: AbstractMatrix`
45

6+
The package defines two [subtypes](#Subtypes-of-AbstractExtendableSparseMatrixCSC) of [`ExtendableSparse.AbstractExtendableSparseMatrixCSC`](@ref) which are parametrized by types of [extension matrices](/extensions/#Matrix-extensions):
7+
- [`ExtendableSparse.GenericExtendableSparseMatrixCSC`](@ref) for single threaded assembly
8+
- [`ExtendableSparse.GenericMTExtendableSparseMatrixCSC`](@ref) for multithreaded assembly
9+
10+
User facing defaults are defined by [type aliases](#Type-aliases):
11+
- `const MTExtendableSparseMatrixCSC = GenericMTExtendableSparseMatrixCSC{SparseMatrixDILNKC}`
12+
- `const STExtendableSparseMatrixCSC = GenericExtendableSparseMatrixCSC{SparseMatrixLNK}`
13+
- `const ExtendableSparseMatrixCSC = STExtendableSparseMatrixCSC`
14+
- `const ExtendableSparseMatrix = ExtendableSparseMatrixCSC`
15+
16+
## Abstract type
17+
```@docs
18+
ExtendableSparse.AbstractExtendableSparseMatrixCSC
19+
```
20+
## Subtypes of AbstractExtendableSparseMatrixCSC
521
```@docs
22+
ExtendableSparse.GenericExtendableSparseMatrixCSC
23+
ExtendableSparse.GenericMTExtendableSparseMatrixCSC
24+
```
25+
26+
## Type aliases
27+
```@docs
28+
MTExtendableSparseMatrixCSC
29+
STExtendableSparseMatrixCSC
30+
ExtendableSparseMatrixCSC
631
ExtendableSparseMatrix
732
```
833

9-
```@autodocs
10-
Modules = [ExtendableSparse]
11-
Pages = ["extendable.jl"]
34+
35+
## Required methods
36+
```@docs
37+
SparseArrays.sparse
38+
ExtendableSparse.rawupdateindex!
39+
ExtendableSparse.flush!
40+
ExtendableSparse.reset!
1241
```
1342

43+
## AbstractSparseMatrixCSC interface
44+
See [SparseArrways#395](https://github.com/JuliaSparse/SparseArrays.jl/pull/395) for a discussion.
45+
46+
1447
```@docs
15-
ExtendableSparse.lu
16-
LinearAlgebra.lu!
48+
SparseArrays.nnz
49+
SparseArrays.nonzeros
50+
SparseArrays.rowvals
51+
SparseArrays.findnz
52+
SparseArrays.dropzeros!
53+
SparseArrays.getcolptr
54+
SparseArrays.SparseMatrixCSC
55+
Base.size
56+
Base.eltype
57+
Base.show
58+
```
59+
60+
## Linear Algebra
61+
```@docs
62+
Base.:\
1763
LinearAlgebra.ldiv!
64+
LinearAlgebra.mul!
65+
LinearAlgebra.norm
66+
LinearAlgebra.opnorm
67+
LinearAlgebra.cond
68+
LinearAlgebra.issymmetric
69+
```
70+
71+
## Algebraic operations
72+
```@docs
73+
Base.:+
74+
Base.:-
75+
Base.:*
76+
1877
```
1978

2079
## Handling of homogeneous Dirichlet BC
@@ -23,10 +82,3 @@ mark_dirichlet
2382
eliminate_dirichlet!
2483
eliminate_dirichlet
2584
```
26-
27-
## Test matrix creation
28-
29-
```@autodocs
30-
Modules = [ExtendableSparse]
31-
Pages = ["sprand.jl"]
32-
```

docs/src/home.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```@docs
2+
ExtendableSparse
3+
```

docs/src/index.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
````@eval
2-
using Markdown
3-
Markdown.parse("""
4-
$(read("../../README.md",String))
5-
""")
6-
````
7-
8-
9-
## Index
1+
# Index
102
```@index
113
```

docs/src/internal.md

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)