Vectors: Examples

PETSc vectors (Vec objects) are used to store the field variables in PDE-based (or other) simulations.

Beginner - Basic usage
NORM_1 VecDestroy VecRestoreArray1d
NORM_1_AND_2 VecDestroyVecsF90 VecRestoreArray2d
NORM_2 VecDuplicate VecRestoreArray3d
NORM_FROBENIUS VecDuplicateVecsF90 VecRestoreArray4d
NORM_INFINITY VecGetArray VecRestoreArrayF90
NORM_MAX VecGetArray1d VecScatter
NormType VecGetArray2d VecSet
PetscMapCreate VecGetArray3d VecSetFromOptions
PetscMapView VecGetArray4d VecSetValue
VECMPI VecGetArrayF90 VecSetValueLocal
VECSEQ VecGetLocalSize VecSetValues
Vec VecGetOwnershipRange VecSqrt
VecAssemblyBegin VecGetSize VecSum
VecAssemblyEnd VecGetValues VecType
VecCopy VecPermute VecView
VecCreate VecRestoreArray
Intermediate - Setting options for algorithms and data structures
PetscMapGetType VecGetArrays VecScatterCreateToZero
PetscMapPrintHelp VecGetType VecScatterDestroy
PetscMapSetFromOptions VecLoad VecScatterEnd
PetscMapSetType VecLoadIntoVector VecScatterView
VecAXPBY VecMAXPY VecSetLocalToGlobalMapping
VecAXPY VecMDot VecSetLocalToGlobalMappingBlock
VecAYPX VecMTDot VecSetOption
VecAbs VecMax VecSetRandom
VecConjugate VecMin VecSetSizes
VecContourScale VecNorm VecSetType
VecCreateMPI VecNormalize VecSetValuesBlocked
VecCreateMPIWithArray VecPrintHelp VecSetValuesBlockedLocal
VecCreateSeq VecReciprocal VecSetValuesLocal
VecCreateSeqWithArray VecRestoreArrays VecShift
VecDestroyVecs VecScale VecStashSetInitialSize
VecDot VecScatterBegin VecTDot
VecDuplicateVecs VecScatterCreate VecViewFromOptions
VecEqual VecScatterCreateToAll VecWAXPY
Advanced - Setting more advanced options and customization
PetscMap VecGhostRestoreLocalForm VecSetUp
PetscMapAppendOptionsPrefix VecGhostUpdateBegin VecStashGetInfo
PetscMapGetOptionsPrefix VecGhostUpdateEnd VecStashView
PetscMapRegisterAll VecMaxPointwiseDivide VecStrideGather
PetscMapRegisterDestroy VecNormBegin VecStrideGatherAll
PetscMapRegisterDynamic VecNormEnd VecStrideMax
PetscMapSetOptionsPrefix VecPointwiseDivide VecStrideMaxAll
PetscMapSetUp VecPointwiseMax VecStrideMin
VecAppendOptionsPrefix VecPointwiseMaxAbs VecStrideMinAll
VecCreateGhost VecPointwiseMin VecStrideNorm
VecCreateGhostBlock VecPointwiseMult VecStrideNormAll
VecCreateGhostBlockWithArray VecRegister VecStrideScale
VecCreateGhostWithArray VecRegisterAll VecStrideScaleAll
VecCreateShared VecRegisterDestroy VecStrideScatter
VecDotBegin VecRegisterDynamic VecStrideScatterAll
VecDotEnd VecScatterCopy VecSwap
VecGetBlockSize VecScatterPostRecvs VecTDotBegin
VecGetOptionsPrefix VecSetBlockSize VecTDotEnd
VecGhostGetLocalForm VecSetOptionsPrefix Vecs
Developer - Interfaces intended primarily for library developers, not for typical applications programmers
PetscMapCreateMPI PetscMapSetLocalSize VecResetArray
PetscMapDestroy PetscMapSetSize VecScatterGetMerged
PetscMapGetGlobalRange VecGetPetscMap VecScatterRemap
PetscMapGetLocalRange VecInitializePackage VecValid
PetscMapGetLocalSize VecPlaceArray
PetscMapGetSize VecReplaceArray

Table of Contents