-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Triangle examples in examples/triangleexamples.jl fail #176
Comments
Perhaps as a simple first step it would be useful to just run these scripts as parts of the CI to just see if they run completely, e.g. in dir = readdir("./examples")
filter!(file -> endswith(file, ".jl"), dir)
for example_path in dir
script = joinpath("./examples", example_path)
mod = @eval module $(gensym()) end
Base.include(mod, script) # make sure each script is self-contained
end unless you have something else you usually do instead for this. |
That’s a great idea. Can you add a PR? |
Note that’s using the old ApproxFun version. We can probably change it to Laplacian(axes(S,1)) we should also add laplacian(S) which would match the diff(S) in 1D |
PR made. Yeah, I was trying to convert it to the newer version, and got to here before making this issue: using MultivariateOrthogonalPolynomials, SpecialFunctions
a, b, c = 1, 1, 1
S = WeightedTriangle(a, b, c)
xy = axes(S, 1)
x, y = first.(xy), last.(xy)
∆ = Laplacian(xy)
f = @. 1.0 + erf(5.0(1.0 - 10.0((x - 1/2)^2 + (y-1/2)^2)))
N = 500
M = sparse(∆[Block.(1:N), Block.(1:N)])
What's the correct code for reproducing Example 1 in the paper, i.e. |
Hmm I just checked and I realised that the code for partial derivatives for @simplify function *(Dy::PartialDerivative{2}, P::WeightedTriangle)
a,b,c = P.P.a,P.P.b,P.P.c
k = mortar(Base.OneTo.(oneto(∞)))
T = promote_type(eltype(Dy), eltype(P))
M = _BandedBlockBandedMatrix((k .+ convert(T, b+c))', axes(k,1), (-1,1), (-1,1)) # TODO: replace with correct formula
WeightedTriangle(a,b-1,c-1) * M # TODO: deal with the case where b or c are 0
end |
The examples here fail (below is Lines 1-12 from that file)
I believe in this case the fix is to do
S = WeightedTriangle(1, 1, 1)
? This error appears later in the script as well (might be some others too -Laplacian(S)
also errors -, but I haven't run it that far). I could try and fix it up later once I've looked into it all a bit more.The text was updated successfully, but these errors were encountered: