Interpolate into complex-valued vector function

I don’t think you’re doing anything wrong. You should, however, consider interpolating to a DG-1 function space and using VTXWriter for exporting results, as noted here:

Below, I compare the real part of the y-component, exported with interpolation into a DG-1 space (plots labeled “VTK”) and without interpolation into a DG-1 space (plots labeled “XDMF”). You can see that the error depends on the type of discretization (left, right, or crossed).

In general, the erroneous nonzero y-component is very small, as you can see by plotting your interpolated field with a “Glyph” filter, so I would guess that the interpolation is giving you the best representation of the plane wave that you can achieve with RT elements.

3 Likes