Yeah! I think! You are completely right! Thanks for your suggestion. I would definitely look at them!
Thanks Amir From: Matthew Knepley [mailto:knep...@gmail.com] Sent: Thursday, March 22, 2018 2:25 AM To: Mohammad Hassan Baghaei <mhbagh...@mail.sjtu.edu.cn> Cc: PETSc <petsc-users@mcs.anl.gov> Subject: Re: [petsc-users] Global Numbering On Wed, Mar 21, 2018 at 2:18 PM, Mohammad Hassan Baghaei <mhbagh...@mail.sjtu.edu.cn <mailto:mhbagh...@mail.sjtu.edu.cn> > wrote: Sorry ! In fact, I am trying to construct the radius and theta coordinate for the circular domain I am having before going to the main local functions. I needed that for my local functions. It sounds like you are having trouble with parallel programming. Maybe get your stuff working in serial, and then look at a book like Using MPI by Gropp, et.al <http://et.al> . or Scientific Computing by Eijkhout to understand more about parallelism. Thanks, Matt From: Matthew Knepley [mailto:knep...@gmail.com <mailto:knep...@gmail.com> ] Sent: Thursday, March 22, 2018 1:45 AM To: Mohammad Hassan Baghaei <mhbagh...@mail.sjtu.edu.cn <mailto:mhbagh...@mail.sjtu.edu.cn> > Cc: PETSc <petsc-users@mcs.anl.gov <mailto:petsc-users@mcs.anl.gov> > Subject: Re: [petsc-users] Global Numbering On Wed, Mar 21, 2018 at 1:28 PM, Mohammad Hassan Baghaei <mhbagh...@mail.sjtu.edu.cn <mailto:mhbagh...@mail.sjtu.edu.cn> > wrote: I am trying to fill a vector based on global coordinate. You can see how this might be too vague for me to follow. As I am trying to use VecGetValues() on the global coordinate, Okay, this does not work for any parallel vector. I find it that argument goes out of range, since I am using global numbering rather than local numbering. It is not the numbering that is a problem. It is that parallel Vectors in PETSc are distributed. You cannot directly access data you do not own. You can send it to one process (for example using VecScatterCreateToZero()), but this is of course not scalable. Thanks, Matt From: Matthew Knepley [mailto:knep...@gmail.com <mailto:knep...@gmail.com> ] Sent: Wednesday, March 21, 2018 10:38 PM To: Mohammad Hassan Baghaei <mhbagh...@mail.sjtu.edu.cn <mailto:mhbagh...@mail.sjtu.edu.cn> > Cc: PETSc <petsc-users@mcs.anl.gov <mailto:petsc-users@mcs.anl.gov> > Subject: Re: [petsc-users] Global Numbering On Wed, Mar 21, 2018 at 8:18 AM, Mohammad Hassan Baghaei <mhbagh...@mail.sjtu.edu.cn <mailto:mhbagh...@mail.sjtu.edu.cn> > wrote: Hello I am trying to create a global vector of coordinates based on the parallelized dm. I find it really hard to work with the local numbering, how can I manage to create a kind of numbering on global level so that I could easily access to the nodes based on the new numbering. Thanks for your time. DMGetCoordinates() gives you a global vector. DMGetCoordinatesLocal() gives you a local vector. What are you trying to do? Thanks, Matt Amir -- 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.caam.rice.edu/~mk51/> -- 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.caam.rice.edu/~mk51/> -- 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.caam.rice.edu/~mk51/>