OK. I am supposed to destroy the matrix returned by MatISGetMPIXAIJ ?
Yes Also, my example still not get the final assembled local matrix (the MatCreateSubMatrix returns an empty matrix) but as far as I understand my (global) index set is OK: what did I miss ?
I really doubt you can use the example you have sent. It doesn’t compile, as MatCreateSubMatrix needs an extra argument. Attached a modified version that does what I guess is what you are looking for (sequential Dirichlet problems on the subdomains).
Franck
De: "Stefano Zampini" <[email protected]> À: "Franck Houssen" <[email protected]> Cc: "petsc-dev" <[email protected]>, "PETSc users list" <[email protected]>, "petsc-maint" <[email protected]> Envoyé: Mardi 23 Mai 2017 13:16:18 Objet: Re: [petsc-dev] Using PETSc MatIS, how to get local matrix (= one domain) before and after assembly ?
MatISGetMPIXAIJ is collective, as it assembles the global operator. To get the matrices you are looking for, you should call MatCreateSubMatrix on the assembled global operator, with the global indices representing the subdomain problem. Each process needs to call both functions
Stefano
<matISLocalMat.cpp>
|
matISLocalMat.cpp
Description: Binary data