On 3/2/26 19:22, Praveen C wrote:
>
> We also want to try GMRES on the entire block matrix with say ILU
> preconditioner, but does not seem to be possible, since all available ILU do
> not take block matrices.
>
> If we assemble into PETSc::BlockSparseMatrix, there is also no way to copy
> that into PETSc::SparseMatrix. So it looks like we have to switch to
> SparseMatrix during assembly itself for this purpose.
I think you misunderstand what the purpose of block matrices is, then. It is
not *necessary* to use block matrices just because you have a system of
equations. If you want to use solvers and preconditioners that work on the
*entire* matrix, then by all means assemble everything into a single matrix.
The point of block matrices and vectors is so that you *can* decompose the
matrix into blocks because you want to use a block preconditioner. But if
that's not what you want to do, then just don't use block objects.
Best
W.