VecSetType#

Builds a vector, for a particular vector implementation.

Synopsis#

#include "petscvec.h"  
PetscErrorCode VecSetType(Vec vec, VecType method)

Collective

Input Parameters#

  • vec - The vector object

  • method - The name of the vector type

Options Database Key#

  • -vec_type - Sets the vector type; use -help for a list of available types

Notes#

See VecType for available vector types (for instance, VECSEQ or VECMPI)

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

See Also#

Vectors and Parallel Data, Vec, VecType, VecGetType(), VecCreate(), VecDuplicate(), VecDuplicateVecs()

Level#

intermediate

Location#

src/vec/vec/interface/vecreg.c

Examples#

src/ksp/ksp/tutorials/ex73.c
src/snes/tutorials/ex7.c
src/snes/tutorials/ex70.c
src/tao/constrained/tutorials/maros.c
src/tao/pde_constrained/tutorials/hyperbolic.c
src/vec/vec/tutorials/ex10.c
src/vec/vec/tutorials/ex9.c


Edit on GitLab

Index of all Vec routines
Table of Contents for all manual pages
Index of all manual pages