[petsc-users] some problem with the VecCreateGhost.

Matthew Knepley knepley at gmail.com
Thu Aug 15 06:12:19 CDT 2013


On Thu, Aug 15, 2013 at 1:30 AM, 丁老师 <ztdepyahoo at 163.com> wrote:

> I want to know
> 1. What is the relationship between Vhat and LocalVhat. Is the LocalVhat a
> copy of the Vhat plus the Ghost values. I think the LocalVhat will consume
> more memeory than the Vhat, am i right?
>

No, the reuse the same memory.


> 2. can i direct call VecGetArrary to the Vhat if i do not operate on the
> ghost value.
>

Yes.

   Matt


>     Vec Vhat;
>     Vec LocalVhat;
>     double* VhatVec;
>
>
> VecCreateGhost(PETSC_COMM_WORLD,aMesh->Nx*aMesh->Ny/Commsize,PETSC_DECIDE,aMesh->nghosts,&aMesh->ghosts[0],&Vhat);     &nb
> sp;
>     VecGhostGetLocalForm(Vhat,&LocalVhat);
>     VecGhostUpdateBegin(Vhat,INSERT_VALUES,SCATTER_FORWARD);
>     VecGhostUpdateEnd(Vhat,INSERT_VALUES,SCATTER_FORWARD);
>
>
>


-- 
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20130815/a730cb33/attachment.html>


More information about the petsc-users mailing list