Dear FEniCS community,
I would like to know about possible API for setting the solver type of a PETSc assembled matrix.
https://www.mcs.anl.gov/petsc/petsc4py-current/docs/apiref/petsc4py.PETSc.Mat.SolverType-class.html
Hence, I did’t put together a MWE.
Context for such a need:
Case 1:
When assembling a matrix with block structure M = \begin{bmatrix} A & - D^{\top}\\
D & C + \tau B \end{bmatrix}, the default solver type is “superlu” and a choice of GMRES with ILU works fine.
Case 2:
When using some implicit RK method, assembled matrix has block structure N = \begin{bmatrix} \tau Q \otimes A & - \tau Q \otimes D^{\top}\\
I \otimes D & I \otimes C + \tau Q \otimes B \end{bmatrix}, the default solver type becomes “superlu_dist” and a choice of GMRES with ILU throws the following error:
Traceback (most recent call last):
File "/tmp/mystorage/scilibs/ellhypar/ellhypar/precond_implicit.py", line 327, in <module>
diagnose()
File "/tmp/mystorage/scilibs/ellhypar/ellhypar/precond_implicit.py", line 267, in diagnose
for ind, (u_n, p_n, t) in enumerate(solutions):
File "/tmp/mystorage/scilibs/ellhypar/ellhypar/ellpar/implicit.py", line 300, in solve_steps
self.solver.solve(b_vec, dUP.vector)
File "PETSc/KSP.pyx", line 403, in petsc4py.PETSc.KSP.solve
petsc4py.PETSc.Error: error code 92
[0] KSPSolve() at /usr/local/petsc/src/ksp/ksp/interface/itfunc.c:1078
[0] KSPSolve_Private() at /usr/local/petsc/src/ksp/ksp/interface/itfunc.c:843
[0] KSPSetUp() at /usr/local/petsc/src/ksp/ksp/interface/itfunc.c:407
[0] PCSetUp() at /usr/local/petsc/src/ksp/pc/interface/precon.c:990
[0] PCSetUp_ILU() at /usr/local/petsc/src/ksp/pc/impls/factor/ilu/ilu.c:127
[0] MatGetFactor() at /usr/local/petsc/src/mat/interface/matrix.c:4590
[0] See https://petsc.org/release/overview/linear_solve_table/ for possible LU and Cholesky solvers
[0] MatSolverType superlu_dist does not support factorization type ILU for matrix type seqaij
Thanks a lot.