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

Venugopal, Vysakh (venugovh) venugovh at mail.uc.edu
Fri Jan 6 17:21:53 CST 2023


Thank you, Matthew!

From: Matthew Knepley <knepley at gmail.com>
Sent: Wednesday, January 4, 2023 10:52 AM
To: Venugopal, Vysakh (venugovh) <venugovh at mail.uc.edu>
Cc: petsc-users at mcs.anl.gov
Subject: Re: [petsc-users] Getting global indices of vector distributed among different processes.


External Email: Use Caution


On Wed, Jan 4, 2023 at 10:48 AM Venugopal, Vysakh (venugovh) via petsc-users <petsc-users at mcs.anl.gov<mailto: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/<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpetsc.org%2Fmain%2Fdocs%2Fmanualpages%2FVec%2FVecGetOwnershipRange%2F&data=05%7C01%7Cvenugovh%40mail.uc.edu%7C365cb9cf491f40c0905f08daee6ba834%7Cf5222e6c5fc648eb8f0373db18203b63%7C1%7C0%7C638084443414359044%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=u1YCZsZA9ZQPdMGG4kUAXfKRGIRTu%2FNwf3B2Ya6N7L0%3D&reserved=0>

  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/<https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.cse.buffalo.edu%2F~knepley%2F&data=05%7C01%7Cvenugovh%40mail.uc.edu%7C365cb9cf491f40c0905f08daee6ba834%7Cf5222e6c5fc648eb8f0373db18203b63%7C1%7C0%7C638084443414359044%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=tByewTx8jvHGDe9ECCmwP5ZKUtRWB%2Fy50ZJgJ3ofizI%3D&reserved=0>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20230106/d2ab569c/attachment.html>


More information about the petsc-users mailing list