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

How to name the variables when writing to vtk file?

+8 votes

I use

vfile << v, t

to write a function v at a time instance t to a file vfile = File('results/vel.pvd'). When I open the file in paraview, I find that the variable is named something like f_nn , where nn changes for each t.

How can I define a consistent name for the variable?

asked Oct 14, 2013 by Jan FEniCS User (8,290 points)

'consistent' is not the right term. I need a 'constant' name.

1 Answer

+11 votes
 
Best answer

Not sure what you mean with consistent? By default the name is "f". You can change that by:

v.rename("something", "label")

where "label" is some sort of description of your Function

answered Oct 15, 2013 by johanhake FEniCS Expert (22,480 points)
selected Oct 15, 2013 by Jan

Yes, that solves it. Thank you. I meant, that I got a different name in each iteration, what leads to crashes in paraview.

...