VecSetType#
Builds a vector, for a particular vector implementation.
Synopsis#
#include "petscvec.h"
PetscErrorCode VecSetType(Vec vec, VecType newType)
Collective
Input Parameters#
vec - The vector object
newType - The name of the vector type
Options Database Key#
-vec_type type - Sets the vector type; see
VecType
Notes#
See VecType for available vector types (for instance, VECSEQ or VECMPI)
Changing a vector to a new type will retain its old value if any.
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#
Examples#
src/vec/vec/tutorials/ex10.c
src/vec/vec/tutorials/ex9.c
src/vec/vec/tests/ex1.c
src/vec/is/sf/tests/ex9.c
src/vec/vec/tests/ex15.c
src/vec/vec/tests/ex16k.kokkos.cxx
src/vec/vec/tests/ex37.c
src/vec/vec/tests/ex41.c
src/vec/vec/tests/ex56.c
src/vec/vec/tests/ex57.cxx
Index of all Vec routines
Table of Contents for all manual pages
Index of all manual pages