VecStrideGather#

Gathers a single component from a multi-component vector into another vector.

Synopsis#

#include "petscvec.h" 
PetscErrorCode VecStrideGather(Vec v, PetscInt start, Vec s, InsertMode addv)

Collective

Input Parameters#

  • v - the vector

  • start - starting point of the subvector (defined by a stride)

  • addv - one of ADD_VALUES,INSERT_VALUES,MAX_VALUES

Output Parameter#

  • s - the location where the subvector is stored

Notes#

One must call VecSetBlockSize() before this routine to set the stride information, or use a vector created from a multicomponent DMDA.

If x is the array representing the vector x then this gathers the array (x[start],x[start+stride],x[start+2*stride], ….)

The parallel layout of the vector and the subvector must be the same; i.e., nlocal of v = stride*(nlocal of s)

Not optimized; could be easily

See Also#

VecStrideNorm(), VecStrideScatter(), VecStrideMin(), VecStrideMax(), VecStrideGatherAll(), VecStrideScatterAll()

Level#

advanced

Location#

src/vec/vec/utils/vinv.c

Examples#

src/vec/vec/tutorials/ex12.c.html
src/vec/vec/tutorials/ex12f.F90.html
src/vec/vec/tutorials/ex16.c.html


Edit on GitLab

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