briochemc / Inpaintings.jl

Inpaint `missing`, `NaN`, or other values in arrays with different methods
MIT License
4 stars 2 forks source link

Stencil-Type #8

Closed KonradScheffler closed 5 months ago

KonradScheffler commented 2 years ago

Hey,

I can not really follow which kind of stencil the code is producing for the laplacian. Could you elaborate a bit on this matter? It seems to stick to the horizontal neighbors, but is not producing a classical 5-point stencil in 2D/ 7-point stencil in 3D?

Best, Konrad

briochemc commented 2 years ago

From memory I think it just adds a [1, -2, 1] in each dimension, so a central -4 in 2D, a -6 in 3D, and so on.

briochemc commented 2 years ago

Do you have a MWE where it does not produce the classical stencil?

KonradScheffler commented 2 years ago

Yeah, the general structure looks like this, but when i build a classical 2D-5 point stencil by using the kronecker sum (klick) my laplacian with hom. dirichlet b.c. looks slightly different in the outer regions:

A=ones(3,3) n1,n1=size(A) S = spdiagm(n1,n1,-1=>ones(n1-1),0=>-2ones(n1),1=>ones(n1-1)) P = spdiagm(n2,n2,-1=>ones(n2-1),0=>-2ones(n2),1=>ones(n2-1)) Δ = kron(S,I(n1)) + kron(I(n2),P)

produces

grafik

but your code produces:

grafik

Is the difference due to other boundary conditions?

briochemc commented 2 years ago

Yes I think so!

briochemc commented 5 months ago

I'll close this but feel free to reopen if you think I did not answer your question!