# VecGhostGetLocalForm

Obtains the local ghosted representation of a parallel vector created with VecCreateGhost().

### Synopsis

    #include "petscvec.h"
    PetscErrorCode PETSCVEC_DLLEXPORT VecGhostGetLocalForm(Vec g,Vec *l)

Not Collective

### Input Parameter

g -the global vector. Vector must be have been obtained with either VecCreateGhost(), VecCreateGhostWithArray() or VecCreateSeq().

### Output Parameter

l -the local (ghosted) representation

### C++ variants

| Vec VecGhostGetLocalForm(Vec x) |  | -> |  | VecGhostGetLocalForm(x,&s); return s;

### Notes

This routine does not actually update the ghost values, but rather it returns a sequential vector that includes the locations for the ghost values and their current values. The returned vector and the original vector passed in share the same array that contains the actual vector data.

One should call VecGhostRestoreLocalForm() or VecDestroy() once one is finished using the object.

### See Also

VecCreateGhost(), VecGhostRestoreLocalForm(), VecCreateGhostWithArray()

Level:advanced
Location:src/vec/impls/mpi/pbvec.c
Index of all Vec routines
Table of Contents for all manual pages
Index of all manual pages

### Examples

src/vec/examples/tutorials/ex9.c.html
src/vec/examples/tutorials/ex9f.F.html
src/vec/examples/tutorials/ex14f.F.html