This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Bug in how vtk files are written in Fenics 1.5.0?

0 votes

I discovered that the otherwise very simple code i wrote in Fenics 1.0.0 for producing data for a paraview animation does not work in Fenics 1.5.0, despite it following the still valid example given in this demo. My code is essentially:

pfile = File("results/pressure.pvd")
while t < T :
    solve(A, p.vector(), b)
    pfile << p

It turns out that after installing Fenics 1.5.0, running the code above, within each new vtk output file, the DataArray is given a new name. This is very inconvenient as the solution in each time-step is then treated as a new separate variable in paraview rather than just a new DataSet of the same variable. As such, it seems i would need to manually rename the DataArray in each of the 2000 or so vtk files.

My question: Is this a bug or a feature? If it is a feature, how do i make it stop?

Also, the vtk output files are now written with doubles instead of floats, is there a way of forcing it to write floats?

asked Jun 2, 2015 by ASN FEniCS Novice (630 points)

1 Answer

+1 vote
 
Best answer

You may need to rename your Function each timestep, e.g.

p.rename('p','p')

answered Jun 2, 2015 by chris_richardson FEniCS Expert (31,740 points)
selected Jun 2, 2015 by ASN

Thank you for the quick answer, it worked!

...