VecDuplicateVecs#

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

Synopsis#

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


Collective

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

Note#

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 array of size at least m. See the PETSc for Fortran Users for details.

Vectors and Parallel Data, Vec, PETSc for Fortran Users, VecDestroyVecs(), VecDuplicate(), VecCreate(), VecDuplicateVecsF90()

intermediate

Location#

src/vec/vec/interface/vector.c

Edit on GitLab