Best way to construct 2-D Laplacian banded matrix: BandedMatrices, sparse, or BlockBandedMatrices?

A version of BlockBandedMatrices.jl that supports 3D would be awesome! Keep hoping to find a phd student interested in that project: any good undergrads listening, please consider applying to Imperial!

3 Likes

Hi Chris!

Graet work you are doing in the DiffEqOperators package.
I was trying to use the solution you suggested to create a 2D Laplacian matrix, but I can’t seem to manage to be able to concretize it to the right Array.

This is my mwe (julia 1.6, DiffEqOperators 4.29.0)

using LinearAlgebra, DiffEqOperators, Plots

n = 10

Lxx = CenteredDifference{1}(2,2,1.,n) 
Lyy = CenteredDifference{2}(2,2,1.,n) 
D = Lxx + Lyy

heatmap(Array(D, (n,n)))
png("mwe.png")

I get the heatmap on the right, while I’d expect something closer to the one on the left.

Is there anything wrong that I am doing?
Or is this the expected behavior?

Thanks!
Fabio

That is definitely odd. Open an issue.