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

solving mass-matrix systems, jacobi preconditioner?

0 votes

I'm upgrading an old FEniCS code where sometime I solve systems with the mass matrix

solve(
    a3 == L3, u1,
    bcs=u_bcs,
    solver_parameters={
        'linear_solver': 'iterative',
        'symmetric': True,
         'preconditioner': 'jacobi',
         'krylov_solver': {
             'relative_tolerance': tol,
             'absolute_tolerance': 0.0,
             'maximum_iterations': 100,
             'monitor_convergence': verbose
             }
         }
     )

Now, the 'jacobi' preconditioner is gone.

*** Error:   Unable to solve linear system.
*** Reason:  Unknown preconditioner method "jacobi". Use list_krylov_solver_preconditioners() to list available methods.

How do you solve your mass-matrix systems?

asked Mar 25, 2017 by nschloe FEniCS User (7,120 points)

1 Answer

+1 vote
 
Best answer

Not as short, but via the PETSc backend:

A, b = assemble_system(a, L, bc)

PETScOptions().set('ksp_view')
PETScOptions().set('ksp_monitor_true_residual')
PETScOptions().set('ksp_type', 'cg')
PETScOptions().set('pc_type', 'jacobi')
PETScOptions().set('atol', 0.0)

sol = PETScKrylovSolver()
sol.set_from_options()
sol.solve(A, w.vector(), b)
answered Mar 29, 2017 by dajuno FEniCS User (4,140 points)
selected Mar 29, 2017 by nschloe
...