[petsc-users] setting ghost padding region

Guido Giuntoli giuntoli1991 at gmail.com
Sun Oct 29 17:20:09 CDT 2017


I have a ghost vector "b" and I want to work with my local representation
adding values in my local part and my ghost padding region. Is this
possible or I have to use VecSetValues ?


VecGhostGetLocalForm( b , &b_loc );
                                                            VecGetArray(
b_loc, &b_arr );
...
VecSetValues( b_loc, n , index, r_e, ADD_VALUES );
VecRestoreArray( b_loc, &b_arr ); // this communicate something in the
ghost padding region ?

I tried to see the code of VecRestoreArray but does not seem to be
communicating anything. I am seeing some routines and I think that adding

VecGhostUpdateBegin(b, ADD_VALUES, SCATTER_REVERSE);
VecGhostUpdateEnd(b, ADD_VALUES, SCATTER_REVERSE);

can do what I want, i.e. adding the ghost padding regions on all the
processes that correspond.Is this true ? Thank you, Guido.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20171029/546a7d8b/attachment.html>


More information about the petsc-users mailing list