Skip to content

Commit

Permalink
fix conversion to BandedMAtrix for coupling of one Legendre operator
Browse files Browse the repository at this point in the history
  • Loading branch information
ranocha committed Apr 28, 2020
1 parent 32d2b47 commit cdbdaca
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "SummationByPartsOperators"
uuid = "9f78cca6-572e-554e-b819-917d2f1cf240"
author = ["Hendrik Ranocha"]
version = "0.4.0"
version = "0.4.1"

[deps]
ArgCheck = "dce04be8-c92d-5529-be00-80e4d2c0e197"
Expand Down
5 changes: 3 additions & 2 deletions src/banded_matrices.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function BandedMatrix(D::BandedDerivativeOperator)
e[j] = 1
mul!(dest, D, e)
e[j] = 0
B.data[end-j-l+1:end,j] = dest[1:j+l]
B.data[end-j-l+1:end-j-l+min(j+l,length(e)),j] = dest[1:min(j+l,length(e))]
end
# inner part
for j in max(l,u)+1:length(e)-max(l,u)
Expand All @@ -44,7 +44,8 @@ function BandedMatrix(D::BandedDerivativeOperator)
e[j] = 1
mul!(dest, D, e)
e[j] = 0
B.data[1:length(e)+1-j+u,j] = dest[j-u:end]
# B.data[1:length(e)+1-j+u,j] = dest[j-u:end]
B.data[1+max(1,j-u)-(j-u):length(e)+1-j+u,j] = dest[max(1,j-u):end]
end

B
Expand Down
4 changes: 1 addition & 3 deletions test/coupling_test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ using SummationByPartsOperators
@test u v
@test integrate(u, cD) sum(mass_matrix(cD) * u)
@test integrate(u->u^2, u, cD) sum(u' * mass_matrix(cD) * u)
if N > 1
@test cD * u BandedMatrix(cD) * u
end
@test cD * u BandedMatrix(cD) * u
@test cD * u Matrix(cD) * u
@test cD * u sparse(cD) * u
end
Expand Down

2 comments on commit cdbdaca

@ranocha
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/13782

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.4.1 -m "<description of version>" cdbdaca40c405d6db5735943a5dc41a33c184201
git push origin v0.4.1

Please sign in to comment.