-
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
firedrake/interpolation.py
Outdated
|
|
||
| point_eval, point_eval_input_ordering = self._get_symbolic_expressions() | ||
| # Interpolate into intermediate quadrature space for non-identity mapped elements | ||
| if into_quadrature_space := V_dest.ufl_element().mapping() != "identity": |
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.
Careful here with symmetric TensorElements
| weights = numpy.full(len(points.points), numpy.nan) # These can be any number since we never integrate | ||
| quad_scheme = QuadratureRule(points, weights, ref_el=V_element.cell) | ||
| element = FiniteElement("Quadrature", degree=V_element.degree, quad_scheme=quad_scheme) | ||
| return self._fs_type(V)(V.mesh(), element) |
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.
The Quadrature space is always scalar-valued, even if it came from a vector-valued space like RT. You should grab the value_shape, and not the Tensorness of the ufl element.
This should be generic enough, although it might be better to special case the scalar case
| return self._fs_type(V)(V.mesh(), element) | |
| return TensorFunctionSpace(V.mesh(), "Quadrature", degree=V_element.degree, quad_scheme=quad_scheme, shape=V.value_shape) |
| "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
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.