-
Notifications
You must be signed in to change notification settings - Fork 178
Leo/cross mesh non lagrange #4804
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
base: main
Are you sure you want to change the base?
Conversation
8e05539 to
416fcde
Compare
| "Can't yet cross-mesh interpolate onto function spaces made from VectorElements " | ||
| "or TensorElements made from sub elements with value shape other than ()." |
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.
This should no longer be the case after this PR
| elif len(shape) == 1: | ||
| return partial(VectorFunctionSpace, dim=shape[0]) | ||
| else: | ||
| symmetry = V.ufl_element().symmetry() |
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.
Just a comment, the Quadrature space may or not enforce the symmetry, but it is always preferable to enforce it. This means that VomOntoVomInterpolator needs to support interpolation of symmetric tensors.
Also related to this, some elements are intrinsically symmetric-valued (all basis functions are symmetric) even when the ufl_element().symmetry() is None, for example HHJ and Regge. This is similar to the case of intrinsically vector-valued elements like RT, where the basis functions are vector-valued but they don't need a VectorElement.
What I am trying to say with this is that when we have intrisic symmetry we can always reduce the size of the Quadrature space by further inspecting the finat elements. But for now, the current approach to construct the Quadrature space seems fine.
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.
Can we turn this into an issue.
8de3837 to
cb92d81
Compare
| * **Nedelec 1st kind/N1curl**, | ||
| * **Nedelec 2nd kind/N2curl**, | ||
| * **Gopalakrishnan-Lederer-Schoberl 1st kind/GLS**, | ||
| * **Gopalakrishnan-Lederer-Schoberl 2nd kind/GLS2**. |
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.
I think some elements are missing (Regge). Maybe add a comment saying that if the same-mesh interpolation works, then the cross mesh interpolation should also work.
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.
I think that a hand-written list in the documentation like this is just asking to be out of date. Do we have a way of determining from the code whether we can interpolate into a space? If so, then I think the right thing to do would be to mark on the automatically generated list of supported elements which ones can be the target of interpolation.
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.
There are two parts to achieving this:
- Generating this list at all.
- Inserting the list into the website.
I don't know how to do 1, but for 2 you should look at how we do this for other things in the docs Makefile (example).
| symmetry = V.ufl_element().symmetry() | ||
| return partial(TensorFunctionSpace, shape=shape, symmetry=symmetry) | ||
|
|
||
| def _get_quadrature_space(self, V: WithGeometry) -> WithGeometry: |
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.
This is now superfluous once #4839 lands.
| DofNotDefinedError | ||
| If any DoFs in the target mesh cannot be defined in the source mesh. | ||
| If any of the target spaces dofs cannot be defined in the source mesh. | ||
| ValueError |
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.
Create DofTypeError
Implement cross-mesh interpolate into non-point evaluation spaces.
To do this we first construct a quadrature space which has point-evaluation dofs at the quadrature points of the target element. We then cross-mesh interpolate into this space. Finally, we interpolate from this quadrature space into the target space.