Skip to content
This repository was archived by the owner on Jul 19, 2023. It is now read-only.
This repository was archived by the owner on Jul 19, 2023. It is now read-only.

full function for various boundary conditions #16

@shivin9

Description

@shivin9

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)
false

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions