petsc-3.7.3 2016-07-24
Report Typos and Errors

# VecCreate

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

### Synopsis

    #include "petscvec.h"
    PetscErrorCode  VecCreate(MPI_Comm comm, Vec *vec)

If you never call VecSetType() or VecSetFromOptions() it will generate an error when you try to use the vector.

Collective on MPI_Comm

### Input Parameter

comm -The communicator for the vector object

### Output Parameter

vec -The vector object

### Keywords

vector, create

### See Also

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

Level:beginner
Location: src/vec/vec/interface/veccreate.c
Index of all Vec routines
Table of Contents for all manual pages
Index of all manual pages

### Examples

src/vec/vec/examples/tutorials/ex1.c.html
src/vec/vec/examples/tutorials/ex2.c.html
src/vec/vec/examples/tutorials/ex3.c.html
src/vec/vec/examples/tutorials/ex5.c.html
src/vec/vec/examples/tutorials/ex6.c.html
src/vec/vec/examples/tutorials/ex7.c.html
src/vec/vec/examples/tutorials/ex8.c.html
src/vec/vec/examples/tutorials/ex9.c.html
src/vec/vec/examples/tutorials/ex10.c.html
src/vec/vec/examples/tutorials/ex11.c.html
src/vec/vec/examples/tutorials/ex12.c.html