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

Unable to set MUMPS as linear solver

0 votes

Hello

Prior to dolfin 1.3.0, I was able to set the linear solver to MUMPS using

NonlinearVariationalProblem MyNonlinearVariationalProblem( F, up, bcs, J);
NonlinearVariationalSolver mysolver( MyNonlinearVariationalProblem );
mysolver.parameters["linear_solver"]="mumps";

but now I get

*** Error: Unable to access parameter.
*** Reason: Parameter "nonlinear_variational_solver.linear_solver" not defined.
*** Where: This error was encountered inside Parameters.cpp.

What's the new method of setting the linear solver?

asked Feb 8, 2014 by gennadiy FEniCS Novice (590 points)

1 Answer

+2 votes
 
Best answer

Hi, try

mysolver.parameters["newton_solver"]["linear_solver"] = "mumps"
answered Feb 9, 2014 by MiroK FEniCS Expert (80,920 points)
selected Feb 10, 2014 by gennadiy

When I make the change, I get

/home/gennadiy/test/main.cpp: In function ‘int main()’:
/home/gennadiy/test/main.cpp:263:57: error: conversion from
‘dolfin::Parameter’ to ‘long int’ is ambiguous
/home/gennadiy/test/main.cpp:263:57: note: candidates are:
/home/gennadiy/FEniCS/include/dolfin/parameter/Parameter.h:109:13:
note: virtual dolfin::Parameter::operator bool() const
/home/gennadiy/FEniCS/include/dolfin/parameter/Parameter.h:103:13:
note: virtual dolfin::Parameter::operator double() const
/home/gennadiy/FEniCS/include/dolfin/parameter/Parameter.h:100:13:
note: virtual dolfin::Parameter::operator std::size_t() const
/home/gennadiy/FEniCS/include/dolfin/parameter/Parameter.h:97:13:
note: virtual dolfin::Parameter::operator int() const

Hi, I didn't notice that you weren't using python interface. The cpp call should be

mysolver.parameters("newton_solver")["linear_solver"] = "mumps"; 

Thanks. That worked fine.

Hi,

I am using this channel since it seems like a similar issue.

I tried the above example on my cpp code with:

LinearVariationalProblem problem( a, L, u, bc);
LinearVariationalSolver solver( problem );
solver.parameters("newton_solver")["linear_solver"]="mumps";
solver.solve();

Unfortunately, I am getting the error

Error: Unable to access parameter.
Reason: Parameter "linear_variational_solver.newton_solver" not defined.
Where: This error was encountered inside Parameters.cpp.

How can I solve this ?

...