RestrictedDualSet: inherit entity permutations - #267
Conversation
An entity whose dofs are all kept by the restriction keeps their relative order, so it permutes under orientation exactly as it did before, and an entity whose dofs are all dropped permutes trivially. An entity that keeps only some of its dofs has no permutation to inherit, since the ones it drops may be where the parent permutation sends the ones it keeps, so no permutations are reported at all in that case. Without this a restricted element reports no entity permutations, and consumers that orient dofs entity by entity cannot lay out a restricted space consistently with the space it restricts. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
A restricted element reports no entity permutations without it, so a restricted space is not laid out consistently with the space it restricts. This PR is stacked on another branch rather than on main, which leaves 'base_ref' unrecognised, so PETSc has no branch to clone and the install fails before any test runs. Fall back to the main configuration, which is the one this branch is ultimately aimed at. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
A restricted element reports no entity permutations without it, so a restricted space is not laid out consistently with the space it restricts. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
A restricted element reports no entity permutations without it, so a restricted space is not laid out consistently with the space it restricts. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
A restricted element reports no entity permutations without it, so a restricted space is not laid out consistently with the space it restricts. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
A restricted element reports no entity permutations without it, so a restricted space is not laid out consistently with the space it restricts. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
A restricted element reports no entity permutations without it, so a restricted space is not laid out consistently with the space it restricts. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> (cherry picked from commit f8f2cb5)
Why is this useful?
I don't understand what this means. |
Consistency in the entity permutations ensures a consistent entity numbering between a FunctionSpace(RestrictedElement) and its unrestricted parent, so that we can use SF/Section to assign across restrictions firedrakeproject/firedrake#5287
RestrictedElement is generic, it can keep any subset of the DOFs on each entity. The most common restrictions are topological, so all DOFs on one entity are either kept or dropped, and propagating the entity permutations is allowed when all DOFs are kept. If only some DOFs are kept, we cannot keep the permutations because then the parent permutation might send parent DOFs to where the child has dropped them. |
I just want to make sure that this is unrelated to
I guess I have no idea why the entity permutations affect the global data layout. In principle we should be able to support assigning to arbitrary restricted elements using your new approach. |
The entity permutations were introduced to ensure a consistent DOFs numbering when redistributing a FunctionSpace (via Checkpointing). We only enable them for CG and DG spaces on simplices. Sure, the SF/Section approach can be made as general as one like, but I'm afraid that mismatching entity-permutations might cost you extra book-keeping that can otherwise be resolved with something so simple as having children elements that obey their parents. I think we can always come back to get the niche case of partrial restrictions on an entity. Either way, this PR is good on its own. |
I'm afraid I still don't see why this PR helps with anything. I have just grepped for |
It does no harm having consistent numbering in the node lists between the Mathematically in FIAT, the restriction operation should propagate every piece of information of the element. Suppose you have a FunctionSpace with no interior DOFs and you restrict it to the facets, the restriction should be a noop. Without this PR that restriction silently gives you a different space. |
This makes perfect sense. I am happy with that argument. I just get concerned when reasons are given that don't make sense. |
Cover degree 1,2 Lagrange facet restrictions, and add a case where restricting to a single dof on a shared entity drops permutations entirely. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Before this PR,
RestrictedElementreported no entity permutations, and consumers that orient dofs entity by entity cannot lay out a restricted space consistently with the space it restricts.By inheriting permuations, an entity whose dofs are all kept by the restriction will keep their relative order, so it would permute under orientation exactly as in the unrestricted case, and an entity whose dofs are all dropped permutes trivially.
An entity that keeps only some of its dofs (a very niche case) has no permutation to inherit, since the ones it drops may be where the parent permutation sends the ones it keeps, so no permutations are reported at all in that case.