Skip to content

Commit c5b24b6

Browse files
author
chmerdon
committed
sparsity patterns for kernels of BilinearOperator now also done by SparseConnectivityTracer, could removed Symbolics as a main dependence now, version bump + changelog
1 parent 6c87755 commit c5b24b6

File tree

6 files changed

+22
-10
lines changed

6 files changed

+22
-10
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# CHANGES
22

3+
## v1.5.0
4+
5+
### Added
6+
- new parameter `autodiff_backend` for NonlinearOperator to change differentiation backend
7+
8+
### Changed
9+
- sparsity patterns of local jacobians are now resolved by SparseConnectivityTracer
10+
- local jacobians are now prepared by DifferentiationInterface
311

412
## v1.4.0
513

Project.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "ExtendableFEM"
22
uuid = "a722555e-65e0-4074-a036-ca7ce79a4aed"
33
authors = ["Christian Merdon <[email protected]>", "Patrick Jaap <[email protected]>"]
4-
version = "1.3.0"
4+
version = "1.5.0"
55

66
[deps]
77
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
@@ -21,7 +21,6 @@ SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
2121
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
2222
SparseConnectivityTracer = "9f842d2f-2579-4b1d-911e-f412cf18a3f5"
2323
SparseMatrixColorings = "0a514795-09f3-496d-8182-132a7b665d35"
24-
Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"
2524
TimerOutputs = "a759f4b9-e2f1-59dc-863e-4aeb61b1ea8f"
2625
UnicodePlots = "b8865327-cd53-5732-bb35-84acbb429228"
2726

@@ -70,9 +69,10 @@ OrdinaryDiffEqRosenbrock = "43230ef6-c299-4910-a778-202eb28ce4ce"
7069
OrdinaryDiffEqSDIRK = "2d112036-d095-4a1e-ab9a-08536f3ecdbf"
7170
SimplexGridFactory = "57bfcd06-606e-45d6-baf4-4ba06da0efd5"
7271
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
72+
Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"
7373
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
7474
TetGen = "c5d3f3f7-f850-59f6-8a2e-ffc6dc1317ea"
7575
Triangulate = "f7e6ffb2-c36d-4f8f-a77e-16e897189344"
7676

7777
[targets]
78-
test = ["Aqua", "ExampleJuggler", "ExplicitImports", "IncompleteLU", "Metis", "OrdinaryDiffEqRosenbrock", "OrdinaryDiffEqSDIRK", "SimplexGridFactory", "StaticArrays", "Test", "TetGen", "Triangulate"]
78+
test = ["Aqua", "ExampleJuggler", "ExplicitImports", "IncompleteLU", "Metis", "OrdinaryDiffEqRosenbrock", "OrdinaryDiffEqSDIRK", "SimplexGridFactory", "StaticArrays", "Symbolics", "Test", "TetGen", "Triangulate"]

src/ExtendableFEM.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,15 @@ using LinearAlgebra: LinearAlgebra, copyto!, isposdef, mul!, norm
6666
using LinearSolve: LinearSolve, LinearProblem, UMFPACKFactorization, deleteat!,
6767
init, solve
6868
using Printf: Printf, @printf, @sprintf
69-
using SparseArrays: SparseArrays, AbstractSparseArray, SparseMatrixCSC, findnz, nnz,
69+
using SparseArrays: SparseArrays, AbstractSparseArray, findnz, nnz,
7070
nzrange, rowvals, sparse
7171
using ADTypes: ADTypes, KnownJacobianSparsityDetector
72-
using SparseConnectivityTracer: SparseConnectivityTracer, TracerSparsityDetector
72+
using SparseConnectivityTracer: SparseConnectivityTracer, TracerSparsityDetector, jacobian_sparsity
7373
using DifferentiationInterface: DifferentiationInterface,
7474
AutoSparse,
7575
AutoForwardDiff,
7676
prepare_jacobian
7777
using SparseMatrixColorings: GreedyColoringAlgorithm, sparsity_pattern
78-
using Symbolics: Symbolics
7978
using SciMLBase: SciMLBase
8079
using TimerOutputs: TimerOutput, print_timer, @timeit
8180
using UnicodePlots: UnicodePlots

