# VecDuplicateVecs

Creates several vectors of the same type as an existing vector.

### Synopsis

    #include "petscvec.h"
    PetscErrorCode PETSCVEC_DLLEXPORT VecDuplicateVecs(Vec v,PetscInt m,Vec *V[])

Collective on Vec

### Input Parameters

| m | - the number of vectors to obtain
| v | - a vector to mimic

### Output Parameter

V -location to put pointer to array of vectors

### Notes

Use VecDestroyVecs() to free the space. Use VecDuplicate() to form a single vector.

### Fortran Note

The Fortran interface is slightly different from that given below, it requires one to pass in V a Vec (integer) array of size at least m. See the Fortran chapter of the users manual and petsc/src/vec/examples for details.

### See Also

VecDestroyVecs(), VecDuplicate(), VecCreate(), VecDuplicateVecsF90()

Level:intermediate
Location:src/vec/interface/vector.c
Index of all Vec routines
Table of Contents for all manual pages
Index of all manual pages

### Examples

src/vec/examples/tutorials/ex1.c.html
src/vec/examples/tutorials/ex1e.c.html
src/vec/examples/tutorials/ex1f.F.html