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

Making the animation shown in an example

–2 votes

In Flow past a dolphin
, what lines can I add to the example code to make the animation of temperature of water over time? (and save it as a movie)

asked Sep 21, 2013 by bshankar FEniCS Novice (790 points)

1 Answer

+1 vote
 
Best answer

Just dump the results to vtk or xdmf format at the end of each time step. Do animation in, e.g., Paraview. Add something like

f = File('dolfin.pvd')
def update(self):
    f << self.c_, self.t
Problem.update = update

update is the last thing called at the end of a time step.

answered Sep 23, 2013 by mikael-mortensen FEniCS Expert (29,340 points)
selected Oct 16, 2013 by bshankar
...