The code seems fine. But just so you know the VTK legacy reader has some limitation. It was written quickly in a plane so we could get some geometry in. I would recommend using the vtp format if you can.