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

List linear solvers

0 votes

Hi all,

I'm trying to list the linear solvers available on my machine,
but apparently there's somethin wrong with the methods

list_linear_solver_methods()
list_krylov_solver_methods()
list_krylov_solver_preconditioners()

or maybe I'm doing something wrong?
I think it's weird that it recognizes PETSc and Epetra are available, but no solvers are listed...

Does anyone has some advice?
Thanks in advance.

from dolfin import *

print "Has PETSc %s " %has_linear_algebra_backend("PETSc")
print "Has EPETRA %s " %has_linear_algebra_backend("Epetra")

parameters['linear_algebra_backend'] = 'Epetra'

print "available solvers"
print list_linear_solver_methods()
print list_krylov_solver_methods()
print list_krylov_solver_preconditioners()

print "available solvers"
list_linear_solver_methods()
list_krylov_solver_methods()
list_krylov_solver_preconditioners()

try:
    from PyTrilinos import Epetra, AztecOO, TriUtils, ML
except:
    print '''You Need to have PyTrilinos with'
    Epetra, AztecOO, TriUtils and ML installed
    for this demo to run'''
    exit()

The result (on my machine) is

Has PETSc True 
Has EPETRA True 
available solvers
None
available solvers
asked May 2, 2014 by stevenvdk FEniCS User (1,590 points)

Hi, it there no output to screen with the second call to list_foo? None in the first case
is understandable because that's what the methods return. They don't return strings.

1 Answer

0 votes

Hi,

Apparently by trying to print the output of the functions the first time,
the functions didn't produce an output the second time they were called.

So everything works by just calling the functions without the print statement.

Thank you for your reply.

answered May 2, 2014 by stevenvdk FEniCS User (1,590 points)
...