Vec - Low-level Interface
This page documents the low-level, automatically wrapped PETSc Vec functions available through LibPETSc. These functions provide direct access to the PETSc C API.
For the high-level Julia interface, see Vec.
Overview
The Vec interface includes:
- Core Vec operations: Creation, manipulation, and mathematical operations on vectors (~186 functions in
Vec_wrappers.jl) - Vec utilities: Scatter operations, FFTW integration, and advanced vector operations (~76 functions in
Vecs_wrappers.jl) - VecTagger: Tools for tagging/marking vector elements based on criteria (~31 functions in
VecTagger_wrappers.jl)
Usage
All low-level Vec functions require a petsclib parameter as the first argument:
using PETSc
# Get the library instance
petsclib = PETSc.petsclibs[1]
PETSc.initialize(petsclib)
# Get PETSc types
PetscInt = petsclib.PetscInt
# Create a vector
vec = LibPETSc.VecCreate(petsclib, LibPETSc.PETSC_COMM_SELF)
LibPETSc.VecSetSizes(petsclib, vec, PetscInt(10), PetscInt(10))
LibPETSc.VecSetType(petsclib, vec, "seq") # Set vector type
LibPETSc.VecSetFromOptions(petsclib, vec)
# Set values
LibPETSc.VecSet(petsclib, vec, 1.0)
# Query the vector
size = LibPETSc.VecGetSize(petsclib, vec)
println("Vector size: $size")
# Get values (0-based indexing!)
idx = PetscInt(0)
val = LibPETSc.VecGetValues(petsclib, vec, PetscInt(1), [idx])
println("Value at index 0: $(val[1])")
# Clean up
LibPETSc.VecDestroy(petsclib, vec)
PETSc.finalize(petsclib)Function Reference
PETSc.LibPETSc.VecAXPBY — Method
VecAXPBY(petsclib::PetscLibType,y::PetscVec, alpha::PetscScalar, beta::PetscScalar, x::PetscVec)Computes y = alpha x + beta y.
Logically Collective
Input Parameters:
alpha- first scalarbeta- second scalarx- the first scaled vectory- the second scaled vector
Output Parameter:
y- output vector
Level: intermediate
-seealso: , Vec, VecAYPX(), VecMAXPY(), VecWAXPY(), VecAXPY(), VecAXPBYPCZ()
External Links
- PETSc Manual:
Vec/VecAXPBY
PETSc.LibPETSc.VecAXPBYPCZ — Method
VecAXPBYPCZ(petsclib::PetscLibType,z::PetscVec, alpha::PetscScalar, beta::PetscScalar, gamma::PetscScalar, x::PetscVec, y::PetscVec)Computes z = alpha x + beta y + gamma z
Logically Collective
Input Parameters:
alpha- first scalarbeta- second scalargamma- third scalarx- first vectory- second vectorz- third vector
Output Parameter:
z- output vector
Level: intermediate
-seealso: , Vec, VecAYPX(), VecMAXPY(), VecWAXPY(), VecAXPY(), VecAXPBY()
External Links
- PETSc Manual:
Vec/VecAXPBYPCZ
PETSc.LibPETSc.VecAXPY — Method
VecAXPY(petsclib::PetscLibType,y::PetscVec, alpha::PetscScalar, x::PetscVec)Computes y = alpha x + y.
Logically Collective
Input Parameters:
alpha- the scalarx- vector scale byalphay- vector accumulated into
Output Parameter:
y- output vector
Level: intermediate
-seealso: , Vec, VecAYPX(), VecMAXPY(), VecWAXPY(), VecAXPBYPCZ(), VecAXPBY()
External Links
- PETSc Manual:
Vec/VecAXPY
PETSc.LibPETSc.VecAYPX — Method
VecAYPX(petsclib::PetscLibType,y::PetscVec, beta::PetscScalar, x::PetscVec)Computes y = x + beta y.
Logically Collective
Input Parameters:
beta- the scalarx- the unscaled vectory- the vector to be scaled
Output Parameter:
y- output vector
Level: intermediate
-seealso: , Vec, VecMAXPY(), VecWAXPY(), VecAXPY(), VecAXPBYPCZ(), VecAXPBY()
External Links
- PETSc Manual:
Vec/VecAYPX
PETSc.LibPETSc.VecAbs — Method
VecAbs(petsclib::PetscLibType,v::PetscVec)Replaces every element in a vector with its absolute value.
Logically Collective
Input Parameter:
v- the vector
Level: intermediate
-seealso: Vec, VecExp(), VecSqrtAbs(), VecReciprocal(), VecLog()
External Links
- PETSc Manual:
Vec/VecAbs
PETSc.LibPETSc.VecAppendOptionsPrefix — Method
VecAppendOptionsPrefix(petsclib::PetscLibType,v::PetscVec, prefix::Vector{Cchar})Appends to the prefix used for searching for all Vec options in the database.
Logically Collective
Input Parameters:
v- theVeccontextprefix- the prefix to prepend to all option names
Level: advanced
-seealso: , Vec, VecGetOptionsPrefix()
External Links
- PETSc Manual:
Vec/VecAppendOptionsPrefix
PETSc.LibPETSc.VecAssemblyBegin — Method
VecAssemblyBegin(petsclib::PetscLibType,vec::PetscVec)Begins assembling the vector; that is ensuring all the vector's entries are stored on the correct MPI process. This routine should be called after completing all calls to VecSetValues().
Collective
Input Parameter:
vec- the vector
Level: beginner
-seealso: , Vec, VecAssemblyEnd(), VecSetValues()
External Links
- PETSc Manual:
Vec/VecAssemblyBegin
PETSc.LibPETSc.VecAssemblyEnd — Method
VecAssemblyEnd(petsclib::PetscLibType,vec::PetscVec)Completes assembling the vector. This routine should be called after VecAssemblyBegin().
Collective
Input Parameter:
vec- the vector
Options Database Keys:
-vec_view- Prints vector inPETSC_VIEWER_DEFAULTformat-vec_view ::ascii_matlab- Prints vector inPETSC_VIEWER_ASCII_MATLABformat to stdout-vec_view matlab:filename- Prints vector in MATLAB .mat file to filename (requires PETSc configured with –with-matlab)-vec_view draw- Activates vector viewing using drawing tools-display <name>- Sets display name (default is host)-draw_pause <sec>- Sets number of seconds to pause after display-vec_view socket- Activates vector viewing using a socket
Level: beginner
-seealso: , Vec, VecAssemblyBegin(), VecSetValues()
External Links
- PETSc Manual:
Vec/VecAssemblyEnd
PETSc.LibPETSc.VecBindToCPU — Method
VecBindToCPU(petsclib::PetscLibType,v::PetscVec, flg::PetscBool)marks a vector to temporarily stay on the CPU and perform computations on the CPU
Logically collective
Input Parameters:
v- the vectorflg- bind to the CPU if value ofPETSC_TRUE
Level: intermediate
-seealso: , Vec, VecBoundToCPU()
External Links
- PETSc Manual:
Vec/VecBindToCPU
PETSc.LibPETSc.VecBoundGradientProjection — Method
VecBoundGradientProjection(petsclib::PetscLibType,G::PetscVec, X::PetscVec, XL::PetscVec, XU::PetscVec, GP::PetscVec)Projects vector according to this definition. If XL[i] < X[i] < XU[i], then GP[i] = G[i]; If X[i] <= XL[i], then GP[i] = min(G[i],0); If X[i] >= XU[i], then GP[i] = max(G[i],0);
Input Parameters:
G- current gradient vectorX- current solution vector with XL[i] <= X[i] <= XU[i]XL- lower boundsXU- upper bounds
Output Parameter:
GP- gradient projection vector
Level: advanced
-seealso: Vec
External Links
- PETSc Manual:
Vec/VecBoundGradientProjection
PETSc.LibPETSc.VecBoundToCPU — Method
flg::PetscBool = VecBoundToCPU(petsclib::PetscLibType,v::PetscVec)query if a vector is bound to the CPU
Not collective
Input Parameter:
v- the vector
Output Parameter:
flg- the logical flag
Level: intermediate
-seealso: , Vec, VecBindToCPU()
External Links
- PETSc Manual:
Vec/VecBoundToCPU
PETSc.LibPETSc.VecConcatenate — Method
VecConcatenate(petsclib::PetscLibType,nx::PetscInt, X::Vector{PetscVec}, Y::PetscVec, x_is::Vector{IS})Creates a new vector that is a vertical concatenation of all the given array of vectors in the order they appear in the array. The concatenated vector resides on the same communicator and is the same type as the source vectors.
Collective
Input Parameters:
nx- number of vectors to be concatenatedX- array containing the vectors to be concatenated in the order of concatenation
Output Parameters:
Y- concatenated vectorx_is- array of index sets corresponding to the concatenated components ofY(passNULLif not needed)
Level: advanced
-seealso: , Vec, VECNEST, VECSCATTER, VecScatterCreate()
External Links
- PETSc Manual:
Vec/VecConcatenate
PETSc.LibPETSc.VecConjugate — Method
VecConjugate(petsclib::PetscLibType,x::PetscVec)Conjugates a vector. That is, replace every entry in a vector with its complex conjugate
Logically Collective
Input Parameter:
x- the vector
Level: intermediate
External Links
- PETSc Manual:
Vec/VecConjugate
PETSc.LibPETSc.VecCopy — Method
VecCopy(petsclib::PetscLibType,x::PetscVec, y::PetscVec)Copies a vector y = x
Logically Collective
Input Parameter:
x- the vector
Output Parameter:
y- the copy
Level: beginner
-seealso: , Vec, VecDuplicate()
External Links
- PETSc Manual:
Vec/VecCopy
PETSc.LibPETSc.VecCreate — Method
vec::PetscVec = VecCreate(petsclib::PetscLibType,comm::MPI_Comm)Creates an empty vector object. The type can then be set with VecSetType(), or VecSetFromOptions().
Collective
Input Parameter:
comm- The communicator for the vector object
Output Parameter:
vec- The vector object
Level: beginner
-seealso: , Vec, VecSetType(), VecSetSizes(), VecCreateMPIWithArray(), VecCreateMPI(), VecDuplicate(), VecDuplicateVecs(), VecCreateGhost(), VecCreateSeq(), VecPlaceArray()
External Links
- PETSc Manual:
Vec/VecCreate
PETSc.LibPETSc.VecCreateFromOptions — Method
vec::PetscVec = VecCreateFromOptions(petsclib::PetscLibType,comm::MPI_Comm, prefix::Vector{Cchar}, bs::PetscInt, m::PetscInt, n::PetscInt)Creates a vector whose type is set from the options database
Collective
Input Parameters:
comm- The communicator for the vector objectprefix- [optional] prefix for the options databasebs- the block size (commonly 1)m- the local size (orPETSC_DECIDE)n- the global size (orPETSC_DETERMINE)
Output Parameter:
vec- The vector object
Options Database Keys:
-vec_type- seeVecType, for exampleseq,mpi,cuda, defaults tompi
Level: beginner
-seealso: , Vec, VecSetType(), VecSetSizes(), VecCreateMPIWithArray(), VecCreateMPI(), VecDuplicate(), VecDuplicateVecs(), VecCreateGhost(), VecCreateSeq(), VecPlaceArray(), VecCreate(), VecType
External Links
- PETSc Manual:
Vec/VecCreateFromOptions
PETSc.LibPETSc.VecCreateGhost — Method
vv::PetscVec = VecCreateGhost(petsclib::PetscLibType,comm::MPI_Comm, n::PetscInt, N::PetscInt, nghost::PetscInt, ghosts::Vector{PetscInt})Creates a parallel vector with ghost padding on each processor.
Collective
Input Parameters:
comm- the MPI communicator to usen- local vector lengthN- global vector length (orPETSC_DETERMINEto have calculated ifnis given)nghost- number of local ghost pointsghosts- global indices of ghost points, these do not need to be in increasing order (sorted)
Output Parameter:
vv- the global vector representation (without ghost points as part of vector)
Level: advanced
-seealso: , Vec, VecType, VecCreateSeq(), VecCreate(), VecDuplicate(), VecDuplicateVecs(), VecCreateMPI(), VecGhostGetLocalForm(), VecGhostRestoreLocalForm(), VecGhostUpdateBegin(), VecCreateGhostWithArray(), VecCreateMPIWithArray(), VecGhostUpdateEnd(), VecCreateGhostBlock(), VecCreateGhostBlockWithArray(), VecMPISetGhost()
External Links
- PETSc Manual:
Vec/VecCreateGhost
PETSc.LibPETSc.VecCreateGhostBlock — Method
vv::PetscVec = VecCreateGhostBlock(petsclib::PetscLibType,comm::MPI_Comm, bs::PetscInt, n::PetscInt, N::PetscInt, nghost::PetscInt, ghosts::Vector{PetscInt})Creates a parallel vector with ghost padding on each processor. The indicing of the ghost points is done with blocks.
Collective
Input Parameters:
comm- the MPI communicator to usebs- the block sizen- local vector lengthN- global vector length (orPETSC_DETERMINEto have calculated ifnis given)nghost- number of local ghost blocksghosts- global indices of ghost blocks, counts are by block, not by individual index, these do not need to be in increasing order (sorted)
Output Parameter:
vv- the global vector representation (without ghost points as part of vector)
Level: advanced
-seealso: , Vec, VecType, VecCreateSeq(), VecCreate(), VecDuplicate(), VecDuplicateVecs(), VecCreateMPI(), VecGhostGetLocalForm(), VecGhostRestoreLocalForm(), VecGhostUpdateBegin(), VecGhostUpdateEnd() VecCreateGhostWithArray(), VecCreateMPIWithArray(), VecCreateGhostBlockWithArray()
External Links
- PETSc Manual:
Vec/VecCreateGhostBlock
PETSc.LibPETSc.VecCreateGhostBlockWithArray — Method
vv::PetscVec = VecCreateGhostBlockWithArray(petsclib::PetscLibType,comm::MPI_Comm, bs::PetscInt, n::PetscInt, N::PetscInt, nghost::PetscInt, ghosts::Vector{PetscInt}, array::Vector{PetscScalar})Creates a parallel vector with ghost padding on each processor; the caller allocates the array space. Indices in the ghost region are based on blocks.
Collective
Input Parameters:
comm- the MPI communicator to usebs- block sizen- local vector lengthN- global vector length (orPETSC_DETERMINEto have calculated ifnis given)nghost- number of local ghost blocksghosts- global indices of ghost blocks (orNULLif not needed), counts are by block not by index, these do not need to be in increasing order (sorted)array- the space to store the vector values (as long as n + nghost*bs)
Output Parameter:
vv- the global vector representation (without ghost points as part of vector)
Level: advanced
-seealso: , Vec, VecType, VecCreate(), VecGhostGetLocalForm(), VecGhostRestoreLocalForm(), VecCreateGhost(), VecCreateSeqWithArray(), VecCreateMPIWithArray(), VecCreateGhostWithArray(), VecCreateGhostBlock(), VecGhostUpdateBegin(), VecGhostUpdateEnd()
External Links
- PETSc Manual:
Vec/VecCreateGhostBlockWithArray
PETSc.LibPETSc.VecCreateGhostWithArray — Method
vv::PetscVec = VecCreateGhostWithArray(petsclib::PetscLibType,comm::MPI_Comm, n::PetscInt, N::PetscInt, nghost::PetscInt, ghosts::Vector{PetscInt}, array::Vector{PetscScalar})Creates a parallel vector with ghost padding on each processor; the caller allocates the array space.
Collective
Input Parameters:
comm- the MPI communicator to usen- local vector lengthN- global vector length (orPETSC_DETERMINEto have calculated ifnis given)nghost- number of local ghost pointsghosts- global indices of ghost points (orNULLif not needed), these do not need to be in increasing order (sorted)array- the space to store the vector values (as long as n + nghost)
Output Parameter:
vv- the global vector representation (without ghost points as part of vector)
Level: advanced
-seealso: , Vec, VecType, VecCreate(), VecGhostGetLocalForm(), VecGhostRestoreLocalForm(), VecCreateGhost(), VecCreateSeqWithArray(), VecCreateMPIWithArray(), VecCreateGhostBlock(), VecCreateGhostBlockWithArray(), VecMPISetGhost(), VecGhostUpdateBegin(), VecGhostUpdateEnd()
External Links
- PETSc Manual:
Vec/VecCreateGhostWithArray
PETSc.LibPETSc.VecCreateLocalVector — Method
w::PetscVec = VecCreateLocalVector(petsclib::PetscLibType,v::PetscVec)Creates a vector object suitable for use with VecGetLocalVector() and friends. You must call VecDestroy() when the vector is no longer needed.
Not Collective.
Input Parameter:
v- The vector for which the local vector is desired.
Output Parameter:
w- Upon exit this contains the local vector.
Level: beginner
-seealso: , Vec, VecGetLocalVectorRead(), VecRestoreLocalVectorRead(), VecGetLocalVector(), VecRestoreLocalVector()
External Links
- PETSc Manual:
Vec/VecCreateLocalVector
PETSc.LibPETSc.VecCreateMPI — Method
v::PetscVec = VecCreateMPI(petsclib::PetscLibType,comm::MPI_Comm, n::PetscInt, N::PetscInt)Creates a parallel vector.
Collective
Input Parameters:
comm- the MPI communicator to usen- local vector length (orPETSC_DECIDEto have calculated ifNis given)N- global vector length (orPETSC_DETERMINEto have calculated ifnis given)
Output Parameter:
v- the vector
Level: intermediate
-seealso: , Vec, VecType, VecCreateSeq(), VecCreate(), VecDuplicate(), VecDuplicateVecs(), VecCreateGhost(), VecCreateMPIWithArray(), VecCreateGhostWithArray(), VecMPISetGhost(), PetscLayout, VecGetOwnershipRange(), VecGetOwnershipRanges()
External Links
- PETSc Manual:
Vec/VecCreateMPI
PETSc.LibPETSc.VecCreateMPIKokkosWithArray — Method
v::PetscVec = VecCreateMPIKokkosWithArray(petsclib::PetscLibType,comm::MPI_Comm, bs::PetscInt, n::PetscInt, N::PetscInt, darray::Vector{PetscScalar})External Links
- PETSc Manual:
Vec/VecCreateMPIKokkosWithArray
PETSc.LibPETSc.VecCreateMPIViennaCLWithArray — Method
array::ViennaCLVector,vv::PetscVec = VecCreateMPIViennaCLWithArray(petsclib::PetscLibType,comm::MPI_Comm, bs::PetscInt, n::PetscInt, N::PetscInt)External Links
- PETSc Manual:
Vec/VecCreateMPIViennaCLWithArray
PETSc.LibPETSc.VecCreateMPIViennaCLWithArrays — Method
viennaclvec::ViennaCLVector,vv::PetscVec = VecCreateMPIViennaCLWithArrays(petsclib::PetscLibType,comm::MPI_Comm, bs::PetscInt, n::PetscInt, N::PetscInt, cpuarray::Vector{PetscScalar})External Links
- PETSc Manual:
Vec/VecCreateMPIViennaCLWithArrays
PETSc.LibPETSc.VecCreateMPIWithArray — Method
vv::PetscVec = VecCreateMPIWithArray(petsclib::PetscLibType,comm::MPI_Comm, bs::PetscInt, n::PetscInt, N::PetscInt, array::Vector{PetscScalar})Creates a parallel, array where the user provides the array space to store the vector values.
Collective
Input Parameters:
comm- the MPI communicator to usebs- block size, same meaning asVecSetBlockSize()n- local vector length, cannot bePETSC_DECIDEN- global vector length (orPETSC_DETERMINEto have calculated)array- the user provided array to store the vector values
Output Parameter:
vv- the vector
Level: intermediate
-seealso: , Vec, VecType, VecCreateSeqWithArray(), VecCreate(), VecDuplicate(), VecDuplicateVecs(), VecCreateGhost(), VecCreateMPI(), VecCreateGhostWithArray(), VecPlaceArray()
External Links
- PETSc Manual:
Vec/VecCreateMPIWithArray
PETSc.LibPETSc.VecCreateNest — Method
Y::PetscVec = VecCreateNest(petsclib::PetscLibType,comm::MPI_Comm, nb::PetscInt, is::Vector{IS}, x::Vector{PetscVec})Creates a new vector containing several nested subvectors, each stored separately
Collective
Input Parameters:
comm- Communicator for the newVecnb- number of nested blocksis- array ofnbindex sets describing each nested block, orNULLto pack subvectors contiguouslyx- array ofnbsub-vectors
Output Parameter:
Y- new vector
Level: advanced
-seealso: VECNEST, , Vec, VecType, VecCreate(), MatCreateNest(), DMSetVecType()
External Links
- PETSc Manual:
Vec/VecCreateNest
PETSc.LibPETSc.VecCreateSeq — Method
v::PetscVec = VecCreateSeq(petsclib::PetscLibType,comm::MPI_Comm, n::PetscInt)Creates a standard, sequential array
Collective
Input Parameters:
comm- the communicator, should bePETSC_COMM_SELFn- the vector length
Output Parameter:
v- the vector
Level: intermediate
-seealso: , Vec, VecType, VecCreateMPI(), VecCreate(), VecDuplicate(), VecDuplicateVecs(), VecCreateGhost()
External Links
- PETSc Manual:
Vec/VecCreateSeq
PETSc.LibPETSc.VecCreateSeqKokkos — Method
v::PetscVec = VecCreateSeqKokkos(petsclib::PetscLibType,comm::MPI_Comm, n::PetscInt)External Links
- PETSc Manual:
Vec/VecCreateSeqKokkos
PETSc.LibPETSc.VecCreateSeqKokkosWithArray — Method
v::PetscVec = VecCreateSeqKokkosWithArray(petsclib::PetscLibType,comm::MPI_Comm, bs::PetscInt, n::PetscInt, darray::Vector{PetscScalar})External Links
- PETSc Manual:
Vec/VecCreateSeqKokkosWithArray
PETSc.LibPETSc.VecCreateSeqViennaCL — Method
v::PetscVec = VecCreateSeqViennaCL(petsclib::PetscLibType,comm::MPI_Comm, n::PetscInt)External Links
- PETSc Manual:
Vec/VecCreateSeqViennaCL
PETSc.LibPETSc.VecCreateSeqViennaCLWithArrays — Method
viennaclvec::ViennaCLVector,V::PetscVec = VecCreateSeqViennaCLWithArrays(petsclib::PetscLibType,comm::MPI_Comm, bs::PetscInt, n::PetscInt, cpuarray::Vector{PetscScalar})External Links
- PETSc Manual:
Vec/VecCreateSeqViennaCLWithArrays
PETSc.LibPETSc.VecCreateSeqWithArray — Method
V::PetscVec = VecCreateSeqWithArray(petsclib::PetscLibType,comm::MPI_Comm, bs::PetscInt, n::PetscInt, array::Vector{PetscScalar})Creates a standard,sequential array where the user provides the array space to store the vector values.
Collective
Input Parameters:
comm- the communicator, should bePETSC_COMM_SELFbs- the block sizen- the vector lengtharray- memory where the vector elements are to be stored.
Output Parameter:
V- the vector
Level: intermediate
-seealso: VecCreateMPIWithArray(), VecCreate(), VecDuplicate(), VecDuplicateVecs(), VecCreateGhost(), VecCreateSeq(), VecPlaceArray()
External Links
- PETSc Manual:
Vec/VecCreateSeqWithArray
PETSc.LibPETSc.VecCreateShared — Method
v::PetscVec = VecCreateShared(petsclib::PetscLibType,comm::MPI_Comm, n::PetscInt, N::PetscInt)Creates a parallel vector that uses shared memory.
Collective
Input Parameters:
comm- the MPI communicator to usen- local vector length (orPETSC_DECIDEto have calculated ifNis given)N- global vector length (orPETSC_DECIDEto have calculated ifnis given)
Output Parameter:
v- the vector
Level: advanced
-seealso: , Vec, VecType, VecCreateSeq(), VecCreate(), VecCreateMPI(), VecDuplicate(), VecDuplicateVecs(), VecCreateGhost(), VecCreateMPIWithArray(), VecCreateGhostWithArray()
External Links
- PETSc Manual:
Vec/VecCreateShared
PETSc.LibPETSc.VecDestroy — Method
VecDestroy(petsclib::PetscLibType,v::PetscVec)Destroys a vector.
Collective
Input Parameter:
v- the vector
Level: beginner
-seealso: , Vec, VecCreate(), VecDuplicate(), VecDestroyVecs()
External Links
- PETSc Manual:
Vec/VecDestroy
PETSc.LibPETSc.VecDestroyVecs — Method
VecDestroyVecs(petsclib::PetscLibType,m::PetscInt, vv::Vector{PetscVec})Frees a block of vectors obtained with VecDuplicateVecs().
Collective
Input Parameters:
m- the number of vectors previously obtained, if zero no vectors are destroyedvv- pointer to pointer to array of vector pointers, ifNULLno vectors are destroyed
Level: intermediate
-seealso: , Vec, , VecDuplicateVecs(), VecDestroyVecsf90()
External Links
- PETSc Manual:
Vec/VecDestroyVecs
PETSc.LibPETSc.VecDot — Method
val::PetscScalar = VecDot(petsclib::PetscLibType,x::PetscVec, y::PetscVec)Computes the vector dot product.
Collective
Input Parameters:
x- first vectory- second vector
Output Parameter:
val- the dot product
Level: intermediate
Notes for Users of Complex Numbers: For complex vectors, VecDot() computes -seealso: , Vec, VecMDot(), VecTDot(), VecNorm(), VecDotBegin(), VecDotEnd(), VecDotRealPart()
External Links
- PETSc Manual:
Vec/VecDot
PETSc.LibPETSc.VecDotBegin — Method
VecDotBegin(petsclib::PetscLibType,x::PetscVec, y::PetscVec, result::PetscScalar)Starts a split phase dot product computation.
Input Parameters:
x- the first vectory- the second vectorresult- where the result will go (can beNULL)
Level: advanced
-seealso: VecDotEnd(), VecNormBegin(), VecNormEnd(), VecNorm(), VecDot(), VecMDot(), VecTDotBegin(), VecTDotEnd(), PetscCommSplitReductionBegin()
External Links
- PETSc Manual:
Vec/VecDotBegin
PETSc.LibPETSc.VecDotEnd — Method
VecDotEnd(petsclib::PetscLibType,x::PetscVec, y::PetscVec, result::PetscScalar)Ends a split phase dot product computation.
Input Parameters:
x- the first vector (can beNULL)y- the second vector (can beNULL)result- where the result will go
Level: advanced
-seealso: VecDotBegin(), VecNormBegin(), VecNormEnd(), VecNorm(), VecDot(), VecMDot(), VecTDotBegin(), VecTDotEnd(), PetscCommSplitReductionBegin()
External Links
- PETSc Manual:
Vec/VecDotEnd
PETSc.LibPETSc.VecDotNorm2 — Method
dp::PetscScalar,nm::PetscReal = VecDotNorm2(petsclib::PetscLibType,s::PetscVec, t::PetscVec)computes the inner product of two vectors and the 2
Collective
Input Parameters:
s- first vectort- second vector
Output Parameters:
dp- s'conj(t)nm- t'conj(t)
Level: advanced
-seealso: Vec, VecDot(), VecNorm(), VecDotBegin(), VecNormBegin(), VecDotEnd(), VecNormEnd()
External Links
- PETSc Manual:
Vec/VecDotNorm2
PETSc.LibPETSc.VecDotRealPart — Method
val::PetscReal = VecDotRealPart(petsclib::PetscLibType,x::PetscVec, y::PetscVec)Computes the real part of the vector dot product.
Collective
Input Parameters:
x- first vectory- second vector
Output Parameter:
val- the real part of the dot product;
Level: intermediate
Notes for Users of Complex Numbers: See VecDot() for more details on the definition of the dot product for complex numbers
For real numbers this returns the same value as VecDot()
For complex numbers in C^n (that is a vector of n components with a complex number for each component) this is equal to the usual real dot product on the the space R^{2n} (that is a vector of 2n components with the real or imaginary part of the complex numbers for components)
-seealso: , Vec, VecMDot(), VecTDot(), VecNorm(), VecDotBegin(), VecDotEnd(), VecDot(), VecDotNorm2()
External Links
- PETSc Manual:
Vec/VecDotRealPart
PETSc.LibPETSc.VecDuplicate — Method
newv::PetscVec = VecDuplicate(petsclib::PetscLibType,v::PetscVec)Creates a new vector of the same type as an existing vector.
Collective
Input Parameter:
v- a vector to mimic
Output Parameter:
newv- location to put new vector
Level: beginner
-seealso: , Vec, VecDestroy(), VecDuplicateVecs(), VecCreate(), VecCopy()
External Links
- PETSc Manual:
Vec/VecDuplicate
PETSc.LibPETSc.VecDuplicateVecs — Method
V::Vector{PetscVec} = VecDuplicateVecs(petsclib::PetscLibType,v::PetscVec, m::PetscInt)Creates several vectors of the same type as an existing vector.
Collective
Input Parameters:
m- the number of vectors to obtainv- a vector to mimic
Output Parameter:
V- location to put pointer to array of vectors
Level: intermediate
-seealso: , Vec, , VecDestroyVecs(), VecDuplicate(), VecCreate(), VecMDot(), VecMAXPY(), KSPGMRES, KSPGMRESSetPreAllocateVectors()
External Links
- PETSc Manual:
Vec/VecDuplicateVecs
PETSc.LibPETSc.VecEqual — Method
flg::PetscBool = VecEqual(petsclib::PetscLibType,vec1::PetscVec, vec2::PetscVec)Compares two vectors. Returns true if the two vectors are either pointing to the same memory buffer, or if the two vectors have the same local and global layout as well as bitwise equality of all entries. Does NOT take round-off errors into account.
Collective
Input Parameters:
vec1- the first vectorvec2- the second vector
Output Parameter:
flg-PETSC_TRUEif the vectors are equal;PETSC_FALSEotherwise.
Level: intermediate
-seealso: Vec
External Links
- PETSc Manual:
Vec/VecEqual
PETSc.LibPETSc.VecErrorWeightedNorms — Method
norm::PetscReal,norm_loc::PetscInt,norma::PetscReal,norma_loc::PetscInt,normr::PetscReal,normr_loc::PetscInt = VecErrorWeightedNorms(petsclib::PetscLibType,U::PetscVec, Y::PetscVec, E::PetscVec, wnormtype::NormType, atol::PetscReal, vatol::PetscVec, rtol::PetscReal, vrtol::PetscVec, ignore_max::PetscReal)compute a weighted norm of the difference between two vectors
Collective
Input Parameters:
U- first vector to be comparedY- second vector to be comparedE- optional third vector representing the error (if not provided, the error is ||U-Y||)wnormtype- norm typeatol- scalar for absolute tolerancevatol- vector representing per-entry absolute tolerances (can beNULL)rtol- scalar for relative tolerancevrtol- vector representing per-entry relative tolerances (can beNULL)ignore_max- ignore values smaller than this value in absolute terms.
Output Parameters:
norm- weighted normnorm_loc- number of vector locations used for the weighted normnorma- weighted norm based on the absolute tolerancenorma_loc- number of vector locations used for the absolute weighted normnormr- weighted norm based on the relative tolerancenormr_loc- number of vector locations used for the relative weighted norm
Level: developer
-seealso: , Vec, NormType, TSErrorWeightedNorm(), TSErrorWeightedENorm()
External Links
- PETSc Manual:
Vec/VecErrorWeightedNorms
PETSc.LibPETSc.VecExp — Method
VecExp(petsclib::PetscLibType,v::PetscVec)Replaces each component of a vector by e^x_i
Not Collective
Input Parameter:
v- The vector
Output Parameter:
v- The vector of exponents
Level: beginner
-seealso: Vec, VecLog(), VecAbs(), VecSqrtAbs(), VecReciprocal()
External Links
- PETSc Manual:
Vec/VecExp
PETSc.LibPETSc.VecFilter — Method
VecFilter(petsclib::PetscLibType,v::PetscVec, tol::PetscReal)Set all values in the vector with an absolute value less than or equal to the tolerance to zero
Input Parameters:
v- The vectortol- The zero tolerance
Output Parameter:
v- The filtered vector
Level: intermediate
-seealso: VecCreate(), VecSet(), MatFilter()
External Links
- PETSc Manual:
Vec/VecFilter
PETSc.LibPETSc.VecFinalizePackage — Method
VecFinalizePackage(petsclib::PetscLibType)This function finalizes everything in the Vec package. It is called from PetscFinalize().
Level: developer
-seealso: PetscInitialize()
External Links
- PETSc Manual:
Vec/VecFinalizePackage
PETSc.LibPETSc.VecFischer — Method
VecFischer(petsclib::PetscLibType,X::PetscVec, F::PetscVec, L::PetscVec, U::PetscVec, FB::PetscVec)Evaluates the Fischer problems.
Logically Collective
Input Parameters:
X- current pointF- function evaluated at xL- lower boundsU- upper bounds
Output Parameter:
FB- The Fischer-Burmeister function vector
Level: developer
-seealso: Vec, VecSFischer(), MatDFischer(), MatDSFischer()
External Links
- PETSc Manual:
Tao/VecFischer
PETSc.LibPETSc.VecFlag — Method
VecFlag(petsclib::PetscLibType,xin::PetscVec, flg::PetscInt)set infinity into the local part of the vector on any subset of MPI processes
Logically Collective
Input Parameters:
xin- the vector, can beNULLbut only if on all processesflg- indicates if this processes portion of the vector should be set to infinity
Level: developer
-seealso: , Vec, PetscLayout, VecGetLayout(), VecGetSize(), VecGetOwnershipRange(), VecGetOwnershipRanges()
External Links
- PETSc Manual:
Vec/VecFlag
PETSc.LibPETSc.VecGetArray — Method
a::Vector{PetscScalar} = VecGetArray(petsclib::PetscLibType,x::PetscVec)Returns a pointer to a contiguous array that contains this MPI processes's portion of the vector data
Logically Collective
Input Parameter:
x- the vector
Output Parameter:
a- location to put pointer to the array
Level: beginner
-seealso: , Vec, VecRestoreArray(), VecGetArrayRead(), VecGetArrays(), VecPlaceArray(), VecGetArray2d(), VecGetArrayPair(), VecRestoreArrayPair(), VecGetArrayWrite(), VecRestoreArrayWrite(), VecGetArrayAndMemType()
External Links
- PETSc Manual:
Vec/VecGetArray
PETSc.LibPETSc.VecGetArray1d — Method
a::PetscArray = VecGetArray1d(petsclib::PetscLibType,x::PetscVec, m::PetscInt, mstart::PetscInt)Returns a pointer to a 1d contiguous array that contains this processor's portion of the vector data. You MUST call VecRestoreArray1d() when you no longer need access to the array.
Logically Collective
Input Parameters:
x- the vectorm- first dimension of two dimensional arraymstart- first index you will use in first coordinate direction (often 0)
Output Parameter:
a- location to put pointer to the array
Level: developer
-seealso: , Vec, VecGetArray(), VecRestoreArray(), VecGetArrays(), VecPlaceArray(), VecRestoreArray2d(), DMDAVecGetArray(), DMDAVecRestoreArray(), VecGetArray3d(), VecRestoreArray3d(), VecGetArray2d(), VecRestoreArray1d(), VecGetArray4d(), VecRestoreArray4d()
External Links
- PETSc Manual:
Vec/VecGetArray1d
PETSc.LibPETSc.VecGetArray1dWrite — Method
a::PetscArray = VecGetArray1dWrite(petsclib::PetscLibType,x::PetscVec, m::PetscInt, mstart::PetscInt)Returns a pointer to a 1d contiguous array that will contain this processor's portion of the vector data. You MUST call VecRestoreArray1dWrite() when you no longer need access to the array.
Logically Collective
Input Parameters:
x- the vectorm- first dimension of two dimensional arraymstart- first index you will use in first coordinate direction (often 0)
Output Parameter:
a- location to put pointer to the array
Level: developer
-seealso: , Vec, VecGetArray(), VecRestoreArray(), VecGetArrays(), VecPlaceArray(), VecRestoreArray2d(), DMDAVecGetArray(), DMDAVecRestoreArray(), VecGetArray3d(), VecRestoreArray3d(), VecGetArray2d(), VecRestoreArray1d(), VecGetArray4d(), VecRestoreArray4d()
External Links
- PETSc Manual:
Vec/VecGetArray1dWrite
PETSc.LibPETSc.VecGetArray2d — Method
a::Vector{PetscScalar} = VecGetArray2d(petsclib::PetscLibType,x::PetscVec, m::PetscInt, n::PetscInt, mstart::PetscInt, nstart::PetscInt)Returns a pointer to a 2d contiguous array that contains this processor's portion of the vector data. You MUST call VecRestoreArray2d() when you no longer need access to the array.
Logically Collective
Input Parameters:
x- the vectorm- first dimension of two dimensional arrayn- second dimension of two dimensional arraymstart- first index you will use in first coordinate direction (often 0)nstart- first index in the second coordinate direction (often 0)
Output Parameter:
a- location to put pointer to the array
Level: developer
-seealso: , Vec, VecGetArray(), VecRestoreArray(), VecGetArrays(), VecPlaceArray(), VecRestoreArray2d(), DMDAVecGetArray(), DMDAVecRestoreArray(), VecGetArray3d(), VecRestoreArray3d(), VecGetArray1d(), VecRestoreArray1d(), VecGetArray4d(), VecRestoreArray4d()
External Links
- PETSc Manual:
Vec/VecGetArray2d
PETSc.LibPETSc.VecGetArray2dRead — Method
a::Vector{PetscScalar} = VecGetArray2dRead(petsclib::PetscLibType,x::PetscVec, m::PetscInt, n::PetscInt, mstart::PetscInt, nstart::PetscInt)Returns a pointer to a 2d contiguous array that contains this processor's portion of the vector data. You MUST call VecRestoreArray2dRead() when you no longer need access to the array.
Logically Collective
Input Parameters:
x- the vectorm- first dimension of two dimensional arrayn- second dimension of two dimensional arraymstart- first index you will use in first coordinate direction (often 0)nstart- first index in the second coordinate direction (often 0)
Output Parameter:
a- location to put pointer to the array
Level: developer
-seealso: , Vec, VecGetArray(), VecRestoreArray(), VecGetArrays(), VecPlaceArray(), VecRestoreArray2d(), DMDAVecGetArray(), DMDAVecRestoreArray(), VecGetArray3d(), VecRestoreArray3d(), VecGetArray1d(), VecRestoreArray1d(), VecGetArray4d(), VecRestoreArray4d()
External Links
- PETSc Manual:
Vec/VecGetArray2dRead
PETSc.LibPETSc.VecGetArray2dWrite — Method
a::Vector{PetscScalar} = VecGetArray2dWrite(petsclib::PetscLibType,x::PetscVec, m::PetscInt, n::PetscInt, mstart::PetscInt, nstart::PetscInt)Returns a pointer to a 2d contiguous array that will contain this processor's portion of the vector data. You MUST call VecRestoreArray2dWrite() when you no longer need access to the array.
Logically Collective
Input Parameters:
x- the vectorm- first dimension of two dimensional arrayn- second dimension of two dimensional arraymstart- first index you will use in first coordinate direction (often 0)nstart- first index in the second coordinate direction (often 0)
Output Parameter:
a- location to put pointer to the array
Level: developer
-seealso: , Vec, VecGetArray(), VecRestoreArray(), VecGetArrays(), VecPlaceArray(), VecRestoreArray2d(), DMDAVecGetArray(), DMDAVecRestoreArray(), VecGetArray3d(), VecRestoreArray3d(), VecGetArray1d(), VecRestoreArray1d(), VecGetArray4d(), VecRestoreArray4d()
External Links
- PETSc Manual:
Vec/VecGetArray2dWrite
PETSc.LibPETSc.VecGetArray3d — Method
a::PetscArray = VecGetArray3d(petsclib::PetscLibType,x::PetscVec, m::PetscInt, n::PetscInt, p::PetscInt, mstart::PetscInt, nstart::PetscInt, pstart::PetscInt)Returns a pointer to a 3d contiguous array that contains this processor's portion of the vector data. You MUST call VecRestoreArray3d() when you no longer need access to the array.
Logically Collective
Input Parameters:
x- the vectorm- first dimension of three dimensional arrayn- second dimension of three dimensional arrayp- third dimension of three dimensional arraymstart- first index you will use in first coordinate direction (often 0)nstart- first index in the second coordinate direction (often 0)pstart- first index in the third coordinate direction (often 0)
Output Parameter:
a- location to put pointer to the array
Level: developer
-seealso: , Vec, VecGetArray(), VecRestoreArray(), VecGetArrays(), VecPlaceArray(), VecRestoreArray2d(), DMDAVecGetarray(), DMDAVecRestoreArray(), VecRestoreArray3d(), VecGetArray1d(), VecRestoreArray1d(), VecGetArray4d(), VecRestoreArray4d()
External Links
- PETSc Manual:
Vec/VecGetArray3d
PETSc.LibPETSc.VecGetArray3dRead — Method
a::PetscArray = VecGetArray3dRead(petsclib::PetscLibType,x::PetscVec, m::PetscInt, n::PetscInt, p::PetscInt, mstart::PetscInt, nstart::PetscInt, pstart::PetscInt)Returns a pointer to a 3d contiguous array that contains this processor's portion of the vector data. You MUST call VecRestoreArray3dRead() when you no longer need access to the array.
Logically Collective
Input Parameters:
x- the vectorm- first dimension of three dimensional arrayn- second dimension of three dimensional arrayp- third dimension of three dimensional arraymstart- first index you will use in first coordinate direction (often 0)nstart- first index in the second coordinate direction (often 0)pstart- first index in the third coordinate direction (often 0)
Output Parameter:
a- location to put pointer to the array
Level: developer
-seealso: , Vec, VecGetArray(), VecRestoreArray(), VecGetArrays(), VecPlaceArray(), VecRestoreArray2d(), DMDAVecGetarray(), DMDAVecRestoreArray(), VecGetArray3d(), VecRestoreArray3d(), VecGetArray1d(), VecRestoreArray1d(), VecGetArray4d(), VecRestoreArray4d()
External Links
- PETSc Manual:
Vec/VecGetArray3dRead
PETSc.LibPETSc.VecGetArray3dWrite — Method
a::PetscArray = VecGetArray3dWrite(petsclib::PetscLibType,x::PetscVec, m::PetscInt, n::PetscInt, p::PetscInt, mstart::PetscInt, nstart::PetscInt, pstart::PetscInt)Returns a pointer to a 3d contiguous array that will contain this processor's portion of the vector data. You MUST call VecRestoreArray3dWrite() when you no longer need access to the array.
Logically Collective
Input Parameters:
x- the vectorm- first dimension of three dimensional arrayn- second dimension of three dimensional arrayp- third dimension of three dimensional arraymstart- first index you will use in first coordinate direction (often 0)nstart- first index in the second coordinate direction (often 0)pstart- first index in the third coordinate direction (often 0)
Output Parameter:
a- location to put pointer to the array
Level: developer
-seealso: , Vec, VecGetArray(), VecRestoreArray(), VecGetArrays(), VecPlaceArray(), VecRestoreArray2d(), DMDAVecGetarray(), DMDAVecRestoreArray(), VecGetArray3d(), VecRestoreArray3d(), VecGetArray1d(), VecRestoreArray1d(), VecGetArray4d(), VecRestoreArray4d()
External Links
- PETSc Manual:
Vec/VecGetArray3dWrite
PETSc.LibPETSc.VecGetArray4d — Method
a::PetscArray = VecGetArray4d(petsclib::PetscLibType,x::PetscVec, m::PetscInt, n::PetscInt, p::PetscInt, q::PetscInt, mstart::PetscInt, nstart::PetscInt, pstart::PetscInt, qstart::PetscInt)Returns a pointer to a 4d contiguous array that contains this processor's portion of the vector data. You MUST call VecRestoreArray4d() when you no longer need access to the array.
Logically Collective
Input Parameters:
x- the vectorm- first dimension of four dimensional arrayn- second dimension of four dimensional arrayp- third dimension of four dimensional arrayq- fourth dimension of four dimensional arraymstart- first index you will use in first coordinate direction (often 0)nstart- first index in the second coordinate direction (often 0)pstart- first index in the third coordinate direction (often 0)qstart- first index in the fourth coordinate direction (often 0)
Output Parameter:
a- location to put pointer to the array
Level: developer
-seealso: , Vec, VecGetArray(), VecRestoreArray(), VecGetArrays(), VecPlaceArray(), VecRestoreArray2d(), DMDAVecGetarray(), DMDAVecRestoreArray(), VecGetArray3d(), VecRestoreArray3d(), VecGetArray1d(), VecRestoreArray1d(), VecRestoreArray4d()
External Links
- PETSc Manual:
Vec/VecGetArray4d
PETSc.LibPETSc.VecGetArray4dRead — Method
a::PetscArray = VecGetArray4dRead(petsclib::PetscLibType,x::PetscVec, m::PetscInt, n::PetscInt, p::PetscInt, q::PetscInt, mstart::PetscInt, nstart::PetscInt, pstart::PetscInt, qstart::PetscInt)Returns a pointer to a 4d contiguous array that contains this processor's portion of the vector data. You MUST call VecRestoreArray4dRead() when you no longer need access to the array.
Logically Collective
Input Parameters:
x- the vectorm- first dimension of four dimensional arrayn- second dimension of four dimensional arrayp- third dimension of four dimensional arrayq- fourth dimension of four dimensional arraymstart- first index you will use in first coordinate direction (often 0)nstart- first index in the second coordinate direction (often 0)pstart- first index in the third coordinate direction (often 0)qstart- first index in the fourth coordinate direction (often 0)
Output Parameter:
a- location to put pointer to the array
Level: beginner
-seealso: , Vec, VecGetArray(), VecRestoreArray(), VecGetArrays(), VecPlaceArray(), VecRestoreArray2d(), DMDAVecGetarray(), DMDAVecRestoreArray(), VecGetArray3d(), VecRestoreArray3d(), VecGetArray1d(), VecRestoreArray1d(), VecGetArray4d(), VecRestoreArray4d()
External Links
- PETSc Manual:
Vec/VecGetArray4dRead
PETSc.LibPETSc.VecGetArray4dWrite — Method
a::PetscArray = VecGetArray4dWrite(petsclib::PetscLibType,x::PetscVec, m::PetscInt, n::PetscInt, p::PetscInt, q::PetscInt, mstart::PetscInt, nstart::PetscInt, pstart::PetscInt, qstart::PetscInt)Returns a pointer to a 4d contiguous array that will contain this processor's portion of the vector data. You MUST call VecRestoreArray4dWrite() when you no longer need access to the array.
Logically Collective
Input Parameters:
x- the vectorm- first dimension of four dimensional arrayn- second dimension of four dimensional arrayp- third dimension of four dimensional arrayq- fourth dimension of four dimensional arraymstart- first index you will use in first coordinate direction (often 0)nstart- first index in the second coordinate direction (often 0)pstart- first index in the third coordinate direction (often 0)qstart- first index in the fourth coordinate direction (often 0)
Output Parameter:
a- location to put pointer to the array
Level: developer
-seealso: , Vec, VecGetArray(), VecRestoreArray(), VecGetArrays(), VecPlaceArray(), VecRestoreArray2d(), DMDAVecGetarray(), DMDAVecRestoreArray(), VecGetArray3d(), VecRestoreArray3d(), VecGetArray1d(), VecRestoreArray1d(), VecGetArray4d(), VecRestoreArray4d()
External Links
- PETSc Manual:
Vec/VecGetArray4dWrite
PETSc.LibPETSc.VecGetArrayAndMemType — Method
a::Vector{PetscScalar},mtype::PetscMemType = VecGetArrayAndMemType(petsclib::PetscLibType,x::PetscVec)Like VecGetArray(), but if this is a standard device vector (e.g., VECCUDA), the returned pointer will be a device pointer to the device memory that contains this MPI processes's portion of the vector data.
Logically Collective; No Fortran Support
Input Parameter:
x- the vector
Output Parameters:
a- location to put pointer to the arraymtype- memory type of the array
Level: beginner
-seealso: , Vec, VecRestoreArrayAndMemType(), VecGetArrayReadAndMemType(), VecGetArrayWriteAndMemType(), VecRestoreArray(), VecGetArrayRead(), VecGetArrays(), VecPlaceArray(), VecGetArray2d(), VecGetArrayPair(), VecRestoreArrayPair(), VecGetArrayWrite(), VecRestoreArrayWrite()
External Links
- PETSc Manual:
Vec/VecGetArrayAndMemType
PETSc.LibPETSc.VecGetArrayPair — Method
xv::Vector{PetscScalar},yv::Vector{PetscScalar} = VecGetArrayPair(petsclib::PetscLibType,x::PetscVec, y::PetscVec)External Links
- PETSc Manual:
Vec/VecGetArrayPair
PETSc.LibPETSc.VecGetArrayRead — Method
a::Vector{PetscScalar} = VecGetArrayRead(petsclib::PetscLibType,x::PetscVec)Get read
Not Collective
Input Parameter:
x- the vector
Output Parameter:
a- the array
Level: beginner
-seealso: , Vec, VecGetArray(), VecRestoreArray(), VecGetArrayPair(), VecRestoreArrayPair(), VecGetArrayAndMemType()
External Links
- PETSc Manual:
Vec/VecGetArrayRead
PETSc.LibPETSc.VecGetArrayReadAndMemType — Method
a::Vector{PetscScalar},mtype::PetscMemType = VecGetArrayReadAndMemType(petsclib::PetscLibType,x::PetscVec)Like VecGetArrayRead(), but if the input vector is a device vector, it will return a read The returned pointer is guaranteed to point to up-to-date data. For host vectors, it functions as VecGetArrayRead().
Not Collective; No Fortran Support
Input Parameter:
x- the vector
Output Parameters:
a- the arraymtype- memory type of the array
Level: beginner
-seealso: , Vec, VecRestoreArrayReadAndMemType(), VecGetArrayAndMemType(), VecGetArrayWriteAndMemType(), VecGetArray(), VecRestoreArray(), VecGetArrayPair(), VecRestoreArrayPair()
External Links
- PETSc Manual:
Vec/VecGetArrayReadAndMemType
PETSc.LibPETSc.VecGetArrayWrite — Method
a::Vector{PetscScalar} = VecGetArrayWrite(petsclib::PetscLibType,x::PetscVec)Returns a pointer to a contiguous array that WILL contain this MPI processes's portion of the vector data.
Logically Collective
Input Parameter:
x- the vector
Output Parameter:
a- location to put pointer to the array
Level: intermediate
-seealso: , Vec, VecRestoreArray(), VecGetArrayRead(), VecGetArrays(), VecPlaceArray(), VecGetArray2d(), VecGetArrayPair(), VecRestoreArrayPair(), VecGetArray(), VecRestoreArrayWrite(), VecGetArrayAndMemType()
External Links
- PETSc Manual:
Vec/VecGetArrayWrite
PETSc.LibPETSc.VecGetArrayWriteAndMemType — Method
a::Vector{PetscScalar},mtype::PetscMemType = VecGetArrayWriteAndMemType(petsclib::PetscLibType,x::PetscVec)Like VecGetArrayWrite(), but if this is a device vector it will always return a device pointer to the device memory that contains this processor's portion of the vector data.
Logically Collective; No Fortran Support
Input Parameter:
x- the vector
Output Parameters:
a- the arraymtype- memory type of the array
Level: beginner
-seealso: , Vec, VecRestoreArrayWriteAndMemType(), VecGetArrayReadAndMemType(), VecGetArrayAndMemType(), VecGetArray(), VecRestoreArray(), VecGetArrayPair(), VecRestoreArrayPair(),
External Links
- PETSc Manual:
Vec/VecGetArrayWriteAndMemType
PETSc.LibPETSc.VecGetArrays — Method
a::Vector{PetscScalar} = VecGetArrays(petsclib::PetscLibType,x::Vector{PetscVec}, n::PetscInt)Returns a pointer to the arrays in a set of vectors that were created by a call to VecDuplicateVecs().
Logically Collective; No Fortran Support
Input Parameters:
x- the vectorsn- the number of vectors
Output Parameter:
a- location to put pointer to the array
Level: intermediate
-seealso: , Vec, VecGetArray(), VecRestoreArrays()
External Links
- PETSc Manual:
Vec/VecGetArrays
PETSc.LibPETSc.VecGetBindingPropagates — Method
flg::PetscBool = VecGetBindingPropagates(petsclib::PetscLibType,v::PetscVec)Gets whether the state of being bound to the CPU for a GPU vector type propagates to child and some other associated objects
Input Parameter:
v- the vector
Output Parameter:
flg- flag indicating whether the boundtocpu flag will be propagated
Level: developer
-seealso: , Vec, VecSetBindingPropagates()
External Links
- PETSc Manual:
Vec/VecGetBindingPropagates
PETSc.LibPETSc.VecGetBlockSize — Method
bs::PetscInt = VecGetBlockSize(petsclib::PetscLibType,v::PetscVec)Gets the blocksize for the vector, i.e. what is used for VecSetValuesBlocked() and VecSetValuesBlockedLocal().
Not Collective
Input Parameter:
v- the vector
Output Parameter:
bs- the blocksize
Level: advanced
-seealso: , Vec, VecSetValuesBlocked(), VecSetLocalToGlobalMapping(), VecSetBlockSize()
External Links
- PETSc Manual:
Vec/VecGetBlockSize
PETSc.LibPETSc.VecGetDM — Method
dm::PetscDM = VecGetDM(petsclib::PetscLibType,v::PetscVec)Gets the DM defining the data layout of the vector
Not Collective
Input Parameter:
v- TheVec
Output Parameter:
dm- TheDM
Level: intermediate
Note: A Vec may not have a DM associated with it.
See also:
DM, VecSetDM(), DMGetLocalVector(), DMGetGlobalVector(), DMSetVecType()
External Links
- PETSc Manual:
DM/VecGetDM
PETSc.LibPETSc.VecGetLayout — Method
VecGetLayout(petsclib::PetscLibType,x::PetscVec, map::PetscLayout)get PetscLayout describing a vector layout
Not Collective
Input Parameter:
x- the vector
Output Parameter:
map- the layout
Level: developer
-seealso: , PetscLayout, Vec, VecGetSize(), VecGetOwnershipRange(), VecGetOwnershipRanges()
External Links
- PETSc Manual:
Vec/VecGetLayout
PETSc.LibPETSc.VecGetLocalSize — Method
size::PetscInt = VecGetLocalSize(petsclib::PetscLibType,x::PetscVec)Returns the number of elements of the vector stored in local memory (that is on this MPI process)
Not Collective
Input Parameter:
x- the vector
Output Parameter:
size- the length of the local piece of the vector
Level: beginner
External Links
- PETSc Manual:
Vec/VecGetLocalSize
PETSc.LibPETSc.VecGetLocalToGlobalMapping — Method
VecGetLocalToGlobalMapping(petsclib::PetscLibType,X::PetscVec, mapping::ISLocalToGlobalMapping)Gets the local
Not Collective
Input Parameter:
X- the vector
Output Parameter:
mapping- the mapping
Level: advanced
-seealso: , Vec, VecSetValuesLocal(), VecSetLocalToGlobalMapping()
External Links
- PETSc Manual:
Vec/VecGetLocalToGlobalMapping
PETSc.LibPETSc.VecGetLocalVector — Method
VecGetLocalVector(petsclib::PetscLibType,v::PetscVec, w::PetscVec)Maps the local portion of a vector into a vector.
Collective
Input Parameter:
v- The vector for which the local vector is desired.
Output Parameter:
w- Upon exit this contains the local vector.
Level: beginner
-seealso: , Vec, VecCreateLocalVector(), VecRestoreLocalVector(), VecGetLocalVectorRead(), VecGetArrayRead(), VecGetArray()
External Links
- PETSc Manual:
Vec/VecGetLocalVector
PETSc.LibPETSc.VecGetLocalVectorRead — Method
VecGetLocalVectorRead(petsclib::PetscLibType,v::PetscVec, w::PetscVec)Maps the local portion of a vector into a vector.
Not Collective.
Input Parameter:
v- The vector for which the local vector is desired.
Output Parameter:
w- Upon exit this contains the local vector.
Level: beginner
-seealso: , Vec, VecCreateLocalVector(), VecRestoreLocalVectorRead(), VecGetLocalVector(), VecGetArrayRead(), VecGetArray()
External Links
- PETSc Manual:
Vec/VecGetLocalVectorRead
PETSc.LibPETSc.VecGetOffloadMask — Method
VecGetOffloadMask(petsclib::PetscLibType,v::PetscVec, mask::PetscOffloadMask)Get the offload mask of a Vec
Not Collective
Input Parameter:
v- the vector
Output Parameter:
mask- correspondingPetscOffloadMaskenum value.
Level: intermediate
-seealso: , Vec, VecCreateSeqCUDA(), VecCreateSeqViennaCL(), VecGetArray(), VecGetType()
External Links
- PETSc Manual:
Vec/VecGetOffloadMask
PETSc.LibPETSc.VecGetOptionsPrefix — Method
VecGetOptionsPrefix(petsclib::PetscLibType,v::PetscVec, prefix::Vector{Cchar})Sets the prefix used for searching for all Vec options in the database.
Not Collective
Input Parameter:
v- theVeccontext
Output Parameter:
prefix- pointer to the prefix string used
Level: advanced
-seealso: , Vec, VecAppendOptionsPrefix()
External Links
- PETSc Manual:
Vec/VecGetOptionsPrefix
PETSc.LibPETSc.VecGetOwnershipRange — Method
low::PetscInt,high::PetscInt = VecGetOwnershipRange(petsclib::PetscLibType,x::PetscVec)Returns the range of indices owned by this process. The vector is laid out with the first n1 elements on the first processor, next n2 elements on the second, etc. For certain parallel layouts this range may not be well defined.
Not Collective
Input Parameter:
x- the vector
Output Parameters:
low- the first local element, pass inNULLif not interestedhigh- one more than the last local element, pass inNULLif not interested
Level: beginner
-seealso: , Vec, MatGetOwnershipRange(), MatGetOwnershipRanges(), VecGetOwnershipRanges(), PetscSplitOwnership(), VecSetSizes(), VecCreateMPI(), PetscLayout, DMDAGetGhostCorners(), DM
External Links
- PETSc Manual:
Vec/VecGetOwnershipRange
PETSc.LibPETSc.VecGetOwnershipRanges — Method
ranges::Vector{PetscInt} = VecGetOwnershipRanges(petsclib::PetscLibType,x::PetscVec)Returns the range of indices owned by EACH processor, The vector is laid out with the first n1 elements on the first processor, next n2 elements on the second, etc. For certain parallel layouts this range may not be well defined.
Not Collective
Input Parameter:
x- the vector
Output Parameter:
ranges- array of lengthsize+ 1 with the start and end+1 for each process
Level: beginner
-seealso: , Vec, MatGetOwnershipRange(), MatGetOwnershipRanges(), VecGetOwnershipRange(), PetscSplitOwnership(), VecSetSizes(), VecCreateMPI(), PetscLayout, DMDAGetGhostCorners(), DM
External Links
- PETSc Manual:
Vec/VecGetOwnershipRanges
PETSc.LibPETSc.VecGetPinnedMemoryMin — Method
VecGetPinnedMemoryMin(petsclib::PetscLibType,v::PetscVec, mbytes::Csize_t)Get the minimum data size for which pinned memory will be used for host (CPU) allocations.
Logically Collective
Input Parameter:
v- the vector
Output Parameter:
mbytes- minimum data size in bytes
Level: developer
-seealso: , Vec, VecSetPinnedMemoryMin()
External Links
- PETSc Manual:
Vec/VecGetPinnedMemoryMin
PETSc.LibPETSc.VecGetSize — Method
size::PetscInt = VecGetSize(petsclib::PetscLibType,x::PetscVec)Returns the global number of elements of the vector.
Not Collective
Input Parameter:
x- the vector
Output Parameter:
size- the global length of the vector
Level: beginner
-seealso: , Vec, VecGetLocalSize()
External Links
- PETSc Manual:
Vec/VecGetSize
PETSc.LibPETSc.VecGetState — Method
VecGetState(petsclib::PetscLibType,v::PetscVec, state::PetscObjectState)Gets the state of a Vec.
Not Collective
Input Parameter:
v- theVeccontext
Output Parameter:
state- the object state
Level: advanced
-seealso: , Vec, VecCreate(), PetscObjectStateGet()
External Links
- PETSc Manual:
Vec/VecGetState
PETSc.LibPETSc.VecGetSubVector — Method
VecGetSubVector(petsclib::PetscLibType,X::PetscVec, is::IS, Y::PetscVec)Gets a vector representing part of another vector
Collective
Input Parameters:
X- vector from which to extract a subvectoris- index set representing portion ofXto extract
Output Parameter:
Y- subvector corresponding tois
Level: advanced
-seealso: , Vec, IS, VECNEST, MatCreateSubMatrix()
External Links
- PETSc Manual:
Vec/VecGetSubVector
PETSc.LibPETSc.VecGetType — Method
type::VecType = VecGetType(petsclib::PetscLibType,vec::PetscVec)Gets the vector type name (as a string) from a Vec.
Not Collective
Input Parameter:
vec- The vector
Output Parameter:
type- TheVecTypeof the vector
Level: intermediate
-seealso: , Vec, VecType, VecCreate(), VecDuplicate(), VecDuplicateVecs()
External Links
- PETSc Manual:
Vec/VecGetType
PETSc.LibPETSc.VecGetValues — Method
y::Vector{PetscScalar} = VecGetValues(petsclib::PetscLibType,x::PetscVec, ni::PetscInt, ix::Vector{PetscInt})Gets values from certain locations of a vector. Currently can only get values on the same processor on which they are owned
Not Collective
Input Parameters:
x- vector to get values fromni- number of elements to getix- indices where to get them from (in global 1d numbering)
Output Parameter:
y- array of values, must be passed in with a length ofni
Level: beginner
-seealso: , Vec, VecAssemblyBegin(), VecAssemblyEnd(), VecSetValues()
External Links
- PETSc Manual:
Vec/VecGetValues
PETSc.LibPETSc.VecGetValuesSection — Method
values::Vector{PetscScalar} = VecGetValuesSection(petsclib::PetscLibType,v::PetscVec, s::PetscSection, point::PetscInt)Gets all the values associated with a given point, according to the section, in the given Vec
Not Collective
Input Parameters:
v- theVecs- the organizingPetscSectionpoint- the point
Output Parameter:
values- the array of output values
Level: developer
-seealso: PetscSection, PetscSectionCreate(), VecSetValuesSection()
External Links
- PETSc Manual:
Vec/VecGetValuesSection
PETSc.LibPETSc.VecGhostGetGhostIS — Method
VecGhostGetGhostIS(petsclib::PetscLibType,X::PetscVec, ghost::IS)Return ghosting indices of a ghost vector
Input Parameters:
X- ghost vector
Output Parameter:
ghost- ghosting indices
Level: beginner
-seealso: VecCreateGhostWithArray(), VecCreateMPIWithArray()
External Links
- PETSc Manual:
Vec/VecGhostGetGhostIS
PETSc.LibPETSc.VecGhostGetLocalForm — Method
l::PetscVec = VecGhostGetLocalForm(petsclib::PetscLibType,g::PetscVec)Obtains the local ghosted representation of a parallel vector (obtained with VecCreateGhost(), VecCreateGhostWithArray() or VecCreateSeq()).
Logically Collective
Input Parameter:
g- the global vector
Output Parameter:
l- the local (ghosted) representation,NULLifgis not ghosted
Level: advanced
-seealso: , VecGhostUpdateBegin(), VecGhostUpdateEnd(), Vec, VecType, VecCreateGhost(), VecGhostRestoreLocalForm(), VecCreateGhostWithArray()
External Links
- PETSc Manual:
Vec/VecGhostGetLocalForm
PETSc.LibPETSc.VecGhostIsLocalForm — Method
flg::PetscBool = VecGhostIsLocalForm(petsclib::PetscLibType,g::PetscVec, l::PetscVec)Checks if a given vector is the local form of a global vector
Not Collective
Input Parameters:
g- the global vectorl- the local vector
Output Parameter:
flg-PETSC_TRUEiflis the local form
Level: advanced
-seealso: , Vec, VecType, VecCreateGhost(), VecGhostRestoreLocalForm(), VecCreateGhostWithArray(), VecGhostGetLocalForm()
External Links
- PETSc Manual:
Vec/VecGhostIsLocalForm
PETSc.LibPETSc.VecGhostRestoreLocalForm — Method
VecGhostRestoreLocalForm(petsclib::PetscLibType,g::PetscVec, l::PetscVec)Restores the local ghosted representation of a parallel vector obtained with VecGhostGetLocalForm().
Logically Collective
Input Parameters:
g- the global vectorl- the local (ghosted) representation
Level: advanced
-seealso: , VecGhostUpdateBegin(), VecGhostUpdateEnd(), Vec, VecType, VecCreateGhost(), VecGhostGetLocalForm(), VecCreateGhostWithArray()
External Links
- PETSc Manual:
Vec/VecGhostRestoreLocalForm
PETSc.LibPETSc.VecGhostUpdateBegin — Method
VecGhostUpdateBegin(petsclib::PetscLibType,g::PetscVec, insertmode::InsertMode, scattermode::ScatterMode)Begins the vector scatter to update the vector from local representation to global or global representation to local.
Neighbor-wise Collective
Input Parameters:
g- the vector (obtained withVecCreateGhost()orVecDuplicate())insertmode- one ofADD_VALUES,MAX_VALUES,MIN_VALUESorINSERT_VALUESscattermode- one ofSCATTER_FORWARD(update ghosts) orSCATTER_REVERSE(update local values from ghosts)
Level: advanced
-seealso: , Vec, VecType, VecCreateGhost(), VecGhostUpdateEnd(), VecGhostGetLocalForm(), VecGhostRestoreLocalForm(), VecCreateGhostWithArray()
External Links
- PETSc Manual:
Vec/VecGhostUpdateBegin
PETSc.LibPETSc.VecGhostUpdateEnd — Method
VecGhostUpdateEnd(petsclib::PetscLibType,g::PetscVec, insertmode::InsertMode, scattermode::ScatterMode)End the vector scatter to update the vector from local representation to global or global representation to local.
Neighbor-wise Collective
Input Parameters:
g- the vector (obtained withVecCreateGhost()orVecDuplicate())insertmode- one ofADD_VALUES,MAX_VALUES,MIN_VALUESorINSERT_VALUESscattermode- one ofSCATTER_FORWARD(update ghosts) orSCATTER_REVERSE(update local values from ghosts)
Level: advanced
-seealso: , Vec, VecType, VecCreateGhost(), VecGhostUpdateBegin(), VecGhostGetLocalForm(), VecGhostRestoreLocalForm(), VecCreateGhostWithArray()
External Links
- PETSc Manual:
Vec/VecGhostUpdateEnd
PETSc.LibPETSc.VecISAXPY — Method
VecISAXPY(petsclib::PetscLibType,vfull::PetscVec, is::IS, alpha::PetscScalar, vreduced::PetscVec)Adds a reduced vector to the appropriate elements of a full vfull[is[i]] += alpha*vreduced[i]
Logically Collective
Input Parameters:
vfull- the full-space vectoris- the index set for the reduced spacealpha- the scalar coefficientvreduced- the reduced-space vector
Output Parameter:
vfull- the sum of the full-space vector and reduced-space vector
Level: advanced
-seealso: VecISCopy(), VecISSet(), VecAXPY()
External Links
- PETSc Manual:
Vec/VecISAXPY
PETSc.LibPETSc.VecISCopy — Method
VecISCopy(petsclib::PetscLibType,vfull::PetscVec, is::IS, mode::ScatterMode, vreduced::PetscVec)Copies between a reduced vector and the appropriate elements of a full
Logically Collective
Input Parameters:
vfull- the full-space vectoris- the index set for the reduced spacemode- the direction of copying,SCATTER_FORWARDorSCATTER_REVERSEvreduced- the reduced-space vector
Output Parameter:
vfull- the sum of the full-space vector and reduced-space vector
Level: advanced
-seealso: VecISSet(), VecISAXPY(), VecCopy()
External Links
- PETSc Manual:
Vec/VecISCopy
PETSc.LibPETSc.VecISSet — Method
VecISSet(petsclib::PetscLibType,V::PetscVec, S::IS, c::PetscScalar)Sets the elements of a vector, specified by an index set, to a constant
Logically Collective
Input Parameters:
V- the vectorS- index set for the locations in the vectorc- the constant
Level: advanced
-seealso: VecISCopy(), VecISAXPY(), VecISShift(), VecSet()
External Links
- PETSc Manual:
Vec/VecISSet
PETSc.LibPETSc.VecISShift — Method
VecISShift(petsclib::PetscLibType,V::PetscVec, S::IS, c::PetscScalar)Shifts the elements of a vector, specified by an index set, by a constant
Logically Collective
Input Parameters:
V- the vectorS- index set for the locations in the vectorc- the constant
Level: advanced
-seealso: VecISCopy(), VecISAXPY(), VecISSet(), VecShift()
External Links
- PETSc Manual:
Vec/VecISShift
PETSc.LibPETSc.VecImaginaryPart — Method
VecImaginaryPart(petsclib::PetscLibType,v::PetscVec)Replaces a complex vector with its imginary part
Collective
Input Parameter:
v- the vector
Level: beginner
-seealso: Vec, VecNorm(), VecRealPart()
External Links
- PETSc Manual:
Vec/VecImaginaryPart
PETSc.LibPETSc.VecInitializePackage — Method
VecInitializePackage(petsclib::PetscLibType)This function initializes everything in the Vec package. It is called from PetscDLLibraryRegister_petscvec() when using dynamic libraries, and on the first call to VecCreate() when using shared or static libraries.
Level: developer
-seealso: PetscInitialize()
External Links
- PETSc Manual:
Vec/VecInitializePackage
PETSc.LibPETSc.VecKokkosPlaceArray — Method
a::PetscScalar = VecKokkosPlaceArray(petsclib::PetscLibType,v::PetscVec)External Links
- PETSc Manual:
Vec/VecKokkosPlaceArray
PETSc.LibPETSc.VecKokkosResetArray — Method
VecKokkosResetArray(petsclib::PetscLibType,v::PetscVec)External Links
- PETSc Manual:
Vec/VecKokkosResetArray
PETSc.LibPETSc.VecLoad — Method
VecLoad(petsclib::PetscLibType,vec::PetscVec, viewer::PetscViewer)Loads a vector that has been stored in binary or HDF5 format with VecView().
Collective
Input Parameters:
vec- the newly loaded vector, this needs to have been created withVecCreate()or
some related function before the call to VecLoad().
viewer- binary file viewer, obtained fromPetscViewerBinaryOpen()or
HDF5 file viewer, obtained from PetscViewerHDF5Open()
Level: intermediate
-seealso: , Vec, PetscViewerBinaryOpen(), VecView(), MatLoad()
External Links
- PETSc Manual:
Vec/VecLoad
PETSc.LibPETSc.VecLockGet — Method
state::PetscInt = VecLockGet(petsclib::PetscLibType,x::PetscVec)Get the current lock status of a vector
Logically Collective
Input Parameter:
x- the vector
Output Parameter:
state- greater than zero indicates the vector is locked for read; less than zero indicates the vector is
locked for write; equal to zero means the vector is unlocked, that is, it is free to read or write.
Level: advanced
-seealso: , Vec, VecRestoreArray(), VecGetArrayRead(), VecLockReadPush(), VecLockReadPop()
External Links
- PETSc Manual:
Vec/VecLockGet
PETSc.LibPETSc.VecLockGetLocation — Method
VecLockGetLocation(petsclib::PetscLibType,x::PetscVec, file::Vector{Cchar}, func::Vector{Cchar}, line::Cint)External Links
- PETSc Manual:
Vec/VecLockGetLocation
PETSc.LibPETSc.VecLockReadPop — Method
VecLockReadPop(petsclib::PetscLibType,x::PetscVec)Pop a read
Logically Collective
Input Parameter:
x- the vector
Level: intermediate
-seealso: , Vec, VecRestoreArray(), VecGetArrayRead(), VecLockReadPush(), VecLockGet()
External Links
- PETSc Manual:
Vec/VecLockReadPop
PETSc.LibPETSc.VecLockReadPush — Method
VecLockReadPush(petsclib::PetscLibType,x::PetscVec)Push a read
Logically Collective
Input Parameter:
x- the vector
Level: intermediate
-seealso: , Vec, VecRestoreArray(), VecGetArrayRead(), VecLockReadPop(), VecLockGet()
External Links
- PETSc Manual:
Vec/VecLockReadPush
PETSc.LibPETSc.VecLockWriteSet — Method
VecLockWriteSet(petsclib::PetscLibType,x::PetscVec, flg::PetscBool)Lock or unlock a vector for exclusive read/write access
Logically Collective
Input Parameters:
x- the vectorflg-PETSC_TRUEto lock the vector for exclusive read/write access;PETSC_FALSEto unlock it.
Level: intermediate
-seealso: , Vec, VecRestoreArray(), VecGetArrayRead(), VecLockReadPush(), VecLockReadPop(), VecLockGet()
External Links
- PETSc Manual:
Vec/VecLockWriteSet
PETSc.LibPETSc.VecLog — Method
VecLog(petsclib::PetscLibType,v::PetscVec)Replaces each component of a vector by log(x_i), the natural logarithm
Not Collective
Input Parameter:
v- The vector
Output Parameter:
v- The vector of logs
Level: beginner
-seealso: Vec, VecExp(), VecAbs(), VecSqrtAbs(), VecReciprocal()
External Links
- PETSc Manual:
Vec/VecLog
PETSc.LibPETSc.VecMAXPBY — Method
VecMAXPBY(petsclib::PetscLibType,y::PetscVec, nv::PetscInt, alpha::Vector{PetscScalar}, beta::PetscScalar, x::Vector{PetscVec})Computes y = beta y + sum alpha[i] x[i]
Logically Collective
Input Parameters:
nv- number of scalars andxvectorsalpha- array of scalarsbeta- scalary- one vectorx- array of vectors
Level: intermediate
-seealso: , Vec, VecMAXPY(), VecAYPX(), VecWAXPY(), VecAXPY(), VecAXPBYPCZ(), VecAXPBY()
External Links
- PETSc Manual:
Vec/VecMAXPBY
PETSc.LibPETSc.VecMAXPY — Method
VecMAXPY(petsclib::PetscLibType,y::PetscVec, nv::PetscInt, alpha::Vector{PetscScalar}, x::Vector{PetscVec})Computes y = y + sum alpha[i] x[i]
Logically Collective
Input Parameters:
nv- number of scalars andxvectorsalpha- array of scalarsy- one vectorx- array of vectors
Level: intermediate
-seealso: , Vec, VecMAXPBY(),VecAYPX(), VecWAXPY(), VecAXPY(), VecAXPBYPCZ(), VecAXPBY(), VecDuplicateVecs()
External Links
- PETSc Manual:
Vec/VecMAXPY
PETSc.LibPETSc.VecMDot — Method
val::Vector{PetscScalar} = VecMDot(petsclib::PetscLibType,x::PetscVec, nv::PetscInt, y::Vector{PetscVec})Computes multiple vector dot products.
Collective
Input Parameters:
x- one vectornv- number of vectorsy- array of vectors.
Output Parameter:
val- array of the dot products (does not allocate the array)
Level: intermediate
Notes for Users of Complex Numbers: For complex vectors, VecMDot() computes -seealso: , Vec, VecMTDot(), VecDot(), VecDuplicateVecs()
External Links
- PETSc Manual:
Vec/VecMDot
PETSc.LibPETSc.VecMDotBegin — Method
VecMDotBegin(petsclib::PetscLibType,x::PetscVec, nv::PetscInt, y::Vector{PetscVec}, result::Vector{PetscScalar})Starts a split phase multiple dot product computation.
Input Parameters:
x- the first vectornv- number of vectorsy- array of vectorsresult- where the result will go (can beNULL)
Level: advanced
-seealso: VecMDotEnd(), VecNormBegin(), VecNormEnd(), VecNorm(), VecDot(), VecMDot(), VecTDotBegin(), VecTDotEnd(), VecMTDotBegin(), VecMTDotEnd(), PetscCommSplitReductionBegin()
External Links
- PETSc Manual:
Vec/VecMDotBegin
PETSc.LibPETSc.VecMDotEnd — Method
result::Vector{PetscScalar} = VecMDotEnd(petsclib::PetscLibType,x::PetscVec, nv::PetscInt, y::Vector{PetscVec})Ends a split phase multiple dot product computation.
Input Parameters:
x- the first vector (can beNULL)nv- number of vectorsy- array of vectors (can beNULL)
Output Parameter:
result- where the result will go
Level: advanced
-seealso: VecMDotBegin(), VecNormBegin(), VecNormEnd(), VecNorm(), VecDot(), VecMDot(), VecTDotBegin(), VecTDotEnd(), VecMTDotBegin(), VecMTDotEnd(), PetscCommSplitReductionBegin()
External Links
- PETSc Manual:
Vec/VecMDotEnd
PETSc.LibPETSc.VecMPISetGhost — Method
VecMPISetGhost(petsclib::PetscLibType,vv::PetscVec, nghost::PetscInt, ghosts::Vector{PetscInt})Sets the ghost points for an MPI ghost vector
Collective
Input Parameters:
vv- the MPI vectornghost- number of local ghost pointsghosts- global indices of ghost points, these do not need to be in increasing order (sorted)
Level: advanced
-seealso: , Vec, VecType, VecCreateSeq(), VecCreate(), VecDuplicate(), VecDuplicateVecs(), VecCreateMPI(), VecGhostGetLocalForm(), VecGhostRestoreLocalForm(), VecGhostUpdateBegin(), VecCreateGhostWithArray(), VecCreateMPIWithArray(), VecGhostUpdateEnd(), VecCreateGhostBlock(), VecCreateGhostBlockWithArray()
External Links
- PETSc Manual:
Vec/VecMPISetGhost
PETSc.LibPETSc.VecMTDot — Method
val::Vector{PetscScalar} = VecMTDot(petsclib::PetscLibType,x::PetscVec, nv::PetscInt, y::Vector{PetscVec})Computes indefinite vector multiple dot products. That is, it does NOT use the complex conjugate.
Collective
Input Parameters:
x- one vectornv- number of vectorsy- array of vectors. Note that vectors are pointers
Output Parameter:
val- array of the dot products
Level: intermediate
Notes for Users of Complex Numbers: For complex vectors, VecMTDot() computes the indefinite form -seealso: , Vec, VecMDot(), VecTDot()
External Links
- PETSc Manual:
Vec/VecMTDot
PETSc.LibPETSc.VecMTDotBegin — Method
VecMTDotBegin(petsclib::PetscLibType,x::PetscVec, nv::PetscInt, y::Vector{PetscVec}, result::Vector{PetscScalar})Starts a split phase transpose multiple dot product computation.
Input Parameters:
x- the first vectornv- number of vectorsy- array of vectorsresult- where the result will go (can beNULL)
Level: advanced
-seealso: VecMTDotEnd(), VecNormBegin(), VecNormEnd(), VecNorm(), VecDot(), VecMDot(), VecDotBegin(), VecDotEnd(), VecMDotBegin(), VecMDotEnd(), PetscCommSplitReductionBegin()
External Links
- PETSc Manual:
Vec/VecMTDotBegin
PETSc.LibPETSc.VecMTDotEnd — Method
result::Vector{PetscScalar} = VecMTDotEnd(petsclib::PetscLibType,x::PetscVec, nv::PetscInt, y::Vector{PetscVec})Ends a split phase transpose multiple dot product computation.
Input Parameters:
x- the first vector (can beNULL)nv- number of vectorsy- array of vectors (can beNULL)
Output Parameter:
result- where the result will go
Level: advanced
-seealso: VecMTDotBegin(), VecNormBegin(), VecNormEnd(), VecNorm(), VecDot(), VecMDot(), VecDotBegin(), VecDotEnd(), VecMDotBegin(), VecMDotEnd(), PetscCommSplitReductionBegin()
External Links
- PETSc Manual:
Vec/VecMTDotEnd
PETSc.LibPETSc.VecMax — Method
p::PetscInt,val::PetscReal = VecMax(petsclib::PetscLibType,x::PetscVec)Determines the vector component with maximum real part and its location.
Collective
Input Parameter:
x- the vector
Output Parameters:
p- the index ofval(passNULLif you don't want this) in the vectorval- the maximum component
Level: intermediate
-seealso: , Vec, VecNorm(), VecMin()
External Links
- PETSc Manual:
Vec/VecMax
PETSc.LibPETSc.VecMaxPointwiseDivide — Method
max::PetscReal = VecMaxPointwiseDivide(petsclib::PetscLibType,x::PetscVec, y::PetscVec)Computes the maximum of the componentwise division max = max_i abs(x[i]/y[i]).
Logically Collective
Input Parameters:
x- the numeratorsy- the denominators
Output Parameter:
max- the result
Level: advanced
-seealso: , Vec, VecPointwiseDivide(), VecPointwiseMult(), VecPointwiseMax(), VecPointwiseMin(), VecPointwiseMaxAbs()
External Links
- PETSc Manual:
Vec/VecMaxPointwiseDivide
PETSc.LibPETSc.VecMean — Method
mean::PetscScalar = VecMean(petsclib::PetscLibType,v::PetscVec)Computes the arithmetic mean of all the components of a vector.
Collective
Input Parameter:
v- the vector
Output Parameter:
mean- the result
Level: beginner
-seealso: Vec, VecSum(), VecNorm()
External Links
- PETSc Manual:
Vec/VecMean
PETSc.LibPETSc.VecMedian — Method
VecMedian(petsclib::PetscLibType,Vec1::PetscVec, Vec2::PetscVec, Vec3::PetscVec, VMedian::PetscVec)Computes the componentwise median of three vectors and stores the result in this vector. Used primarily for projecting a vector within upper and lower bounds.
Logically Collective
Input Parameters:
Vec1- The first vectorVec2- The second vectorVec3- The third vector
Output Parameter:
VMedian- The median vector (this can be any one of the input vectors)
Level: advanced
-seealso: Vec
External Links
- PETSc Manual:
Vec/VecMedian
PETSc.LibPETSc.VecMin — Method
p::PetscInt,val::PetscReal = VecMin(petsclib::PetscLibType,x::PetscVec)Determines the vector component with minimum real part and its location.
Collective
Input Parameter:
x- the vector
Output Parameters:
p- the index ofval(passNULLif you don't want this location) in the vectorval- the minimum component
Level: intermediate
External Links
- PETSc Manual:
Vec/VecMin
PETSc.LibPETSc.VecNestGetSize — Method
N::PetscInt = VecNestGetSize(petsclib::PetscLibType,X::PetscVec)Returns the size of the nest vector.
Not Collective
Input Parameter:
X- nest vector
Output Parameter:
N- number of nested vecs
Level: developer
-seealso: VECNEST, , Vec, VecType, VecNestGetSubVec(), VecNestGetSubVecs()
External Links
- PETSc Manual:
Vec/VecNestGetSize
PETSc.LibPETSc.VecNestGetSubVec — Method
VecNestGetSubVec(petsclib::PetscLibType,X::PetscVec, idxm::PetscInt, sx::PetscVec)Returns a single, sub
Not Collective
Input Parameters:
X- nest vectoridxm- index of the vector within the nest
Output Parameter:
sx- vector at indexidxmwithin the nest
Level: developer
-seealso: VECNEST, , Vec, VecType, VecNestGetSize(), VecNestGetSubVecs()
External Links
- PETSc Manual:
Vec/VecNestGetSubVec
PETSc.LibPETSc.VecNestGetSubVecs — Method
N::PetscInt = VecNestGetSubVecs(petsclib::PetscLibType,X::PetscVec, sx::Vector{PetscVec})Returns the entire array of vectors defining a nest vector.
Not Collective
Input Parameter:
X- nest vector
Output Parameters:
N- number of nested vecssx- array of vectors, can pass inNULL
Level: developer
-seealso: VECNEST, , Vec, VecType, VecNestGetSize(), VecNestGetSubVec()
External Links
- PETSc Manual:
Vec/VecNestGetSubVecs
PETSc.LibPETSc.VecNestSetSubVec — Method
VecNestSetSubVec(petsclib::PetscLibType,X::PetscVec, idxm::PetscInt, sx::PetscVec)Set a single component vector in a nest vector at specified index.
Not Collective
Input Parameters:
X- nest vectoridxm- index of the vector within the nest vectorsx- vector at indexidxmwithin the nest vector
Level: developer
-seealso: VECNEST, , Vec, VecType, VecNestSetSubVecs(), VecNestGetSubVec()
External Links
- PETSc Manual:
Vec/VecNestSetSubVec
PETSc.LibPETSc.VecNestSetSubVecs — Method
VecNestSetSubVecs(petsclib::PetscLibType,X::PetscVec, N::PetscInt, idxm::Vector{PetscInt}, sx::Vector{PetscVec})Sets the component vectors at the specified indices in a nest vector.
Not Collective
Input Parameters:
X- nest vectorN- number of component vecs insxidxm- indices of component vectors that are to be replacedsx- array of vectors
Level: developer
-seealso: VECNEST, , Vec, VecType, VecNestGetSize(), VecNestGetSubVec()
External Links
- PETSc Manual:
Vec/VecNestSetSubVecs
PETSc.LibPETSc.VecNorm — Method
val::PetscReal = VecNorm(petsclib::PetscLibType,x::PetscVec, type::NormType)Computes the vector norm.
Collective
Input Parameters:
x- the vectortype- the type of the norm requested
Output Parameter:
val- the norm
Level: intermediate
-seealso: , Vec, NormType, VecDot(), VecTDot(), VecDotBegin(), VecDotEnd(), VecNormAvailable(), VecNormBegin(), VecNormEnd(), NormType()
External Links
- PETSc Manual:
Vec/VecNorm
PETSc.LibPETSc.VecNormAvailable — Method
available::PetscBool,val::PetscReal = VecNormAvailable(petsclib::PetscLibType,x::PetscVec, type::NormType)Returns the vector norm if it is already known. That is, it has been previously computed and cached in the vector
Not Collective
Input Parameters:
x- the vectortype- one ofNORM_1(sumi |x[i]|), `NORM2sqrt(sum_i (x[i])^2),NORMINFINITY` maxi |x[i]|. Also available
NORM_1_AND_2, which computes both norms and stores them in a two element array.
Output Parameters:
available-PETSC_TRUEif the val returned is validval- the norm
Level: intermediate
-seealso: , Vec, VecDot(), VecTDot(), VecNorm(), VecDotBegin(), VecDotEnd(), VecNormBegin(), VecNormEnd()
External Links
- PETSc Manual:
Vec/VecNormAvailable
PETSc.LibPETSc.VecNormBegin — Method
VecNormBegin(petsclib::PetscLibType,x::PetscVec, ntype::NormType, result::PetscReal)Starts a split phase norm computation.
Input Parameters:
x- the first vectorntype- norm type, one ofNORM_1,NORM_2,NORM_MAX,NORM_1_AND_2result- where the result will go (can beNULL)
Level: advanced
-seealso: VecNormEnd(), VecNorm(), VecDot(), VecMDot(), VecDotBegin(), VecDotEnd(), PetscCommSplitReductionBegin()
External Links
- PETSc Manual:
Vec/VecNormBegin
PETSc.LibPETSc.VecNormEnd — Method
VecNormEnd(petsclib::PetscLibType,x::PetscVec, ntype::NormType, result::PetscReal)Ends a split phase norm computation.
Input Parameters:
x- the first vectorntype- norm type, one ofNORM_1,NORM_2,NORM_MAX,NORM_1_AND_2result- where the result will go
Level: advanced
-seealso: VecNormBegin(), VecNorm(), VecDot(), VecMDot(), VecDotBegin(), VecDotEnd(), PetscCommSplitReductionBegin()
External Links
- PETSc Manual:
Vec/VecNormEnd
PETSc.LibPETSc.VecNormalize — Method
val::PetscReal = VecNormalize(petsclib::PetscLibType,x::PetscVec)Normalizes a vector by its 2
Collective
Input Parameter:
x- the vector
Output Parameter:
val- the vector norm before normalization. May beNULLif the value is not needed.
Level: intermediate
-seealso: , Vec, VecNorm(), NORM_2, NormType
External Links
- PETSc Manual:
Vec/VecNormalize
PETSc.LibPETSc.VecPermute — Method
VecPermute(petsclib::PetscLibType,x::PetscVec, row::IS, inv::PetscBool)Permutes a vector in place using the given ordering.
Input Parameters:
x- The vectorrow- The orderinginv- The flag for inverting the permutation
Level: beginner
-seealso: Vec, MatPermute()
External Links
- PETSc Manual:
Vec/VecPermute
PETSc.LibPETSc.VecPlaceArray — Method
VecPlaceArray(petsclib::PetscLibType,vec::PetscVec, array::Vector{PetscScalar})Allows one to replace the array in a vector with an array provided by the user. This is useful to avoid copying an array into a vector.
Logically Collective; No Fortran Support
Input Parameters:
vec- the vectorarray- the array
Level: developer
-seealso: , Vec, VecGetArray(), VecRestoreArray(), VecReplaceArray(), VecResetArray()
External Links
- PETSc Manual:
Vec/VecPlaceArray
PETSc.LibPETSc.VecPointwiseDivide — Method
VecPointwiseDivide(petsclib::PetscLibType,w::PetscVec, x::PetscVec, y::PetscVec)Computes the component
Logically Collective
Input Parameters:
x- the numerator vectory- the denominator vector
Output Parameter:
w- the result
Level: advanced
-seealso: , Vec, VecPointwiseMult(), VecPointwiseMax(), VecPointwiseMin(), VecPointwiseMaxAbs(), VecMaxPointwiseDivide()
External Links
- PETSc Manual:
Vec/VecPointwiseDivide
PETSc.LibPETSc.VecPointwiseMax — Method
VecPointwiseMax(petsclib::PetscLibType,w::PetscVec, x::PetscVec, y::PetscVec)Computes the component
Logically Collective
Input Parameters:
x- the first input vectory- the second input vector
Output Parameter:
w- the result
Level: advanced
-seealso: , Vec, VecPointwiseDivide(), VecPointwiseMult(), VecPointwiseMin(), VecPointwiseMaxAbs(), VecMaxPointwiseDivide()
External Links
- PETSc Manual:
Vec/VecPointwiseMax
PETSc.LibPETSc.VecPointwiseMaxAbs — Method
VecPointwiseMaxAbs(petsclib::PetscLibType,w::PetscVec, x::PetscVec, y::PetscVec)Computes the component
Logically Collective
Input Parameters:
x- the first input vectory- the second input vector
Output Parameter:
w- the result
Level: advanced
-seealso: , Vec, VecPointwiseDivide(), VecPointwiseMult(), VecPointwiseMin(), VecPointwiseMax(), VecMaxPointwiseDivide()
External Links
- PETSc Manual:
Vec/VecPointwiseMaxAbs
PETSc.LibPETSc.VecPointwiseMin — Method
VecPointwiseMin(petsclib::PetscLibType,w::PetscVec, x::PetscVec, y::PetscVec)Computes the component
Logically Collective
Input Parameters:
x- the first input vectory- the second input vector
Output Parameter:
w- the result
Level: advanced
-seealso: , Vec, VecPointwiseDivide(), VecPointwiseMult(), VecPointwiseMaxAbs(), VecMaxPointwiseDivide()
External Links
- PETSc Manual:
Vec/VecPointwiseMin
PETSc.LibPETSc.VecPointwiseMult — Method
VecPointwiseMult(petsclib::PetscLibType,w::PetscVec, x::PetscVec, y::PetscVec)Computes the component
Logically Collective
Input Parameters:
x- the first vectory- the second vector
Output Parameter:
w- the result
Level: advanced
-seealso: , Vec, VecPointwiseDivide(), VecPointwiseMax(), VecPointwiseMin(), VecPointwiseMaxAbs(), VecMaxPointwiseDivide()
External Links
- PETSc Manual:
Vec/VecPointwiseMult
PETSc.LibPETSc.VecPow — Method
VecPow(petsclib::PetscLibType,v::PetscVec, p::PetscScalar)Replaces each component of a vector by x_i^p
Logically Collective
Input Parameters:
v- the vectorp- the exponent to use on each element
Level: intermediate
-seealso: Vec
External Links
- PETSc Manual:
Vec/VecPow
PETSc.LibPETSc.VecRealPart — Method
VecRealPart(petsclib::PetscLibType,v::PetscVec)Replaces a complex vector with its real part
Collective
Input Parameter:
v- the vector
Level: beginner
-seealso: Vec, VecNorm(), VecImaginaryPart()
External Links
- PETSc Manual:
Vec/VecRealPart
PETSc.LibPETSc.VecReciprocal — Method
VecReciprocal(petsclib::PetscLibType,vec::PetscVec)Replaces each component of a vector by its reciprocal.
Logically Collective
Input Parameter:
vec- the vector
Output Parameter:
vec- the vector reciprocal
Level: intermediate
-seealso: , Vec, VecLog(), VecExp(), VecSqrtAbs()
External Links
- PETSc Manual:
Vec/VecReciprocal
PETSc.LibPETSc.VecRegister — Method
VecRegister(petsclib::PetscLibType,sname::Vector{Cchar}, fnc::external)Adds a new vector component implementation
Not Collective, No Fortran Support
Input Parameters:
sname- The name of a new user-defined creation routinefunction- The creation routine
-seealso: VecRegisterAll(), VecRegisterDestroy()
External Links
- PETSc Manual:
Vec/VecRegister
PETSc.LibPETSc.VecRegisterAll — Method
VecRegisterAll(petsclib::PetscLibType)Registers all of the vector types in the Vec package.
Not Collective
Level: advanced
-seealso: , Vec, VecType, VecRegister(), VecRegisterDestroy()
External Links
- PETSc Manual:
Vec/VecRegisterAll
PETSc.LibPETSc.VecReplaceArray — Method
VecReplaceArray(petsclib::PetscLibType,vec::PetscVec, array::Vector{PetscScalar})Allows one to replace the array in a vector with an array provided by the user. This is useful to avoid copying an array into a vector.
Logically Collective; No Fortran Support
Input Parameters:
vec- the vectorarray- the array
Level: developer
-seealso: , Vec, VecGetArray(), VecRestoreArray(), VecPlaceArray(), VecResetArray()
External Links
- PETSc Manual:
Vec/VecReplaceArray
PETSc.LibPETSc.VecResetArray — Method
VecResetArray(petsclib::PetscLibType,vec::PetscVec)Resets a vector to use its default memory. Call this after the use of VecPlaceArray().
Not Collective
Input Parameter:
vec- the vector
Level: developer
-seealso: , Vec, VecGetArray(), VecRestoreArray(), VecReplaceArray(), VecPlaceArray()
External Links
- PETSc Manual:
Vec/VecResetArray
PETSc.LibPETSc.VecRestoreArray — Method
VecRestoreArray(petsclib::PetscLibType,x::PetscVec, a::Vector{PetscScalar})Restores a vector after VecGetArray() has been called and the array is no longer needed
Logically Collective
Input Parameters:
x- the vectora- location of pointer to array obtained fromVecGetArray()
Level: beginner
-seealso: , Vec, VecGetArray(), VecRestoreArrayRead(), VecRestoreArrays(), VecPlaceArray(), VecRestoreArray2d(), VecGetArrayPair(), VecRestoreArrayPair()
External Links
- PETSc Manual:
Vec/VecRestoreArray
PETSc.LibPETSc.VecRestoreArray1d — Method
VecRestoreArray1d(petsclib::PetscLibType,x::PetscVec, m::PetscInt, mstart::PetscInt, a::PetscArray{PetscScalar, 1})Restores a vector after VecGetArray1d() has been called.
Logically Collective
Input Parameters:
x- the vectorm- first dimension of two dimensional arraymstart- first index you will use in first coordinate direction (often 0)a- location of pointer to array obtained fromVecGetArray1d()
Level: developer
-seealso: , Vec, VecGetArray(), VecRestoreArray(), VecRestoreArrays(), VecPlaceArray(), VecGetArray2d(), VecGetArray3d(), VecRestoreArray3d(), DMDAVecGetArray(), DMDAVecRestoreArray() VecGetArray1d(), VecRestoreArray2d(), VecGetArray4d(), VecRestoreArray4d()
External Links
- PETSc Manual:
Vec/VecRestoreArray1d
PETSc.LibPETSc.VecRestoreArray1dRead — Method
VecRestoreArray1dRead(petsclib::PetscLibType,x::PetscVec, m::PetscInt, mstart::PetscInt, a::PetscArray{PetscScalar, 1})Restores a vector after VecGetArray1dRead() has been called.
Logically Collective
Input Parameters:
x- the vectorm- first dimension of two dimensional arraymstart- first index you will use in first coordinate direction (often 0)a- location of pointer to array obtained fromVecGetArray1dRead()
Level: developer
-seealso: , Vec, VecGetArray(), VecRestoreArray(), VecRestoreArrays(), VecPlaceArray(), VecGetArray2d(), VecGetArray3d(), VecRestoreArray3d(), DMDAVecGetArray(), DMDAVecRestoreArray() VecGetArray1d(), VecRestoreArray2d(), VecGetArray4d(), VecRestoreArray4d()
External Links
- PETSc Manual:
Vec/VecRestoreArray1dRead
PETSc.LibPETSc.VecRestoreArray1dRead — Method
VecRestoreArray1dRead(petsclib::PetscLibType,x::PetscVec, m::PetscInt, mstart::PetscInt, a::Vector{PetscScalar})Restores a vector after VecGetArray1dRead() has been called.
Logically Collective
Input Parameters:
x- the vectorm- first dimension of two dimensional arraymstart- first index you will use in first coordinate direction (often 0)a- location of pointer to array obtained fromVecGetArray1dRead()
Level: developer
-seealso: , Vec, VecGetArray(), VecRestoreArray(), VecRestoreArrays(), VecPlaceArray(), VecGetArray2d(), VecGetArray3d(), VecRestoreArray3d(), DMDAVecGetArray(), DMDAVecRestoreArray() VecGetArray1d(), VecRestoreArray2d(), VecGetArray4d(), VecRestoreArray4d()
External Links
- PETSc Manual:
Vec/VecRestoreArray1dRead
PETSc.LibPETSc.VecRestoreArray1dWrite — Method
VecRestoreArray1dWrite(petsclib::PetscLibType,x::PetscVec, m::PetscInt, mstart::PetscInt, a::PetscArray{PetscScalar, 1})Restores a vector after VecGetArray1dWrite() has been called.
Logically Collective
Input Parameters:
x- the vectorm- first dimension of two dimensional arraymstart- first index you will use in first coordinate direction (often 0)a- location of pointer to array obtained fromVecGetArray1d()
Level: developer
-seealso: , Vec, VecGetArray(), VecRestoreArray(), VecRestoreArrays(), VecPlaceArray(), VecGetArray2d(), VecGetArray3d(), VecRestoreArray3d(), DMDAVecGetArray(), DMDAVecRestoreArray() VecGetArray1d(), VecRestoreArray2d(), VecGetArray4d(), VecRestoreArray4d()
External Links
- PETSc Manual:
Vec/VecRestoreArray1dWrite
PETSc.LibPETSc.VecRestoreArray2d — Method
VecRestoreArray2d(petsclib::PetscLibType,x::PetscVec, m::PetscInt, n::PetscInt, mstart::PetscInt, nstart::PetscInt, a::PetscArray{PetscScalar, 2})Restores a vector after VecGetArray2d() has been called.
Logically Collective
Input Parameters:
x- the vectorm- first dimension of two dimensional arrayn- second dimension of the two dimensional arraymstart- first index you will use in first coordinate direction (often 0)nstart- first index in the second coordinate direction (often 0)a- location of pointer to array obtained fromVecGetArray2d()
Level: developer
-seealso: , Vec, VecGetArray(), VecRestoreArray(), VecRestoreArrays(), VecPlaceArray(), VecGetArray2d(), VecGetArray3d(), VecRestoreArray3d(), DMDAVecGetArray(), DMDAVecRestoreArray() VecGetArray1d(), VecRestoreArray1d(), VecGetArray4d(), VecRestoreArray4d()
External Links
- PETSc Manual:
Vec/VecRestoreArray2d
PETSc.LibPETSc.VecRestoreArray2dRead — Method
VecRestoreArray2dRead(petsclib::PetscLibType,x::PetscVec, m::PetscInt, n::PetscInt, mstart::PetscInt, nstart::PetscInt, a::PetscArray{PetscScalar, 2})Restores a vector after VecGetArray2dRead() has been called.
Logically Collective
Input Parameters:
x- the vectorm- first dimension of two dimensional arrayn- second dimension of the two dimensional arraymstart- first index you will use in first coordinate direction (often 0)nstart- first index in the second coordinate direction (often 0)a- location of pointer to array obtained from VecGetArray2d()
Level: developer
-seealso: , Vec, VecGetArray(), VecRestoreArray(), VecRestoreArrays(), VecPlaceArray(), VecGetArray2d(), VecGetArray3d(), VecRestoreArray3d(), DMDAVecGetArray(), DMDAVecRestoreArray() VecGetArray1d(), VecRestoreArray1d(), VecGetArray4d(), VecRestoreArray4d()
External Links
- PETSc Manual:
Vec/VecRestoreArray2dRead
PETSc.LibPETSc.VecRestoreArray2dWrite — Method
VecRestoreArray2dWrite(petsclib::PetscLibType,x::PetscVec, m::PetscInt, n::PetscInt, mstart::PetscInt, nstart::PetscInt, a::PetscArray{PetscScalar, 2})Restores a vector after VecGetArray2dWrite() has been called.
Logically Collective
Input Parameters:
x- the vectorm- first dimension of two dimensional arrayn- second dimension of the two dimensional arraymstart- first index you will use in first coordinate direction (often 0)nstart- first index in the second coordinate direction (often 0)a- location of pointer to array obtained fromVecGetArray2d()
Level: developer
-seealso: , Vec, VecGetArray(), VecRestoreArray(), VecRestoreArrays(), VecPlaceArray(), VecGetArray2d(), VecGetArray3d(), VecRestoreArray3d(), DMDAVecGetArray(), DMDAVecRestoreArray() VecGetArray1d(), VecRestoreArray1d(), VecGetArray4d(), VecRestoreArray4d()
External Links
- PETSc Manual:
Vec/VecRestoreArray2dWrite
PETSc.LibPETSc.VecRestoreArray3d — Method
VecRestoreArray3d(petsclib::PetscLibType,x::PetscVec, m::PetscInt, n::PetscInt, p::PetscInt, mstart::PetscInt, nstart::PetscInt, pstart::PetscInt, a::PetscArray{PetscScalar, 3})Restores a vector after VecGetArray3d() has been called.
Logically Collective
Input Parameters:
x- the vectorm- first dimension of three dimensional arrayn- second dimension of the three dimensional arrayp- third dimension of the three dimensional arraymstart- first index you will use in first coordinate direction (often 0)nstart- first index in the second coordinate direction (often 0)pstart- first index in the third coordinate direction (often 0)a- location of pointer to array obtained from VecGetArray3d()
Level: developer
-seealso: , Vec, VecGetArray(), VecRestoreArray(), VecRestoreArrays(), VecPlaceArray(), VecGetArray2d(), VecGetArray3d(), DMDAVecGetArray(), DMDAVecRestoreArray() VecGetArray1d(), VecRestoreArray1d(), VecGetArray4d(), VecRestoreArray4d()
External Links
- PETSc Manual:
Vec/VecRestoreArray3d
PETSc.LibPETSc.VecRestoreArray3dRead — Method
VecRestoreArray3dRead(petsclib::PetscLibType,x::PetscVec, m::PetscInt, n::PetscInt, p::PetscInt, mstart::PetscInt, nstart::PetscInt, pstart::PetscInt, a::PetscArray{PetscScalar, 3})Restores a vector after VecGetArray3dRead() has been called.
Logically Collective
Input Parameters:
x- the vectorm- first dimension of three dimensional arrayn- second dimension of the three dimensional arrayp- third dimension of the three dimensional arraymstart- first index you will use in first coordinate direction (often 0)nstart- first index in the second coordinate direction (often 0)pstart- first index in the third coordinate direction (often 0)a- location of pointer to array obtained fromVecGetArray3dRead()
Level: developer
-seealso: , Vec, VecGetArray(), VecRestoreArray(), VecRestoreArrays(), VecPlaceArray(), VecGetArray2d(), VecGetArray3d(), VecRestoreArray3d(), DMDAVecGetArray(), DMDAVecRestoreArray() VecGetArray1d(), VecRestoreArray1d(), VecGetArray4d(), VecRestoreArray4d()
External Links
- PETSc Manual:
Vec/VecRestoreArray3dRead
PETSc.LibPETSc.VecRestoreArray3dWrite — Method
VecRestoreArray3dWrite(petsclib::PetscLibType,x::PetscVec, m::PetscInt, n::PetscInt, p::PetscInt, mstart::PetscInt, nstart::PetscInt, pstart::PetscInt, a::PetscArray{PetscScalar, 3})Restores a vector after VecGetArray3dWrite() has been called.
Logically Collective
Input Parameters:
x- the vectorm- first dimension of three dimensional arrayn- second dimension of the three dimensional arrayp- third dimension of the three dimensional arraymstart- first index you will use in first coordinate direction (often 0)nstart- first index in the second coordinate direction (often 0)pstart- first index in the third coordinate direction (often 0)a- location of pointer to array obtained from VecGetArray3d()
Level: developer
-seealso: , Vec, VecGetArray(), VecRestoreArray(), VecRestoreArrays(), VecPlaceArray(), VecGetArray2d(), VecGetArray3d(), VecRestoreArray3d(), DMDAVecGetArray(), DMDAVecRestoreArray() VecGetArray1d(), VecRestoreArray1d(), VecGetArray4d(), VecRestoreArray4d()
External Links
- PETSc Manual:
Vec/VecRestoreArray3dWrite
PETSc.LibPETSc.VecRestoreArray4d — Method
VecRestoreArray4d(petsclib::PetscLibType,x::PetscVec, m::PetscInt, n::PetscInt, p::PetscInt, q::PetscInt, mstart::PetscInt, nstart::PetscInt, pstart::PetscInt, qstart::PetscInt, a::PetscArray{PetscScalar, 4})Restores a vector after VecGetArray4d() has been called.
Logically Collective
Input Parameters:
x- the vectorm- first dimension of four dimensional arrayn- second dimension of the four dimensional arrayp- third dimension of the four dimensional arrayq- fourth dimension of the four dimensional arraymstart- first index you will use in first coordinate direction (often 0)nstart- first index in the second coordinate direction (often 0)pstart- first index in the third coordinate direction (often 0)qstart- first index in the fourth coordinate direction (often 0)a- location of pointer to array obtained from VecGetArray4d()
Level: developer
-seealso: , Vec, VecGetArray(), VecRestoreArray(), VecRestoreArrays(), VecPlaceArray(), VecGetArray2d(), VecGetArray3d(), VecRestoreArray3d(), DMDAVecGetArray(), DMDAVecRestoreArray() VecGetArray1d(), VecRestoreArray1d(), VecGetArray4d()
External Links
- PETSc Manual:
Vec/VecRestoreArray4d
PETSc.LibPETSc.VecRestoreArray4dRead — Method
VecRestoreArray4dRead(petsclib::PetscLibType,x::PetscVec, m::PetscInt, n::PetscInt, p::PetscInt, q::PetscInt, mstart::PetscInt, nstart::PetscInt, pstart::PetscInt, qstart::PetscInt, a::PetscArray{PetscScalar, 4})Restores a vector after VecGetArray4d() has been called.
Logically Collective
Input Parameters:
x- the vectorm- first dimension of four dimensional arrayn- second dimension of the four dimensional arrayp- third dimension of the four dimensional arrayq- fourth dimension of the four dimensional arraymstart- first index you will use in first coordinate direction (often 0)nstart- first index in the second coordinate direction (often 0)pstart- first index in the third coordinate direction (often 0)qstart- first index in the fourth coordinate direction (often 0)a- location of pointer to array obtained fromVecGetArray4dRead()
Level: beginner
-seealso: , Vec, VecGetArray(), VecRestoreArray(), VecRestoreArrays(), VecPlaceArray(), VecGetArray2d(), VecGetArray3d(), VecRestoreArray3d(), DMDAVecGetArray(), DMDAVecRestoreArray() VecGetArray1d(), VecRestoreArray1d(), VecGetArray4d(), VecRestoreArray4d()
External Links
- PETSc Manual:
Vec/VecRestoreArray4dRead
PETSc.LibPETSc.VecRestoreArray4dWrite — Method
VecRestoreArray4dWrite(petsclib::PetscLibType,x::PetscVec, m::PetscInt, n::PetscInt, p::PetscInt, q::PetscInt, mstart::PetscInt, nstart::PetscInt, pstart::PetscInt, qstart::PetscInt, a::PetscArray{PetscScalar, 4})Restores a vector after VecGetArray4dWrite() has been called.
Logically Collective
Input Parameters:
x- the vectorm- first dimension of four dimensional arrayn- second dimension of the four dimensional arrayp- third dimension of the four dimensional arrayq- fourth dimension of the four dimensional arraymstart- first index you will use in first coordinate direction (often 0)nstart- first index in the second coordinate direction (often 0)pstart- first index in the third coordinate direction (often 0)qstart- first index in the fourth coordinate direction (often 0)a- location of pointer to array obtained fromVecGetArray4d()
Level: developer
-seealso: , Vec, VecGetArray(), VecRestoreArray(), VecRestoreArrays(), VecPlaceArray(), VecGetArray2d(), VecGetArray3d(), VecRestoreArray3d(), DMDAVecGetArray(), DMDAVecRestoreArray() VecGetArray1d(), VecRestoreArray1d(), VecGetArray4d(), VecRestoreArray4d()
External Links
- PETSc Manual:
Vec/VecRestoreArray4dWrite
PETSc.LibPETSc.VecRestoreArrayAndMemType — Method
VecRestoreArrayAndMemType(petsclib::PetscLibType,x::PetscVec, a::Vector{PetscScalar})Restores a vector after VecGetArrayAndMemType() has been called.
Logically Collective; No Fortran Support
Input Parameters:
x- the vectora- location of pointer to array obtained fromVecGetArrayAndMemType()
Level: beginner
-seealso: , Vec, VecGetArrayAndMemType(), VecGetArray(), VecRestoreArrayRead(), VecRestoreArrays(), VecPlaceArray(), VecRestoreArray2d(), VecGetArrayPair(), VecRestoreArrayPair()
External Links
- PETSc Manual:
Vec/VecRestoreArrayAndMemType
PETSc.LibPETSc.VecRestoreArrayPair — Method
VecRestoreArrayPair(petsclib::PetscLibType,x::PetscVec, y::PetscVec, xv::Vector{PetscScalar}, yv::Vector{PetscScalar})External Links
- PETSc Manual:
Vec/VecRestoreArrayPair
PETSc.LibPETSc.VecRestoreArrayRead — Method
VecRestoreArrayRead(petsclib::PetscLibType,x::PetscVec, a::Vector{PetscScalar})Restore array obtained with VecGetArrayRead()
Not Collective
Input Parameters:
x- the vectora- the array
Level: beginner
-seealso: , Vec, VecGetArray(), VecRestoreArray(), VecGetArrayPair(), VecRestoreArrayPair()
External Links
- PETSc Manual:
Vec/VecRestoreArrayRead
PETSc.LibPETSc.VecRestoreArrayReadAndMemType — Method
VecRestoreArrayReadAndMemType(petsclib::PetscLibType,x::PetscVec, a::Vector{PetscScalar})Restore array obtained with VecGetArrayReadAndMemType()
Not Collective; No Fortran Support
Input Parameters:
x- the vectora- the array
Level: beginner
-seealso: , Vec, VecGetArrayReadAndMemType(), VecRestoreArrayAndMemType(), VecRestoreArrayWriteAndMemType(), VecGetArray(), VecRestoreArray(), VecGetArrayPair(), VecRestoreArrayPair()
External Links
- PETSc Manual:
Vec/VecRestoreArrayReadAndMemType
PETSc.LibPETSc.VecRestoreArrayWrite — Method
VecRestoreArrayWrite(petsclib::PetscLibType,x::PetscVec, a::Vector{PetscScalar})Restores a vector after VecGetArrayWrite() has been called.
Logically Collective
Input Parameters:
x- the vectora- location of pointer to array obtained fromVecGetArray()
Level: beginner
-seealso: , Vec, VecGetArray(), VecRestoreArrayRead(), VecRestoreArrays(), VecPlaceArray(), VecRestoreArray2d(), VecGetArrayPair(), VecRestoreArrayPair(), VecGetArrayWrite()
External Links
- PETSc Manual:
Vec/VecRestoreArrayWrite
PETSc.LibPETSc.VecRestoreArrayWriteAndMemType — Method
VecRestoreArrayWriteAndMemType(petsclib::PetscLibType,x::PetscVec, a::Vector{PetscScalar})Restore array obtained with VecGetArrayWriteAndMemType()
Logically Collective; No Fortran Support
Input Parameters:
x- the vectora- the array
Level: beginner
-seealso: , Vec, VecGetArrayWriteAndMemType(), VecRestoreArrayAndMemType(), VecGetArray(), VecRestoreArray(), VecGetArrayPair(), VecRestoreArrayPair()
External Links
- PETSc Manual:
Vec/VecRestoreArrayWriteAndMemType
PETSc.LibPETSc.VecRestoreArrays — Method
VecRestoreArrays(petsclib::PetscLibType,x::Vector{PetscVec}, n::PetscInt, a::Vector{PetscScalar})Restores a group of vectors after VecGetArrays() has been called.
Logically Collective; No Fortran Support
Input Parameters:
x- the vectorn- the number of vectorsa- location of pointer to arrays obtained fromVecGetArrays()
-seealso: , Vec, VecGetArrays(), VecRestoreArray()
External Links
- PETSc Manual:
Vec/VecRestoreArrays
PETSc.LibPETSc.VecRestoreLocalVector — Method
VecRestoreLocalVector(petsclib::PetscLibType,v::PetscVec, w::PetscVec)Unmaps the local portion of a vector previously mapped into a vector using VecGetLocalVector().
Logically Collective.
Input Parameters:
v- The local portion of this vector was previously mapped intowusingVecGetLocalVector().w- The vector into which the local portion ofvwas mapped.
Level: beginner
-seealso: , Vec, VecCreateLocalVector(), VecGetLocalVector(), VecGetLocalVectorRead(), VecRestoreLocalVectorRead(), LocalVectorRead(), VecGetArrayRead(), VecGetArray()
External Links
- PETSc Manual:
Vec/VecRestoreLocalVector
PETSc.LibPETSc.VecRestoreLocalVectorRead — Method
VecRestoreLocalVectorRead(petsclib::PetscLibType,v::PetscVec, w::PetscVec)Unmaps the local portion of a vector previously mapped into a vector using VecGetLocalVectorRead().
Not Collective.
Input Parameters:
v- The local portion of this vector was previously mapped intowusingVecGetLocalVectorRead().w- The vector into which the local portion ofvwas mapped.
Level: beginner
-seealso: , Vec, VecCreateLocalVector(), VecGetLocalVectorRead(), VecGetLocalVector(), VecGetArrayRead(), VecGetArray()
External Links
- PETSc Manual:
Vec/VecRestoreLocalVectorRead
PETSc.LibPETSc.VecRestoreSubVector — Method
VecRestoreSubVector(petsclib::PetscLibType,X::PetscVec, is::IS, Y::PetscVec)Restores a subvector extracted using VecGetSubVector()
Collective
Input Parameters:
X- vector from which subvector was obtainedis- index set representing the subset ofXY- subvector being restored
Level: advanced
-seealso: , Vec, IS, VecGetSubVector()
External Links
- PETSc Manual:
Vec/VecRestoreSubVector
PETSc.LibPETSc.VecTDot — Method
val::PetscScalar = VecTDot(petsclib::PetscLibType,x::PetscVec, y::PetscVec)Computes an indefinite vector dot product. That is, this routine does NOT use the complex conjugate.
Collective
Input Parameters:
x- first vectory- second vector
Output Parameter:
val- the dot product
Level: intermediate
Notes for Users of Complex Numbers: For complex vectors, VecTDot() computes the indefinite form -seealso: , Vec, VecDot(), VecMTDot()
External Links
- PETSc Manual:
Vec/VecTDot
PETSc.LibPETSc.VecTDotBegin — Method
VecTDotBegin(petsclib::PetscLibType,x::PetscVec, y::PetscVec, result::PetscScalar)Starts a split phase transpose dot product computation.
Input Parameters:
x- the first vectory- the second vectorresult- where the result will go (can beNULL)
Level: advanced
-seealso: VecTDotEnd(), VecNormBegin(), VecNormEnd(), VecNorm(), VecDot(), VecMDot(), VecDotBegin(), VecDotEnd(), PetscCommSplitReductionBegin()
External Links
- PETSc Manual:
Vec/VecTDotBegin
PETSc.LibPETSc.VecTDotEnd — Method
VecTDotEnd(petsclib::PetscLibType,x::PetscVec, y::PetscVec, result::PetscScalar)Ends a split phase transpose dot product computation.
Input Parameters:
x- the first vector (can beNULL)y- the second vector (can beNULL)result- where the result will go
Level: advanced
-seealso: VecTDotBegin(), VecNormBegin(), VecNormEnd(), VecNorm(), VecDot(), VecMDot(), VecDotBegin(), VecDotEnd()
External Links
- PETSc Manual:
Vec/VecTDotEnd
PETSc.LibPETSc.VecUniqueEntries — Method
n::PetscInt,e::Vector{PetscScalar} = VecUniqueEntries(petsclib::PetscLibType,vec::PetscVec)Compute the number of unique entries, and those entries
Collective
Input Parameter:
vec- the vector
Output Parameters:
n- The number of unique entriese- The entries, each MPI process receives all the unique entries
Level: intermediate
-seealso: Vec
External Links
- PETSc Manual:
Vec/VecUniqueEntries
PETSc.LibPETSc.VecView — Method
VecView(petsclib::PetscLibType,vec::PetscVec, viewer::PetscViewer)Views a vector object.
Collective
Input Parameters:
vec- the vectorviewer- an optionalPetscViewervisualization context
Level: beginner
-seealso: , Vec, VecViewFromOptions(), PetscViewerASCIIOpen(), PetscViewerDrawOpen(), PetscDrawLGCreate(), PetscViewerSocketOpen(), PetscViewerBinaryOpen(), VecLoad(), PetscViewerCreate(), PetscRealView(), PetscScalarView(), PetscIntView(), PetscViewerHDF5SetTimestep()
External Links
- PETSc Manual:
Vec/VecView
PETSc.LibPETSc.VecViewFromOptions — Method
VecViewFromOptions(petsclib::PetscLibType,A::PetscVec, obj::PetscObject, name::Vector{Cchar})View a vector based on values in the options database
Collective
Input Parameters:
A- the vectorobj- optional object that provides the options prefix for this viewing, use 'NULL' to use the prefix ofAname- command line option
Level: intermediate
-seealso: , Vec, VecView, PetscObjectViewFromOptions(), VecCreate()
External Links
- PETSc Manual:
Vec/VecViewFromOptions
PETSc.LibPETSc.VecViewNative — Method
VecViewNative(petsclib::PetscLibType,vec::PetscVec, viewer::PetscViewer)Views a vector object with the original type specific viewer
Collective
Input Parameters:
vec- the vectorviewer- an optionalPetscViewervisualization context
Level: developer
-seealso: , Vec, PetscViewerASCIIOpen(), PetscViewerDrawOpen(), PetscDrawLGCreate(), VecView() PetscViewerSocketOpen(), PetscViewerBinaryOpen(), VecLoad(), PetscViewerCreate(), PetscRealView(), PetscScalarView(), PetscIntView(), PetscViewerHDF5SetTimestep()
External Links
- PETSc Manual:
Vec/VecViewNative
PETSc.LibPETSc.VecWAXPY — Method
VecWAXPY(petsclib::PetscLibType,w::PetscVec, alpha::PetscScalar, x::PetscVec, y::PetscVec)Computes w = alpha x + y.
Logically Collective
Input Parameters:
alpha- the scalarx- first vector, multiplied byalphay- second vector
Output Parameter:
w- the result
Level: intermediate
-seealso: , Vec, VecAXPY(), VecAYPX(), VecAXPBY(), VecMAXPY(), VecAXPBYPCZ()
External Links
- PETSc Manual:
Vec/VecWAXPY
PETSc.LibPETSc.VecWhichBetween — Method
VecWhichBetween(petsclib::PetscLibType,VecLow::PetscVec, V::PetscVec, VecHigh::PetscVec, S::IS)Creates an index set containing the indices where VecLow < V < VecHigh
Collective
Input Parameters:
VecLow- lower boundV- Vector to compareVecHigh- higher bound
Output Parameter:
S- The index set containing the indices i where veclow[i] < v[i] < vechigh[i]
Level: advanced
-seealso: Vec
External Links
- PETSc Manual:
Vec/VecWhichBetween
PETSc.LibPETSc.VecWhichBetweenOrEqual — Method
VecWhichBetweenOrEqual(petsclib::PetscLibType,VecLow::PetscVec, V::PetscVec, VecHigh::PetscVec, S::IS)Creates an index set containing the indices where VecLow <= V <= VecHigh
Collective
Input Parameters:
VecLow- lower boundV- Vector to compareVecHigh- higher bound
Output Parameter:
S- The index set containing the indices i where veclow[i] <= v[i] <= vechigh[i]
Level: advanced
-seealso: Vec
External Links
- PETSc Manual:
Vec/VecWhichBetweenOrEqual
PETSc.LibPETSc.VecWhichEqual — Method
VecWhichEqual(petsclib::PetscLibType,Vec1::PetscVec, Vec2::PetscVec, S::IS)Creates an index set containing the indices where the vectors Vec1 and Vec2 have identical elements.
Collective
Input Parameters:
Vec1- the first vector to compareVec2- the second two vector to compare
Output Parameter:
S- The index set containing the indices i where vec1[i] == vec2[i]
Level: advanced
-seealso: Vec
External Links
- PETSc Manual:
Vec/VecWhichEqual
PETSc.LibPETSc.VecWhichGreaterThan — Method
VecWhichGreaterThan(petsclib::PetscLibType,Vec1::PetscVec, Vec2::PetscVec, S::IS)Creates an index set containing the indices where the vectors Vec1 > Vec2
Collective
Input Parameters:
Vec1- the first vector to compareVec2- the second vector to compare
Output Parameter:
S- The index set containing the indices i where vec1[i] > vec2[i]
Level: advanced
-seealso: Vec
External Links
- PETSc Manual:
Vec/VecWhichGreaterThan
PETSc.LibPETSc.VecWhichInactive — Method
VecWhichInactive(petsclib::PetscLibType,VecLow::PetscVec, V::PetscVec, D::PetscVec, VecHigh::PetscVec, Strong::PetscBool, S::IS)Creates an IS based on a set of vectors
Collective
Input Parameters:
VecLow- lower boundV- Vector to compareD- Direction to compareVecHigh- higher boundStrong- indicator for applying strongly inactive test
Output Parameter:
S- The index set containing the indices i where the bound is inactive
Level: advanced
-seealso: Vec
External Links
- PETSc Manual:
Vec/VecWhichInactive
PETSc.LibPETSc.VecWhichLessThan — Method
VecWhichLessThan(petsclib::PetscLibType,Vec1::PetscVec, Vec2::PetscVec, S::IS)Creates an index set containing the indices where the vectors Vec1 < Vec2
Collective
Input Parameters:
Vec1- the first vector to compareVec2- the second vector to compare
Output Parameter:
S- The index set containing the indices i where vec1[i] < vec2[i]
Level: advanced
-seealso: Vec
External Links
- PETSc Manual:
Vec/VecWhichLessThan
PETSc.LibPETSc.VecZeroEntries — Method
VecZeroEntries(petsclib::PetscLibType,vec::PetscVec)puts a 0.0 in each element of a vector
Logically Collective
Input Parameter:
vec- The vector
Level: beginner
-seealso: , Vec, VecCreate(), VecSetOptionsPrefix(), VecSet(), VecSetValues()
External Links
- PETSc Manual:
Vec/VecZeroEntries
PETSc.LibPETSc.VecSFischer — Method
VecSFischer(petsclib::PetscLibType,X::PetscVec, F::PetscVec, L::PetscVec, U::PetscVec, mu::PetscReal, FB::PetscVec)Evaluates the Smoothed Fischer complementarity problems.
Logically Collective
Input Parameters:
X- current pointF- function evaluated at xL- lower boundsU- upper boundsmu- smoothing parameter
Output Parameter:
FB- The Smoothed Fischer-Burmeister function vector
-seealso: Vec, VecFischer(), MatDFischer(), MatDSFischer()
External Links
- PETSc Manual:
Tao/VecSFischer
PETSc.LibPETSc.VecScale — Method
VecScale(petsclib::PetscLibType,x::PetscVec, alpha::PetscScalar)Scales a vector.
Logically Collective
Input Parameters:
x- the vectoralpha- the scalar
Level: intermediate
External Links
- PETSc Manual:
Vec/VecScale
PETSc.LibPETSc.VecScatterBegin — Method
VecScatterBegin(petsclib::PetscLibType,sf::VecScatter, x::PetscVec, y::PetscVec, addv::InsertMode, mode::ScatterMode)Begins a generalized scatter from one vector to another. Complete the scattering phase with VecScatterEnd().
Neighbor-wise Collective
Input Parameters:
sf- scatter context generated byVecScatterCreate()x- the vector from which we scattery- the vector to which we scatteraddv- eitherADD_VALUES,MAX_VALUES,MIN_VALUESorINSERT_VALUES, withINSERT_VALUESmode any location
not scattered to retains its old value; i.e. the vector is NOT first zeroed.
mode- the scattering mode, usuallySCATTER_FORWARD. The available modes are:SCATTER_FORWARDorSCATTER_REVERSE
Level: intermediate
-seealso: , VecScatter, VecScatterCreate(), VecScatterEnd(), InsertMode, ScatterMode
External Links
- PETSc Manual:
Vec/VecScatterBegin
PETSc.LibPETSc.VecScatterCopy — Method
VecScatterCopy(petsclib::PetscLibType,sf::VecScatter, newsf::VecScatter)Makes a copy of a scatter context.
Collective
Input Parameter:
sf- the scatter context
Output Parameter:
newsf- the context copy
Level: advanced
-seealso: , VecScatter, VecScatterType, VecScatterCreate(), VecScatterDestroy()
External Links
- PETSc Manual:
Vec/VecScatterCopy
PETSc.LibPETSc.VecScatterCreate — Method
newsf::VecScatter = VecScatterCreate(petsclib::PetscLibType,x::PetscVec, ix::IS, y::PetscVec, iy::IS)Creates a vector scatter VecScatter context that is used to communicate entries between two vectors Vec
Collective
Input Parameters:
x- a vector that defines the shape (parallel data layout of the vector) of vectors from which we scattery- a vector that defines the shape (parallel data layout of the vector) of vectors to which we scatterix- the indices ofxto scatter (ifNULLscatters all values)iy- the indices ofyto hold results (ifNULLfills entire vectoryinin order)
Output Parameter:
newsf- location to store the new scatter context
Options Database Keys:
-vecscatter_view- Prints detail of communications-vecscatter_view ::ascii_info- Print less details about communication-vecscatter_merge-VecScatterBegin()handles all of the communication,VecScatterEnd()is a nop
eliminates the chance for overlap of computation and communication
Level: intermediate
-seealso: , VecScatter, VecScatterDestroy(), VecScatterCreateToAll(), VecScatterCreateToZero(), PetscSFCreate(), VecScatterType, InsertMode, ScatterMode, VecScatterBegin(), VecScatterEnd()
External Links
- PETSc Manual:
Vec/VecScatterCreate
PETSc.LibPETSc.VecScatterCreateToAll — Method
ctx::VecScatter,vout::PetscVec = VecScatterCreateToAll(petsclib::PetscLibType,vin::PetscVec)Creates a vector and a scatter context that copies all vector values to each processor
Collective
Input Parameter:
vin- anMPIVEC
Output Parameters:
ctx- scatter contextvout- outputSEQVECthat is large enough to scatter into
Level: intermediate
-seealso: , VecScatter, VecScatterCreate(), VecScatterCreateToZero(), VecScatterBegin(), VecScatterEnd()
External Links
- PETSc Manual:
Vec/VecScatterCreateToAll
PETSc.LibPETSc.VecScatterCreateToZero — Method
ctx::VecScatter,vout::PetscVec = VecScatterCreateToZero(petsclib::PetscLibType,vin::PetscVec)Creates an output vector and a scatter context used to copy all vector values into the output vector on the zeroth processor
Collective
Input Parameter:
vin-Vecof typeMPIVEC
Output Parameters:
ctx- scatter contextvout- outputSEQVECthat is large enough to scatter into on processor 0 and
of length zero on all other processors
Level: intermediate
-seealso: , VecScatter, VecScatterCreate(), VecScatterCreateToAll(), VecScatterBegin(), VecScatterEnd()
External Links
- PETSc Manual:
Vec/VecScatterCreateToZero
PETSc.LibPETSc.VecScatterDestroy — Method
VecScatterDestroy(petsclib::PetscLibType,sf::VecScatter)Destroys a scatter context created by VecScatterCreate()
Collective
Input Parameter:
sf- the scatter context
Level: intermediate
-seealso: , VecScatter, VecScatterCreate(), VecScatterCopy()
External Links
- PETSc Manual:
Vec/VecScatterDestroy
PETSc.LibPETSc.VecScatterEnd — Method
VecScatterEnd(petsclib::PetscLibType,sf::VecScatter, x::PetscVec, y::PetscVec, addv::InsertMode, mode::ScatterMode)Ends a generalized scatter from one vector to another. Call after first calling VecScatterBegin().
Neighbor-wise Collective
Input Parameters:
sf- scatter context generated byVecScatterCreate()x- the vector from which we scattery- the vector to which we scatteraddv- one ofADD_VALUES,MAX_VALUES,MIN_VALUESorINSERT_VALUESmode- the scattering mode, usuallySCATTER_FORWARD. The available modes are:SCATTER_FORWARD,SCATTER_REVERSE
Level: intermediate
-seealso: , VecScatter, VecScatterBegin(), VecScatterCreate()
External Links
- PETSc Manual:
Vec/VecScatterEnd
PETSc.LibPETSc.VecScatterFFTWToPetsc — Method
VecScatterFFTWToPetsc(petsclib::PetscLibType,A::PetscMat, x::PetscVec, y::PetscVec)Converts MATFFTW output vector to a PETSc vector.
Collective
Input Parameters:
A-MATFFTWmatrixx- FFTW vector
Output Parameter:
y- PETSc vector
Level: intermediate
-seealso: , Mat, VecScatterPetscToFFTW(), MATFFTW, MatCreateVecsFFTW()
External Links
- PETSc Manual:
Mat/VecScatterFFTWToPetsc
PETSc.LibPETSc.VecScatterGetMerged — Method
flg::PetscBool = VecScatterGetMerged(petsclib::PetscLibType,sf::VecScatter)Returns true if the scatter is completed in the VecScatterBegin() and the VecScatterEnd() does nothing
Not Collective
Input Parameter:
sf- scatter context created withVecScatterCreate()
Output Parameter:
flg-PETSC_TRUEif theVecScatterBegin()/VecScatterEnd()are all done during theVecScatterBegin()
Level: developer
-seealso: , VecScatter, VecScatterCreate(), VecScatterEnd(), VecScatterBegin()
External Links
- PETSc Manual:
Vec/VecScatterGetMerged
PETSc.LibPETSc.VecScatterGetType — Method
type::VecScatterType = VecScatterGetType(petsclib::PetscLibType,sf::VecScatter)Gets the vector scatter type name (as a string) from the VecScatter.
Not Collective
Input Parameter:
sf- The vector scatter
Output Parameter:
type- The vector scatter type name
Level: intermediate
-seealso: , VecScatter, VecScatterType, VecScatterSetType(), VecScatterCreate()
External Links
- PETSc Manual:
Vec/VecScatterGetType
PETSc.LibPETSc.VecScatterPetscToFFTW — Method
VecScatterPetscToFFTW(petsclib::PetscLibType,A::PetscMat, x::PetscVec, y::PetscVec)Copies a PETSc vector to the vector that goes into MATFFTW calls.
Collective
Input Parameters:
A- FFTW matrixx- the PETSc vector
Output Parameter:
y- the FFTW vector
Level: intermediate
-seealso: , Mat, MATFFTW, VecScatterFFTWToPetsc(), MatCreateVecsFFTW()
External Links
- PETSc Manual:
Mat/VecScatterPetscToFFTW
PETSc.LibPETSc.VecScatterRegister — Method
VecScatterRegister(petsclib::PetscLibType,sname::Vector{Cchar}, fnc::external)Adds a new vector scatter component implementation
Not Collective
Input Parameters:
sname- The name of a new user-defined creation routinefunction- The creation routine
Level: advanced
-seealso: , VecScatter, VecScatterType, VecRegister()
External Links
- PETSc Manual:
Vec/VecScatterRegister
PETSc.LibPETSc.VecScatterRemap — Method
VecScatterRemap(petsclib::PetscLibType,sf::VecScatter, tomap::Vector{PetscInt}, frommap::Vector{PetscInt})Remaps the "from" and "to" indices in a vector scatter context.
Collective
Input Parameters:
sf- vector scatter contexttomap- remapping plan for "to" indices (may beNULL).frommap- remapping plan for "from" indices (may beNULL)
Level: developer
-seealso: , VecScatter, VecScatterCreate()
External Links
- PETSc Manual:
Vec/VecScatterRemap
PETSc.LibPETSc.VecScatterSetFromOptions — Method
VecScatterSetFromOptions(petsclib::PetscLibType,sf::VecScatter)Configures the vector scatter from values in the options database.
Collective
Input Parameter:
sf- The vector scatter
-seealso: , VecScatter, VecScatterCreate(), VecScatterDestroy(), VecScatterSetUp()
External Links
- PETSc Manual:
Vec/VecScatterSetFromOptions
PETSc.LibPETSc.VecScatterSetType — Method
VecScatterSetType(petsclib::PetscLibType,sf::VecScatter, type::VecScatterType)Builds a vector scatter, for a particular vector scatter implementation.
Collective
Input Parameters:
sf- TheVecScatterobjecttype- The name of the vector scatter type
Options Database Key:
-sf_type <type>- Sets theVecScatterType
Level: intermediate
-seealso: , VecScatter, VecScatterType, VecScatterGetType(), VecScatterCreate()
External Links
- PETSc Manual:
Vec/VecScatterSetType
PETSc.LibPETSc.VecScatterSetUp — Method
VecScatterSetUp(petsclib::PetscLibType,sf::VecScatter)Sets up the VecScatter to be able to actually scatter information between vectors
Collective
Input Parameter:
sf- the scatter context
Level: intermediate
-seealso: , VecScatter, VecScatterCreate(), VecScatterCopy()
External Links
- PETSc Manual:
Vec/VecScatterSetUp
PETSc.LibPETSc.VecScatterView — Method
VecScatterView(petsclib::PetscLibType,sf::VecScatter, viewer::PetscViewer)Views a vector scatter context.
Collective
Input Parameters:
sf- the scatter contextviewer- the viewer for displaying the context
Level: intermediate
-seealso: , VecScatter, PetscViewer, VecScatterViewFromOptions(), PetscObjectViewFromOptions(), VecScatterCreate()
External Links
- PETSc Manual:
Vec/VecScatterView
PETSc.LibPETSc.VecScatterViewFromOptions — Method
VecScatterViewFromOptions(petsclib::PetscLibType,sf::VecScatter, obj::PetscObject, name::Vector{Cchar})View a VecScatter object based on values in the options database
Collective
Input Parameters:
sf- the scatter contextobj- Optional objectname- command line option
Level: intermediate
-seealso: , VecScatter, VecScatterView(), PetscObjectViewFromOptions(), VecScatterCreate()
External Links
- PETSc Manual:
Vec/VecScatterViewFromOptions
PETSc.LibPETSc.VecSet — Method
VecSet(petsclib::PetscLibType,x::PetscVec, alpha::PetscScalar)Sets all components of a vector to a single scalar value.
Logically Collective
Input Parameters:
x- the vectoralpha- the scalar
Level: beginner
-seealso: , Vec, VecSetValues(), VecSetValuesBlocked(), VecSetRandom()
External Links
- PETSc Manual:
Vec/VecSet
PETSc.LibPETSc.VecSetBindingPropagates — Method
VecSetBindingPropagates(petsclib::PetscLibType,v::PetscVec, flg::PetscBool)Sets whether the state of being bound to the CPU for a GPU vector type propagates to child and some other associated objects
Input Parameters:
v- the vectorflg- flag indicating whether the boundtocpu flag should be propagated
Level: developer
-seealso: , Vec, MatSetBindingPropagates(), VecGetBindingPropagates()
External Links
- PETSc Manual:
Vec/VecSetBindingPropagates
PETSc.LibPETSc.VecSetBlockSize — Method
VecSetBlockSize(petsclib::PetscLibType,v::PetscVec, bs::PetscInt)Sets the block size for future calls to VecSetValuesBlocked() and VecSetValuesBlockedLocal().
Logically Collective
Input Parameters:
v- the vectorbs- the blocksize
Level: advanced
-seealso: , Vec, VecSetValuesBlocked(), VecSetLocalToGlobalMapping(), VecGetBlockSize()
External Links
- PETSc Manual:
Vec/VecSetBlockSize
PETSc.LibPETSc.VecSetDM — Method
VecSetDM(petsclib::PetscLibType,v::PetscVec, dm::PetscDM)Sets the DM defining the data layout of the vector.
Not Collective
Input Parameters:
v- TheVecdm- TheDM
Level: developer
Notes: This is rarely used, generally one uses DMGetLocalVector() or DMGetGlobalVector() to create a vector associated with a given DM
This is NOT the same as DMCreateGlobalVector() since it does not change the view methods or perform other customization, but merely sets the DM member.
See also:
DM, VecGetDM(), DMGetLocalVector(), DMGetGlobalVector(), DMSetVecType()
External Links
- PETSc Manual:
Dm/VecSetDM
PETSc.LibPETSc.VecSetErrorIfLocked — Method
VecSetErrorIfLocked(petsclib::PetscLibType,x::PetscVec, arg::PetscInt)External Links
- PETSc Manual:
Vec/VecSetErrorIfLocked
PETSc.LibPETSc.VecSetFromOptions — Method
VecSetFromOptions(petsclib::PetscLibType,vec::PetscVec)Configures the vector from the options database.
Collective
Input Parameter:
vec- The vector
Level: beginner
-seealso: , Vec, VecCreate(), VecSetOptionsPrefix()
External Links
- PETSc Manual:
Vec/VecSetFromOptions
PETSc.LibPETSc.VecSetLayout — Method
VecSetLayout(petsclib::PetscLibType,x::PetscVec, map::PetscLayout)set PetscLayout describing vector layout
Not Collective
Input Parameters:
x- the vectormap- the layout
Level: developer
-seealso: , Vec, PetscLayout, VecGetLayout(), VecGetSize(), VecGetOwnershipRange(), VecGetOwnershipRanges()
External Links
- PETSc Manual:
Vec/VecSetLayout
PETSc.LibPETSc.VecSetLocalToGlobalMapping — Method
VecSetLocalToGlobalMapping(petsclib::PetscLibType,x::PetscVec, mapping::ISLocalToGlobalMapping)Sets a local numbering to global numbering used by the routine VecSetValuesLocal() to allow users to insert vector entries using a local (per-processor) numbering.
Logically Collective
Input Parameters:
x- vectormapping- mapping created withISLocalToGlobalMappingCreate()orISLocalToGlobalMappingCreateIS()
Level: intermediate
-seealso: , Vec, VecAssemblyBegin(), VecAssemblyEnd(), VecSetValues(), VecSetValuesLocal(), VecGetLocalToGlobalMapping(), VecSetValuesBlockedLocal()
External Links
- PETSc Manual:
Vec/VecSetLocalToGlobalMapping
PETSc.LibPETSc.VecSetOption — Method
VecSetOption(petsclib::PetscLibType,x::PetscVec, op::VecOption, flag::PetscBool)Sets an option for controlling a vector's behavior.
Collective
Input Parameters:
x- the vectorop- the optionflag- turn the option on or off
Supported Options:
VEC_IGNORE_OFF_PROC_ENTRIES- which causesVecSetValues()to ignore
entries destined to be stored on a separate processor. This can be used to eliminate the global reduction in the VecAssemblyBegin() if you know that you have only used VecSetValues() to set local elements
VEC_IGNORE_NEGATIVE_INDICES- which means you can pass negative indices
in ix in calls to VecSetValues() or VecGetValues(). These rows are simply ignored.
VEC_SUBSET_OFF_PROC_ENTRIES- which causesVecAssemblyBegin()to assume that the off-process
entries will always be a subset (possibly equal) of the off-process entries set on the first assembly which had a true VEC_SUBSET_OFF_PROC_ENTRIES and the vector has not changed this flag afterwards. If this assembly is not such first assembly, then this assembly can reuse the communication pattern setup in that first assembly, thus avoiding a global reduction. Subsequent assemblies setting off-process values should use the same InsertMode as the first assembly.
Level: intermediate
-seealso: , Vec, VecSetValues()
External Links
- PETSc Manual:
Vec/VecSetOption
PETSc.LibPETSc.VecSetOptionsPrefix — Method
VecSetOptionsPrefix(petsclib::PetscLibType,v::PetscVec, prefix::Vector{Cchar})Sets the prefix used for searching for all Vec options in the database.
Logically Collective
Input Parameters:
v- theVeccontextprefix- the prefix to prepend to all option names
Level: advanced
-seealso: , Vec, VecSetFromOptions()
External Links
- PETSc Manual:
Vec/VecSetOptionsPrefix
PETSc.LibPETSc.VecSetPinnedMemoryMin — Method
VecSetPinnedMemoryMin(petsclib::PetscLibType,v::PetscVec, mbytes::Csize_t)Set the minimum data size for which pinned memory will be used for host (CPU) allocations.
Logically Collective
Input Parameters:
v- the vectormbytes- minimum data size in bytes
Options Database Key:
-vec_pinned_memory_min <size>- minimum size (in bytes) for an allocation to use pinned memory on host.
Level: developer
-seealso: , Vec, VecGetPinnedMemoryMin()
External Links
- PETSc Manual:
Vec/VecSetPinnedMemoryMin
PETSc.LibPETSc.VecSetPreallocationCOO — Method
VecSetPreallocationCOO(petsclib::PetscLibType,x::PetscVec, ncoo::PetscCount, coo_i::Vector{PetscInt})set preallocation for a vector using a coordinate format of the entries with global indices
Collective
Input Parameters:
x- vector being preallocatedncoo- number of entriescoo_i- entry indices
Level: beginner
-seealso: , Vec, VecSetValuesCOO(), VecSetPreallocationCOOLocal()
External Links
- PETSc Manual:
Vec/VecSetPreallocationCOO
PETSc.LibPETSc.VecSetPreallocationCOOLocal — Method
VecSetPreallocationCOOLocal(petsclib::PetscLibType,x::PetscVec, ncoo::PetscCount, coo_i::Vector{PetscInt})set preallocation for vectors using a coordinate format of the entries with local indices
Collective
Input Parameters:
x- vector being preallocatedncoo- number of entriescoo_i- row indices (local numbering; may be modified)
Level: beginner
-seealso: , Vec, VecSetPreallocationCOO(), VecSetValuesCOO()
External Links
- PETSc Manual:
Vec/VecSetPreallocationCOOLocal
PETSc.LibPETSc.VecSetRandom — Method
VecSetRandom(petsclib::PetscLibType,x::PetscVec, rctx::PetscRandom)Sets all components of a vector to random numbers.
Logically Collective
Input Parameters:
x- the vectorrctx- the random number context, formed byPetscRandomCreate(), or useNULLand it will create one internally.
Output Parameter:
x- the vector
Example of Usage: -seealso: , Vec, VecSet(), VecSetValues(), PetscRandomCreate(), PetscRandomDestroy()
External Links
- PETSc Manual:
Vec/VecSetRandom
PETSc.LibPETSc.VecSetSizes — Method
VecSetSizes(petsclib::PetscLibType,v::PetscVec, n::PetscInt, N::PetscInt)Sets the local and global sizes, and checks to determine compatibility of the sizes
Collective
Input Parameters:
v- the vectorn- the local size (orPETSC_DECIDEto have it set)N- the global size (orPETSC_DETERMINEto have it set)
Level: intermediate
-seealso: , Vec, VecCreate(), VecCreateSeq(), VecCreateMPI(), VecGetSize(), PetscSplitOwnership(), PetscLayout, VecGetOwnershipRange(), VecGetOwnershipRanges(), MatSetSizes()
External Links
- PETSc Manual:
Vec/VecSetSizes
PETSc.LibPETSc.VecSetType — Method
VecSetType(petsclib::PetscLibType,vec::PetscVec, newType::VecType)Builds a vector, for a particular vector implementation.
Collective
Input Parameters:
vec- The vector objectnewType- The name of the vector type
Options Database Key:
-vec_type <type>- Sets the vector type; use -help for a list
of available types
Level: intermediate
-seealso: , Vec, VecType, VecGetType(), VecCreate(), VecDuplicate(), VecDuplicateVecs()
External Links
- PETSc Manual:
Vec/VecSetType
PETSc.LibPETSc.VecSetUp — Method
VecSetUp(petsclib::PetscLibType,v::PetscVec)Sets up the internal vector data structures for the later use.
Collective
Input Parameter:
v- theVeccontext
Level: advanced
-seealso: , Vec, VecCreate(), VecDestroy()
External Links
- PETSc Manual:
Vec/VecSetUp
PETSc.LibPETSc.VecSetValue — Method
VecSetValue(petsclib::PetscLibType,v::PetscVec, i::PetscInt, va::PetscScalar, mode::InsertMode)External Links
- PETSc Manual:
Vec/VecSetValue
PETSc.LibPETSc.VecSetValueLocal — Method
VecSetValueLocal(petsclib::PetscLibType,v::PetscVec, i::PetscInt, va::PetscScalar, mode::InsertMode)External Links
- PETSc Manual:
Vec/VecSetValueLocal
PETSc.LibPETSc.VecSetValues — Method
VecSetValues(petsclib::PetscLibType,x::PetscVec, ni::PetscInt, ix::Vector{PetscInt}, y::Vector{PetscScalar}, iora::InsertMode)Inserts or adds values into certain locations of a vector.
Not Collective
Input Parameters:
x- vector to insert inni- number of elements to addix- indices where to addy- array of values. PassNULLto set all zeroes.iora- eitherINSERT_VALUESto replace the current values orADD_VALUESto add values to any existing entries
Level: beginner
-seealso: , Vec, VecAssemblyBegin(), VecAssemblyEnd(), VecSetValuesLocal(), VecSetValue(), VecSetValuesBlocked(), InsertMode, INSERT_VALUES, ADD_VALUES, VecGetValues()
External Links
- PETSc Manual:
Vec/VecSetValues
PETSc.LibPETSc.VecSetValuesBlocked — Method
VecSetValuesBlocked(petsclib::PetscLibType,x::PetscVec, ni::PetscInt, ix::Vector{PetscInt}, y::Vector{PetscScalar}, iora::InsertMode)Inserts or adds blocks of values into certain locations of a vector.
Not Collective
Input Parameters:
x- vector to insert inni- number of blocks to addix- indices where to add in block count, rather than element county- array of values. PassNULLto set all zeroes.iora- eitherINSERT_VALUESreplaces existing entries with new values,ADD_VALUES, adds values to any existing entries
Level: intermediate
-seealso: , Vec, VecAssemblyBegin(), VecAssemblyEnd(), VecSetValuesBlockedLocal(), VecSetValues()
External Links
- PETSc Manual:
Vec/VecSetValuesBlocked
PETSc.LibPETSc.VecSetValuesBlockedLocal — Method
VecSetValuesBlockedLocal(petsclib::PetscLibType,x::PetscVec, ni::PetscInt, ix::Vector{PetscInt}, y::Vector{PetscScalar}, iora::InsertMode)Inserts or adds values into certain locations of a vector, using a local ordering of the nodes.
Not Collective
Input Parameters:
x- vector to insert inni- number of blocks to addix- indices where to add in block count, not element county- array of values. PassNULLto set all zeroes.iora- eitherINSERT_VALUESreplaces existing entries with new values,ADD_VALUESadds values to any existing entries
Level: intermediate
-seealso: , Vec, VecAssemblyBegin(), VecAssemblyEnd(), VecSetValues(), VecSetValuesBlocked(), VecSetLocalToGlobalMapping()
External Links
- PETSc Manual:
Vec/VecSetValuesBlockedLocal
PETSc.LibPETSc.VecSetValuesCOO — Method
VecSetValuesCOO(petsclib::PetscLibType,x::PetscVec, coo_v::Vector{PetscScalar}, imode::InsertMode)set values at once in a vector preallocated using VecSetPreallocationCOO()
Collective
Input Parameters:
x- vector being setcoo_v- the value arrayimode- the insert mode
Level: beginner
-seealso: , Vec, VecSetPreallocationCOO(), VecSetPreallocationCOOLocal(), VecSetValues()
External Links
- PETSc Manual:
Vec/VecSetValuesCOO
PETSc.LibPETSc.VecSetValuesLocal — Method
VecSetValuesLocal(petsclib::PetscLibType,x::PetscVec, ni::PetscInt, ix::Vector{PetscInt}, y::Vector{PetscScalar}, iora::InsertMode)Inserts or adds values into certain locations of a vector, using a local ordering of the nodes.
Not Collective
Input Parameters:
x- vector to insert inni- number of elements to addix- indices where to addy- array of values. PassNULLto set all zeroes.iora- eitherINSERT_VALUESreplaces existing entries with new values,ADD_VALUESadds values to any existing entries
Level: intermediate
-seealso: , Vec, VecAssemblyBegin(), VecAssemblyEnd(), VecSetValues(), VecSetLocalToGlobalMapping(), VecSetValuesBlockedLocal()
External Links
- PETSc Manual:
Vec/VecSetValuesLocal
PETSc.LibPETSc.VecSetValuesSection — Method
VecSetValuesSection(petsclib::PetscLibType,v::PetscVec, s::PetscSection, point::PetscInt, values::Vector{PetscScalar}, mode::InsertMode)Sets all the values associated with a given point, according to the section, in the given Vec
Not Collective
Input Parameters:
v- theVecs- the organizingPetscSectionpoint- the pointvalues- the array of input valuesmode- the insertion mode, eitherADD_VALUESorINSERT_VALUES
Level: developer
-seealso: PetscSection, PetscSectionCreate(), VecGetValuesSection()
External Links
- PETSc Manual:
Vec/VecSetValuesSection
PETSc.LibPETSc.VecShift — Method
VecShift(petsclib::PetscLibType,v::PetscVec, shift::PetscScalar)Shifts all of the components of a vector by computing x[i] = x[i] + shift.
Logically Collective
Input Parameters:
v- the vectorshift- the shift
Level: intermediate
-seealso: Vec, VecISShift()
External Links
- PETSc Manual:
Vec/VecShift
PETSc.LibPETSc.VecSqrtAbs — Method
VecSqrtAbs(petsclib::PetscLibType,v::PetscVec)Replaces each component of a vector by the square root of its magnitude.
Not Collective
Input Parameter:
v- The vector
Level: beginner
-seealso: Vec, VecLog(), VecExp(), VecReciprocal(), VecAbs()
External Links
- PETSc Manual:
Vec/VecSqrtAbs
PETSc.LibPETSc.VecStashGetInfo — Method
nstash::PetscInt,reallocs::PetscInt,bnstash::PetscInt,breallocs::PetscInt = VecStashGetInfo(petsclib::PetscLibType,vec::PetscVec)Gets how many values are currently in the vector stash, i.e. need to be communicated to other processors during the VecAssemblyBegin()/VecAssemblyEnd() process
Not Collective
Input Parameter:
vec- the vector
Output Parameters:
nstash- the size of the stashreallocs- the number of additional mallocs incurred in building the stashbnstash- the size of the block stashbreallocs- the number of additional mallocs incurred in building the block stash (fromVecSetValuesBlocked())
Level: advanced
-seealso: , Vec, VecAssemblyBegin(), VecAssemblyEnd(), VecStashSetInitialSize(), VecStashView()
External Links
- PETSc Manual:
Vec/VecStashGetInfo
PETSc.LibPETSc.VecStashSetInitialSize — Method
VecStashSetInitialSize(petsclib::PetscLibType,vec::PetscVec, size::PetscInt, bsize::PetscInt)sets the sizes of the vec used during the assembly process to store values that belong to other processors.
Not Collective, different processes can have different size stashes
Input Parameters:
vec- the vectorsize- the initial size of the stash.bsize- the initial size of the block-stash(if used).
Options Database Keys:
-vecstash_initial_size <size> or <size0,size1,...sizep-1>- set initial size-vecstash_block_initial_size <bsize> or <bsize0,bsize1,...bsizep-1>- set initial block size
Level: intermediate
-seealso: , Vec, VecSetBlockSize(), VecSetValues(), VecSetValuesBlocked(), VecStashView()
External Links
- PETSc Manual:
Vec/VecStashSetInitialSize
PETSc.LibPETSc.VecStashView — Method
VecStashView(petsclib::PetscLibType,v::PetscVec, viewer::PetscViewer)Prints the entries in the vector stash and block stash.
Collective
Input Parameters:
v- the vectorviewer- the viewer
Level: advanced
-seealso: , Vec, VecSetBlockSize(), VecSetValues(), VecSetValuesBlocked()
External Links
- PETSc Manual:
Vec/VecStashView
PETSc.LibPETSc.VecStashViewFromOptions — Method
VecStashViewFromOptions(petsclib::PetscLibType,obj::PetscVec, bobj::PetscObject, optionname::Vector{Cchar})Processes command line options to determine if/how a VecStash object is to be viewed.
Collective
Input Parameters:
obj- theVeccontaining a stashbobj- optional other object that provides the prefixoptionname- option to activate viewing
Level: intermediate
-seealso: , Vec, VecStashSetInitialSize()
External Links
- PETSc Manual:
Vec/VecStashViewFromOptions
PETSc.LibPETSc.VecStepBoundInfo — Method
boundmin::PetscReal,wolfemin::PetscReal,boundmax::PetscReal = VecStepBoundInfo(petsclib::PetscLibType,X::PetscVec, DX::PetscVec, XL::PetscVec, XU::PetscVec)See below
Collective
Input Parameters:
X- vector with no negative entriesXL- lower boundsXU- upper boundsDX- step direction, can have negative, positive or zero entries
Output Parameters:
boundmin- (may beNULLthis it is not computed) maximum value so that XL[i] <= X[i] + boundmax*DX[i] <= XU[i]wolfemin- (may beNULLthis it is not computed)boundmax- (may beNULLthis it is not computed) minimum value so that X[i] + boundmaxDX[i] <= XL[i] or XU[i] <= X[i] + boundmaxDX[i]
Level: advanced
-seealso: Vec
External Links
- PETSc Manual:
Vec/VecStepBoundInfo
PETSc.LibPETSc.VecStepMax — Method
step::PetscReal = VecStepMax(petsclib::PetscLibType,X::PetscVec, DX::PetscVec)Returns the largest value so that x[i] + step*DX[i] >= 0 for all i
Collective
Input Parameters:
X- vector with no negative entriesDX- a step direction, can have negative, positive or zero entries
Output Parameter:
step- largest value such that x[i] + step*DX[i] >= 0 for all i
Level: advanced
-seealso: Vec
External Links
- PETSc Manual:
Vec/VecStepMax
PETSc.LibPETSc.VecStepMaxBounded — Method
stepmax::PetscReal = VecStepMaxBounded(petsclib::PetscLibType,X::PetscVec, DX::PetscVec, XL::PetscVec, XU::PetscVec)See below
Collective
Input Parameters:
X- vector with no negative entriesXL- lower boundsXU- upper boundsDX- step direction, can have negative, positive or zero entries
Output Parameter:
stepmax- minimum value so that X[i] + stepmaxDX[i] <= XL[i] or XU[i] <= X[i] + stepmaxDX[i]
Level: intermediate
-seealso: Vec
External Links
- PETSc Manual:
Vec/VecStepMaxBounded
PETSc.LibPETSc.VecStrideGather — Method
VecStrideGather(petsclib::PetscLibType,v::PetscVec, start::PetscInt, s::PetscVec, addv::InsertMode)Gathers a single component from a multi another vector.
Collective
Input Parameters:
v- the vectorstart- starting point of the subvector (defined by a stride)addv- one ofADD_VALUES,INSERT_VALUES,MAX_VALUES
Output Parameter:
s- the location where the subvector is stored
Level: advanced
-seealso: Vec, VecStrideNorm(), VecStrideScatter(), VecStrideMin(), VecStrideMax(), VecStrideGatherAll(), VecStrideScatterAll()
External Links
- PETSc Manual:
Vec/VecStrideGather
PETSc.LibPETSc.VecStrideGatherAll — Method
VecStrideGatherAll(petsclib::PetscLibType,v::PetscVec, s::Vector{PetscVec}, addv::InsertMode)Gathers all the single components from a multi separate vectors.
Collective
Input Parameters:
v- the vectoraddv- one ofADD_VALUES,INSERT_VALUES,MAX_VALUES
Output Parameter:
s- the location where the subvectors are stored
Level: advanced
-seealso: Vec, VecStrideNorm(), VecStrideScatter(), VecStrideMin(), VecStrideMax(), VecStrideGather(), VecStrideScatterAll()
External Links
- PETSc Manual:
Vec/VecStrideGatherAll
PETSc.LibPETSc.VecStrideMax — Method
idex::PetscInt,nrm::PetscReal = VecStrideMax(petsclib::PetscLibType,v::PetscVec, start::PetscInt)Computes the maximum of subvector of a vector defined by a starting point and a stride and optionally its location.
Collective
Input Parameters:
v- the vectorstart- starting point of the subvector (defined by a stride)
Output Parameters:
idex- the location where the maximum occurred (passNULLif not required)nrm- the maximum value in the subvector
Level: advanced
-seealso: Vec, VecMax(), VecStrideNorm(), VecStrideGather(), VecStrideScatter(), VecStrideMin()
External Links
- PETSc Manual:
Vec/VecStrideMax
PETSc.LibPETSc.VecStrideMaxAll — Method
idex::Vector{PetscInt},nrm::Vector{PetscReal} = VecStrideMaxAll(petsclib::PetscLibType,v::PetscVec)Computes the maximums of subvectors of a vector defined by a starting point and a stride and optionally its location.
Collective
Input Parameter:
v- the vector
Output Parameters:
idex- the location where the maximum occurred (not supported, passNULL,
if you need this, send mail to petsc-maint@mcs.anl.gov to request it)
nrm- the maximum values of each subvector
Level: advanced
-seealso: Vec, VecMax(), VecStrideNorm(), VecStrideGather(), VecStrideScatter(), VecStrideMin()
External Links
- PETSc Manual:
Vec/VecStrideMaxAll
PETSc.LibPETSc.VecStrideMin — Method
idex::PetscInt,nrm::PetscReal = VecStrideMin(petsclib::PetscLibType,v::PetscVec, start::PetscInt)Computes the minimum of subvector of a vector defined by a starting point and a stride and optionally its location.
Collective
Input Parameters:
v- the vectorstart- starting point of the subvector (defined by a stride)
Output Parameters:
idex- the location where the minimum occurred. (passNULLif not required)nrm- the minimum value in the subvector
Level: advanced
-seealso: Vec, VecMin(), VecStrideNorm(), VecStrideGather(), VecStrideScatter(), VecStrideMax()
External Links
- PETSc Manual:
Vec/VecStrideMin
PETSc.LibPETSc.VecStrideMinAll — Method
idex::Vector{PetscInt},nrm::Vector{PetscReal} = VecStrideMinAll(petsclib::PetscLibType,v::PetscVec)Computes the minimum of subvector of a vector defined by a starting point and a stride and optionally its location.
Collective
Input Parameter:
v- the vector
Output Parameters:
idex- the location where the minimum occurred (not supported, passNULL,
if you need this, send mail to petsc-maint@mcs.anl.gov to request it)
nrm- the minimums of each subvector
Level: advanced
-seealso: Vec, VecMin(), VecStrideNorm(), VecStrideGather(), VecStrideScatter(), VecStrideMax()
External Links
- PETSc Manual:
Vec/VecStrideMinAll
PETSc.LibPETSc.VecStrideNorm — Method
nrm::PetscReal = VecStrideNorm(petsclib::PetscLibType,v::PetscVec, start::PetscInt, ntype::NormType)Computes the norm of subvector of a vector defined by a starting point and a stride.
Collective
Input Parameters:
v- the vectorstart- starting point of the subvector (defined by a stride)ntype- type of norm, one ofNORM_1,NORM_2,NORM_INFINITY
Output Parameter:
nrm- the norm
Level: advanced
-seealso: Vec, VecNorm(), VecStrideGather(), VecStrideScatter(), VecStrideMin(), VecStrideMax()
External Links
- PETSc Manual:
Vec/VecStrideNorm
PETSc.LibPETSc.VecStrideNormAll — Method
nrm::Vector{PetscReal} = VecStrideNormAll(petsclib::PetscLibType,v::PetscVec, ntype::NormType)Computes the norms of subvectors of a vector defined by a starting point and a stride.
Collective
Input Parameters:
v- the vectorntype- type of norm, one ofNORM_1,NORM_2,NORM_INFINITY
Output Parameter:
nrm- the norms
Level: advanced
-seealso: Vec, VecNorm(), VecStrideGather(), VecStrideScatter(), VecStrideMin(), VecStrideMax()
External Links
- PETSc Manual:
Vec/VecStrideNormAll
PETSc.LibPETSc.VecStrideScale — Method
VecStrideScale(petsclib::PetscLibType,v::PetscVec, start::PetscInt, scale::PetscScalar)Scales a subvector of a vector defined by a starting point and a stride.
Logically Collective
Input Parameters:
v- the vectorstart- starting point of the subvector (defined by a stride)scale- value to multiply each subvector entry by
Level: advanced
-seealso: Vec, VecNorm(), VecStrideGather(), VecStrideScatter(), VecStrideMin(), VecStrideMax()
External Links
- PETSc Manual:
Vec/VecStrideScale
PETSc.LibPETSc.VecStrideScaleAll — Method
VecStrideScaleAll(petsclib::PetscLibType,v::PetscVec, scales::PetscScalar)Scales the subvectors of a vector defined by a starting point and a stride.
Logically Collective
Input Parameters:
v- the vectorscales- values to multiply each subvector entry by
Level: advanced
-seealso: Vec, VecNorm(), VecStrideScale(), VecScale(), VecStrideGather(), VecStrideScatter(), VecStrideMin(), VecStrideMax()
External Links
- PETSc Manual:
Vec/VecStrideScaleAll
PETSc.LibPETSc.VecStrideScatter — Method
VecStrideScatter(petsclib::PetscLibType,s::PetscVec, start::PetscInt, v::PetscVec, addv::InsertMode)Scatters a single component from a vector into a multi
Collective
Input Parameters:
s- the single-component vectorstart- starting point of the subvector (defined by a stride)addv- one ofADD_VALUES,INSERT_VALUES,MAX_VALUES
Output Parameter:
v- the location where the subvector is scattered (the multi-component vector)
Level: advanced
-seealso: Vec, VecStrideNorm(), VecStrideGather(), VecStrideMin(), VecStrideMax(), VecStrideGatherAll(), VecStrideScatterAll(), VecStrideSubSetScatter(), VecStrideSubSetGather()
External Links
- PETSc Manual:
Vec/VecStrideScatter
PETSc.LibPETSc.VecStrideScatterAll — Method
VecStrideScatterAll(petsclib::PetscLibType,s::Vector{PetscVec}, v::PetscVec, addv::InsertMode)Scatters all the single components from separate vectors into a multi-component vector.
Collective
Input Parameters:
s- the location where the subvectors are storedaddv- one ofADD_VALUES,INSERT_VALUES,MAX_VALUES
Output Parameter:
v- the multicomponent vector
Level: advanced
-seealso: Vec, VecStrideNorm(), VecStrideScatter(), VecStrideMin(), VecStrideMax(), VecStrideGather(),
External Links
- PETSc Manual:
Vec/VecStrideScatterAll
PETSc.LibPETSc.VecStrideSet — Method
VecStrideSet(petsclib::PetscLibType,v::PetscVec, start::PetscInt, s::PetscScalar)Sets a subvector of a vector defined by a starting point and a stride with a given value
Logically Collective
Input Parameters:
v- the vectorstart- starting point of the subvector (defined by a stride)s- value to set for each entry in that subvector
Level: advanced
-seealso: Vec, VecNorm(), VecStrideGather(), VecStrideScatter(), VecStrideMin(), VecStrideMax(), VecStrideScale()
External Links
- PETSc Manual:
Vec/VecStrideSet
PETSc.LibPETSc.VecStrideSubSetGather — Method
VecStrideSubSetGather(petsclib::PetscLibType,v::PetscVec, nidx::PetscInt, idxv::Vector{PetscInt}, idxs::Vector{PetscInt}, s::PetscVec, addv::InsertMode)Gathers a subset of components from a multi another vector.
Collective
Input Parameters:
v- the vectornidx- the number of indicesidxv- the indices of the components 0 <= idxv[0] ...idxv[nidx-1] < bs(v), they need not be sortedidxs- the indices of the components 0 <= idxs[0] ...idxs[nidx-1] < bs(s), they need not be sorted, may be null if nidx == bs(s) or isPETSC_DETERMINEaddv- one ofADD_VALUES,INSERT_VALUES,MAX_VALUES
Output Parameter:
s- the location where the subvector is stored
Level: advanced
-seealso: Vec, VecStrideNorm(), VecStrideScatter(), VecStrideGather(), VecStrideSubSetScatter(), VecStrideMin(), VecStrideMax(), VecStrideGatherAll(), VecStrideScatterAll()
External Links
- PETSc Manual:
Vec/VecStrideSubSetGather
PETSc.LibPETSc.VecStrideSubSetScatter — Method
VecStrideSubSetScatter(petsclib::PetscLibType,s::PetscVec, nidx::PetscInt, idxs::Vector{PetscInt}, idxv::Vector{PetscInt}, v::PetscVec, addv::InsertMode)Scatters components from a vector into a subset of components of a multi
Collective
Input Parameters:
s- the smaller-component vectornidx- the number of indices in idxidxs- the indices of the components in the smaller-component vector, 0 <= idxs[0] ...idxs[nidx-1] < bs(s) they need not be sorted, may be null if nidx == bs(s) or isPETSC_DETERMINEidxv- the indices of the components in the larger-component vector, 0 <= idx[0] ...idx[nidx-1] < bs(v) they need not be sortedaddv- one ofADD_VALUES,INSERT_VALUES,MAX_VALUES
Output Parameter:
v- the location where the subvector is into scattered (the multi-component vector)
Level: advanced
-seealso: Vec, VecStrideNorm(), VecStrideGather(), VecStrideSubSetGather(), VecStrideMin(), VecStrideMax(), VecStrideGatherAll(), VecStrideScatterAll()
External Links
- PETSc Manual:
Vec/VecStrideSubSetScatter
PETSc.LibPETSc.VecStrideSum — Method
sum::PetscScalar = VecStrideSum(petsclib::PetscLibType,v::PetscVec, start::PetscInt)Computes the sum of subvector of a vector defined by a starting point and a stride.
Collective
Input Parameters:
v- the vectorstart- starting point of the subvector (defined by a stride)
Output Parameter:
sum- the sum
Level: advanced
-seealso: Vec, VecSum(), VecStrideGather(), VecStrideScatter(), VecStrideMin(), VecStrideMax()
External Links
- PETSc Manual:
Vec/VecStrideSum
PETSc.LibPETSc.VecStrideSumAll — Method
sums::Vector{PetscScalar} = VecStrideSumAll(petsclib::PetscLibType,v::PetscVec)Computes the sums of subvectors of a vector defined by a stride.
Collective
Input Parameter:
v- the vector
Output Parameter:
sums- the sums
Level: advanced
-seealso: Vec, VecSum(), VecStrideGather(), VecStrideScatter(), VecStrideMin(), VecStrideMax()
External Links
- PETSc Manual:
Vec/VecStrideSumAll
PETSc.LibPETSc.VecSum — Method
sum::PetscScalar = VecSum(petsclib::PetscLibType,v::PetscVec)Computes the sum of all the components of a vector.
Collective
Input Parameter:
v- the vector
Output Parameter:
sum- the result
Level: beginner
-seealso: Vec, VecMean(), VecNorm()
External Links
- PETSc Manual:
Vec/VecSum
PETSc.LibPETSc.VecSwap — Method
VecSwap(petsclib::PetscLibType,x::PetscVec, y::PetscVec)Swaps the values between two vectors, x and y.
Logically Collective
Input Parameters:
x- the first vectory- the second vector
Level: advanced
External Links
- PETSc Manual:
Vec/VecSwap
PETSc.LibPETSc.VecsCreateSeq — Method
x::Vecs = VecsCreateSeq(petsclib::PetscLibType,comm::MPI_Comm, p::PetscInt, m::PetscInt)External Links
- PETSc Manual:
Vec/VecsCreateSeq
PETSc.LibPETSc.VecsCreateSeqWithArray — Method
a::PetscScalar,x::Vecs = VecsCreateSeqWithArray(petsclib::PetscLibType,comm::MPI_Comm, p::PetscInt, m::PetscInt)External Links
- PETSc Manual:
Vec/VecsCreateSeqWithArray
PETSc.LibPETSc.VecsDestroy — Method
PETSc.LibPETSc.VecsDuplicate — Method
y::Vecs = VecsDuplicate(petsclib::PetscLibType,x::Vecs)External Links
- PETSc Manual:
Vec/VecsDuplicate
PETSc.LibPETSc.VecTaggerAbsoluteGetBox — Method
VecTaggerAbsoluteGetBox(petsclib::PetscLibType,tagger::VecTagger, box::Vector{VecTaggerBox})Get the box defining the values to be tagged by the tagger.
Logically Collective
Input Parameter:
tagger- theVecTaggercontext
Output Parameter:
box- the box: a blocksize array ofVecTaggerBoxboxes
Level: advanced
-seealso: VecTagger, VecTaggerBox, VecTaggerAbsoluteSetBox()
External Links
- PETSc Manual:
Vec/VecTaggerAbsoluteGetBox
PETSc.LibPETSc.VecTaggerAbsoluteSetBox — Method
VecTaggerAbsoluteSetBox(petsclib::PetscLibType,tagger::VecTagger, box::Vector{VecTaggerBox})Set the box defining the values to be tagged by the tagger.
Logically Collective
Input Parameters:
tagger- theVecTaggercontextbox- the box: a blocksize array ofVecTaggerBoxboxes
Level: advanced
-seealso: VecTagger, VecTaggerBox, VecTaggerAbsoluteGetBox()
External Links
- PETSc Manual:
Vec/VecTaggerAbsoluteSetBox
PETSc.LibPETSc.VecTaggerAndGetSubs — Method
nsubs::PetscInt = VecTaggerAndGetSubs(petsclib::PetscLibType,tagger::VecTagger, subs::Vector{VecTagger})Get the sub VecTaggers whose intersection defines the outer VecTagger
Not Collective
Input Parameter:
tagger- theVecTaggercontext
Output Parameters:
nsubs- the number of subVecTaggerssubs- the subVecTaggers
Level: advanced
-seealso: VecTagger, VecTaggerAndSetSubs()
External Links
- PETSc Manual:
Vec/VecTaggerAndGetSubs
PETSc.LibPETSc.VecTaggerAndSetSubs — Method
VecTaggerAndSetSubs(petsclib::PetscLibType,tagger::VecTagger, nsubs::PetscInt, subs::Vector{VecTagger}, mode::PetscCopyMode)Set the sub VecTaggers whose intersection defines the outer VecTagger
Logically Collective
Input Parameters:
tagger- theVecTaggercontextnsubs- the number of subVecTaggerssubs- the subVecTaggersmode- the copy mode to use forsubs
Level: advanced
-seealso: VecTagger
External Links
- PETSc Manual:
Vec/VecTaggerAndSetSubs
PETSc.LibPETSc.VecTaggerCDFGetBox — Method
VecTaggerCDFGetBox(petsclib::PetscLibType,tagger::VecTagger, box::Vector{VecTaggerBox})Get the cumulative box (multi are subsets of [0,1], where 0 indicates the smallest value present in the vector and 1 indicates the largest.
Logically Collective
Input Parameter:
tagger- theVecTaggercontext
Output Parameter:
box- a blocksize array ofVecTaggerBoxboxes
Level: advanced
-seealso: VecTagger, VecTaggerCDFSetBox(), VecTaggerBox
External Links
- PETSc Manual:
Vec/VecTaggerCDFGetBox
PETSc.LibPETSc.VecTaggerCDFGetMethod — Method
VecTaggerCDFGetMethod(petsclib::PetscLibType,tagger::VecTagger, method::VecTaggerCDFMethod)Get the method used to compute absolute boxes from CDF boxes
Logically Collective
Input Parameter:
tagger- theVecTaggercontext
Output Parameter:
method- the method
Level: advanced
-seealso: Vec, VecTagger, VecTaggerCDFMethod
External Links
- PETSc Manual:
Vec/VecTaggerCDFGetMethod
PETSc.LibPETSc.VecTaggerCDFIterativeGetTolerances — Method
maxit::PetscInt,rtol::PetscReal,atol::PetscReal = VecTaggerCDFIterativeGetTolerances(petsclib::PetscLibType,tagger::VecTagger)Get the tolerances for iterative computation of absolute boxes from CDF boxes.
Logically Collective
Input Parameter:
tagger- theVecTaggercontext
Output Parameters:
maxit- the maximum number of iterations: 0 indicates the absolute values will be estimated from an initial guess based only on the minimum, maximum,
mean, and standard deviation of the box endpoints.
rtol- the acceptable relative tolerance in the absolute values from the initial guessatol- the acceptable absolute tolerance in the absolute values from the initial guess
Level: advanced
-seealso: VecTagger, VecTaggerCDFSetMethod()
External Links
- PETSc Manual:
Vec/VecTaggerCDFIterativeGetTolerances
PETSc.LibPETSc.VecTaggerCDFIterativeSetTolerances — Method
VecTaggerCDFIterativeSetTolerances(petsclib::PetscLibType,tagger::VecTagger, maxit::PetscInt, rtol::PetscReal, atol::PetscReal)Set the tolerances for iterative computation of absolute boxes from CDF boxes.
Logically Collective
Input Parameters:
tagger- theVecTaggercontextmaxit- the maximum number of iterations: 0 indicates the absolute values will be estimated from an initial guess based only on the minimum, maximum, mean,
and standard deviation of the box endpoints.
rtol- the acceptable relative tolerance in the absolute values from the initial guessatol- the acceptable absolute tolerance in the absolute values from the initial guess
Level: advanced
-seealso: VecTagger, VecTaggerCDFSetMethod()
External Links
- PETSc Manual:
Vec/VecTaggerCDFIterativeSetTolerances
PETSc.LibPETSc.VecTaggerCDFSetBox — Method
VecTaggerCDFSetBox(petsclib::PetscLibType,tagger::VecTagger, box::Vector{VecTaggerBox})Set the cumulative box defining the values to be tagged by the tagger, where cumulative boxes are subsets of [0,1], where 0 indicates the smallest value present in the vector and 1 indicates the largest.
Logically Collective
Input Parameters:
tagger- theVecTaggercontextbox- a blocksize array ofVecTaggerBoxboxes
Level: advanced
-seealso: VecTagger, VecTaggerCDFGetBox(), VecTaggerBox
External Links
- PETSc Manual:
Vec/VecTaggerCDFSetBox
PETSc.LibPETSc.VecTaggerCDFSetMethod — Method
VecTaggerCDFSetMethod(petsclib::PetscLibType,tagger::VecTagger, method::VecTaggerCDFMethod)Set the method used to compute absolute boxes from CDF boxes
Logically Collective
Input Parameters:
tagger- theVecTaggercontextmethod- the method
Level: advanced
-seealso: Vec, VecTagger, VecTaggerCDFMethod
External Links
- PETSc Manual:
Vec/VecTaggerCDFSetMethod
PETSc.LibPETSc.VecTaggerComputeBoxes — Method
numBoxes::PetscInt,listed::PetscBool = VecTaggerComputeBoxes(petsclib::PetscLibType,tagger::VecTagger, vec::PetscVec, boxes::Vector{VecTaggerBox})If the tagged index set can be summarized as a list of boxes of values, returns that list, otherwise returns in listed PETSC_FALSE
Collective
Input Parameters:
tagger- theVecTaggercontextvec- the vec to tag
Output Parameters:
numBoxes- the number of boxes in the tag definitionboxes- a newly allocated list of boxes. This is a flat array of (BlockSize *numBoxes) pairs that the user can free withPetscFree().listed-PETSC_TRUEif a list was created, pass inNULLif not needed
Level: advanced
-seealso: VecTaggerComputeIS(), VecTagger, VecTaggerCreate()
External Links
- PETSc Manual:
Vec/VecTaggerComputeBoxes
PETSc.LibPETSc.VecTaggerComputeIS — Method
listed::PetscBool = VecTaggerComputeIS(petsclib::PetscLibType,tagger::VecTagger, vec::PetscVec, is::Vector{IS})Use a VecTagger context to tag a set of indices based on a vector's values
Collective
Input Parameters:
tagger- theVecTaggercontextvec- the vec to tag
Output Parameters:
is- a list of the indices tagged by the tagger, i.e., if the number of local indices will be n / bs, where n isVecGetLocalSize()and bs isVecTaggerGetBlockSize().listed- routine was able to compute theIS, pass inNULLif not needed
Level: advanced
-seealso: VecTaggerComputeBoxes(), VecTagger, VecTaggerCreate()
External Links
- PETSc Manual:
Vec/VecTaggerComputeIS
PETSc.LibPETSc.VecTaggerCreate — Method
tagger::VecTagger = VecTaggerCreate(petsclib::PetscLibType,comm::MPI_Comm)create a VecTagger context.
Collective
Input Parameter:
comm- communicator on which theVecTaggerwill operate
Output Parameter:
tagger- new Vec tagger context
Level: advanced
-seealso: VecTagger, VecTaggerSetBlockSize(), VecTaggerSetFromOptions(), VecTaggerSetUp(), VecTaggerComputeIS(), VecTaggerComputeBoxes(), VecTaggerDestroy()
External Links
- PETSc Manual:
Vec/VecTaggerCreate
PETSc.LibPETSc.VecTaggerDestroy — Method
VecTaggerDestroy(petsclib::PetscLibType,tagger::VecTagger)destroy a VecTagger context
Collective
Input Parameter:
tagger- address of tagger
Level: advanced
-seealso: VecTaggerCreate(), VecTaggerSetType(), VecTagger
External Links
- PETSc Manual:
Vec/VecTaggerDestroy
PETSc.LibPETSc.VecTaggerFinalizePackage — Method
VecTaggerFinalizePackage(petsclib::PetscLibType)Finalize VecTagger package, it is called from PetscFinalize()
Logically Collective
Level: developer
-seealso: VecTaggerInitializePackage()
External Links
- PETSc Manual:
Vec/VecTaggerFinalizePackage
PETSc.LibPETSc.VecTaggerGetBlockSize — Method
blocksize::PetscInt = VecTaggerGetBlockSize(petsclib::PetscLibType,tagger::VecTagger)get the block size of the indices created by VecTaggerComputeIS().
Logically Collective
Input Parameter:
tagger- vec tagger
Output Parameter:
blocksize- block size of the vectors the tagger operates on
Level: advanced
-seealso: VecTaggerComputeIS(), VecTaggerSetBlockSize(), VecTagger, VecTaggerCreate()
External Links
- PETSc Manual:
Vec/VecTaggerGetBlockSize
PETSc.LibPETSc.VecTaggerGetInvert — Method
invert::PetscBool = VecTaggerGetInvert(petsclib::PetscLibType,tagger::VecTagger)get whether the set of indices returned by VecTaggerComputeIS() are inverted
Logically Collective
Input Parameter:
tagger- vec tagger
Output Parameter:
invert-PETSC_TRUEto invert,PETSC_FALSEto use the indices as is
Level: advanced
-seealso: VecTaggerComputeIS(), VecTaggerSetInvert(), VecTagger, VecTaggerCreate()
External Links
- PETSc Manual:
Vec/VecTaggerGetInvert
PETSc.LibPETSc.VecTaggerGetType — Method
type::VecTaggerType = VecTaggerGetType(petsclib::PetscLibType,tagger::VecTagger)Gets the VecTaggerType name (as a string) from the VecTagger.
Not Collective
Input Parameter:
tagger- TheVecTaggercontext
Output Parameter:
type- TheVecTaggertype name
Level: advanced
-seealso: VecTaggerSetType(), VecTaggerCreate(), VecTaggerSetFromOptions(), VecTagger, VecTaggerType
External Links
- PETSc Manual:
Vec/VecTaggerGetType
PETSc.LibPETSc.VecTaggerInitializePackage — Method
VecTaggerInitializePackage(petsclib::PetscLibType)Initialize VecTagger package
Logically Collective
Level: developer
-seealso: VecTaggerFinalizePackage()
External Links
- PETSc Manual:
Vec/VecTaggerInitializePackage
PETSc.LibPETSc.VecTaggerOrGetSubs — Method
nsubs::PetscInt = VecTaggerOrGetSubs(petsclib::PetscLibType,tagger::VecTagger, subs::Vector{VecTagger})Get the sub VecTaggers whose union defines the outer VecTagger
Not Collective
Input Parameter:
tagger- theVecTaggercontext
Output Parameters:
nsubs- the number of subVecTaggerssubs- the subVecTaggers
Level: advanced
-seealso: VecTaggerOrSetSubs()
External Links
- PETSc Manual:
Vec/VecTaggerOrGetSubs
PETSc.LibPETSc.VecTaggerOrSetSubs — Method
VecTaggerOrSetSubs(petsclib::PetscLibType,tagger::VecTagger, nsubs::PetscInt, subs::Vector{VecTagger}, mode::PetscCopyMode)Set the sub VecTaggers whose union defines the outer VecTagger
Logically Collective
Input Parameters:
tagger- theVecTaggercontextnsubs- the number of subVecTaggerssubs- the subVecTaggersmode- the copy mode to use forsubs
Level: advanced
-seealso: VecTaggetOrGetStubs()
External Links
- PETSc Manual:
Vec/VecTaggerOrSetSubs
PETSc.LibPETSc.VecTaggerRegister — Method
VecTaggerRegister(petsclib::PetscLibType,sname::String, fnc::external)Adds an implementation of the VecTagger communication protocol.
Not Collective, No Fortran Support
Input Parameters:
sname- name of a new user-defined implementationfunction- routine to create method context
Level: advanced
-seealso: VecTaggerType, VecTaggerCreate(), VecTagger, VecTaggerRegisterAll(), VecTaggerRegisterDestroy()
External Links
- PETSc Manual:
Vec/VecTaggerRegister
PETSc.LibPETSc.VecTaggerRegisterAll — Method
VecTaggerRegisterAll(petsclib::PetscLibType)Registers all the VecTagger communication implementations
Not Collective
Level: advanced
-seealso: VecTaggerRegisterDestroy()
External Links
- PETSc Manual:
Vec/VecTaggerRegisterAll
PETSc.LibPETSc.VecTaggerRelativeGetBox — Method
VecTaggerRelativeGetBox(petsclib::PetscLibType,tagger::VecTagger, box::Vector{VecTaggerBox})Get the relative box defining the values to be tagged by the tagger, where relative boxess are subsets of [0,1] (or [0,1]+[0,1]i for complex scalars), where 0 indicates the smallest value present in the vector and 1 indicates the largest.
Logically Collective
Input Parameter:
tagger- the VecTagger context
Output Parameter:
box- a blocksize list of VecTaggerBox boxes
Level: advanced
-seealso: VecTaggerRelativeSetBox()
External Links
- PETSc Manual:
Vec/VecTaggerRelativeGetBox
PETSc.LibPETSc.VecTaggerRelativeSetBox — Method
VecTaggerRelativeSetBox(petsclib::PetscLibType,tagger::VecTagger, box::Vector{VecTaggerBox})Set the relative box defining the values to be tagged by the tagger, where relative boxes are subsets of [0,1] (or [0,1]+[0,1]i for complex scalars), where 0 indicates the smallest value present in the vector and 1 indicates the largest.
Logically Collective
Input Parameters:
tagger- the VecTagger contextbox- a blocksize list of VecTaggerBox boxes
Level: advanced
-seealso: VecTaggerRelativeGetBox()
External Links
- PETSc Manual:
Vec/VecTaggerRelativeSetBox
PETSc.LibPETSc.VecTaggerSetBlockSize — Method
VecTaggerSetBlockSize(petsclib::PetscLibType,tagger::VecTagger, blocksize::PetscInt)set the block size of the set of indices returned by VecTaggerComputeIS().
Logically Collective
Input Parameters:
tagger- vec taggerblocksize- block size of the criteria used to tagger vectors
Level: advanced
-seealso: VecTaggerComputeIS(), VecTaggerGetBlockSize(), VecSetBlockSize(), VecGetBlockSize(), VecTagger, VecTaggerCreate()
External Links
- PETSc Manual:
Vec/VecTaggerSetBlockSize
PETSc.LibPETSc.VecTaggerSetFromOptions — Method
VecTaggerSetFromOptions(petsclib::PetscLibType,tagger::VecTagger)set VecTagger options using the options database
Logically Collective
Input Parameter:
tagger- vec tagger
Options Database Keys:
-vec_tagger_type- implementation type, seeVecTaggerSetType()-vec_tagger_block_size- set the block size, seeVecTaggerSetBlockSize()-vec_tagger_invert- invert the index set returned byVecTaggerComputeIS()
Level: advanced
-seealso: VecTagger, VecTaggerCreate(), VecTaggerSetUp()
External Links
- PETSc Manual:
Vec/VecTaggerSetFromOptions
PETSc.LibPETSc.VecTaggerSetInvert — Method
VecTaggerSetInvert(petsclib::PetscLibType,tagger::VecTagger, invert::PetscBool)If the tagged index sets are based on boxes that can be returned by VecTaggerComputeBoxes(), then this option inverts values used to compute the IS, i.e., from being in the union of the boxes to being in the intersection of their exteriors.
Logically Collective
Input Parameters:
tagger- vec taggerinvert-PETSC_TRUEto invert,PETSC_FALSEto use the indices as is
Level: advanced
-seealso: VecTaggerComputeIS(), VecTaggerGetInvert(), VecTagger, VecTaggerCreate()
External Links
- PETSc Manual:
Vec/VecTaggerSetInvert
PETSc.LibPETSc.VecTaggerSetType — Method
VecTaggerSetType(petsclib::PetscLibType,tagger::VecTagger, type::VecTaggerType)set the Vec tagger implementation
Collective
Input Parameters:
tagger- theVecTaggercontexttype- a known method
Options Database Key:
-vec_tagger_type <type>- Sets the method; use -help for a list
of available methods (for instance, absolute, relative, cdf, or, and)
Level: advanced
-seealso: VecTaggerType, VecTaggerCreate(), VecTagger
External Links
- PETSc Manual:
Vec/VecTaggerSetType
PETSc.LibPETSc.VecTaggerSetUp — Method
VecTaggerSetUp(petsclib::PetscLibType,tagger::VecTagger)set up a VecTagger context
Collective
Input Parameter:
tagger- Vec tagger object
Level: advanced
-seealso: VecTaggerSetFromOptions(), VecTaggerSetType(), VecTagger, VecTaggerCreate()
External Links
- PETSc Manual:
Vec/VecTaggerSetUp
PETSc.LibPETSc.VecTaggerView — Method
VecTaggerView(petsclib::PetscLibType,tagger::VecTagger, viewer::PetscViewer)view a VecTagger context
Collective
Input Parameters:
tagger- vec taggerviewer- viewer to display tagger, for examplePETSC_VIEWER_STDOUT_WORLD
Level: advanced
-seealso: VecTaggerCreate(), VecTagger
External Links
- PETSc Manual:
Vec/VecTaggerView