Skip to content

Parallel writing of a Function in a VFS is broken #259

Description

@ctjacobs

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:
vtu_vfs

However, in parallel a pvtu file is produced and the output in paraview looks like:
pvtu_vfs
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.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions