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

What linear solver and preconditioner are used when both are set to "default" (Assuming using PETSc backend).

0 votes

I have used info() to try and find this out, but have not been able pin down exactly what is meant by "default." I have played around with using "default" for the linear solver, and then coupled it with different preconditioners (e.g. amg, hypre-euclid) and based on the variation in run times I am led to believe that the "default" solver is some iterative method, but I am not sure which one it is (e.g. cg, bicgstab, etc.). This however, appears to be in contradiction with the Dolfin manual where it states that the default solver (at least for the PETSc backend) is LU (a direct method). I have set the log_level to DEBUG as well to try and see what is going on "under-the-hood", but this has not provided me with any information either.

asked Jan 30, 2016 by Tim FEniCS Novice (190 points)

What kind of problem are you solving?

A standard linear variational problem. Here is explicitly, how I am calling it:
solve(lhs(F) == rhs(F), solution, bcs = bcs, solver_parameters={"linear_solver": "default", "preconditioner":"default"}).

1 Answer

+2 votes

Maybe use the following line and take a look to the LinearVariationalSolver.cpp (lines 129 to 173), LinearSolver.cpp and solve.h (in general, more information can be found in dolfin/la directory) files might be useful for you

info(LinearVariationalSolver.default_parameters(), True)
answered Feb 1, 2016 by hernan_mella FEniCS Expert (19,460 points)
edited Feb 1, 2016 by hernan_mella

Hernan,
Thank you for the advice. I was able to find what what I was looking for in LinearSolver.cpp, where it states that if (method == "default") and if (preconditioner == "default") then, method = "lu" and preconditioner = "none".

...