Ferrite.jl
Ferrite.jl copied to clipboard
Sparsity pattern entries for interface coupling is slow
For example:
using Ferrite
const n = 20
const grid = generate_grid(Hexahedron, (n, n, n))
const top = ExclusiveTopology(grid)
const dh = DofHandler(grid)
add!(dh, :u, Lagrange{RefHexahedron, 2}()^3)
add!(dh, :p, Lagrange{RefHexahedron, 1}())
add!(dh, :q, DiscontinuousLagrange{RefHexahedron, 1}())
close!(dh)
# Just couple q-q over the interface
const interface_coupling = [
false false false
false false false
false false true
]
@time create_sparsity_pattern(dh)
@time create_sparsity_pattern(dh; topology = top, cross_coupling = interface_coupling)
Gives
0.708471 seconds (3.04 k allocations: 3.653 GiB, 13.00% gc time, 2.40% compilation time)
16.754851 seconds (217.19 k allocations: 4.485 GiB, 1.05% gc time, 0.03% compilation time)
(Also happens with #888).
Unclear if https://github.com/Ferrite-FEM/Ferrite.jl/pull/1028 is enough to close this.