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

Cannot create BandedMatrix from GhostDerivativeOperator #394

Closed
bclyons12 opened this issue May 13, 2021 · 2 comments
Closed

Cannot create BandedMatrix from GhostDerivativeOperator #394

bclyons12 opened this issue May 13, 2021 · 2 comments

Comments

@bclyons12
Copy link

Trying to concretize a GhostDerivativeOperator as a BandedMatrix is throwing an error for me:

using DiffEqOperators
using SparseArrays
using BandedMatrices
Δ = CenteredDifference(2, 2, 0.1, 7);
bc = Neumann0BC(0.1, 1);
#this works
display(sparse(Δ*bc))
#this fails
BandedMatrix(Δ*bc)

Output:

(
 -100.0   100.0      ⋅       ⋅       ⋅       ⋅       ⋅ 
  100.0  -200.0   100.0      ⋅       ⋅       ⋅       ⋅ 
     ⋅    100.0  -200.0   100.0      ⋅       ⋅       ⋅ 
     ⋅       ⋅    100.0  -200.0   100.0      ⋅       ⋅ 
     ⋅       ⋅       ⋅    100.0  -200.0   100.0      ⋅ 
     ⋅       ⋅       ⋅       ⋅    100.0  -200.0   100.0
     ⋅       ⋅       ⋅       ⋅       ⋅    100.0  -100.0, [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0])
ERROR: LoadError: MethodError: no method matching inbands_setindex!(::BandedMatrix{Float64, Matrix{Float64}, Base.OneTo{Int64}}, ::Vector{Float64}, ::Int64, ::UnitRange{Int64})
Closest candidates are:
  inbands_setindex!(::BandedMatrix, ::Any, ::Integer, ::Integer) at /Users/Lyons/.julia/packages/BandedMatrices/Gbqeq/src/banded/BandedMatrix.jl:443
  inbands_setindex!(::AbstractArray, ::Any, ::Integer, ::Integer) at /Users/Lyons/.julia/packages/BandedMatrices/Gbqeq/src/generic/indexing.jl:7
  inbands_setindex!(::LinearAlgebra.Adjoint, ::Any, ::Integer, ::Integer) at /Users/Lyons/.julia/packages/BandedMatrices/Gbqeq/src/generic/indexing.jl:16
  ...
Stacktrace:
 [1] BandedMatrix(Q::RobinBC{Float64, Vector{Float64}}, N::Int64)
   @ DiffEqOperators ~/.julia/packages/DiffEqOperators/DMNmH/src/derivative_operators/concretization.jl:126
 [2] BandedMatrix(A::GhostDerivativeOperator{Float64, DerivativeOperator{Float64, 1, false, Float64, StaticArrays.SVector{3, Float64}, StaticArrays.SVector{0, StaticArrays.SVector{4, Float64}}, StaticArrays.SVector{0, StaticArrays.SVector{4, Float64}}, Nothing, Nothing}, RobinBC{Float64, Vector{Float64}}}, N::Int64) (repeats 2 times)
   @ DiffEqOperators ~/.julia/packages/DiffEqOperators/DMNmH/src/derivative_operators/concretization.jl:718
@bclyons12
Copy link
Author

Seems related to #182 and #185

@bclyons12
Copy link
Author

This appears fixed with #432

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant