#include "petscvec.h" PetscErrorCode VecDuplicate(Vec v,Vec *newv)
Use VecDestroy() to free the space. Use VecDuplicateVecs() to get several vectors.