Skip to content

Commit 9d0a273

Browse files
committed
use spdiagm in Serre-Green-Naghdi equations
1 parent 526ea31 commit 9d0a273

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/DispersiveShallowWater.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import SciMLBase: u_modified!
3333

3434
@reexport using StaticArrays: SVector
3535
using SimpleUnPack: @unpack
36-
using SparseArrays: sparse, issparse
36+
using SparseArrays: sparse, spdiagm, issparse
3737
using SummationByPartsOperators: SummationByPartsOperators,
3838
AbstractDerivativeOperator,
3939
PeriodicDerivativeOperator, PeriodicUpwindOperators,

src/equations/serre_green_naghdi_1d.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ function assemble_system_matrix!(cache, h, D1, D1mat,
268268
# is not necessarily perfectly symmetric but only up to
269269
# round-off errors. We wrap it here to avoid issues with the
270270
# factorization.
271-
return Symmetric(Diagonal(M_h) + D1mat' * Diagonal(M_h3_3) * D1mat)
271+
return Symmetric(Diagonal(M_h) + D1mat' * spdiagm(M_h3_3) * D1mat)
272272
end
273273

274274
# variable bathymetry

0 commit comments

Comments
 (0)