This repository was archived by the owner on Jul 19, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 72
This repository was archived by the owner on Jul 19, 2023. It is now read-only.
full function for various boundary conditions #16
Copy link
Copy link
Closed
Description
The full(A) functionality to retrieve the matrix of transpositions needs to be updated to correctly accommodate the various boundary conditions eg. Dirichlet and Neumann.
For Dirichlet with a specific boundary condition it is working as follows:-
julia> A = LinearOperator{Float64}(2,2,1.0,10,:D1,:D1;bndry_fn=(u[1],u[end]));
julia> full(A)
10×10 Array{Float64,2}:
1.84135 2.84135 1.84135 … 1.84135 1.84135 1.84135
-1.84135 -3.84135 -0.841347 -1.84135 -1.84135 -1.84135
0.0 1.0 -2.0 0.0 0.0 0.0
0.0 0.0 1.0 0.0 0.0 0.0
0.0 0.0 0.0 0.0 0.0 0.0
0.0 0.0 0.0 … 0.0 0.0 0.0
0.0 0.0 0.0 1.0 0.0 0.0
0.0 0.0 0.0 -2.0 1.0 0.0
0.0 -0.0136593 -0.0136593 0.986341 -2.01366 1.0
0.0 0.0136593 0.0136593 0.0136593 1.01366 -1.0 with the matrix multiplication not getting the right values at the boundaries.
julia> res = A*u
401-element Array{Float64,1}:
0.0392531
-0.00115466
-0.00111008
-0.00106763
-0.0010272
-0.000988661
-0.000951915
-0.000916862
-0.00088341
-0.00085147
⋮
-1.54722e-6
-1.53094e-6
-1.51485e-6
-1.49893e-6
-1.48318e-6
-1.46761e-6
-1.45221e-6
-1.43698e-6
-0.00013916
julia> full(A)*u
401-element Array{Float64,1}:
-215.342
215.38
-0.00111008
-0.00106763
-0.0010272
-0.000988661
-0.000951915
-0.000916862
-0.00088341
-0.00085147
⋮
-1.54722e-6
-1.53094e-6
-1.51485e-6
-1.49893e-6
-1.48318e-6
-1.46761e-6
-1.45221e-6
1.55873
-1.55887
julia> res[3:398]≈(full(A)*u)[3:398]
true
julia> res≈(full(A)*u)
falseChrisRackauckas
Metadata
Metadata
Assignees
Labels
No labels