-
Notifications
You must be signed in to change notification settings - Fork 5
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
Multigrid #117
Multigrid #117
Conversation
I can do the algebra by hand with |
TODO: See whether today's 1-form prolongation and restriction functions work when you do give multigrid invertible operators, even if they're not physically interesting. |
Decapodes related todos:
|
(They do not.) |
@KevinDCarlson Is the trie backend necessary for the multigrid feature? |
@lukem12345 It's not strictly necessary but GeometricMaps go through it and bypassing that would make construction of what would be just implicitly GeometricMaps less safe. |
Does the notion of GeometricMap as given in this PR require a trie/ simplex tree backend? I'm just looking at how to modularize the code in this PR (after merging). |
Yes, essentially; a geometric map is fully defined by its action on 0-simplices but that means it's only well defined on simplicial complexes. |
Gotcha. The requirement is that it is capable of being faithfully represented as a trie/ simplex tree, which are guaranteed to only represent simplicial complexes. This goes for the differential operators in this package too (assuming they are going to be used for DEC purposes), and further that they are manifold-like. Those functions typically just assume the simplicial complex requirements are met. Aside, I added a helper function for one of the manifold-like conditions that seemed more likely to occur in practice. Is there a test for the case in which a SimplicialSet that is not a SimplicialComplex has the |
I believe it'll error with something about trying to duplicate a simplex. |
Awesome. It sounds like a method that does |
@lukem12345 I'll factor the simplicial complexes stuff out of this PR then. |
It is time to start getting this code reviewed and merged. Lets factor the SimplicialComplex / Trie / Geometric Map stuff into one PR and then do the multigrid stuff in a second PR. The first PR should now be stable since we successfully used those APIs for the multigrid effort. |
I think I resolved the merge conflicts correctly. The \flat_mat code was the part I am least confident in. |
@jpfairbanks The simplicial complexes etc are supposed to be covered in #101 , if we want to bring that one back up for review. |
Co-authored-by: Kevin Carlson <[email protected]>
Changes "D_" to "dual_" in DualComplex schemas. There's some handedness bug still in the comparison between this and the `subdivide` function.
The flat operators from main are the ones that need to be used, for whoever rebases next. |
I kept both versions since they had different signatures. This branch currently has three versions. function ♭(s::AbstractDeltaDualComplex2D, X::AbstractVector, ::PPFlat)
map(edges(s)) do e
# Assume linear-interpolation of the vector field across the edge,
# determined solely by the values of the vector-field at the endpoints.
vs = edge_vertices(s,e)
l_vec = 1/2*(X[vs][1]+X[vs][2])
e_vec = (point(s, tgt(s,e)) - point(s, src(s,e))) * sign(1,s,e)
dot(l_vec, e_vec)
end
end
function ♭_mat(s::AbstractDeltaDualComplex2D)
♭_mat(s, ∂(2,s))
end
♭_mat(s::AbstractDeltaDualComplex2D, f::DPPFlat) =
♭_mat(s, ∂(2,s), f) Should we delete any of them? |
New type signatures were added to the old |
@KevinDCarlson I just did that directly on this branch. |
b90a4ba
to
10a4903
Compare
Something is wrong with loading the torus mesh (which I've commented out) and maybe with BuildKite, but otherwise everything seems to be working here, would be happy for somebody to start reviewing. |
Likely guess is that it is saved as a JSON ACSet, and this PR renamed some Homs. |
Ahhh, nice. The |
Ah, now I remember; the renaming makes it much easier and more resilient to write automatic migrations from a dual complex to the schema for its associated primal type. Anyway, it's reverted since we weren't really using |
src/Multigrid.jl
Outdated
allunique(map(1:ntriangles(s)) do i triangle_vertices(s,i) end) | ||
end | ||
|
||
function triforce_subdivision(s) |
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.
Calling this either binary or medial subdivision would work
I've tried to separate out the multigrid-specific work from the last couple of months from the work applying to simplicial complexes and geometric maps more generally which is covered in #101 . You might diff this with
multiscale
rather thanmain
for easiest review.The main output and good entry point so far is the
stokes.md
notebook.