Writing a Function in a VFS in parallel results in an incorrect pvtu file. For example, running this code:
from firedrake import *
mesh = UnitSquareMesh(2, 2)
VFS = VectorFunctionSpace(mesh, "CG", 1)
f = Function(VFS)
f.interpolate(Expression(("cos(x[0])", "sin(x[1])")))
File("vfs.pvd") << f
in serial produces a vtu file with the correct result. This is what the magnitude looks like in paraview:

However, in parallel a pvtu file is produced and the output in paraview looks like:

and no longer gives the choice of viewing just the x, y or z component.
The problem is that the NumberOfComponents attribute in <PDataArray NumberOfComponents="1" type="Float64" Name="function_1005"> is always being set to 1. For Functions in a VFS, this needs to be set to 3.
Writing a Function in a VFS in parallel results in an incorrect pvtu file. For example, running this code:
in serial produces a vtu file with the correct result. This is what the magnitude looks like in paraview:

However, in parallel a pvtu file is produced and the output in paraview looks like:

and no longer gives the choice of viewing just the x, y or z component.
The problem is that the
NumberOfComponentsattribute in<PDataArray NumberOfComponents="1" type="Float64" Name="function_1005">is always being set to 1. For Functions in a VFS, this needs to be set to 3.