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

tutorial sample ft08_navier_stokes_cylinder

+1 vote

This test case runs slower and slower as time goes. It take 1 second to finish the first 30% time-stepping but takes more than 5 seconds to run a single step in the last 20% of time stepping. I read the file and thought that the computational complexity shall not increase over time. Anyone have the similar observation? Thanks! - yc

asked May 23, 2017 by yzhou FEniCS Novice (150 points)

1 Answer

+2 votes

Yes, I see the same slowdown when running that script. It seems to be caused by the call to plot in line 139:

plot(u_, title='Velocity')

When I remove this line, the script runs with the same speed for all time steps.

answered May 24, 2017 by johannr FEniCS Expert (17,350 points)

This is it - thanks!

I waited over 24 to have the simulation get to only 54%. Commented out the plot and it finished in just a couple minutes! Thanks!

This seems to only be a problem with the Matplotlib backend, not the VTK backend.

...