PETSc version 3.17.4

Vectors: Examples

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

Beginner - Basic usage
NORM_1 VecAssemblyEnd VecLog
NORM_1_AND_2 VecCopy VecMean
NORM_2 VecCreate VecPermute
NORM_FROBENIUS VecDestroy VecRealPart
NORM_INFINITY VecDestroyVecsF90 VecRestoreArray
NORM_MAX VecDuplicate VecRestoreArray4d
NormType VecDuplicateVecsF90 VecRestoreArray4dRead
REDUCTION_MEAN_IMAGINARYPART VecExp VecRestoreArray4dWrite
REDUCTION_MEAN_REALPART VecGetArray VecRestoreArrayAndMemType
REDUCTION_SUM_IMAGINARYPART VecGetArray4d VecRestoreArrayF90
REDUCTION_SUM_REALPART VecGetArray4dRead VecRestoreArrayRead
ReductionType VecGetArray4dWrite VecRestoreArrayReadAndMemType
SCATTER_FORWARD VecGetArrayAndMemType VecRestoreArrayReadF90
SCATTER_REVERSE VecGetArrayF90 VecRestoreArrayWrite
ScatterMode VecGetArrayRead VecRestoreArrayWriteAndMemType
VECCUDA VecGetArrayReadAndMemType VecRestoreKokkosView
VECHIP VecGetArrayReadF90 VecRestoreKokkosViewWrite
VECKOKKOS VecGetArrayWriteAndMemType VecRestoreLocalVector
VECMPI VecGetKokkosView VecRestoreLocalVectorRead
VECMPICUDA VecGetKokkosViewWrite VecSet
VECMPIHIP VecGetLocalSize VecSetFromOptions
VECMPIKOKKOS VecGetLocalVector VecSetValue
VECMPIVIENNACL VecGetLocalVectorRead VecSetValueLocal
VECSEQ VecGetOwnershipRange VecSetValues
VECSEQCUDA VecGetOwnershipRanges VecSqrtAbs
VECSEQHIP VecGetSize VecSum
VECSEQKOKKOS VecGetValues VecTaggerBox
VECSEQVIENNACL VecImaginaryPart VecType
VECSTANDARD VecLockGet VecView
VECVIENNACL VecLockReadPop VecZeroEntries
Vec VecLockReadPush
VecAssemblyBegin VecLockWriteSet_Private
Intermediate - Setting options for algorithms and data structures
PetscSectionVecNorm VecCreateSeqCUDAWithArrays VecNorm
VECNEST VecCreateSeqHIP VecNormAvailable
VecAXPBY VecCreateSeqHIPWithArray VecNormalize
VecAXPBYPCZ VecCreateSeqHIPWithArrays VecPow
VecAXPY VecCreateSeqKokkos VecReciprocal
VecAYPX VecCreateSeqKokkosWithArray VecRestoreArrays
VecAbs VecCreateSeqViennaCL VecScale
VecBindToCPU VecCreateSeqViennaCLWithArray VecSetLocalToGlobalMapping
VecBoundToCPU VecCreateSeqViennaCLWithArrays VecSetOption
VecCUDAGetArray VecCreateSeqWithArray VecSetRandom
VecCUDAGetArrayRead VecDestroyVecs VecSetSizes
VecCUDARestoreArray VecDot VecSetType
VecCUDARestoreArrayRead VecDotRealPart VecSetValuesBlocked
VecCUDARestoreArrayWrite VecDuplicateVecs VecSetValuesBlockedLocal
VecChop VecEqual VecSetValuesLocal
VecConjugate VecGetArrayWrite VecShift
VecCreateMPI VecGetArrays VecStashSetInitialSize
VecCreateMPICUDA VecGetOffloadMask VecStepMaxBounded
VecCreateMPICUDAWithArray VecGetType VecTDot
VecCreateMPICUDAWithArrays VecHIPGetArray VecUniqueEntries
VecCreateMPIHIP VecHIPGetArrayRead VecViennaCLGetCLContext
VecCreateMPIHIPWithArray VecHIPRestoreArray VecViennaCLGetCLMem
VecCreateMPIHIPWithArrays VecHIPRestoreArrayRead VecViennaCLGetCLMemRead
VecCreateMPIKokkosWithArray VecHIPRestoreArrayWrite VecViennaCLGetCLMemWrite
VecCreateMPIViennaCLWithArray VecLoad VecViennaCLGetCLQueue
VecCreateMPIViennaCLWithArrays VecMAXPY VecViennaCLPlaceArray
VecCreateMPIWithArray VecMDot VecViennaCLRestoreCLMem
VecCreateSeq VecMTDot VecViennaCLRestoreCLMemWrite
VecCreateSeqCUDA VecMax VecViewFromOptions
VecCreateSeqCUDAWithArray VecMin VecWAXPY
Advanced - Setting more advanced options and customization
ISComplementVec VecPointwiseDivide VecTaggerAndGetSubs
PetscCommSplitReductionBegin VecPointwiseMax VecTaggerAndSetSubs
VecAppendOptionsPrefix VecPointwiseMaxAbs VecTaggerCDFGetBox
VecBoundGradientProjection VecPointwiseMin VecTaggerCDFGetMethod
VecCUDAGetArrayWrite VecPointwiseMult VecTaggerCDFIterativeGetTolerances
VecConcatenate VecRegister VecTaggerCDFIterativeSetTolerances
VecCreateGhost VecRegisterAll VecTaggerCDFMethod
VecCreateGhostBlock VecRestoreSubVector VecTaggerCDFSetBox
VecCreateGhostBlockWithArray VecSetBlockSize VecTaggerCDFSetMethod
VecCreateGhostWithArray VecSetOperation VecTaggerComputeBoxes
VecCreateNest VecSetOptionsPrefix VecTaggerComputeIS
VecCreateShared VecSetUp VecTaggerCreate
VecDotBegin VecStashGetInfo VecTaggerDestroy
VecDotEnd VecStashView VecTaggerGetBlockSize
VecDotNorm2 VecStepBoundInfo VecTaggerGetInvert
VecGetBlockSize VecStepMax VecTaggerGetType
VecGetLocalToGlobalMapping VecStrideGather VecTaggerOrGetSubs
VecGetOptionsPrefix VecStrideGatherAll VecTaggerOrSetSubs
VecGetSubVector VecStrideMax VecTaggerRegister
VecGhostGetLocalForm VecStrideMaxAll VecTaggerRegisterAll
VecGhostIsLocalForm VecStrideMin VecTaggerRelativeGetBox
VecGhostRestoreLocalForm VecStrideMinAll VecTaggerRelativeSetBox
VecGhostUpdateBegin VecStrideNorm VecTaggerSetBlockSize
VecGhostUpdateEnd VecStrideNormAll VecTaggerSetFromOptions
VecHIPGetArrayWrite VecStrideScale VecTaggerSetInvert
VecISAXPY VecStrideScaleAll VecTaggerSetType
VecISCopy VecStrideScatter VecTaggerSetUp
VecISSet VecStrideScatterAll VecTaggerType
VecMDotBegin VecStrideSet VecTaggerView
VecMDotEnd VecStrideSubSetGather VecWhichBetween
VecMPISetGhost VecStrideSubSetScatter VecWhichBetweenOrEqual
VecMTDotBegin VecSwap VecWhichEqual
VecMTDotEnd VecTDotBegin VecWhichGreaterThan
VecMaxPointwiseDivide VecTDotEnd VecWhichInactive
VecMedian VecTagger VecWhichLessThan
VecNormBegin VecTaggerAbsoluteGetBox Vecs
VecNormEnd VecTaggerAbsoluteSetBox
Developer - Interfaces intended primarily for library developers, not for typical applications programmers
ISFinalizePackage VecGetArrayPair VecRestoreArray1dRead
ISInitializePackage VecGetBindingPropagates VecRestoreArray1dWrite
PetscSectionVecView VecGetLayout VecRestoreArray2d
SCATTER_FORWARD_LOCAL VecGetPinnedMemoryMin VecRestoreArray2dRead
SCATTER_REVERSE_LOCAL VecGetValuesSection VecRestoreArray2dWrite
VecCUDAPlaceArray VecHIPPlaceArray VecRestoreArray3d
VecCUDAReplaceArray VecHIPReplaceArray VecRestoreArray3dRead
VecCUDAResetArray VecHIPResetArray VecRestoreArray3dWrite
VecFinalizePackage VecInitializePackage VecRestoreArrayPair
VecGetArray1d VecNestGetSize VecSetBindingPropagates
VecGetArray1dRead VecNestGetSubVec VecSetLayout
VecGetArray1dWrite VecNestGetSubVecs VecSetPinnedMemoryMin
VecGetArray2d VecNestSetSubVec VecSetValuesSection
VecGetArray2dRead VecNestSetSubVecs VecTaggerFinalizePackage
VecGetArray2dWrite VecPlaceArray VecTaggerInitializePackage
VecGetArray3d VecReplaceArray VecViennaCLResetArray
VecGetArray3dRead VecResetArray VecViewNative
VecGetArray3dWrite VecRestoreArray1d
Deprecated - Functionality scheduled for removal in future versions
VecLockPop VecLockPush

Table of Contents