Skip to content

Commit 038850f

Browse files
committed
ill-conditioned, probably need FEM
1 parent e4c09f8 commit 038850f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

examples/L-shaped Laplace.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ uy = T -> 3 + (T-1)*3
5656
Dx = Derivative([1,0])
5757
Dy = Derivative([0,1])
5858

59-
N = 100
59+
N = 30
6060
sprs = A -> (global N; sparse(A[Block.(1:N), Block.(1:N)]))
6161

6262
A = Matrix{SparseMatrixCSC{Float64,Int}}(undef, length(rs), length(ds))
@@ -114,14 +114,18 @@ M = hvcat(ntuple(_ -> size(A,2),size(A,1)), permutedims(A)...)
114114

115115
rhs = vcat(coefficients.(Fun.(Ref((x,y) -> real(exp(x+im*y))), rs[1:length(∂d)], N))...)
116116

117-
rhs = vcat(coefficients.(Fun.(Ref((x,y) -> x^2), rs[1:length(∂d)], N))...)
117+
rhs = vcat(pad.(coefficients.(Fun.(Ref((x,y) -> x^2), rs[1:length(∂d)])),N)...)
118118

119119

120120
F = factorize(M)
121121
u_cfs = F \ pad(rhs, size(M,1))
122122

123123
u1 = Fun(ds[4], u_cfs[(4-1)*sum(1:N)+1:4*sum(1:N)])
124124
u1(0.99,0.99)
125+
plot(abs.(u_cfs); yscale=:log10)
126+
127+
σ = svdvals(Matrix(M))
128+
plot(svdvals(Matrix(M)))
125129

126130
u1.coefficients
127131
u1(0.1,1.2)-real(exp(0.1+im*1.2))

0 commit comments

Comments
 (0)