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

Input Parameter#

  • comm - The communicator for the vector object

Output Parameter#

  • vec - The vector object

See Also#

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

Level#

beginner

Location#

src/vec/vec/interface/veccreate.c

Examples#

src/vec/vec/utils/tagger/tutorials/ex1.c.html
src/vec/vec/tutorials/ex10.c.html
src/vec/vec/tutorials/ex11.c.html
src/vec/vec/tutorials/ex11f90.F90.html
src/vec/vec/tutorials/ex11f.F90.html
src/vec/vec/tutorials/ex12.c.html
src/vec/vec/tutorials/ex12f.F90.html
src/vec/vec/tutorials/ex13.c.html
src/vec/vec/tutorials/ex15.c.html
src/vec/vec/tutorials/ex16.c.html
src/vec/vec/tutorials/ex16f.F90.html

Implementations#

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_MPICUDA in src/vec/vec/impls/mpi/mpicuda/mpicuda.cu
{ VecCreate_CUDA in src/vec/vec/impls/mpi/mpicuda/mpicuda.cu
{ VecCreate_MPIHIP in src/vec/vec/impls/mpi/mpihip/mpihip.hip.c
{ VecCreate_HIP in src/vec/vec/impls/mpi/mpihip/mpihip.hip.c
{ 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_SeqKokkos in src/vec/vec/impls/seq/kokkos/veckok.kokkos.cxx
{ VecCreate_SeqCUDA in src/vec/vec/impls/seq/seqcuda/veccuda.c
{ VecCreate_SeqHIP in src/vec/vec/impls/seq/seqhip/vechip.hip.c
{ 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
{


Edit on GitLab

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