:orphan:
# VecSetUp
Sets up the internal vector data structures for the later use.
## Synopsis
```
#include "petscvec.h"
PetscErrorCode VecSetUp(Vec v)
```
Collective
## Input Parameter
- ***v -*** the `Vec` context
## Notes
For basic use of the `Vec` classes the user need not explicitly call
`VecSetUp()`, since these actions will happen automatically.
## See Also
[](ch_vectors), `Vec`, `VecCreate()`, `VecDestroy()`
## Level
advanced
## Location
src/vec/vec/interface/vector.c
## Examples
src/dm/field/tutorials/ex1.c
src/ksp/ksp/tutorials/ex56.c
src/tao/constrained/tutorials/ex1.c
src/ts/tutorials/ex11.c
src/ts/tutorials/ex31.c
src/ts/tutorials/ex40.c
src/ts/tutorials/ex41.c
src/ts/tutorials/ex43.c
src/ts/tutorials/ex51.c
src/vec/is/sf/tutorials/ex2.c
src/vec/is/sf/tutorials/ex3.c
---
[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](/manualpages/index.md)
[Index of all manual pages](/manualpages/singleindex.md)