Skip to content
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

CeedElemRestriction for H(curl) #1265

Merged
merged 16 commits into from
Aug 3, 2023
Merged

CeedElemRestriction for H(curl) #1265

merged 16 commits into from
Aug 3, 2023

Conversation

sebastiangrimberg
Copy link
Collaborator

Reopening #1168 from within CEED/libCEED for GitLab CI tests.

From #1168:

High-order H(curl) spaces (p > 1) in 3D involve pairs of element face dofs which must be treated specially in the L-vector to E-vector transformation. These transformations are more complicated than the simple sign flip accounted for in #889. In general, the pairs of dofs are transfomed by 2x2 blocks with entries {-1, 0, 1} to write the transformed E-vector dofs as linear combinations of the L-vector dofs. Thus, if each pair of face dofs are arranged to be consecutive in the element dof ordering, we can represent the transformation required as a tridiagonal matrix with entries {-1, 0, 1} applied to the E-vector. Note this is a (more expensive) generalization of the simple orientation flip case where the transformation matrix is just diagonal with entries {-1, 1}. Note that an alternative approach is to apply some global ordering of the nodes of the mesh as a preprocessing step after which a simple signed restriction suffices (like in https://epubs.siam.org/doi/10.1137/08073901X). However this strategy has its own shortcomings in particular when doing things like AMR.

More information can be found in this paper: https://dl.acm.org/doi/pdf/10.1145/3524456 (section 4.1.4, for example). See also mfem/mfem#1046 and https://github.com/mfem/mfem/blob/master/fem/doftrans.hpp for examples of how this transformation is handled in MFEM.

This PR adds CeedElemRestrictionCreateCurlOriented, which is similar to the CeedElemRestrictionCreateOriented constructor introduced in #889. Currently only implemented for CPU backends, with the main change coming in CeedElemRestrictionApply_Ref_Core.

Also adds some missing methods which should make blocked and opt backends work for oriented restrictions.

python/ceed_basis.py Outdated Show resolved Hide resolved
Copy link
Member

@jeremylt jeremylt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good to me 🎉 big feature update!

@sebastiangrimberg sebastiangrimberg force-pushed the sjg/hcurl-restr-dev branch 2 times, most recently from 1c725d0 to 7368813 Compare July 27, 2023 20:47
@sebastiangrimberg sebastiangrimberg force-pushed the sjg/hcurl-restr-dev branch 4 times, most recently from ecf8da0 to 4b31528 Compare July 31, 2023 23:00
Copy link
Member

@jedbrown jedbrown left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pipeline is clean now and coverage is better. Thanks.

@sebastiangrimberg
Copy link
Collaborator Author

sebastiangrimberg commented Aug 2, 2023

Pipeline is clean now and coverage is better. Thanks.

@jeremylt, do you have any last comments or is this ready to merge from your POV?

@sebastiangrimberg sebastiangrimberg merged commit 3843268 into main Aug 3, 2023
26 of 28 checks passed
@sebastiangrimberg sebastiangrimberg deleted the sjg/hcurl-restr-dev branch August 3, 2023 00:14
@sebastiangrimberg
Copy link
Collaborator Author

Thank you @jedbrown @jeremylt @nbeams @rezgarshakeri for all your help with this feature and PR! Now onto GPU backends for H(div) and H(curl)... 🚀

@rezgarshakeri
Copy link
Collaborator

Thank you @jedbrown @jeremylt @nbeams @rezgarshakeri for all your help with this feature and PR! Now onto GPU backends for H(div) and H(curl)... rocket

Thank you for this nice feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants