-
Notifications
You must be signed in to change notification settings - Fork 6
Fix cellparents interpolation #54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix cellparents interpolation #54
Conversation
|
Additionally, using julia> xgrid = ringsector(0.5:0.1:1., linspace(0.,2π-π/4,10);eltype = Triangle2D); xgrid = uniform_refine(xgrid, 3); source_space = FESpace{H1Pk{2,2,2}}(xgrid); target_space = FESpace{H1Pk{2,2,1}}(uniform_refine(xgrid, 1; store_parents = true)); source_fevector = FEVector(source_space); interpolate!(source_fevector[1], (result,qpinfo) -> (x=qpinfo.x; result[1] = sin(4 * pi * x[1]) * sin(4 * pi * x[2]))); target_fevector = FEVector(target_space);
julia> @btime lazy_interpolate!(target_fevector[1], source_fevector; use_cellparents = false)
19.943 ms (188336 allocations: 7.14 MiB)
julia> @btime lazy_interpolate!(target_fevector[1], source_fevector; use_cellparents = true)
18.271 ms (148128 allocations: 6.61 MiB)Surprisingly, the speedup is not very great, though and should probably be looked into at some point. |
…_cellparents in lazy_interpolate!
8042988 to
836c351
Compare
|
It seems that the upstream test for The Should be easily fixed by setting the |
|
It would seem this runs through fine now. I added a |
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.
Looks good (apart from the suggestions below), thanks!
As pointed out in #53 , the
use_cellparentsflag inlazy_interpolatedoesn't seem to work right.The issue was that for higher order interpolations, the
MomentInterpolator'sQPInfoobject was initialized with acellindex of 1 and never actually filled with any useful info. @pjaap and I updated it to fill it with simply the first best incident cell info (extracted fromEdgeCells).Not sure if I did it right or if there are cases and assembly types that need special treatment.
This also contains your revisions, @chmerdon to the
evaluate!functions inlazy_interpolatewhich made a slight difference in allocations.I tried to check the speedup for a nasty grid case (b/c on convex domains this hardly makes a difference,
lastnonzerocellis simply very good there). But this revealed another problem (see #55).HINT:
ExtendableGridsneeds to be checked out to#100for this to run