Skip to content

Conversation

@leo-collins
Copy link
Contributor

@leo-collins leo-collins commented Jan 5, 2026

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.

Comment on lines 473 to 457
"Can't yet cross-mesh interpolate onto function spaces made from VectorElements "
"or TensorElements made from sub elements with value shape other than ()."
Copy link
Contributor

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()
Copy link
Contributor

@pbrubeck pbrubeck Jan 23, 2026

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.

Copy link
Member

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.

@leo-collins leo-collins force-pushed the leo/cross-mesh-non-lagrange branch from 8de3837 to cb92d81 Compare January 26, 2026 23:08
@leo-collins leo-collins marked this pull request as ready for review January 27, 2026 15:34
* **Nedelec 1st kind/N1curl**,
* **Nedelec 2nd kind/N2curl**,
* **Gopalakrishnan-Lederer-Schoberl 1st kind/GLS**,
* **Gopalakrishnan-Lederer-Schoberl 2nd kind/GLS2**.
Copy link
Contributor

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.

Copy link
Member

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.

Copy link
Contributor

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:

  1. Generating this list at all.
  2. 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:
Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

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

Create DofTypeError

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants