- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 235
 
Closed
Labels
Description
Describe the bug π
In #2567, it seems that the sparsity pattern is modified using the mass_matrix outside of the DI pipeline (see #2567 (comment)). This is an issue because:
- during preparation, the 
sparsity_detectorfromAutoSparsewon't be aware of this change - during preparation, the 
coloring_algorithmfromAutoSparsewill compute a coloring for the unmodified sparsity pattern, and prepare decompression accordingly - during execution, the function 
SparseMatrixColorings.decompress!will either error or return incorrect results because it expected the unmodified sparsity pattern 
This problem was detected by Deltares/Ribasim#2201
Expected behavior
Any modification of the sparsity pattern should be done in a way that allows the sparsity_detector to see it.
Minimal Reproducible Example π
Not available yet.
Error & Stacktrace 
The typical stack trace could look something like:
ERROR: DimensionMismatch: all inputs to eachindex must have the same indices, got Base.OneTo(28) and Base.OneTo(26)
Stacktrace:
  [1] throw_eachindex_mismatch_indices(::IndexLinear, ::Base.OneTo{Int64}, ::Vararg{Base.OneTo{Int64}})
    @ Base ./abstractarray.jl:325
  [2] eachindex
    @ ./abstractarray.jl:393 [inlined]
  [3] eachindex
    @ ./abstractarray.jl:382 [inlined]
  [4] decompress!
    @ ~/.julia/packages/SparseMatrixColorings/BED6Y/src/decompression.jl:361 [inlined]
  [5] _sparse_jacobian_aux!(::Tuple{typeof(Ribasim.water_balance!), Vector{Float64}}, 
  [6] jacobian!
    @ ~/.julia/packages/DifferentiationInterface/7eD1K/ext/DifferentiationInterfaceSparseMatrixColoringsExt/jacobian.jl:237 [inlined]Environment (please complete the following information):
- Output of 
using Pkg; Pkg.status() 
Not available yet
- Output of 
using Pkg; Pkg.status(; mode = PKGMODE_MANIFEST) 
Not available yet
- Output of 
versioninfo() 
Not available yet
Additional context
This should only happen for people who have upgraded to OrdinaryDiffEqDifferentiation v1.5.0, released a few hours ago
SouthEndMusic