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

Commit 448c401

Browse files
fix tests and overwrites
1 parent b8366aa commit 448c401

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

src/derivative_operators/BC_operators.jl

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,8 @@ struct GeneralBC{T, V<:AbstractVector{T}} <:AffineBC{T,V}
8686
end
8787

8888
#implement Neumann and Dirichlet as special cases of RobinBC
89-
NeumannBC::AbstractVector{T}, dx::AbstractVector{T}, order) where T = RobinBC([zero(T), one(T), α[1]], [zero(T), one(T), α[2]], dx, order)
90-
NeumannBC::AbstractVector{T}, dx::AbstractVector{T}) where T = RobinBC([zero(T), one(T), α[1]], [zero(T), one(T), α[2]], dx)
91-
92-
DirichletBC::AbstractVector{T}, dx::AbstractVector{T}, order) where T = RobinBC([one(T), zero(T), α[1]], [one(T), zero(T), α[2]], dx, order)
93-
DirichletBC::AbstractVector{T}, dx::AbstractVector{T}) where T = RobinBC([one(T), zero(T), α[1]], [one(T), zero(T), α[2]], dx)
89+
NeumannBC( α::AbstractVector{T}, dx::AbstractVector{T}, order=1) where T = RobinBC([zero(T), one(T), α[1]], [zero(T), one(T), α[2]], dx, order)
90+
DirichletBC::AbstractVector{T}, dx::AbstractVector{T}, order=1) where T = RobinBC([one(T), zero(T), α[1]], [one(T), zero(T), α[2]], dx, order)
9491

9592
# other acceptable argument signatures
9693
RobinBC(al::T, bl::T, cl::T, dx_l::T, ar::T, br::T, cr::T, dx_r::T, order = 1) where T = RobinBC([cl,al,bl], [cr, ar, br], [dx_l, dx_r], order)
@@ -135,9 +132,6 @@ function SparseArrays.sparse(Q::AffineBC{T,V}, N::Int) where {T,V}
135132
SparseMatrixCSC(Q,N)
136133
end
137134

138-
LinearAlgebra.Array(Q::PeriodicBC{T}, N::Int) where T = [transpose(zeros(T, N-1)) one(T); Diagonal(ones(T,N)); one(T) transpose(zeros(T, N-1))]
139-
140-
141135
LinearAlgebra.Array(Q::PeriodicBC{T}, N::Int) where T = Array([transpose(zeros(T, N-1)) one(T); Diagonal(ones(T,N)); one(T) transpose(zeros(T, N-1))])
142136
SparseArrays.SparseMatrixCSC(Q::PeriodicBC{T}, N::Int) where T = [transpose(zeros(T, N-1)) one(T); Diagonal(ones(T,N)); one(T) transpose(zeros(T, N-1))]
143137
SparseArrays.sparse(Q::PeriodicBC{T}, N::Int) where T = SparseMatrixCSC(Q,N)

test/robin.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#using LinearAlgebra, DiffEqOperators, Random, Test
1+
using LinearAlgebra, DiffEqOperators, Random, Test
22

33
# Generate random parameters
44
al = rand(5)
@@ -34,7 +34,7 @@ for i in 1:5
3434

3535
@test length(Qextended) 5i+2
3636

37-
#test the test
37+
#test the test
3838
@test (u[1]*(bl[i]/dx_l[i]))/(al[i]-bl[i]/dx_l[i]) -u[1] / (1-al[i]*dx_l[i]/bl[i])
3939
@test (u[end]*(br[i]/dx_r[i]))/(ar[i]+br[i]/dx_r[i]) u[end] / (1+ar[i]*dx_r[i]/br[i])
4040

0 commit comments

Comments
 (0)