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

How do I disable the preconditioner in FENICS 1.0(Windows)?

+1 vote

I write on a big cfd simulation based on a real problem and have to solve 60000 x 60000 systems and the preconditioner wich I´m forced to use
(I tried "solver_parameters={"linear_solver": "gmres","preconditioner": "none"}")
fails:

Error: Unable to initialize uBLAS ILU preconditioner.
Reason: Zero pivot detected in row 4352.
Where: This error was encountered inside uBLASILUPreconditioner.cpp.

I don´t want to sacrifice 2GB to Linux because I have only 8GB and I need Windows, too.
Also I want to keep this Simulation portable for other students who need the results but know even less of FENICS than me.
Finally we have old and idle computers in our lab so spending more time on iterations
is more affordable than installing Linux...

asked Aug 14, 2013 by Billy_Six FEniCS Novice (160 points)

I would rather recommend to think of a preconditioner that suits your problem. As the error message tells you, the ILU has a problem with zero-blocks in your system and the "none" seems to be ignored. What kind of problem are you trying to solve? Incompressible Navier-Stokes?

Problem is that any preconditioner requested will be ignored by buggy uBLASKrylovSolver(method=”default”, preconditioner=”default”) constructor and ILU will be used.

1 Answer

0 votes

This bug has been fixed in 1.0.1. I guess there are only 1.0.0 binaries available for windows.

You may circumvent buggy uBLASKrylovSolver(method=”default”, preconditioner=”default”) constructor by

solver = uBLASKrylovSolver('gmres', uBLASDummyPreconditioner())

but unfortunately uBLASDummyPreconditioner is not exposed in python interface so this would work only in C++. You may try to embed this C++ workaround to python using compile_extension_module.

answered Aug 14, 2013 by Jan Blechta FEniCS Expert (51,420 points)
How do I use this compile_extension_module exactly

Don't copy whole code of uBLASDummyPreconditioner.h. Try rather to embed something like this

boost::shared_ptr<uBLASKrylovSolver> gmres_wo_precond() {
  boost::shared_ptr<uBLASKrylovSolver> 
    solver(new uBLASKrylovSolver('gmres', uBLASDummyPreconditioner()));
  return solver;
}

to python using compile_extension_module. This should be probably possible as uBLASKrylovSolver should be typemapped between C++ and python. Proper expert for this issue is Johan.

First I want to thank you for you help.
Unfortunatly my python compiler(Fenics 1.0.0 Windows) treats the indentations after a multi-line string wrong(I tried both versions) and isn´t able to execute c++-code(The error i posted yesterday was one version of the problem the other one says "unexpected indent".) so I see two "solutions":

  1. I recompile the scource of a "fixed" ublasKrylovsolver and place it in my personal distribution

  2. I have to rewrite the whole Program in c++.

  1. good luck with windows - chances of getting help with this are pretty low.

It seems to me that you would do better installing Ubuntu. Its lightweight variant Lubuntu takes ca. 3GB (plus FEniCS and its dependencies) and runs very fast on older machines. It can coexist with windows and in optimal case installer takes care of everything. You just need to download an image and burn it on CD.

python compiler(Fenics 1.0.0 Windows) treats the indentations after a multi-line string wrong

There may be caveats with mixing spaces/tabs (avoid tabs) and LF(unix style newline) / CR+LF(windows style newlines). You should be able to put pure C++ code in separate file and read it as a str by python. Just try which newline style works.

None worked so I installed virtual box + ubuntu 13 and Fenics as shown on the Fenics page.
Then I tried to compile my program and got this result:

billy@billy-VirtualBox:~/windkanal$ python Hauptprogamm.py
Traceback (most recent call last):
File "Hauptprogamm.py", line 1, in
from dolfin import*
File "/usr/lib/python2.7/dist-packages/dolfin/init.py", line 23, in
from dolfin.cppimports import *
File "/usr/lib/python2.7/dist-packages/dolfin/cppimports.py", line 4, in
import dolfin.cpp as cpp
ImportError: No module named cpp

There is a bug in the Ubuntu package on Ubuntu 13.04. Please use the packages from the FEniCS PPA instead. This will also give you the latest stable release of FEniCS (1.2.0).

...