# DMLocalToLocalEnd
Maps from a local vector to another local vector where the ghost points in the second are set correctly. Must be preceded by `DMLocalToLocalBegin()`. 
## Synopsis
```
#include "petscdm.h"          
#include "petscdmlabel.h"     
#include "petscds.h"     
PetscErrorCode DMLocalToLocalEnd(DM dm, Vec g, InsertMode mode, Vec l)
```
Neighbor-wise Collective on dm


## Input Parameters

- ***da -*** the `DM` object
- ***g -*** the original local vector
- ***mode -*** one of `INSERT_VALUES` or `ADD_VALUES`



## Output Parameter

- ***l  -*** the local vector with correct ghost values





## See Also
 `DMLocalToLocalBegin()`, `DMCoarsen()`, `DMDestroy()`, `DMView()`, `DMCreateLocalVector()`, `DMCreateGlobalVector()`, `DMCreateInterpolation()`, `DMLocalToLocalBegin()`, `DMGlobalToLocalEnd()`, `DMLocalToGlobalBegin()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/interface/dm.c.html#DMLocalToLocalEnd">src/dm/interface/dm.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/tutorials/ex13f90.F90.html">src/dm/tutorials/ex13f90.F90.html</A><BR>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/impls/composite/pack.c.html#DMLocalToLocalEnd_Composite">DMLocalToLocalEnd_Composite in src/dm/impls/composite/pack.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/impls/da/daltol.c.html#DMLocalToLocalEnd_DA">DMLocalToLocalEnd_DA in src/dm/impls/da/daltol.c</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/dm/interface/dm.c)


[Index of all DM routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
