[petsc-users] Get global column indices thay belong to another process?

Smith, Barry F. bsmith at mcs.anl.gov
Sun Mar 3 16:01:21 CST 2019



> On Mar 3, 2019, at 3:04 PM, Appel, Thibaut via petsc-users <petsc-users at mcs.anl.gov> wrote:
> 
> Assuming you preallocate/assemble a MPIAIJ matrix “by hand” using a ISLocalToGlobalMapping object obtained from DMDA: what’s the easiest way to get global column indices that do not belong to a process? 
> 
> Say, if you have a finite-difference stencil and the stencil exceeds the portion owned by the process.
> 
> I think the way to go is to preallocate a MPIAIJ matrix using local information with MatPreallocateSetLocal and then fill values with MatSetLocal, those routines can’t work with rows/columns not owned by the process right?

   Yes, MatSetValuesLocal() cannot write for matrix locations that are NOT in the ghosted region of the process.

> 
> Thank you,
> 
> Thibaut



More information about the petsc-users mailing list