-
Notifications
You must be signed in to change notification settings - Fork 93
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
Update some missing Lagrange docs #889
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #889 +/- ##
=======================================
Coverage 93.60% 93.60%
=======================================
Files 39 39
Lines 5879 5883 +4
=======================================
+ Hits 5503 5507 +4
Misses 376 376 ☔ View full report in Codecov by Sentry. |
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.
Nice!
Just some formatting fix suggestions while we are at it...
Co-authored-by: Knut Andreas Meyer <knutam@gmail.com>
I noticed that on master some things can be now done in a better way (i.e. without relying on assumptions taken between the interpolation and cell) so I updated it. Also some dispatches were missing, which I added for completeness of the API. |
I just saw that #935 has quite a bit of overlap here, so we need to decide on a merge order. |
CI failure seems to be the github CDN or CI servers choking
|
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.
LGTM if if removing changes in grid.md as discussed on Slack, and fixes the comments
Example to be reinserted separately. Now to a full example. Let us reconstruct the local facets of a grid boundary with the described machinery to see how everything julia> function recompute_facetset_on_boundary(cells, global_facets)
# Facets in 2D are edges and have two vertices
d = Dict{NTuple{2, Int}, FacetIndex}()
for (c, cell) in enumerate(cells) # c is global cell number
# Grab all local facets
local_facets = Ferrite.reference_facets(cell)
for (f, facet) in enumerate(local_facets) # f is local facet number
# Translate into global nodes
global_facet = ntuple(i-> cell.nodes[facet[i]], length(facet))
d[global_facet] = FacetIndex(c, f)
end
end
facets = Vector{FacetIndex}()
for facet in global_facets
# lookup the element, local facet combination for this facet
push!(facets, d[facet])
end
return facets
end
julia> recompute_facetset_on_boundary(cells, facets)
Vector{FacetIndex} with 2 elements:
FacetIndex((2, 2))
FacetIndex((4, 2)) Note that this example can be simplified by directly using julia> function recompute_facetset_on_boundary_alternative(cells, global_facets)
# Facets in 2D are edges and have two vertices
d = Dict{NTuple{2, Int}, FacetIndex}()
for (c, cell) in enumerate(cells) # c is global cell number
# Grab all local facets
for (f, global_facet) in enumerate(Ferrite.facets(cell)) # f is local facet number
d[global_facet] = FacetIndex(c, f)
end
end
facets = Vector{FacetIndex}()
for facet in global_facets
# lookup the element, local facet combination for this facet
push!(facets, d[facet])
end
return facets
end
julia> recompute_facetset_on_boundary_alternative(cells, facets)
Vector{FacetIndex} with 2 elements:
FacetIndex((2, 2))
FacetIndex((4, 2)) |
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.
Spotted a few more things when going through carefully
Co-authored-by: Knut Andreas Meyer <knutam@gmail.com>
Co-authored-by: Knut Andreas Meyer <knutam@gmail.com>
…le) info. A future PR should introduce a page with more context and add the reference to this page into the docstring.
…le) info. A future PR should introduce a page with more context and add the reference to this page into the docstring.
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.
Nice!
A lot of discussion for a small docs PR :)
But I think we ended up with some quite important improvements / clarifications in the end!
No description provided.