Dear petsc users,
I have parallel matrix A (mpiaij) and I would like to create a matrix B like
B = [A v
wT 0 ]
where wT and v are vectors.
A is involved in eigenvalue computation (slepc4py) and B will be used by a
direct solver.
Currently, the matrix A is built from a sparse scipy matrix thanks to
A.createAIJ, but I would like to avoid to create B from scipy. I am looking for
a more _petscic_ way to solve this problem.
I have read that it seems not possible to change a matrix structure after its
assembly. However
- Is there a way to build directly in petsc this kind of block matrix B to
reuse A ?
- Is there a way to convert the petsc matrix A into csr form and to create B as
new petsc matrix ?
- Is there a way to copy a matrix into another one with a different structure ?
- ...
My second question is similar, suppose I have three matrices A1, A2, C
resulting form coupled 2 FEM problems, what is the good way to create the
coupled global system
B = [A1 C
CT A2]
to use it with direct solver.
Thanks a lot,
Benoit