I wonder what is the best approach to solve a matrix equation of the form AX=B in PETSc, where A is full rank. I have read about the matSolve method from petsc4py.PETSc, but I cannot find a simple usage example. Any help or workaround would really be appreciated.
Then I would first do an LU decomposition once, by calling PC.setUp() after setting the the ksp type preonly and preconditioner to LU.
Otherwise there is no benefit, as an iterative solver would be dependent on the RHS