-
-
Notifications
You must be signed in to change notification settings - Fork 72
Rebased #168 #246
Rebased #168 #246
Conversation
…as it is now later
…rrays for GhostDerivativeOperator
…ivativeOperator` an `AbstractDiffEqLinearOperator`
…ded concretization tests
… BC is purely periodic
- Rename some files to make them more consistent with the julia styleguide - Add some tests for concretizations - Remove duplicate method definition
| @test size(A) == (10, 10) | ||
| @test size(A, 1) == 10 | ||
| @test length(A) == 100 | ||
| @test_broken size(A) == (10, 10) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how did these break?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
edit: disregard this comment
one of my "rebase" commits changes A.L.len to size(A.L, 2) in the definition of size(::GhostDerivativeOperator) which all the broken tests rely on. I don't see any reason whatsoever why I would have done that -- both master and xtalax have A.L.len and I'm aware that those aren't the same thing. Best guess is I was being stupid. So I can fix that, but where should I commit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR to this branch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately I can't fix this. In doing this rebase, I was purely fixing things that didn't require me to make changes to what I saw as @xtalax's intentions/the code's semantics.
My mistake was today, not in the rebase. Today, I was mistakenly looking at xtalax:master rather than xtalax:#168 to figure out what the outcome is supposed to be.
In fact, xtalax:#168 does redefine size(A::GhostDerivativeOperator) = (size(A.L, 2),size(A.L, 2)). But the constructor for CenteredDifference(_, _, 10) will very definitely have second dimension of size 10+2. I don't know which definition of size (or maybe the constructor?) is wrong. So two different parts of the code have two clear but conflicting effects. I can start trying to fix the code's semantics, but that'll be a longer process.
edit: concisely, branch #168 breaks this test by redefining size(::GhostDerivativeOperator) and the rebase faithfully also breaks the test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would revert that change I think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted and passing. @ChrisRackauckas how often do you want me to PR from my personal branch into this branch?
| @@ -0,0 +1,36 @@ | |||
| using DiffEqOperators, DifferentialEquations, ProgressMeter | |||
| function main() | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xtalax note that this isn't needed anymore now that we are using @safetestsets
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
noted, i'll change that around on my next commit
|
Not sure if this is perfect, but perfect might be the enemy of good here. Let's make sure this is passing tests and get it merged. Then we can continue to clean up the other little pieces. I think the next thing I want to do is to try and start getting a real documentation together for this library to really take stock of where we're at. |
|
It looks like there's a lot of failing tests? Are there commits that were not on that branch? |
|
Doesn't look like this can merge because there's a ton of broken tests. |
| @time @safetestset "Upwind Operator Interface" begin include("upwind_operators_interface.jl") end | ||
| @time @safetestset "MOLFiniteDifference Interface" begin include("MOLtest.jl") end | ||
| @time @safetestset "Basic SDO Examples" begin include("BasicSDOExamples.jl") end | ||
| @time @safetestset "3D laplacian Test" begin include("3D_laplacian.jl") end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something's weird -- I'm not sure this is from the right commit. Line 23 of test/runtests.jl is causing an error that's fixed post-rebase (cf. https://github.com/xtalax/DiffEqOperators.jl/pull/26/files#diff-fce720c43af3c52c862fd7451c7374b8 which shows how I'd expect this file to look)
|
That's my guess, too, but I don't know why @xtalax changed it in the first
place, or if other new code relies on the new definition. If this PR is
still unresolved at the end of June (after a thesis committee meeting) I'd
be happy to jump in completely. Until then I wouldn't be comfortable
asserting a change like this. Still happy to resolve any rebase-related
problems in the meantime, since those are more mechanical and local. Though
depending on how long it takes to resolve the failing tests, I might just
need to run another rebase in a month....
…On Sun, Jun 7, 2020, 9:56 AM Christopher Rackauckas < ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In test/ghost_derivative_operators_interface.jl
<#246 (comment)>
:
> @@ -7,7 +7,7 @@ using DiffEqOperators, Test
A = L * Q
@test ndims(A) == 2
- @test size(A) == (10, 10)
- @test size(A, 1) == 10
- @test length(A) == 100
+ @test_broken size(A) == (10, 10)
I would revert that change I think?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#246 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AANS24FXNTTS3IGWBTQTIQ3RVOTCBANCNFSM4NVO4GSQ>
.
|
|
No worries. I think these test failures are what stalled it in the first place, so we can work through them whenever there's time. |
| @test As_l ≈ analytic_AL #This is true | ||
| @test As_b ≈ analytic_Ab #This is true | ||
| @test Vector(u .- analytic_Ab) ≈ Vector(u .- As_b) #this is true | ||
| @test_broken analytic_AL\Vector(u .- analytic_Ab) ≈ As_l\Vector(u .- As_b) #Then why isn't this working? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ChrisRackauckas this error and those just below are what stalled progress before - I really have no idea why this isn't working
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the test marked broken should definitely pass if the above three are passing, and yet it doesn't
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It feels like it has to be a bug in the one of the \ implementations (or, more likely, expected imprecision). Running everything in the REPL:
EDIT: added fourth_deriv_approx_stencil definition; other things that I accidentally got from including test file
julia> using DiffEqOperators
julia> function fourth_deriv_approx_stencil(N)
A = zeros(N,N+2)
A[1,1:8] = [3.5 -56/3 42.5 -54.0 251/6 -20.0 5.5 -2/3]
A[2,1:8] = [2/3 -11/6 0.0 31/6 -22/3 4.5 -4/3 1/6]
A[N-1,N-5:end] = reverse([2/3 -11/6 0.0 31/6 -22/3 4.5 -4/3 1/6], dims=2)
A[N,N-5:end] = reverse([3.5 -56/3 42.5 -54.0 251/6 -20.0 5.5 -2/3], dims=2)
for i in 3:N-2
A[i,i-2:i+4] = [-1/6 2.0 -13/2 28/3 -13/2 2.0 -1/6]
end
return A
end
julia> dx = 0.01; x = 0.01:dx:0.2; N=length(x); u=sin.(x); L = CenteredDifference(4, 4, dx, N); Q = RobinBC((1.0, 0.0, 0.0), (1.0, 0.0, sin(0.2+dx)), dx); A = L*Q;
julia> analytic_L = fourth_deriv_approx_stencil(N) ./ dx^4; analytic_QL = [transpose(zeros(N)); Diagonal(ones(N)); transpose(zeros(N))]; analytic_AL = analytic_L * analytic_QL; analytic_Qb = [zeros(N+1); sin(0.2+dx)]; analytic_Ab = analytic_L*analytic_Qb;
julia> using SparseArrays; As_l, As_b = sparse(A, length(u))
julia> analytic_AL \ Vector(u .- analytic_Ab) ≈ As_l \ Vector(u .- As_b)
false
julia> analytic_AL \ Vector(u .- analytic_Ab) ≈ Array(As_l) \ Vector(u .- As_b)
true
julia> methods(\, typeof.([analytic_AL, Vector(u .- analytic_Ab)]))
# 1 method for generic function "\":
[1] \(A::AbstractArray{T,2} where T, B::Union{AbstractArray{T,1}, AbstractArray{T,2}} where T)
in LinearAlgebra at /home/graham/.local/opt/julia-1.5.0/share/julia/stdlib/v1.5/LinearAlgebra
/src/generic.jl:1102
julia> methods(\, typeof.([As_l, Vector(u .- As_b)]))
# 1 method for generic function "\":
[1] \(A::SparseArrays.AbstractSparseMatrixCSC, B::Union{AbstractArray{T,1}, AbstractArray{T,2}} where T) in SparseArrays at /home/graham/.local/opt/julia-1.5.0/share/julia/stdlib/v1.5/SparseArrays/src/linalg.jl:1460
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I filed an issue with an MWE: JuliaLang/julia#37004. I'll mark this as broken for now and move on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They pointed out that the difference is within the expected range given the condition number of analytic_AL. I've revised the test to reflect that, and now it and a nearby similar test are passing. I imagine this is a problem in some other tests as well. Would we rather use a better conditioned matrix? I wouldn't know how to choose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just change the tolerance to be fit for the condition number. Any stencil operation is going to be pretty ill-conditioned (this is where the stiffness comes from)
|
Status update: Only two problem areas remaining.
|
|
The fallback
|
|
Awesome. Should this be passing then? |
|
Looks like there's a merge conflict. |
|
@ChrisRackauckas Nope! I don't have access to this branch; I was working on yet another fork. I've opened #279 which is rebased to master as of 20 minutes ago and is passing all tests on my machine. |
|
alright, let's continue there. |
| @assert size(ops[i]) == size(ops[1]) "Operators must be of the same size to be combined! Mismatch between $(ops[i]) and $(ops[i-1]), which are operators $i and $(i-1) respectively" | ||
| end | ||
| if cache == nothing | ||
| cache = Vector{T}(undef, size(ops[1], 1)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's zero this so errors with undef memory don't pop up.
No description provided.