[petsc-users] Accessing non-local values of a vector

Satish Balay balay at mcs.anl.gov
Mon Jun 18 09:50:34 CDT 2018


You would have to use VecScatter.

http://www.mcs.anl.gov/petsc/documentation/faq.html#mpi-vec-access

Satish

On Mon, 18 Jun 2018, Najeeb Ahmad wrote:

> Hi all,
> 
> I am a novice user and I am trying to write my first project in PETSc. In
> my code, I need to get vector values that may be residing on other
> processes. I noticed that VecGetValues can get values on the same
> processor.  For instance, I need a calculation like this:
> 
> temp = (dy(i) + dy(i + xmax));           /// xmax is length along x -
> direction
> 
> where dy(i + xmax) may be on another processes. What is the best way to
> accomplish this?
> 
> Thanks
> 
> 



More information about the petsc-users mailing list