VecCopy#
Copies a vector y = x
Synopsis#
#include "petscvec.h"
PetscErrorCode VecCopy(Vec x, Vec y)
Logically Collective
Input Parameter#
x - the vector
Output Parameter#
y - the copy
Note#
For default parallel PETSc vectors, both x
and y
must be distributed in
the same manner; local copies are done.
Developer Note#
PetscCheckSameTypeAndComm
(x,1,y,2) is not used on these vectors because we allow one
of the vectors to be sequential and one to be parallel so long as both have the same
local sizes. This is used in some internal functions in PETSc.
See Also#
Level#
beginner
Location#
Examples#
src/vec/vec/tutorials/ex1.c.html
src/vec/vec/tutorials/ex1f.F90.html
src/vec/vec/tutorials/ex1f90.F90.html
src/vec/vec/tutorials/ex20f90.F90.html
src/vec/vec/tutorials/ex4f.F90.html
src/vec/vec/tutorials/ex4f90.F90.html
src/vec/vec/tutorials/performance.c.html
src/mat/tutorials/ex9.c.html
src/dm/impls/swarm/tutorials/ex1.c.html
src/dm/impls/swarm/tutorials/ex1f90.F90.html
src/dm/impls/stag/tutorials/ex1.c.html
Implementations#
VecCopy_Nest in src/vec/vec/impls/nest/vecnest.c
VecCopy_Seq in src/vec/vec/impls/seq/bvec2.c
VecCopy_SeqKokkos in src/vec/vec/impls/seq/kokkos/veckok.kokkos.cxx
VecCopy_SeqCUDA in src/vec/vec/impls/seq/seqcuda/veccuda2.cu
VecCopy_SeqHIP in src/vec/vec/impls/seq/seqhip/vechip2.hip.c
VecCopy_SeqViennaCL in src/vec/vec/impls/seq/seqviennacl/vecviennacl.cxx
Index of all Vec routines
Table of Contents for all manual pages
Index of all manual pages