VecCreate

Creates a vector, where the vector type is determined from the options database. Generates a parallel MPI vector if the communicator has more than one processor.

Synopsis

int VecCreate(MPI_Comm comm,int n,int N,Vec *V)
Collective on MPI_Comm

Input Parameters

comm - MPI communicator
n - local vector length (or PETSC_DECIDE)
N - global vector length (or PETSC_DETERMINE) Output Parameter:
V -location to stash resulting vector

Options Database Keys

-vec_mpi - Activates use of MPI vectors, even for the uniprocessor case by internally calling VecCreateMPI()
-vec_shared - Activates use of shared memory parallel vectors by internally calling VecCreateShared()

Notes

Use VecDuplicate() or VecDuplicateVecs() to form additional vectorsof the same type as an existing vector.

Keywords

vector, create, initial

See Also

VecCreateSeq(), VecCreateMPI(), VecCreateShared(), VecDuplicate(), VecDuplicateVecs()

Examples

src/vec/examples/tutorials/ex1f.F
src/vec/examples/tutorials/ex3f.F
src/vec/examples/tutorials/ex1f90.F
src/vec/examples/tutorials/ex1.c
src/vec/examples/tutorials/ex3.c
src/adic/examples/tutorials/ex1.c
src/adic/examples/tutorials/ex2.c
src/adic/examples/tutorials/ex3.c
src/adic/examples/tutorials/ex4.c
src/adic/examples/tutorials/ex5.c

Location: src/vec/utils/gcreatev.c
Vector Index
Table of Contents