# VecRestoreArrays
Restores a group of vectors after `VecGetArrays()` has been called. 
## Synopsis
```
#include "petscvec.h"   
PetscErrorCode VecRestoreArrays(const Vec x[], PetscInt n, PetscScalar **a[])
```
Logically Collective; No Fortran Support


## Input Parameters

- ***x -*** the vector
- ***n -*** the number of vectors
- ***a -*** location of pointer to arrays obtained from `VecGetArrays()`



## Notes
For regular PETSc vectors this routine does not involve any copies. For
any special vectors that do not store local vector data in a contiguous
array, this routine will copy the data back into the underlying
vector data structure from the arrays obtained with `VecGetArrays()`.




## See Also
 [](chapter_vectors), `Vec`, `VecGetArrays()`, `VecRestoreArray()`

## Level
intermediate

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


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/vec/vec/interface/rvector.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)  
