[petsc-users] Getting global indices of vector distributed among different processes.

Matthew Knepley knepley at gmail.com
Wed Jan 4 09:52:04 CST 2023


On Wed, Jan 4, 2023 at 10:48 AM Venugopal, Vysakh (venugovh) via
petsc-users <petsc-users at mcs.anl.gov> wrote:

> Hello,
>
>
>
> Is there a way to get the global indices from a vector created from
> DMCreateGlobalVector? Example:
>
>
>
> If global vector V (of size 10) has indices {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
> and they are divided into 2 processes. Is there a way to get information
> such as (process 1: {0,1,2,3,4}, process 2: {5,6,7,8,9})?
>

https://petsc.org/main/docs/manualpages/Vec/VecGetOwnershipRange/

  Thanks,

     Matt


> The reason I need this information is that I need to query the values of a
> different vector Q of size 10 and place those values in V. Example: Q(1)
> --- V(1) @ process 1, Q(7) – V(7) @ process 2, etc.. If there are smarter
> ways to do this, I am happy to pursue that.
>
>
>
> Thank you,
>
>
>
> Vysakh V.
>
>
>
> ---
>
> Vysakh Venugopal
>
> Ph.D. Candidate
>
> Department of Mechanical Engineering
>
> University of Cincinnati, Cincinnati, OH 45221-0072
>
>
>


-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener

https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20230104/099c83ac/attachment.html>


More information about the petsc-users mailing list