[petsc-users] global indices of a vector in each process

Barry Smith bsmith at petsc.dev
Mon Jan 30 10:18:22 CST 2023


  VecGetOwnershipRange() works with any vector, including DM created vectors. You could not have the global ownership you provide below.

  Perhaps you are thinking about the Natural ownership values? For those if you using DMDA take a look at DMDAGetAO() and DMDACreateNaturalVector()

  Barry


> On Jan 30, 2023, at 10:36 AM, Venugopal, Vysakh (venugovh) via petsc-users <petsc-users at mcs.anl.gov> wrote:
> 
> Hello,
>  
> I am using a DMCreateGlobalVector to create a vector V. If V is divided into m processes, is there a way to get the global indices of V assigned to each process?
>  
> For example: V = [10, 20, 30, 40, 50, 60, 70, 80].
> If MPI process 0 has [10, 40, 50, 60] and process 1 has [20, 30, 70, 80], is it possible to get the indices for process 0 as [0,3,4,5] and process 1 as [1,2,6,7]?
>  
> Thanks,
>  
> Vysakh
> ---
> Vysakh Venugopal
> Ph.D. Candidate
> Department of Mechanical Engineering
> University of Cincinnati, Cincinnati, OH 45221-0072

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20230130/06a0e385/attachment.html>


More information about the petsc-users mailing list