On 29/11/16 13:49, Francis Poulin wrote:
Hello David,
Thanks a lot for the help. Some responses/follow ups below.
1) Sorry that I foolishly forgot to call the solver. That was a pretty silly mistake on my part.
2) Thanks for the advice on what solver to use. That makes a lot of sense.
3) The plot does show up. But it only lasts for a second before it vanishes. Any idea how to get it to last longer?
The plotting we have is designed for interactive use, you can run, for example with ipython: ipython -i my_script.py Then, you'll drop into a prompt when you're done, and you can interact then. See https://ipython.readthedocs.io/en/stable/interactive/plotting.html for how to interact with matplotlib within ipython.
4) I agree that the SW solver should also be modified to use LU. But at the moment I am using the generic solver and it doesn't converge. I suspect it's because the boundary conditions are not set up correctly. If I wanted to set no-normal flow BCs in my BDM velocity field I am doing the following, The fact that it doesn't converge makes me think that it is not set up correctly.
bc = DirichletBC(Z.sub(0), Constant((0, 0)), (1, 2, 3, 4))
If you have a linear problem that is not converging with an iterative method, switching to a direct solve will at least (if that then converges) give you confidence that your formulation is right, you just need to work harder on preconditioning. If the direct solver doesn't work, then you'll want to go back and figure out the problem with your formulation. Lawrence