Use generated functions for edgedof_indices and facedof_indices#1293
Use generated functions for edgedof_indices and facedof_indices#1293
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1293 +/- ##
=======================================
Coverage 94.30% 94.30%
=======================================
Files 40 40
Lines 6762 6748 -14
=======================================
- Hits 6377 6364 -13
+ Misses 385 384 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Nice! Do we want the order of the indices in such a way that cross(dxdxi, dxdeta) (on the face) is a outward pointing normal? It seems like we test something like that here. Also, I guess if we re-implement n_indices_on_face and(::Interpolation) n_indices_on_edge(::Interpolation) which we once had but deleted, we can also generate the functions facedofs_interior_indeices and edgedofs_interior_indices. |
Currently, we don't have the mapping (AFAIK) for reducing from a facet of a Line 214 in 236eb50
That would assume that we follow the current ordering scheme which would contradict e.g. #1188 I think (CC: @termi-official) since this has to be aligned with how the |
I initially ordered them in a way that we can map between codimensional entities back and forth. So if your hex' faces are ordered in such that your normal is outwards pointing, then the faces in terms of assigned quads preserve this property.
How? |
I guess something like function edgedof_interior_indices(ip)
n = sum(vdofs -> sum(vdofs; init=0), vertexdof_indices(ip))
dofs = Any[]
for i = 1:nedges(ip)
push!(dofs, ntuple(i -> n + i, n_indices_on_edge(ip)))
n += n_indices_on_edge(ip)
end
return dofs
endbut as generated ? But this assumes dof-numbering Probably be shouldn't go overboard with the generation, but we could of course probably define the shape functions on a per-entity basis following the |
|
Not sure if I would do that tbh. I really like the addition to always generate these two functions, because it is just error prone to sync with the functions uses during dof distribution. Especially since we want some very specific convention to be follows. Instead of adding back |
Yes, I'm not suggesting that we should do that here. This PR is only to add the generated function for the non-interior indices on edges and faces, since these are pure duplication of information already provided, just in a different format. Is it the current content of this PR that you don't like, or is it the addition in the comment above? |
The latter, because it is quite arbitrary. |
Have tracked this down: Ferrite-FEM/FerriteInterfaceElements.jl#32 |
|
As I do not think this is an urgent feature for someone to have immediately, let us wait until downstream has a fix and then merge. |
Downstream fixed |
termi-official
left a comment
There was a problem hiding this comment.
The Lagrange and Nedelec implementations were genuine wrong by not respecting the local orderings correctly. Other than that this should be a nice and helpful simplification!
Let us postpone any discussion on the convention for these orderings until we have cases where these orderings actually matter. Then we can also add suitable tests.
Where is that specified (asking since I obviously missed that when adding the Nedelec)? |
This removes the need to manually implement these.
While tests pass, the following changes occur for
facedof_indices:The numbering scheme as not been fully clear for
facedof_indices, and with this PR we also ensure that it is consistent between interpolations.test script