VecCreate

Creates an empty vector object. The type can then be set with VecSetType().

Synopsis

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

Input Parameter

comm - the communicator, should be PETSC_COMM_SELF
n - the local vector length
N - total vector length

Output Parameter

V -the vector

Notes

You MUST call eitehr VecSetFromOptions() or VecSetType() after this call before the vector may be used.

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

Keywords

vector, sequential, create, BLAS

See Also

VecCreateMPIWithArray(), VecCreateMPI(), VecDuplicate(), VecDuplicateVecs(),
VecCreateGhost(), VecCreateSeq(), VecPlaceArray(), VecSetType()

Examples

src/vec/examples/tutorials/ex1f.F
src/vec/examples/tutorials/ex3f.F
src/vec/examples/tutorials/ex1f90.F
src/vec/examples/tutorials/ex11f.F
src/vec/examples/tutorials/ex1.c
src/vec/examples/tutorials/ex3.c
src/vec/examples/tutorials/ex10.c
src/vec/examples/tutorials/ex11.c
src/vec/examples/tutorials/ex12.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

Level:beginner
Location:src/vec/interface/vnake.c
Vector Index
Table of Contents