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.

Cannot create BandedMatrix from GhostDerivativeOperator #394

@bclyons12

Description

@bclyons12

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

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