src/common_operators/bilinear_operator.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,8 @@ function build_assembler!(A::AbstractMatrix, O::BilinearOperator{Tv}, FE_test, F
410410
coupling_matrix::Matrix{Bool} = ones(Bool, nansatz, ntest)
411411
if use_sparsity_pattern
412412
kernel_params = (result, input) -> (O.kernel(result, input, O.QP_infos[1]))
413-
sparsity_pattern = SparseMatrixCSC{Float64, Int}(Symbolics.jacobian_sparsity(kernel_params, zeros(Tv, op_offsets_test[end]), zeros(Tv, op_offsets_ansatz[end])))
413+
detector = TracerSparsityDetector()
414+
sparsity_pattern = jacobian_sparsity(kernel_params, zeros(Tv, op_offsets_test[end]), zeros(Tv, op_offsets_ansatz[end]), detector)
414415

415416
## find out which test and ansatz functions couple
416417
for id in 1:nansatz
@@ -779,7 +780,8 @@ function build_assembler!(A, O::BilinearOperator{Tv}, FE_test, FE_ansatz; time =
779780
coupling_matrix::Matrix{Bool} = ones(Bool, nansatz, ntest)
780781
if use_sparsity_pattern
781782
kernel_params = (result, input) -> (O.kernel(result, input, O.QP_infos[1]))
782-
sparsity_pattern = SparseMatrixCSC{Float64, Int}(Symbolics.jacobian_sparsity(kernel_params, zeros(Tv, op_offsets_test[end]), zeros(Tv, op_offsets_ansatz[end])))
783+
detector = TracerSparsityDetector()
784+
sparsity_pattern = jacobian_sparsity(kernel_params, zeros(Tv, op_offsets_test[end]), zeros(Tv, op_offsets_ansatz[end]), detector)
783785

784786
## find out which test and ansatz functions couple
785787
for id in 1:nansatz

src/common_operators/bilinear_operator_dg.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,8 @@ function build_assembler!(A, O::BilinearOperatorDG{Tv}, FE_test, FE_ansatz, FE_a
367367
coupling_matrix::Matrix{Bool} = ones(Bool, nansatz, ntest)
368368
if use_sparsity_pattern
369369
kernel_params = (result, input) -> (O.kernel(result, input, O.QP_infos[1]))
370-
sparsity_pattern = SparseMatrixCSC{Float64, Int}(Symbolics.jacobian_sparsity(kernel_params, zeros(Tv, op_offsets_test[end]), zeros(Tv, op_offsets_ansatz[end])))
370+
detector = TracerSparsityDetector()
371+
sparsity_pattern = jacobian_sparsity(kernel_params, zeros(Tv, op_offsets_test[end]), zeros(Tv, op_offsets_ansatz[end]), detector)
371372

372373
## find out which test and ansatz functions couple
373374
for id in 1:nansatz
@@ -782,7 +783,8 @@ function build_assembler!(A, O::BilinearOperatorDG{Tv}, FE_test, FE_ansatz; time
782783
coupling_matrix::Matrix{Bool} = ones(Bool, nansatz, ntest)
783784
if use_sparsity_pattern
784785
kernel_params = (result, input) -> (O.kernel(result, input, O.QP_infos[1]))
785-
sparsity_pattern = SparseMatrixCSC{Float64, Int}(Symbolics.jacobian_sparsity(kernel_params, zeros(Tv, op_offsets_test[end]), zeros(Tv, op_offsets_ansatz[end])))
786+
detector = TracerSparsityDetector()
787+
sparsity_pattern = jacobian_sparsity(kernel_params, zeros(Tv, op_offsets_test[end]), zeros(Tv, op_offsets_ansatz[end]), detector)
786788

787789
## find out which test and ansatz functions couple
788790
for id in 1:nansatz

test/runtests.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ using Metis
88
using Aqua
99
using Triangulate
1010
using SimplexGridFactory
11+
using Symbolics
1112

1213

1314
include("test_dgblf.jl")

0 commit comments

Comments
 (0)