[petsc-users] VecGhostRestoreLocalForm

José Lorenzo joslorgom at gmail.com
Sat Jul 20 05:45:09 CDT 2019


Hello,

I am not sure I understand the function VecGhostRestoreLocalForm. If I
proceed as stated in the manual,

    VecGhostUpdateBegin
<https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Vec/VecGhostUpdateBegin.html#VecGhostUpdateBegin>(x,INSERT_VALUES
<https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/INSERT_VALUES.html#INSERT_VALUES>,SCATTER_FORWARD
<https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Vec/SCATTER_FORWARD.html#SCATTER_FORWARD>);

    VecGhostUpdateEnd
<https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Vec/VecGhostUpdateEnd.html#VecGhostUpdateEnd>(x,INSERT_VALUES
<https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/INSERT_VALUES.html#INSERT_VALUES>,SCATTER_FORWARD
<https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Vec/SCATTER_FORWARD.html#SCATTER_FORWARD>);

    VecGhostGetLocalForm
<https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Vec/VecGhostGetLocalForm.html#VecGhostGetLocalForm>(x,&xlocal);

    VecGetArray
<https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Vec/VecGetArray.html#VecGetArray>(xlocal,&xvalues);

       // access the non-ghost values in locations xvalues[0:n-1] and
ghost values in locations xvalues[n:n+nghost];

    VecRestoreArray
<https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Vec/VecRestoreArray.html#VecRestoreArray>(xlocal,&xvalues);

    VecGhostRestoreLocalForm
<https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Vec/VecGhostRestoreLocalForm.html#VecGhostRestoreLocalForm>(x,&xlocal)

Does VecRestoreArray update the values in the local vector xlocal, and
then VecGhostRestoreLocalForm update the values of the global vector
x?

Does one need to call these two functions?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20190720/ba103986/attachment.html>


More information about the petsc-users mailing list