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)
Collective
Input Parameter#
comm - The communicator for the vector object
Output Parameter#
vec - The vector object
Notes#
If you never call VecSetType() or VecSetFromOptions() it will generate an
error when you try to use the vector.
PETSc Vec always have all zero entries until routines such as VecSet() or VecSetValues() are used to change the values.
There is no reason to call VecZeroEntries() after creation.
See Also#
Vectors and Parallel Data, Vec, VecSetType(), VecSetSizes(), VecCreateMPIWithArray(), VecCreateMPI(), VecDuplicate(),
VecDuplicateVecs(), VecCreateGhost(), VecCreateSeq(), VecPlaceArray()
Level#
beginner
Location#
Examples#
src/mat/tutorials/ex7.c
src/mat/tutorials/ex19.c
src/mat/tutorials/ex12.c
src/snes/tutorials/ex1.c
src/snes/tutorials/ex70.c
src/snes/tutorials/ex99.c
src/snes/tutorials/ex6.c
src/snes/tutorials/ex73f90t.F90
src/snes/tutorials/ex59.c
src/snes/tutorials/ex7.c
Implementations#
VecCreate_CUDA() in src/vec/vec/impls/mpi/cupm/cuda/vecmpicupm.cu
VecCreate_MPICUDA() in src/vec/vec/impls/mpi/cupm/cuda/vecmpicupm.cu
VecCreate_HIP() in src/vec/vec/impls/mpi/cupm/hip/vecmpicupm.hip.cxx
VecCreate_MPIHIP() in src/vec/vec/impls/mpi/cupm/hip/vecmpicupm.hip.cxx
VecCreate_MPIKokkos() in src/vec/vec/impls/mpi/kokkos/mpikok.kokkos.cxx
VecCreate_Kokkos() in src/vec/vec/impls/mpi/kokkos/mpikok.kokkos.cxx
VecCreate_MPIViennaCL() in src/vec/vec/impls/mpi/mpiviennacl/mpiviennacl.cxx
VecCreate_ViennaCL() in src/vec/vec/impls/mpi/mpiviennacl/mpiviennacl.cxx
VecCreate_MPI() in src/vec/vec/impls/mpi/pbvec.c
VecCreate_Standard() in src/vec/vec/impls/mpi/pbvec.c
VecCreate_Seq() in src/vec/vec/impls/seq/bvec3.c
VecCreate_SeqCUDA() in src/vec/vec/impls/seq/cupm/cuda/vecseqcupm.cu
VecCreate_SeqHIP() in src/vec/vec/impls/seq/cupm/hip/vecseqcupm.hip.cxx
VecCreate_SeqKokkos() in src/vec/vec/impls/seq/kokkos/veckok.kokkos.cxx
VecCreate_SeqViennaCL() in src/vec/vec/impls/seq/seqviennacl/vecviennacl.cxx
VecCreate_Shared() in src/vec/vec/impls/shared/shvec.c
VecCreate_Shared() in src/vec/vec/impls/shared/shvec.c
Index of all Vec routines
Table of Contents for all manual pages
Index of all manual pages