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

Error with demo "demo_navier-stokes.py"

0 votes

When running the Demo for Navier-stokes in python, the following error comes up. How can I fix this to make the code run? I want to use it as an example to build a different fluid dynamics code.

Also, what will this demo export in terms of properties (i.e. pressure, water velocity, ect.)?

Error:

C:\FEniCS\share\dolfin\demo\pde\navier-stokes\python>python demo_navier-stokes.p
y
Computing tentative velocity
*** Warning: Requested preconditioner is not available for uBLAS Krylov solver
. Using ILU.
Solving linear system of size 15170 x 15170 (uBLAS Krylov solver).
Krylov solver converged in 0 iterations.
Computing pressure correction
Traceback (most recent call last):
File "demo_navier-stokes.py", line 114, in
solve(A2, p1.vector(), b2, "gmres", "amg")
File "C:\FEniCS\lib\site-packages\dolfin\fem\solving.py", line 254, in solve
return cpp.solve(args)
File "C:\FEniCS\lib\site-packages\dolfin\cpp.py", line 20119, in solve
return _cpp.solve(
args)
RuntimeError:

*** -------------------------------------------------------------------------
*** DOLFIN encountered an error. If you are not able to resolve this issue
*** using the information listed below, you can ask for help at


*** https://answers.launchpad.net/dolfin


*** Remember to include the error message listed below and, if possible,
*** include a minimal running example to reproduce the error.


*** -------------------------------------------------------------------------
*** Error: Unable to solve linear system using Krylov iteration.
*** Reason: Unknown preconditioner "amg". Use list_krylov_solver_preconditioners
() to list available preconditioners().
*** Where: This error was encountered inside KrylovSolver.cpp.
*** -------------------------------------------------------------------------

asked Oct 21, 2013 by veronichka92 FEniCS Novice (150 points)
edited Oct 21, 2013 by veronichka92

1 Answer

0 votes
 
Best answer

Your dolfin installation does not have "amg" and the function call
solve(A2, p1.vector(), b2, "gmres", "amg") does therefore not
work.

Check for available preconditioners using the function call

list_krylov_solver_preconditioners()

answered Oct 21, 2013 by Kent-Andre Mardal FEniCS Expert (14,380 points)
selected Oct 21, 2013 by veronichka92

I think I figured out what you meant. This is the response, do you know what this means?

list_krylov_solver_preconditioners()

Preconditioner | Description

default | default preconditioner
none | No preconditioner
ilu | Incomplete LU factorization

For anyone with the same problem:

when listing the preconditioners with list_krylov_solver_preconditioners() , if amg is not listed, then replace the solve(A2, p1.vector(), b2, "gmres", "amg") with solve(A2, p1.vector(), b2, "gmres", "default")

...