PETSc version 3.16.3

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 VecRestoreLocalVector
VECCUDA VecGetArrayReadAndMemType VecRestoreLocalVectorRead
VECHIP VecGetArrayReadF90 VecSet
VECMPI VecGetLocalSize VecSetFromOptions
VECMPICUDA VecGetLocalVector VecSetValue
VECMPIHIP VecGetLocalVectorRead VecSetValueLocal
VECMPIVIENNACL VecGetOwnershipRange VecSetValues
VECSEQ VecGetOwnershipRanges VecSqrtAbs
VECSEQCUDA VecGetSize VecSum
VECSEQHIP 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 VecNormAvailable
VECNEST VecCreateSeqHIP VecNormalize
VecAXPBY VecCreateSeqHIPWithArray VecPow
VecAXPBYPCZ VecCreateSeqHIPWithArrays VecReciprocal
VecAXPY VecCreateSeqViennaCL VecRestoreArrays
VecAYPX VecCreateSeqViennaCLWithArray VecScale
VecAbs VecCreateSeqViennaCLWithArrays VecSetLocalToGlobalMapping
VecBindToCPU VecCreateSeqWithArray VecSetOption
VecBoundToCPU VecDestroyVecs VecSetRandom
VecCUDAGetArray VecDot VecSetSizes
VecCUDAGetArrayRead VecDotRealPart VecSetType
VecCUDARestoreArray VecDuplicateVecs VecSetValuesBlocked
VecCUDARestoreArrayRead VecEqual VecSetValuesBlockedLocal
VecCUDARestoreArrayWrite VecGetArrayWrite VecSetValuesLocal
VecChop VecGetArrays VecShift
VecConjugate VecGetOffloadMask VecStashSetInitialSize
VecCreateMPI VecGetType VecStepMaxBounded
VecCreateMPICUDA VecHIPGetArray VecTDot
VecCreateMPICUDAWithArray VecHIPGetArrayRead VecUniqueEntries
VecCreateMPICUDAWithArrays VecHIPRestoreArray VecViennaCLGetCLContext
VecCreateMPIHIP VecHIPRestoreArrayRead VecViennaCLGetCLMem
VecCreateMPIHIPWithArray VecHIPRestoreArrayWrite VecViennaCLGetCLMemRead
VecCreateMPIHIPWithArrays VecLoad VecViennaCLGetCLMemWrite
VecCreateMPIViennaCLWithArray VecMAXPY VecViennaCLGetCLQueue
VecCreateMPIViennaCLWithArrays VecMDot VecViennaCLPlaceArray
VecCreateMPIWithArray VecMTDot VecViennaCLRestoreCLMem
VecCreateSeq VecMax VecViennaCLRestoreCLMemWrite
VecCreateSeqCUDA VecMin VecViewFromOptions
VecCreateSeqCUDAWithArray VecNorm 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 VecGetArray3dWrite VecRestoreArray1d
ISInitializePackage VecGetArrayPair VecRestoreArray1dRead
PetscSectionVecView VecGetLayout VecRestoreArray1dWrite
SCATTER_FORWARD_LOCAL VecGetPinnedMemoryMin VecRestoreArray2d
SCATTER_REVERSE_LOCAL VecGetValuesSection VecRestoreArray2dRead
VecCUDAPlaceArray VecHIPPlaceArray VecRestoreArray2dWrite
VecCUDAReplaceArray VecHIPReplaceArray VecRestoreArray3d
VecCUDAResetArray VecHIPResetArray VecRestoreArray3dRead
VecFinalizePackage VecInitializePackage VecRestoreArray3dWrite
VecGetArray1d VecNestGetSize VecRestoreArrayPair
VecGetArray1dRead VecNestGetSubVec VecSetLayout
VecGetArray1dWrite VecNestGetSubVecs VecSetPinnedMemoryMin
VecGetArray2d VecNestSetSubVec VecSetValuesSection
VecGetArray2dRead VecNestSetSubVecs VecTaggerFinalizePackage
VecGetArray2dWrite VecPlaceArray VecTaggerInitializePackage
VecGetArray3d VecReplaceArray VecViennaCLResetArray
VecGetArray3dRead VecResetArray
Deprecated - Functionality scheduled for removal in future versions
VecLockPop VecLockPush

Table of Contents