Fix interpolation for Arguments of zany spaces#286
Open
Conversation
Previously we only checked if any coefficients in the source expression needed a coordinate mapping, but we should also check if any arguments do.
When determinining if the kernel needs a coordinate mapping we need to check if terminal elements need it (e.g. VectorElement(Argyris)). Previously we only checked the top-level element type which was incorrect for this case.
wence-
commented
Jan 30, 2023
| @needs_coordinate_mapping.register(finat.HDivElement) | ||
| @needs_coordinate_mapping.register(finat.HCurlElement) | ||
| def _needs_coordinate_mapping_finat_hdivcurl(element): | ||
| return needs_coordinate_mapping(element.wrappee) |
Contributor
Author
There was a problem hiding this comment.
I put this here because it meant I didn't need a PR in finat as well, but probably finat should offer a traverse function that yields all the elements in a structured element. Everything needs special-casing because elements don't have regular "children" slots.
e.g. ideally you would just write (if you don't care about ordering)
def traverse(element):
yield element
yield from map(traverse, element.children)
wence-
commented
Jan 30, 2023
| expr = ufl.TestFunction(Q) | ||
| to_element = create_element(V.ufl_element()) | ||
| kernel = compile_expression_dual_evaluation(expr, to_element, V.ufl_element()) | ||
| assert kernel.needs_external_coords |
Contributor
Author
There was a problem hiding this comment.
Not checking for correctness, just that a kernel actually comes out the other end.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously we only checked if any coefficients in the source expression needed a coordinate mapping, but we should also check if any arguments do.