VecCreate

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

Synopsis

#include "petscvec.h" 
int VecCreate(MPI_Comm comm,int n,int N,Vec *V)
Collective on MPI_Comm

Input Parameter

comm - the communicator
n - the local vector length (or PETSC_DECIDE)
N - total vector length (or PETSC_DETERMINE)

Output Parameter

V -the vector

Notes

You MUST call either 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.

See Also

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

Level:beginner
Location:
src/vec/interface/vnake.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/ex3.c.html
src/vec/examples/tutorials/ex5.c.html
src/vec/examples/tutorials/ex6.c.html
src/vec/examples/tutorials/ex7.c.html
src/vec/examples/tutorials/ex10.c.html
src/vec/examples/tutorials/ex11.c.html
src/vec/examples/tutorials/ex12.c.html
src/vec/examples/tutorials/ex1f.F.html
src/vec/examples/tutorials/ex3f.F.html