# VecAssemblyEnd
Completes assembling the vector.  This routine should be called after `VecAssemblyBegin()`. 
## Synopsis
```
#include "petscvec.h"   
PetscErrorCode VecAssemblyEnd(Vec vec)
```
Collective


## Input Parameter

- ***vec -*** the vector



## Options Database Keys

- ***-vec_view -*** Prints vector in `PETSC_VIEWER_DEFAULT` format
- ***-vec_view ::ascii_matlab -*** Prints vector in `PETSC_VIEWER_ASCII_MATLAB` format to stdout
- ***-vec_view matlab:filename -*** Prints vector in MATLAB .mat file to filename (requires PETSc configured with --with-matlab)
- ***-vec_view draw -*** Activates vector viewing using drawing tools
- ***-display <name> -*** Sets display name (default is host)
- ***-draw_pause <sec> -*** Sets number of seconds to pause after display
- ***-vec_view socket -*** Activates vector viewing using a socket





## See Also
 [](chapter_vectors), `Vec`, `VecAssemblyBegin()`, `VecSetValues()`

## Level
beginner

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/interface/vector.c.html#VecAssemblyEnd">src/vec/vec/interface/vector.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/tutorials/ex10.c.html">src/vec/vec/tutorials/ex10.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/tutorials/ex14f.F90.html">src/vec/vec/tutorials/ex14f.F90.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/tutorials/ex15.c.html">src/vec/vec/tutorials/ex15.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/tutorials/ex18.c.html">src/vec/vec/tutorials/ex18.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/tutorials/ex18f.F90.html">src/vec/vec/tutorials/ex18f.F90.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/tutorials/ex2.c.html">src/vec/vec/tutorials/ex2.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/tutorials/ex2f.F90.html">src/vec/vec/tutorials/ex2f.F90.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/tutorials/ex3.c.html">src/vec/vec/tutorials/ex3.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/tutorials/ex3f.F90.html">src/vec/vec/tutorials/ex3f.F90.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/tutorials/ex44.c.html">src/vec/vec/tutorials/ex44.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/tutorials/ex4f.F90.html">src/vec/vec/tutorials/ex4f.F90.html</A><BR>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/impls/mpi/pdvec.c.html#VecAssemblyEnd_MPI">VecAssemblyEnd_MPI in src/vec/vec/impls/mpi/pdvec.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/impls/nest/vecnest.c.html#VecAssemblyEnd_Nest">VecAssemblyEnd_Nest in src/vec/vec/impls/nest/vecnest.c</A><BR>


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


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