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::AbstractPetscVec, alpha::PetscScalar, beta::PetscScalar, x::AbstractPetscVec)

Computes y = alpha x + beta y.

Logically Collective

Input Parameters:

  • alpha - first scalar
  • beta - second scalar
  • x - the first scaled vector
  • y - the second scaled vector

Output Parameter:

  • y - output vector

Level: intermediate

See also: Vec, VecAYPX(), VecMAXPY(), VecWAXPY(), VecAXPY(), VecAXPBYPCZ()

External Links

source
PETSc.LibPETSc.VecAXPBYPCZ — Method
VecAXPBYPCZ(petsclib::PetscLibType, z::AbstractPetscVec, alpha::PetscScalar, beta::PetscScalar, gamma::PetscScalar, x::AbstractPetscVec, y::AbstractPetscVec)

Computes z = alpha x + beta y + gamma z

Logically Collective

Input Parameters:

  • alpha - first scalar
  • beta - second scalar
  • gamma - third scalar
  • x - first vector
  • y - second vector
  • z - third vector

Output Parameter:

  • z - output vector

Level: intermediate

See also: Vec, VecAYPX(), VecMAXPY(), VecWAXPY(), VecAXPY(), VecAXPBY()

External Links

source
PETSc.LibPETSc.VecAXPY — Method
VecAXPY(petsclib::PetscLibType, y::AbstractPetscVec, alpha::PetscScalar, x::AbstractPetscVec)

Computes y = alpha x + y.

Logically Collective

Input Parameters:

  • alpha - the scalar
  • x - vector scale by alpha
  • y - vector accumulated into

Output Parameter:

  • y - output vector

Level: intermediate

See also: Vec, VecAYPX(), VecMAXPY(), VecWAXPY(), VecAXPBYPCZ(), VecAXPBY()

External Links

source
PETSc.LibPETSc.VecAYPX — Method
VecAYPX(petsclib::PetscLibType, y::AbstractPetscVec, beta::PetscScalar, x::AbstractPetscVec)

Computes y = x + beta y.

Logically Collective

Input Parameters:

  • beta - the scalar
  • x - the unscaled vector
  • y - the vector to be scaled

Output Parameter:

  • y - output vector

Level: intermediate

See also: Vec, VecMAXPY(), VecWAXPY(), VecAXPY(), VecAXPBYPCZ(), VecAXPBY()

External Links

source
PETSc.LibPETSc.VecAbs — Method
VecAbs(petsclib::PetscLibType, v::AbstractPetscVec)

Replaces every element in a vector with its absolute value.

Logically Collective

Input Parameter:

  • v - the vector

Level: intermediate

See also: Vec, VecExp(), VecSqrtAbs(), VecReciprocal(), VecLog(), VecPointwiseSign()

External Links

source
PETSc.LibPETSc.VecAppendOptionsPrefix — Method
VecAppendOptionsPrefix(petsclib::PetscLibType, v::AbstractPetscVec, prefix::String)

Appends to the prefix used for searching for all Vec options in the database.

Logically Collective

Input Parameters:

  • v - the Vec context
  • prefix - the prefix to prepend to all option names

Level: advanced

See also: Vec, VecGetOptionsPrefix()

External Links

source
PETSc.LibPETSc.VecAssemblyBegin — Method
VecAssemblyBegin(petsclib::PetscLibType, vec::AbstractPetscVec)

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

See also: Vec, VecAssemblyEnd(), VecSetValues()

External Links

source
PETSc.LibPETSc.VecAssemblyEnd — Method
VecAssemblyEnd(petsclib::PetscLibType, vec::AbstractPetscVec)

Completes assembling the vector. This routine should be called after VecAssemblyBegin().

Collective

Input Parameter:

  • vec - the vector

Options Database Keys:

  • -vec_view [viewertype][:...] - Display the vector. See VecViewFromOptions()/PetscObjectViewFromOptions() for the possible arguments
  • -vecstash_view [viewertype][:...] - Display the vector stash. See VecStashViewFromOptions()/PetscObjectViewFromOptions() for the possible arguments

Level: beginner

See also: Vec, VecAssemblyBegin(), VecSetValues(), VecViewFromOptions(), VecStashViewFromOptions(), PetscObjectViewFromOptions()

External Links

source
PETSc.LibPETSc.VecBindToCPU — Method
VecBindToCPU(petsclib::PetscLibType, v::AbstractPetscVec, flg::PetscBool)

marks a vector to temporarily stay on the CPU and perform computations on the CPU

Logically collective

Input Parameters:

  • v - the vector
  • flg - bind to the CPU if value of PETSC_TRUE

Level: intermediate

See also: Vec, VecBoundToCPU()

External Links

source
PETSc.LibPETSc.VecBoundGradientProjection — Method
VecBoundGradientProjection(petsclib::PetscLibType, G::AbstractPetscVec, X::AbstractPetscVec, XL::AbstractPetscVec, XU::AbstractPetscVec, GP::AbstractPetscVec)

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 vector
  • X - current solution vector with XL[i] <= X[i] <= XU[i]
  • XL - lower bounds
  • XU - upper bounds

Output Parameter:

  • GP - gradient projection vector

Level: advanced

See also: Vec

External Links

source
PETSc.LibPETSc.VecBoundToCPU — Method
flg::PetscBool = VecBoundToCPU(petsclib::PetscLibType, v::AbstractPetscVec)

query if a vector is bound to the CPU

Not collective

Input Parameter:

  • v - the vector

Output Parameter:

  • flg - the logical flag

Level: intermediate

See also: Vec, VecBindToCPU()

External Links

source
PETSc.LibPETSc.VecConcatenate — Method
Y::PetscVec,x_is::Vector{IS} = VecConcatenate(petsclib::PetscLibType, nx::PetscInt, X::Vector{<:AbstractPetscVec})

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 concatenated
  • X - array containing the vectors to be concatenated in the order of concatenation

Output Parameters:

  • Y - concatenated vector
  • x_is - array of index sets corresponding to the concatenated components of Y (pass NULL if not needed)

Level: advanced

See also: Vec, VECNEST, VECSCATTER, VecScatterCreate()

External Links

source
PETSc.LibPETSc.VecConjugate — Method
VecConjugate(petsclib::PetscLibType, x::AbstractPetscVec)

Conjugates a vector. That is, replace every entry in a vector with its complex conjugate

Logically Collective

Input Parameter:

  • x - the vector

Level: intermediate

See also: Vec, VecSet()

External Links

source
PETSc.LibPETSc.VecCopy — Method
VecCopy(petsclib::PetscLibType, x::AbstractPetscVec, y::AbstractPetscVec)

Copies a vector y = x

Logically Collective

Input Parameter:

  • x - the vector

Output Parameter:

  • y - the copy

Level: beginner

See also: Vec, VecDuplicate()

External Links

source
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

See also: Vec, VecSetType(), VecSetSizes(), VecCreateMPIWithArray(), VecCreateMPI(), VecDuplicate(), VecDuplicateVecs(), VecCreateGhost(), VecCreateSeq(), VecPlaceArray()

External Links

source
PETSc.LibPETSc.VecCreateFromOptions — Method
vec::PetscVec = VecCreateFromOptions(petsclib::PetscLibType, comm::MPI_Comm, prefix::String, 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 object
  • prefix - [optional] prefix for the options database
  • bs - the block size (commonly 1)
  • m - the local size (or PETSC_DECIDE)
  • n - the global size (or PETSC_DETERMINE)

Output Parameter:

  • vec - The vector object

Options Database Keys:

  • -vec_type - see VecType, for example seq, mpi, cuda, defaults to mpi

Level: beginner

See also: Vec, VecSetType(), VecSetSizes(), VecCreateMPIWithArray(), VecCreateMPI(), VecDuplicate(), VecDuplicateVecs(), VecCreateGhost(), VecCreateSeq(), VecPlaceArray(), VecCreate(), VecType

External Links

source
PETSc.LibPETSc.VecCreateGhost — Method
vv::PetscVec = VecCreateGhost(petsclib::PetscLibType, comm::MPI_Comm, n::PetscInt, M_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 use
  • n - local vector length
  • N - global vector length (or PETSC_DETERMINE to have calculated if n is given)
  • nghost - number of local ghost points
  • ghosts - 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

See also: Vec, VecType, VecCreateSeq(), VecCreate(), VecDuplicate(), VecDuplicateVecs(), VecCreateMPI(), VecGhostGetLocalForm(), VecGhostRestoreLocalForm(), VecGhostUpdateBegin(), VecCreateGhostWithArray(), VecCreateMPIWithArray(), VecGhostUpdateEnd(), VecCreateGhostBlock(), VecCreateGhostBlockWithArray(), VecMPISetGhost()

External Links

source
PETSc.LibPETSc.VecCreateGhostBlock — Method
vv::PetscVec = VecCreateGhostBlock(petsclib::PetscLibType, comm::MPI_Comm, bs::PetscInt, n::PetscInt, M_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 use
  • bs - the block size
  • n - local vector length
  • N - global vector length (or PETSC_DETERMINE to have calculated if n is given)
  • nghost - number of local ghost blocks
  • ghosts - 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

See also: Vec, VecType, VecCreateSeq(), VecCreate(), VecDuplicate(), VecDuplicateVecs(), VecCreateMPI(), VecGhostGetLocalForm(), VecGhostRestoreLocalForm(), VecGhostUpdateBegin(), VecGhostUpdateEnd(), VecCreateGhostWithArray(), VecCreateMPIWithArray(), VecCreateGhostBlockWithArray()

External Links

source
PETSc.LibPETSc.VecCreateGhostBlockWithArray — Method
vv::PetscVec = VecCreateGhostBlockWithArray(petsclib::PetscLibType, comm::MPI_Comm, bs::PetscInt, n::PetscInt, M_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 use
  • bs - block size
  • n - local vector length
  • N - global vector length (or PETSC_DETERMINE to have calculated if n is given)
  • nghost - number of local ghost blocks
  • ghosts - global indices of ghost blocks (or NULL if 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

See also: Vec, VecType, VecCreate(), VecGhostGetLocalForm(), VecGhostRestoreLocalForm(), VecCreateGhost(), VecCreateSeqWithArray(), VecCreateMPIWithArray(), VecCreateGhostWithArray(), VecCreateGhostBlock(), VecGhostUpdateBegin(), VecGhostUpdateEnd()

External Links

source
PETSc.LibPETSc.VecCreateGhostWithArray — Method
vv::PetscVec = VecCreateGhostWithArray(petsclib::PetscLibType, comm::MPI_Comm, n::PetscInt, M_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 use
  • n - local vector length
  • N - global vector length (or PETSC_DETERMINE to have calculated if n is given)
  • nghost - number of local ghost points
  • ghosts - global indices of ghost points (or NULL if 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

See also: Vec, VecType, VecCreate(), VecGhostGetLocalForm(), VecGhostRestoreLocalForm(), VecCreateGhost(), VecCreateSeqWithArray(), VecCreateMPIWithArray(), VecCreateGhostBlock(), VecCreateGhostBlockWithArray(), VecMPISetGhost(), VecGhostUpdateBegin(), VecGhostUpdateEnd()

External Links

source
PETSc.LibPETSc.VecCreateLocalVector — Method
w::PetscVec = VecCreateLocalVector(petsclib::PetscLibType, v::AbstractPetscVec)

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

See also: Vec, VecGetLocalVectorRead(), VecRestoreLocalVectorRead(), VecGetLocalVector(), VecRestoreLocalVector()

External Links

source
PETSc.LibPETSc.VecCreateMPI — Method
v::PetscVec = VecCreateMPI(petsclib::PetscLibType, comm::MPI_Comm, n::PetscInt, M_N::PetscInt)

Creates a parallel vector.

Collective

Input Parameters:

  • comm - the MPI communicator to use
  • n - local vector length (or PETSC_DECIDE to have calculated if N is given)
  • N - global vector length (or PETSC_DETERMINE to have calculated if n is given)

Output Parameter:

  • v - the vector

Level: intermediate

See also: Vec, VecType, VecCreateSeq(), VecCreate(), VecDuplicate(), VecDuplicateVecs(), VecCreateGhost(), VecCreateMPIWithArray(), VecCreateGhostWithArray(), VecMPISetGhost(), PetscLayout, VecGetOwnershipRange(), VecGetOwnershipRanges()

External Links

source
PETSc.LibPETSc.VecCreateMPIWithArray — Method
vv::PetscVec = VecCreateMPIWithArray(petsclib::PetscLibType, comm::MPI_Comm, bs::PetscInt, n::PetscInt, M_N::PetscInt, array::Vector{PetscScalar})

Creates a parallel, array-style vector, where the user provides the array space to store the vector values.

Collective

Input Parameters:

  • comm - the MPI communicator to use
  • bs - block size, same meaning as VecSetBlockSize()
  • n - local vector length, cannot be PETSC_DECIDE
  • N - global vector length (or PETSC_DETERMINE to have calculated)
  • array - the user provided array to store the vector values

Output Parameter:

  • vv - the vector

Level: intermediate

See also: Vec, VecType, VecCreateSeqWithArray(), VecCreate(), VecDuplicate(), VecDuplicateVecs(), VecCreateGhost(), VecCreateMPI(), VecCreateGhostWithArray(), VecPlaceArray()

External Links

source
PETSc.LibPETSc.VecCreateNest — Method
Y::PetscVec = VecCreateNest(petsclib::PetscLibType, comm::MPI_Comm, nb::PetscInt, is::Vector{<:AbstractIS}, x::Vector{<:AbstractPetscVec})

Creates a new vector containing several nested subvectors, each stored separately

Collective

Input Parameters:

  • comm - Communicator for the new Vec
  • nb - number of nested blocks
  • is - array of nb index sets describing each nested block, or NULL to pack subvectors contiguously
  • x - array of nb sub-vectors

Output Parameter:

  • Y - new vector

Level: advanced

See also: VECNEST, Vec, VecType, VecCreate(), MatCreateNest(), DMSetVecType()

External Links

source
PETSc.LibPETSc.VecCreateSeq — Method
v::PetscVec = VecCreateSeq(petsclib::PetscLibType, comm::MPI_Comm, n::PetscInt)

Creates a standard, sequential array-style vector.

Collective

Input Parameters:

  • comm - the communicator, should be PETSC_COMM_SELF
  • n - the vector length

Output Parameter:

  • v - the vector

Level: intermediate

See also: Vec, VecType, VecCreateMPI(), VecCreate(), VecDuplicate(), VecDuplicateVecs(), VecCreateGhost()

External Links

source
PETSc.LibPETSc.VecCreateSeqWithArray — Method
V::PetscVec = VecCreateSeqWithArray(petsclib::PetscLibType, comm::MPI_Comm, bs::PetscInt, n::PetscInt, array::Vector{PetscScalar})

Creates a standard,sequential array-style vector, where the user provides the array space to store the vector values.

Collective

Input Parameters:

  • comm - the communicator, should be PETSC_COMM_SELF
  • bs - the block size
  • n - the vector length
  • array - memory where the vector elements are to be stored.

Output Parameter:

  • V - the vector

Level: intermediate

See also: VecCreateMPIWithArray(), VecCreate(), VecDuplicate(), VecDuplicateVecs(), VecCreateGhost(), VecCreateSeq(), VecPlaceArray()

External Links

source
PETSc.LibPETSc.VecCreateShared — Method
v::PetscVec = VecCreateShared(petsclib::PetscLibType, comm::MPI_Comm, n::PetscInt, M_N::PetscInt)

Creates a parallel vector that uses shared memory.

Collective

Input Parameters:

  • comm - the MPI communicator to use
  • n - local vector length (or PETSC_DECIDE to have calculated if N is given)
  • N - global vector length (or PETSC_DECIDE to have calculated if n is given)

Output Parameter:

  • v - the vector

Level: advanced

See also: Vec, VecType, VecCreateSeq(), VecCreate(), VecCreateMPI(), VecDuplicate(), VecDuplicateVecs(), VecCreateGhost(), VecCreateMPIWithArray(), VecCreateGhostWithArray()

External Links

source
PETSc.LibPETSc.VecDestroy — Method
VecDestroy(petsclib::PetscLibType, v::AbstractPetscVec)

Destroys a vector.

Collective

Input Parameter:

  • v - the vector

Level: beginner

See also: Vec, VecCreate(), VecDuplicate(), VecDestroyVecs()

External Links

source
PETSc.LibPETSc.VecDestroyVecs — Method
VecDestroyVecs(petsclib::PetscLibType, m::PetscInt, vv::Ptr)

Frees a block of vectors obtained with VecDuplicateVecs().

Collective

Input Parameters:

  • m - the number of vectors previously obtained, if zero no vectors are destroyed
  • vv - pointer to pointer to array of vector pointers, if NULL no vectors are destroyed

Level: intermediate

See also: Vec, VecDuplicateVecs(), VecDestroyVecsf90()

External Links

source
PETSc.LibPETSc.VecDot — Method
val::PetscScalar = VecDot(petsclib::PetscLibType, x::AbstractPetscVec, y::AbstractPetscVec)

Computes the vector dot product.

Collective

Input Parameters:

  • x - first vector
  • y - second vector

Output Parameter:

  • val - the dot product

Level: intermediate

See also: Vec, VecMDot(), VecTDot(), VecNorm(), VecDotBegin(), VecDotEnd(), VecDotRealPart()

External Links

source
PETSc.LibPETSc.VecDotBegin — Method
result::PetscScalar = VecDotBegin(petsclib::PetscLibType, x::AbstractPetscVec, y::AbstractPetscVec)

Starts a split phase dot product computation.

Input Parameters:

  • x - the first vector
  • y - the second vector
  • result - where the result will go (can be NULL)

Level: advanced

See also: VecDotEnd(), VecNormBegin(), VecNormEnd(), VecNorm(), VecDot(), VecMDot(), VecTDotBegin(), VecTDotEnd(), PetscCommSplitReductionBegin()

External Links

source
PETSc.LibPETSc.VecDotEnd — Method
result::PetscScalar = VecDotEnd(petsclib::PetscLibType, x::AbstractPetscVec, y::AbstractPetscVec)

Ends a split phase dot product computation.

Input Parameters:

  • x - the first vector (can be NULL)
  • y - the second vector (can be NULL)
  • result - where the result will go

Level: advanced

See also: VecDotBegin(), VecNormBegin(), VecNormEnd(), VecNorm(), VecDot(), VecMDot(), VecTDotBegin(), VecTDotEnd(), PetscCommSplitReductionBegin()

External Links

source
PETSc.LibPETSc.VecDotNorm2 — Method
dp::PetscScalar,nm::PetscReal = VecDotNorm2(petsclib::PetscLibType, s::AbstractPetscVec, t::AbstractPetscVec)

computes the inner product of two vectors and the 2-norm squared of the second vector

Collective

Input Parameters:

  • s - first vector
  • t - second vector

Output Parameters:

  • dp - s'conj(t)
  • nm - t'conj(t)

Level: advanced

See also: Vec, VecDot(), VecNorm(), VecDotBegin(), VecNormBegin(), VecDotEnd(), VecNormEnd()

External Links

source
PETSc.LibPETSc.VecDotRealPart — Method
val::PetscReal = VecDotRealPart(petsclib::PetscLibType, x::AbstractPetscVec, y::AbstractPetscVec)

Computes the real part of the vector dot product.

Collective

Input Parameters:

  • x - first vector
  • y - 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)

See also: Vec, VecMDot(), VecTDot(), VecNorm(), VecDotBegin(), VecDotEnd(), VecDot(), VecDotNorm2()

External Links

source
PETSc.LibPETSc.VecDuplicate — Method
newv::PetscVec = VecDuplicate(petsclib::PetscLibType, v::AbstractPetscVec)

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

See also: Vec, VecDestroy(), VecDuplicateVecs(), VecCreate(), VecCopy()

External Links

source
PETSc.LibPETSc.VecDuplicateVecs — Method
M_V::Ptr{CVec} = VecDuplicateVecs(petsclib::PetscLibType, v::AbstractPetscVec, m::PetscInt)

Creates several vectors of the same type as an existing vector.

Collective

Input Parameters:

  • m - the number of vectors to obtain
  • v - a vector to mimic

Output Parameter:

  • V - location to put pointer to array of vectors

Level: intermediate

See also: Vec, VecDestroyVecs(), VecDuplicate(), VecCreate(), VecMDot(), VecMAXPY(), KSPGMRES, KSPGMRESSetPreAllocateVectors()

External Links

source
PETSc.LibPETSc.VecEqual — Method
flg::PetscBool = VecEqual(petsclib::PetscLibType, vec1::AbstractPetscVec, vec2::AbstractPetscVec)

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 vector
  • vec2 - the second vector

Output Parameter:

  • flg - PETSC_TRUE if the vectors are equal; PETSC_FALSE otherwise.

Level: intermediate

See also: Vec

External Links

source
PETSc.LibPETSc.VecErrorWeightedNorms — Method
norm::PetscReal,norm_loc::PetscInt,norma::PetscReal,norma_loc::PetscInt,normr::PetscReal,normr_loc::PetscInt = VecErrorWeightedNorms(petsclib::PetscLibType, U::AbstractPetscVec, Y::AbstractPetscVec, E::AbstractPetscVec, wnormtype::NormType, atol::PetscReal, vatol::AbstractPetscVec, rtol::PetscReal, vrtol::AbstractPetscVec, ignore_max::PetscReal)

compute a weighted norm of the difference between two vectors

Collective

Input Parameters:

  • U - first vector to be compared
  • Y - second vector to be compared
  • E - optional third vector representing the error (if not provided, the error is ||U-Y||)
  • wnormtype - norm type
  • atol - scalar for absolute tolerance
  • vatol - vector representing per-entry absolute tolerances (can be NULL)
  • rtol - scalar for relative tolerance
  • vrtol - vector representing per-entry relative tolerances (can be NULL)
  • ignore_max - ignore values smaller than this value in absolute terms.

Output Parameters:

  • norm - weighted norm
  • norm_loc - number of vector locations used for the weighted norm
  • norma - weighted norm based on the absolute tolerance
  • norma_loc - number of vector locations used for the absolute weighted norm
  • normr - weighted norm based on the relative tolerance
  • normr_loc - number of vector locations used for the relative weighted norm

Level: developer

See also: Vec, NormType, TSErrorWeightedNorm(), TSErrorWeightedENorm()

External Links

source
PETSc.LibPETSc.VecExp — Method
VecExp(petsclib::PetscLibType, v::AbstractPetscVec)

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

See also: Vec, VecLog(), VecAbs(), VecSqrtAbs(), VecReciprocal()

External Links

source
PETSc.LibPETSc.VecFilter — Method
VecFilter(petsclib::PetscLibType, v::AbstractPetscVec, 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 vector
  • tol - The zero tolerance

Output Parameter:

  • v - The filtered vector

Level: intermediate

See also: VecCreate(), VecSet(), MatFilter()

External Links

source
PETSc.LibPETSc.VecFischer — Method
VecFischer(petsclib::PetscLibType, X::AbstractPetscVec, F::AbstractPetscVec, L::AbstractPetscVec, U::AbstractPetscVec, FB::AbstractPetscVec)

Evaluates the Fischer-Burmeister function for complementarity problems.

Logically Collective

Input Parameters:

  • X - current point
  • F - function evaluated at x
  • L - lower bounds
  • U - upper bounds

Output Parameter:

  • FB - The Fischer-Burmeister function vector

Level: developer

See also: Vec, VecSFischer(), MatDFischer(), MatDSFischer()

External Links

source
PETSc.LibPETSc.VecFlag — Method
VecFlag(petsclib::PetscLibType, xin::AbstractPetscVec, 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 be NULL but only if on all processes
  • flg - indicates if this processes portion of the vector should be set to infinity

Level: developer

See also: Vec, PetscLayout, VecGetLayout(), VecGetSize(), VecGetOwnershipRange(), VecGetOwnershipRanges()

External Links

source
PETSc.LibPETSc.VecGetArray — Method
a::Vector{PetscScalar} = VecGetArray(petsclib::PetscLibType, x::AbstractPetscVec)

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

See also: Vec, VecRestoreArray(), VecGetArrayRead(), VecGetArrays(), VecPlaceArray(), VecGetArray2d(), VecGetArrayPair(), VecRestoreArrayPair(), VecGetArrayWrite(), VecRestoreArrayWrite(), VecGetArrayAndMemType()

External Links

source
PETSc.LibPETSc.VecGetArray1d — Method
a::PetscArray = VecGetArray1d(petsclib::PetscLibType, x::AbstractPetscVec, 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 vector
  • m - first dimension of two dimensional array
  • mstart - first index you will use in first coordinate direction (often 0)

Output Parameter:

  • a - location to put pointer to the array

Level: developer

See also: Vec, VecGetArray(), VecRestoreArray(), VecGetArrays(), VecPlaceArray(), VecRestoreArray2d(), DMDAVecGetArray(), DMDAVecRestoreArray(), VecGetArray3d(), VecRestoreArray3d(), VecGetArray2d(), VecRestoreArray1d(), VecGetArray4d(), VecRestoreArray4d()

External Links

source
PETSc.LibPETSc.VecGetArray1dWrite — Method
a::PetscArray = VecGetArray1dWrite(petsclib::PetscLibType, x::AbstractPetscVec, 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 vector
  • m - first dimension of two dimensional array
  • mstart - first index you will use in first coordinate direction (often 0)

Output Parameter:

  • a - location to put pointer to the array

Level: developer

See also: Vec, VecGetArray(), VecRestoreArray(), VecGetArrays(), VecPlaceArray(), VecRestoreArray2d(), DMDAVecGetArray(), DMDAVecRestoreArray(), VecGetArray3d(), VecRestoreArray3d(), VecGetArray2d(), VecRestoreArray1d(), VecGetArray4d(), VecRestoreArray4d()

External Links

source
PETSc.LibPETSc.VecGetArray2d — Method
a::Vector{PetscScalar} = VecGetArray2d(petsclib::PetscLibType, x::AbstractPetscVec, 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 vector
  • m - first dimension of two dimensional array
  • n - second dimension of two dimensional array
  • mstart - 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

See also: Vec, VecGetArray(), VecRestoreArray(), VecGetArrays(), VecPlaceArray(), VecRestoreArray2d(), DMDAVecGetArray(), DMDAVecRestoreArray(), VecGetArray3d(), VecRestoreArray3d(), VecGetArray1d(), VecRestoreArray1d(), VecGetArray4d(), VecRestoreArray4d()

External Links

source
PETSc.LibPETSc.VecGetArray2dRead — Method
a::Vector{PetscScalar} = VecGetArray2dRead(petsclib::PetscLibType, x::AbstractPetscVec, 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 vector
  • m - first dimension of two dimensional array
  • n - second dimension of two dimensional array
  • mstart - 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

See also: Vec, VecGetArray(), VecRestoreArray(), VecGetArrays(), VecPlaceArray(), VecRestoreArray2d(), DMDAVecGetArray(), DMDAVecRestoreArray(), VecGetArray3d(), VecRestoreArray3d(), VecGetArray1d(), VecRestoreArray1d(), VecGetArray4d(), VecRestoreArray4d()

External Links

source
PETSc.LibPETSc.VecGetArray2dWrite — Method
a::Vector{PetscScalar} = VecGetArray2dWrite(petsclib::PetscLibType, x::AbstractPetscVec, 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 vector
  • m - first dimension of two dimensional array
  • n - second dimension of two dimensional array
  • mstart - 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

See also: Vec, VecGetArray(), VecRestoreArray(), VecGetArrays(), VecPlaceArray(), VecRestoreArray2d(), DMDAVecGetArray(), DMDAVecRestoreArray(), VecGetArray3d(), VecRestoreArray3d(), VecGetArray1d(), VecRestoreArray1d(), VecGetArray4d(), VecRestoreArray4d()

External Links

source
PETSc.LibPETSc.VecGetArray3d — Method
a::PetscArray = VecGetArray3d(petsclib::PetscLibType, x::AbstractPetscVec, 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 vector
  • m - first dimension of three dimensional array
  • n - second dimension of three dimensional array
  • p - third dimension of three dimensional array
  • mstart - 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

See also: Vec, VecGetArray(), VecRestoreArray(), VecGetArrays(), VecPlaceArray(), VecRestoreArray2d(), DMDAVecGetarray(), DMDAVecRestoreArray(), VecRestoreArray3d(), VecGetArray1d(), VecRestoreArray1d(), VecGetArray4d(), VecRestoreArray4d()

External Links

source
PETSc.LibPETSc.VecGetArray3dRead — Method
a::PetscArray = VecGetArray3dRead(petsclib::PetscLibType, x::AbstractPetscVec, 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 vector
  • m - first dimension of three dimensional array
  • n - second dimension of three dimensional array
  • p - third dimension of three dimensional array
  • mstart - 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

See also: Vec, VecGetArray(), VecRestoreArray(), VecGetArrays(), VecPlaceArray(), VecRestoreArray2d(), DMDAVecGetarray(), DMDAVecRestoreArray(), VecGetArray3d(), VecRestoreArray3d(), VecGetArray1d(), VecRestoreArray1d(), VecGetArray4d(), VecRestoreArray4d()

External Links

source
PETSc.LibPETSc.VecGetArray3dWrite — Method
a::PetscArray = VecGetArray3dWrite(petsclib::PetscLibType, x::AbstractPetscVec, 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 vector
  • m - first dimension of three dimensional array
  • n - second dimension of three dimensional array
  • p - third dimension of three dimensional array
  • mstart - 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

See also: Vec, VecGetArray(), VecRestoreArray(), VecGetArrays(), VecPlaceArray(), VecRestoreArray2d(), DMDAVecGetarray(), DMDAVecRestoreArray(), VecGetArray3d(), VecRestoreArray3d(), VecGetArray1d(), VecRestoreArray1d(), VecGetArray4d(), VecRestoreArray4d()

External Links

source
PETSc.LibPETSc.VecGetArray4d — Method
a::PetscArray = VecGetArray4d(petsclib::PetscLibType, x::AbstractPetscVec, 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 vector
  • m - first dimension of four dimensional array
  • n - second dimension of four dimensional array
  • p - third dimension of four dimensional array
  • q - fourth dimension of four dimensional array
  • mstart - 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

See also: Vec, VecGetArray(), VecRestoreArray(), VecGetArrays(), VecPlaceArray(), VecRestoreArray2d(), DMDAVecGetarray(), DMDAVecRestoreArray(), VecGetArray3d(), VecRestoreArray3d(), VecGetArray1d(), VecRestoreArray1d(), VecRestoreArray4d()

External Links

source
PETSc.LibPETSc.VecGetArray4dRead — Method
a::PetscArray = VecGetArray4dRead(petsclib::PetscLibType, x::AbstractPetscVec, 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 vector
  • m - first dimension of four dimensional array
  • n - second dimension of four dimensional array
  • p - third dimension of four dimensional array
  • q - fourth dimension of four dimensional array
  • mstart - 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

See also: Vec, VecGetArray(), VecRestoreArray(), VecGetArrays(), VecPlaceArray(), VecRestoreArray2d(), DMDAVecGetarray(), DMDAVecRestoreArray(), VecGetArray3d(), VecRestoreArray3d(), VecGetArray1d(), VecRestoreArray1d(), VecGetArray4d(), VecRestoreArray4d()

External Links

source
PETSc.LibPETSc.VecGetArray4dWrite — Method
a::PetscArray = VecGetArray4dWrite(petsclib::PetscLibType, x::AbstractPetscVec, 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 vector
  • m - first dimension of four dimensional array
  • n - second dimension of four dimensional array
  • p - third dimension of four dimensional array
  • q - fourth dimension of four dimensional array
  • mstart - 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

See also: Vec, VecGetArray(), VecRestoreArray(), VecGetArrays(), VecPlaceArray(), VecRestoreArray2d(), DMDAVecGetarray(), DMDAVecRestoreArray(), VecGetArray3d(), VecRestoreArray3d(), VecGetArray1d(), VecRestoreArray1d(), VecGetArray4d(), VecRestoreArray4d()

External Links

source
PETSc.LibPETSc.VecGetArrayAndMemType — Method
a::Vector{PetscScalar},mtype::PetscMemType = VecGetArrayAndMemType(petsclib::PetscLibType, x::AbstractPetscVec)

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 array
  • mtype - memory type of the array

Level: beginner

See also: Vec, VecRestoreArrayAndMemType(), VecGetArrayReadAndMemType(), VecGetArrayWriteAndMemType(), VecRestoreArray(), VecGetArrayRead(), VecGetArrays(), VecPlaceArray(), VecGetArray2d(), VecGetArrayPair(), VecRestoreArrayPair(), VecGetArrayWrite(), VecRestoreArrayWrite()

External Links

source
PETSc.LibPETSc.VecGetArrayRead — Method
a::Vector{PetscScalar} = VecGetArrayRead(petsclib::PetscLibType, x::AbstractPetscVec)

Get read-only pointer to contiguous array containing this processor's portion of the vector data.

Not Collective

Input Parameter:

  • x - the vector

Output Parameter:

  • a - the array

Level: beginner

See also: Vec, VecGetArray(), VecRestoreArray(), VecGetArrayPair(), VecRestoreArrayPair(), VecGetArrayAndMemType()

External Links

source
PETSc.LibPETSc.VecGetArrayReadAndMemType — Method
a::Vector{PetscScalar},mtype::PetscMemType = VecGetArrayReadAndMemType(petsclib::PetscLibType, x::AbstractPetscVec)

Like VecGetArrayRead(), but if the input vector is a device vector, it will return a read-only device pointer. 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 array
  • mtype - memory type of the array

Level: beginner

See also: Vec, VecRestoreArrayReadAndMemType(), VecGetArrayAndMemType(), VecGetArrayWriteAndMemType(), VecGetArray(), VecRestoreArray(), VecGetArrayPair(), VecRestoreArrayPair()

External Links

source
PETSc.LibPETSc.VecGetArrayWrite — Method
a::Vector{PetscScalar} = VecGetArrayWrite(petsclib::PetscLibType, x::AbstractPetscVec)

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

See also: Vec, VecRestoreArray(), VecGetArrayRead(), VecGetArrays(), VecPlaceArray(), VecGetArray2d(), VecGetArrayPair(), VecRestoreArrayPair(), VecGetArray(), VecRestoreArrayWrite(), VecGetArrayAndMemType()

External Links

source
PETSc.LibPETSc.VecGetArrayWriteAndMemType — Method
a::Vector{PetscScalar},mtype::PetscMemType = VecGetArrayWriteAndMemType(petsclib::PetscLibType, x::AbstractPetscVec)

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 array
  • mtype - memory type of the array

Level: beginner

See also: Vec, VecRestoreArrayWriteAndMemType(), VecGetArrayReadAndMemType(), VecGetArrayAndMemType(), VecGetArray(), VecRestoreArray(), VecGetArrayPair(), VecRestoreArrayPair()

External Links

source
PETSc.LibPETSc.VecGetArrays — Method
a::Vector{Ptr{PetscScalar}} = VecGetArrays(petsclib::PetscLibType, x::Vector{<:AbstractPetscVec}, 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 vectors
  • n - the number of vectors

Output Parameter:

  • a - location to put pointer to the array

Level: intermediate

See also: Vec, VecGetArray(), VecRestoreArrays()

External Links

source
PETSc.LibPETSc.VecGetBindingPropagates — Method
flg::PetscBool = VecGetBindingPropagates(petsclib::PetscLibType, v::AbstractPetscVec)

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

See also: Vec, VecSetBindingPropagates()

External Links

source
PETSc.LibPETSc.VecGetBlockSize — Method
bs::PetscInt = VecGetBlockSize(petsclib::PetscLibType, v::AbstractPetscVec)

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

See also: Vec, VecSetValuesBlocked(), VecSetLocalToGlobalMapping(), VecSetBlockSize()

External Links

source
PETSc.LibPETSc.VecGetDM — Method
dm::PetscDM = VecGetDM(petsclib::PetscLibType, v::AbstractPetscVec)

Gets the DM defining the data layout of the vector

Not Collective

Input Parameter:

  • v - The Vec

Output Parameter:

  • dm - The DM

Level: intermediate

See also: DM, VecSetDM(), DMGetLocalVector(), DMGetGlobalVector(), DMSetVecType()

External Links

source
PETSc.LibPETSc.VecGetLayout — Method
map::PetscLayout = VecGetLayout(petsclib::PetscLibType, x::AbstractPetscVec)

get PetscLayout describing a vector layout

Not Collective

Input Parameter:

  • x - the vector

Output Parameter:

  • map - the layout

Level: developer

See also: PetscLayout, Vec, VecGetSize(), VecGetOwnershipRange(), VecGetOwnershipRanges()

External Links

source
PETSc.LibPETSc.VecGetLocalSize — Method
size::PetscInt = VecGetLocalSize(petsclib::PetscLibType, x::AbstractPetscVec)

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

See also: Vec, VecGetSize()

External Links

source
PETSc.LibPETSc.VecGetLocalToGlobalMapping — Method
mapping::ISLocalToGlobalMapping = VecGetLocalToGlobalMapping(petsclib::PetscLibType, X::AbstractPetscVec)

Gets the local-to-global numbering set by VecSetLocalToGlobalMapping()

Not Collective

Input Parameter:

  • X - the vector

Output Parameter:

  • mapping - the mapping

Level: advanced

See also: Vec, VecSetValuesLocal(), VecSetLocalToGlobalMapping()

External Links

source
PETSc.LibPETSc.VecGetLocalVector — Method
VecGetLocalVector(petsclib::PetscLibType, v::AbstractPetscVec, w::AbstractPetscVec)

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

See also: Vec, VecCreateLocalVector(), VecRestoreLocalVector(), VecGetLocalVectorRead(), VecGetArrayRead(), VecGetArray()

External Links

source
PETSc.LibPETSc.VecGetLocalVectorRead — Method
VecGetLocalVectorRead(petsclib::PetscLibType, v::AbstractPetscVec, w::AbstractPetscVec)

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

See also: Vec, VecCreateLocalVector(), VecRestoreLocalVectorRead(), VecGetLocalVector(), VecGetArrayRead(), VecGetArray()

External Links

source
PETSc.LibPETSc.VecGetOffloadMask — Method
mask::PetscOffloadMask = VecGetOffloadMask(petsclib::PetscLibType, v::AbstractPetscVec)

Get the offload mask of a Vec

Not Collective

Input Parameter:

  • v - the vector

Output Parameter:

  • mask - corresponding PetscOffloadMask enum value.

Level: intermediate

See also: Vec, VecCreateSeqCUDA(), VecCreateSeqViennaCL(), VecGetArray(), VecGetType()

External Links

source
PETSc.LibPETSc.VecGetOptionsPrefix — Method
prefix::String = VecGetOptionsPrefix(petsclib::PetscLibType, v::AbstractPetscVec)

Sets the prefix used for searching for all Vec options in the database.

Not Collective

Input Parameter:

  • v - the Vec context

Output Parameter:

  • prefix - pointer to the prefix string used

Level: advanced

See also: Vec, VecAppendOptionsPrefix()

External Links

source
PETSc.LibPETSc.VecGetOwnershipRange — Method
low::PetscInt,high::PetscInt = VecGetOwnershipRange(petsclib::PetscLibType, x::AbstractPetscVec)

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 in NULL if not interested
  • high - one more than the last local element, pass in NULL if not interested

Level: beginner

See also: Vec, MatGetOwnershipRange(), MatGetOwnershipRanges(), VecGetOwnershipRanges(), PetscSplitOwnership(), VecSetSizes(), VecCreateMPI(), PetscLayout, DMDAGetGhostCorners(), DM

External Links

source
PETSc.LibPETSc.VecGetOwnershipRanges — Method
ranges::Vector{PetscInt} = VecGetOwnershipRanges(petsclib::PetscLibType, x::AbstractPetscVec)

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 length size + 1 with the start and end+1 for each process

Level: beginner

See also: Vec, MatGetOwnershipRange(), MatGetOwnershipRanges(), VecGetOwnershipRange(), PetscSplitOwnership(), VecSetSizes(), VecCreateMPI(), PetscLayout, DMDAGetGhostCorners(), DM

External Links

source
PETSc.LibPETSc.VecGetPinnedMemoryMin — Method
mbytes::Csize_t = VecGetPinnedMemoryMin(petsclib::PetscLibType, v::AbstractPetscVec)

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

See also: Vec, VecSetPinnedMemoryMin()

External Links

source
PETSc.LibPETSc.VecGetSize — Method
size::PetscInt = VecGetSize(petsclib::PetscLibType, x::AbstractPetscVec)

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

See also: Vec, VecGetLocalSize()

External Links

source
PETSc.LibPETSc.VecGetState — Method
state::PetscObjectState = VecGetState(petsclib::PetscLibType, v::AbstractPetscVec)

Gets the state of a Vec.

Not Collective

Input Parameter:

  • v - the Vec context

Output Parameter:

  • state - the object state

Level: advanced

See also: Vec, VecCreate(), PetscObjectStateGet()

External Links

source
PETSc.LibPETSc.VecGetSubVector — Method
Y::PetscVec = VecGetSubVector(petsclib::PetscLibType, X::AbstractPetscVec, is::AbstractIS)

Gets a vector representing part of another vector

Collective

Input Parameters:

  • X - vector from which to extract a subvector
  • is - index set representing portion of X to extract

Output Parameter:

  • Y - subvector corresponding to is

Level: advanced

See also: Vec, IS, VECNEST, MatCreateSubMatrix()

External Links

source
PETSc.LibPETSc.VecGetType — Method
type::String = VecGetType(petsclib::PetscLibType, vec::AbstractPetscVec)

Gets the vector type name (as a string) from a Vec.

Not Collective

Input Parameter:

  • vec - The vector

Output Parameter:

  • type - The VecType of the vector

Level: intermediate

See also: Vec, VecType, VecCreate(), VecDuplicate(), VecDuplicateVecs(), PetscObjectTypeCompare(), PetscObjectTypeCompareAny()

External Links

source
PETSc.LibPETSc.VecGetValues — Method
y::Vector{PetscScalar} = VecGetValues(petsclib::PetscLibType, x::AbstractPetscVec, 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 from
  • ni - number of elements to get
  • ix - indices where to get them from (in global 1d numbering)

Output Parameter:

  • y - array of values, must be passed in with a length of ni

Level: beginner

See also: Vec, VecAssemblyBegin(), VecAssemblyEnd(), VecSetValues()

External Links

source
PETSc.LibPETSc.VecGetValuesSection — Method
values::Ptr{PetscScalar} = VecGetValuesSection(petsclib::PetscLibType, v::AbstractPetscVec, 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 - the Vec
  • s - the organizing PetscSection
  • point - the point

Output Parameter:

  • values - the array of output values

Level: developer

See also: PetscSection, PetscSectionCreate(), VecSetValuesSection()

External Links

source
PETSc.LibPETSc.VecGhostGetGhostIS — Method
ghost::IS = VecGhostGetGhostIS(petsclib::PetscLibType, X::AbstractPetscVec)

Return ghosting indices of a ghost vector

Input Parameters:

  • X - ghost vector

Output Parameter:

  • ghost - ghosting indices

Level: beginner

See also: VecCreateGhostWithArray(), VecCreateMPIWithArray()

External Links

source
PETSc.LibPETSc.VecGhostGetLocalForm — Method
l::PetscVec = VecGhostGetLocalForm(petsclib::PetscLibType, g::AbstractPetscVec)

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,NULL if g is not ghosted

Level: advanced

See also: VecGhostUpdateBegin(), VecGhostUpdateEnd(), Vec, VecType, VecCreateGhost(), VecGhostRestoreLocalForm(), VecCreateGhostWithArray()

External Links

source
PETSc.LibPETSc.VecGhostIsLocalForm — Method
flg::PetscBool = VecGhostIsLocalForm(petsclib::PetscLibType, g::AbstractPetscVec, l::AbstractPetscVec)

Checks if a given vector is the local form of a global vector

Not Collective

Input Parameters:

  • g - the global vector
  • l - the local vector

Output Parameter:

  • flg - PETSC_TRUE if l is the local form

Level: advanced

See also: Vec, VecType, VecCreateGhost(), VecGhostRestoreLocalForm(), VecCreateGhostWithArray(), VecGhostGetLocalForm()

External Links

source
PETSc.LibPETSc.VecGhostRestoreLocalForm — Method
VecGhostRestoreLocalForm(petsclib::PetscLibType, g::AbstractPetscVec, l::AbstractPetscVec)

Restores the local ghosted representation of a parallel vector obtained with VecGhostGetLocalForm().

Logically Collective

Input Parameters:

  • g - the global vector
  • l - the local (ghosted) representation

Level: advanced

See also: VecGhostUpdateBegin(), VecGhostUpdateEnd(), Vec, VecType, VecCreateGhost(), VecGhostGetLocalForm(), VecCreateGhostWithArray()

External Links

source
PETSc.LibPETSc.VecGhostUpdateBegin — Method
VecGhostUpdateBegin(petsclib::PetscLibType, g::AbstractPetscVec, 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 with VecCreateGhost() or VecDuplicate())
  • insertmode - one of ADD_VALUES, MAX_VALUES, MIN_VALUES or INSERT_VALUES
  • scattermode - one of SCATTER_FORWARD (update ghosts) or SCATTER_REVERSE (update local values from ghosts)

Level: advanced

See also: Vec, VecType, VecCreateGhost(), VecGhostUpdateEnd(), VecGhostGetLocalForm(), VecGhostRestoreLocalForm(), VecCreateGhostWithArray()

External Links

source
PETSc.LibPETSc.VecGhostUpdateEnd — Method
VecGhostUpdateEnd(petsclib::PetscLibType, g::AbstractPetscVec, 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 with VecCreateGhost() or VecDuplicate())
  • insertmode - one of ADD_VALUES, MAX_VALUES, MIN_VALUES or INSERT_VALUES
  • scattermode - one of SCATTER_FORWARD (update ghosts) or SCATTER_REVERSE (update local values from ghosts)

Level: advanced

See also: Vec, VecType, VecCreateGhost(), VecGhostUpdateBegin(), VecGhostGetLocalForm(), VecGhostRestoreLocalForm(), VecCreateGhostWithArray()

External Links

source
PETSc.LibPETSc.VecISAXPY — Method
VecISAXPY(petsclib::PetscLibType, vfull::AbstractPetscVec, is::AbstractIS, alpha::PetscScalar, vreduced::AbstractPetscVec)

Adds a reduced vector to the appropriate elements of a full-space vector. vfull[is[i]] += alpha*vreduced[i]

Logically Collective

Input Parameters:

  • vfull - the full-space vector
  • is - the index set for the reduced space
  • alpha - the scalar coefficient
  • vreduced - the reduced-space vector

Output Parameter:

  • vfull - the sum of the full-space vector and reduced-space vector

Level: advanced

See also: VecISCopy(), VecISSet(), VecAXPY()

External Links

source
PETSc.LibPETSc.VecISCopy — Method
VecISCopy(petsclib::PetscLibType, vfull::AbstractPetscVec, is::AbstractIS, mode::ScatterMode, vreduced::AbstractPetscVec)

Copies between a reduced vector and the appropriate elements of a full-space vector.

Logically Collective

Input Parameters:

  • vfull - the full-space vector
  • is - the index set for the reduced space
  • mode - the direction of copying, SCATTER_FORWARD or SCATTER_REVERSE
  • vreduced - the reduced-space vector

Output Parameter:

  • vfull - the sum of the full-space vector and reduced-space vector

Level: advanced

See also: VecISSet(), VecISAXPY(), VecCopy()

External Links

source
PETSc.LibPETSc.VecISSet — Method
VecISSet(petsclib::PetscLibType, V::AbstractPetscVec, S::AbstractIS, c::PetscScalar)

Sets the elements of a vector, specified by an index set, to a constant

Logically Collective

Input Parameters:

  • V - the vector
  • S - index set for the locations in the vector
  • c - the constant

Level: advanced

See also: VecISCopy(), VecISAXPY(), VecISShift(), VecSet()

External Links

source
PETSc.LibPETSc.VecISShift — Method
VecISShift(petsclib::PetscLibType, V::AbstractPetscVec, S::AbstractIS, c::PetscScalar)

Shifts the elements of a vector, specified by an index set, by a constant

Logically Collective

Input Parameters:

  • V - the vector
  • S - index set for the locations in the vector
  • c - the constant

Level: advanced

See also: VecISCopy(), VecISAXPY(), VecISSet(), VecShift()

External Links

source
PETSc.LibPETSc.VecImaginaryPart — Method
VecImaginaryPart(petsclib::PetscLibType, v::AbstractPetscVec)

Replaces a complex vector with its imaginary part

Collective

Input Parameter:

  • v - the vector

Level: beginner

See also: Vec, VecNorm(), VecRealPart()

External Links

source
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

See also: PetscInitialize()

External Links

source
PETSc.LibPETSc.VecLoad — Method
VecLoad(petsclib::PetscLibType, vec::AbstractPetscVec, 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 with VecCreate() or

some related function before the call to VecLoad().

  • viewer - binary file viewer, obtained from PetscViewerBinaryOpen() or

HDF5 file viewer, obtained from PetscViewerHDF5Open()

Level: intermediate

See also: Vec, PetscViewerBinaryOpen(), VecView(), MatLoad()

External Links

source
PETSc.LibPETSc.VecLockGet — Method
state::PetscInt = VecLockGet(petsclib::PetscLibType, x::AbstractPetscVec)

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

See also: Vec, VecRestoreArray(), VecGetArrayRead(), VecLockReadPush(), VecLockReadPop()

External Links

source
PETSc.LibPETSc.VecLockGetLocation — Method
file::String,func::String,line::Cint = VecLockGetLocation(petsclib::PetscLibType, x::AbstractPetscVec)

Return the source code location where a Vec was most recently read-locked

Not Collective

Input Parameter:

  • x - the vector

Output Parameters:

  • file - the source file name of the most recent VecLockReadPush(), or NULL if none is active
  • func - the function name of the most recent VecLockReadPush(), or NULL if none is active
  • line - the source line number of the most recent VecLockReadPush(), or 0 if none is active

Level: developer

See also: Vec, VecLockGet(), VecLockReadPush(), VecLockReadPop(), VecGetArray()

External Links

source
PETSc.LibPETSc.VecLockReadPop — Method
VecLockReadPop(petsclib::PetscLibType, x::AbstractPetscVec)

Pop a read-only lock from a vector

Logically Collective

Input Parameter:

  • x - the vector

Level: intermediate

See also: Vec, VecRestoreArray(), VecGetArrayRead(), VecLockReadPush(), VecLockGet()

External Links

source
PETSc.LibPETSc.VecLockReadPush — Method
VecLockReadPush(petsclib::PetscLibType, x::AbstractPetscVec)

Push a read-only lock on a vector to prevent it from being written to

Logically Collective

Input Parameter:

  • x - the vector

Level: intermediate

See also: Vec, VecRestoreArray(), VecGetArrayRead(), VecLockReadPop(), VecLockGet()

External Links

source
PETSc.LibPETSc.VecLockWriteSet — Method
VecLockWriteSet(petsclib::PetscLibType, x::AbstractPetscVec, flg::PetscBool)

Lock or unlock a vector for exclusive read/write access

Logically Collective

Input Parameters:

  • x - the vector
  • flg - PETSC_TRUE to lock the vector for exclusive read/write access; PETSC_FALSE to unlock it.

Level: intermediate

See also: Vec, VecRestoreArray(), VecGetArrayRead(), VecLockReadPush(), VecLockReadPop(), VecLockGet()

External Links

source
PETSc.LibPETSc.VecLog — Method
VecLog(petsclib::PetscLibType, v::AbstractPetscVec)

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

See also: Vec, VecExp(), VecAbs(), VecSqrtAbs(), VecReciprocal()

External Links

source
PETSc.LibPETSc.VecMAXPBY — Method
VecMAXPBY(petsclib::PetscLibType, y::AbstractPetscVec, nv::PetscInt, alpha::Vector{PetscScalar}, beta::PetscScalar, x::Vector{<:AbstractPetscVec})

Computes y = beta y + sum alpha[i] x[i]

Logically Collective

Input Parameters:

  • nv - number of scalars and x vectors
  • alpha - array of scalars
  • beta - scalar
  • y - one vector
  • x - array of vectors

Level: intermediate

See also: Vec, VecMAXPY(), VecAYPX(), VecWAXPY(), VecAXPY(), VecAXPBYPCZ(), VecAXPBY()

External Links

source
PETSc.LibPETSc.VecMAXPY — Method
VecMAXPY(petsclib::PetscLibType, y::AbstractPetscVec, nv::PetscInt, alpha::Vector{PetscScalar}, x::Vector{<:AbstractPetscVec})

Computes y = y + sum alpha[i] x[i]

Logically Collective

Input Parameters:

  • nv - number of scalars and x vectors
  • alpha - array of scalars
  • y - one vector
  • x - array of vectors

Level: intermediate

See also: Vec, VecMAXPBY(), VecAYPX(), VecWAXPY(), VecAXPY(), VecAXPBYPCZ(), VecAXPBY(), VecDuplicateVecs()

External Links

source
PETSc.LibPETSc.VecMDot — Method
VecMDot(petsclib::PetscLibType, x::AbstractPetscVec, nv::PetscInt, y::Vector{<:AbstractPetscVec}, val::Vector{PetscScalar})

Computes multiple vector dot products.

Collective

Input Parameters:

  • x - one vector
  • nv - number of vectors
  • y - 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 $val = (x,y) = y^H x,$ where y^H denotes the conjugate transpose of y.

Use VecMTDot() for the indefinite form $val = (x,y) = y^T x,$ where y^T denotes the transpose of y.

See also: Vec, VecMTDot(), VecDot(), VecDuplicateVecs()

External Links

source
PETSc.LibPETSc.VecMDotBegin — Method
VecMDotBegin(petsclib::PetscLibType, x::AbstractPetscVec, nv::PetscInt, y::Vector{<:AbstractPetscVec}, result::Vector{PetscScalar})

Starts a split phase multiple dot product computation.

Input Parameters:

  • x - the first vector
  • nv - number of vectors
  • y - array of vectors
  • result - where the result will go (can be NULL)

Level: advanced

See also: VecMDotEnd(), VecNormBegin(), VecNormEnd(), VecNorm(), VecDot(), VecMDot(), VecTDotBegin(), VecTDotEnd(), VecMTDotBegin(), VecMTDotEnd(), PetscCommSplitReductionBegin()

External Links

source
PETSc.LibPETSc.VecMDotEnd — Method
VecMDotEnd(petsclib::PetscLibType, x::AbstractPetscVec, nv::PetscInt, y::Vector{<:AbstractPetscVec}, result::Vector{PetscScalar})

Ends a split phase multiple dot product computation.

Input Parameters:

  • x - the first vector (can be NULL)
  • nv - number of vectors
  • y - array of vectors (can be NULL)

Output Parameter:

  • result - where the result will go

Level: advanced

See also: VecMDotBegin(), VecNormBegin(), VecNormEnd(), VecNorm(), VecDot(), VecMDot(), VecTDotBegin(), VecTDotEnd(), VecMTDotBegin(), VecMTDotEnd(), PetscCommSplitReductionBegin()

External Links

source
PETSc.LibPETSc.VecMPISetGhost — Method
VecMPISetGhost(petsclib::PetscLibType, vv::AbstractPetscVec, nghost::PetscInt, ghosts::Vector{PetscInt})

Sets the ghost points for an MPI ghost vector

Collective

Input Parameters:

  • vv - the MPI vector
  • nghost - number of local ghost points
  • ghosts - global indices of ghost points, these do not need to be in increasing order (sorted)

Level: advanced

See also: Vec, VecType, VecCreateSeq(), VecCreate(), VecDuplicate(), VecDuplicateVecs(), VecCreateMPI(), VecGhostGetLocalForm(), VecGhostRestoreLocalForm(), VecGhostUpdateBegin(), VecCreateGhostWithArray(), VecCreateMPIWithArray(), VecGhostUpdateEnd(), VecCreateGhostBlock(), VecCreateGhostBlockWithArray()

External Links

source
PETSc.LibPETSc.VecMTDot — Method
VecMTDot(petsclib::PetscLibType, x::AbstractPetscVec, nv::PetscInt, y::Vector{<:AbstractPetscVec}, val::Vector{PetscScalar})

Computes indefinite vector multiple dot products. That is, it does NOT use the complex conjugate.

Collective

Input Parameters:

  • x - one vector
  • nv - number of vectors
  • y - 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 $val = (x,y) = y^T x,$ where y^T denotes the transpose of y.

Use VecMDot() for the inner product $val = (x,y) = y^H x,$ where y^H denotes the conjugate transpose of y.

See also: Vec, VecMDot(), VecTDot()

External Links

source
PETSc.LibPETSc.VecMTDotBegin — Method
VecMTDotBegin(petsclib::PetscLibType, x::AbstractPetscVec, nv::PetscInt, y::Vector{<:AbstractPetscVec}, result::Vector{PetscScalar})

Starts a split phase transpose multiple dot product computation.

Input Parameters:

  • x - the first vector
  • nv - number of vectors
  • y - array of vectors
  • result - where the result will go (can be NULL)

Level: advanced

See also: VecMTDotEnd(), VecNormBegin(), VecNormEnd(), VecNorm(), VecDot(), VecMDot(), VecDotBegin(), VecDotEnd(), VecMDotBegin(), VecMDotEnd(), PetscCommSplitReductionBegin()

External Links

source
PETSc.LibPETSc.VecMTDotEnd — Method
result::Vector{PetscScalar} = VecMTDotEnd(petsclib::PetscLibType, x::AbstractPetscVec, nv::PetscInt, y::Vector{<:AbstractPetscVec})

Ends a split phase transpose multiple dot product computation.

Input Parameters:

  • x - the first vector (can be NULL)
  • nv - number of vectors
  • y - array of vectors (can be NULL)

Output Parameter:

  • result - where the result will go

Level: advanced

See also: VecMTDotBegin(), VecNormBegin(), VecNormEnd(), VecNorm(), VecDot(), VecMDot(), VecDotBegin(), VecDotEnd(), VecMDotBegin(), VecMDotEnd(), PetscCommSplitReductionBegin()

External Links

source
PETSc.LibPETSc.VecMax — Method
p::PetscInt,val::PetscReal = VecMax(petsclib::PetscLibType, x::AbstractPetscVec)

Determines the vector component with maximum real part and its location.

Collective

Input Parameter:

  • x - the vector

Output Parameters:

  • p - the index of val (pass NULL if you don't want this) in the vector
  • val - the maximum component

Level: intermediate

See also: Vec, VecNorm(), VecMin()

External Links

source
PETSc.LibPETSc.VecMaxPointwiseDivide — Method
max::PetscReal = VecMaxPointwiseDivide(petsclib::PetscLibType, x::AbstractPetscVec, y::AbstractPetscVec)

Computes the maximum of the componentwise division max = max_i abs(x[i]/y[i]).

Logically Collective

Input Parameters:

  • x - the numerators
  • y - the denominators

Output Parameter:

  • max - the result

Level: advanced

See also: Vec, VecPointwiseDivide(), VecPointwiseMult(), VecPointwiseMax(), VecPointwiseMin(), VecPointwiseMaxAbs()

External Links

source
PETSc.LibPETSc.VecMean — Method
mean::PetscScalar = VecMean(petsclib::PetscLibType, v::AbstractPetscVec)

Computes the arithmetic mean of all the components of a vector.

Collective

Input Parameter:

  • v - the vector

Output Parameter:

  • mean - the result

Level: beginner

See also: Vec, VecSum(), VecNorm()

External Links

source
PETSc.LibPETSc.VecMedian — Method
VecMedian(petsclib::PetscLibType, Vec1::AbstractPetscVec, Vec2::AbstractPetscVec, Vec3::AbstractPetscVec, VMedian::AbstractPetscVec)

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 vector
  • Vec2 - The second vector
  • Vec3 - The third vector

Output Parameter:

  • VMedian - The median vector (this can be any one of the input vectors)

Level: advanced

See also: Vec

External Links

source
PETSc.LibPETSc.VecMin — Method
p::PetscInt,val::PetscReal = VecMin(petsclib::PetscLibType, x::AbstractPetscVec)

Determines the vector component with minimum real part and its location.

Collective

Input Parameter:

  • x - the vector

Output Parameters:

  • p - the index of val (pass NULL if you don't want this location) in the vector
  • val - the minimum component

Level: intermediate

See also: Vec, VecMax()

External Links

source
PETSc.LibPETSc.VecNestGetSize — Method
N::PetscInt = VecNestGetSize(petsclib::PetscLibType, X::AbstractPetscVec)

Returns the size of the nest vector.

Not Collective

Input Parameter:

  • X - nest vector

Output Parameter:

  • N - number of nested vecs

Level: developer

See also: VECNEST, Vec, VecType, VecNestGetSubVec(), VecNestGetSubVecs()

External Links

source
PETSc.LibPETSc.VecNestGetSubVec — Method
sx::PetscVec = VecNestGetSubVec(petsclib::PetscLibType, X::AbstractPetscVec, idxm::PetscInt)

Returns a single, sub-vector from a nest vector.

Not Collective

Input Parameters:

  • X - nest vector
  • idxm - index of the vector within the nest

Output Parameter:

  • sx - vector at index idxm within the nest

Level: developer

See also: VECNEST, Vec, VecType, VecNestGetSize(), VecNestGetSubVecs()

External Links

source
PETSc.LibPETSc.VecNestGetSubVecs — Method
N::PetscInt,sx::Vector{PetscVec} = VecNestGetSubVecs(petsclib::PetscLibType, X::AbstractPetscVec)

Returns the entire array of vectors defining a nest vector.

Not Collective

Input Parameter:

  • X - nest vector

Output Parameters:

  • N - number of nested vecs
  • sx - array of vectors, can pass in NULL

Level: developer

See also: VECNEST, Vec, VecType, VecNestGetSize(), VecNestGetSubVec(), VecNestGetSubVecsRead()

External Links

source
PETSc.LibPETSc.VecNestGetSubVecsRead — Method
N::PetscInt,sx::Vector{PetscVec} = VecNestGetSubVecsRead(petsclib::PetscLibType, X::AbstractPetscVec)

Access the subvecs of a VECNEST vector for read-only access

Logically collective

Input Parameter:

  • X - nest vector

Output Parameters:

  • N - number of nested vecs
  • sx - array of read-locked vectors, borrowed from X

VecNestRestoreSubVecsRead() checks that it gets back the array PETSc handed out, so pass it the returned vector.

Level: advanced

See also: VECNEST, Vec, VecType, VecNestGetSize(), VecNestGetSubVec(), VecNestRestoreSubVecsRead()

External Links

source
PETSc.LibPETSc.VecNestGetTaoTermSumParameters — Method
subparams::PetscVec = VecNestGetTaoTermSumParameters(petsclib::PetscLibType, params::AbstractPetscVec, index::PetscInt)

A wrapper around VecNestGetSubVec() for TAOTERMSUM.

Not collective

Input Parameters:

  • params - a VECNEST that has one nested vector for each term of a TAOTERMSUM
  • index - the index of a term

Output Parameter:

  • subparams - the parameters of the internal terms of TAOTERMSUM. (may be NULL)

Level: intermediate

Note: VecNestGetSubVec() cannot return NULL for the subvec. If params was created by TaoTermSumParametersPack(), then any NULL subvecs that were passed to that function will be returned NULL by this function.

TaoTerm, TAOTERMSUM, TaoTermSumParametersPack(), TaoTermSumParametersUnpack(), VECNEST, VecNestGetSubVec()

External Links

source
PETSc.LibPETSc.VecNestRestoreSubVecsRead — Method
VecNestRestoreSubVecsRead(petsclib::PetscLibType, X::AbstractPetscVec, N::PetscInt, sx::Union{Ptr, AbstractVector{<:AbstractPetscVec}})

Restore access the subvecs of a VECNEST vector obtained with VecNestGetSubVecsRead()

Logically collective

Input Parameters:

  • X - nest vector
  • N - number of nested vecs
  • sx - the vector VecNestGetSubVecsRead() returned, or the raw pointer to PETSc's array

PETSc checks that it gets back its own array, so only a vector VecNestGetSubVecsRead() returned is accepted: any other vector throws an ArgumentError. The vectors in it are left with a null pointer.

Level: advanced

See also: VECNEST, Vec, VecType, VecNestGetSize(), VecNestGetSubVec(), VecNestGetSubVecsRead()

External Links

source
PETSc.LibPETSc.VecNestSetSubVec — Method
VecNestSetSubVec(petsclib::PetscLibType, X::AbstractPetscVec, idxm::PetscInt, sx::AbstractPetscVec)

Set a single component vector in a nest vector at specified index.

Not Collective

Input Parameters:

  • X - nest vector
  • idxm - index of the vector within the nest vector
  • sx - vector at index idxm within the nest vector

Level: developer

See also: VECNEST, Vec, VecType, VecNestSetSubVecs(), VecNestGetSubVec()

External Links

source
PETSc.LibPETSc.VecNestSetSubVecs — Method
VecNestSetSubVecs(petsclib::PetscLibType, X::AbstractPetscVec, N::PetscInt, idxm::Vector{PetscInt}, sx::Vector{<:AbstractPetscVec})

Sets the component vectors at the specified indices in a nest vector.

Not Collective

Input Parameters:

  • X - nest vector
  • N - number of component vecs in sx
  • idxm - indices of component vectors that are to be replaced
  • sx - array of vectors

Level: developer

See also: VECNEST, Vec, VecType, VecNestGetSize(), VecNestGetSubVec()

External Links

source
PETSc.LibPETSc.VecNorm — Method
val::PetscReal = VecNorm(petsclib::PetscLibType, x::AbstractPetscVec, type::NormType)

Computes the vector norm.

Collective

Input Parameters:

  • x - the vector
  • type - the type of the norm requested

Output Parameter:

  • val - the norm

Level: intermediate

See also: Vec, NormType, VecDot(), VecTDot(), VecDotBegin(), VecDotEnd(), VecNormAvailable(), VecNormBegin(), VecNormEnd(), NormType()

External Links

source
PETSc.LibPETSc.VecNormAvailable — Method
available::PetscBool,val::PetscReal = VecNormAvailable(petsclib::PetscLibType, x::AbstractPetscVec, 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 vector
  • type - one of NORM_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_TRUE if the val returned is valid
  • val - the norm

Level: intermediate

See also: Vec, VecDot(), VecTDot(), VecNorm(), VecDotBegin(), VecDotEnd(), VecNormBegin(), VecNormEnd()

External Links

source
PETSc.LibPETSc.VecNormBegin — Method
result::PetscReal = VecNormBegin(petsclib::PetscLibType, x::AbstractPetscVec, ntype::NormType)

Starts a split phase norm computation.

Input Parameters:

  • x - the first vector
  • ntype - norm type, one of NORM_1, NORM_2, NORM_MAX, NORM_1_AND_2
  • result - where the result will go (can be NULL)

Level: advanced

See also: VecNormEnd(), VecNorm(), VecDot(), VecMDot(), VecDotBegin(), VecDotEnd(), PetscCommSplitReductionBegin()

External Links

source
PETSc.LibPETSc.VecNormEnd — Method
result::PetscReal = VecNormEnd(petsclib::PetscLibType, x::AbstractPetscVec, ntype::NormType)

Ends a split phase norm computation.

Input Parameters:

  • x - the first vector
  • ntype - norm type, one of NORM_1, NORM_2, NORM_MAX, NORM_1_AND_2
  • result - where the result will go

Level: advanced

See also: VecNormBegin(), VecNorm(), VecDot(), VecMDot(), VecDotBegin(), VecDotEnd(), PetscCommSplitReductionBegin()

External Links

source
PETSc.LibPETSc.VecNormalize — Method
val::PetscReal = VecNormalize(petsclib::PetscLibType, x::AbstractPetscVec)

Normalizes a vector by its 2-norm.

Collective

Input Parameter:

  • x - the vector

Output Parameter:

  • val - the vector norm before normalization. May be NULL if the value is not needed.

Level: intermediate

See also: Vec, VecNorm(), NORM_2, NormType

External Links

source
PETSc.LibPETSc.VecPermute — Method
VecPermute(petsclib::PetscLibType, x::AbstractPetscVec, row::AbstractIS, inv::PetscBool)

Permutes a vector in place using the given ordering.

Input Parameters:

  • x - The vector
  • row - The ordering
  • inv - The flag for inverting the permutation

Level: beginner

See also: Vec, MatPermute()

External Links

source
PETSc.LibPETSc.VecPlaceArray — Method
VecPlaceArray(petsclib::PetscLibType, vec::AbstractPetscVec, 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

Input Parameters:

  • vec - the vector
  • array - the array

Level: developer

See also: Vec, VecGetArray(), VecRestoreArray(), VecReplaceArray(), VecResetArray()

External Links

source
PETSc.LibPETSc.VecPointwiseDivide — Method
VecPointwiseDivide(petsclib::PetscLibType, w::AbstractPetscVec, x::AbstractPetscVec, y::AbstractPetscVec)

Computes the component-wise division w[i] = x[i] / y[i].

Logically Collective

Input Parameters:

  • x - the numerator vector
  • y - the denominator vector

Output Parameter:

  • w - the result

Level: advanced

See also: Vec, VecPointwiseMult(), VecPointwiseMax(), VecPointwiseMin(), VecPointwiseMaxAbs(), VecMaxPointwiseDivide()

External Links

source
PETSc.LibPETSc.VecPointwiseMax — Method
VecPointwiseMax(petsclib::PetscLibType, w::AbstractPetscVec, x::AbstractPetscVec, y::AbstractPetscVec)

Computes the component-wise maximum w[i] = max(x[i], y[i]).

Logically Collective

Input Parameters:

  • x - the first input vector
  • y - the second input vector

Output Parameter:

  • w - the result

Level: advanced

See also: Vec, VecPointwiseDivide(), VecPointwiseMult(), VecPointwiseMin(), VecPointwiseMaxAbs(), VecMaxPointwiseDivide()

External Links

source
PETSc.LibPETSc.VecPointwiseMaxAbs — Method
VecPointwiseMaxAbs(petsclib::PetscLibType, w::AbstractPetscVec, x::AbstractPetscVec, y::AbstractPetscVec)

Computes the component-wise maximum of the absolute values w[i] = max(abs(x[i]), abs(y[i])).

Logically Collective

Input Parameters:

  • x - the first input vector
  • y - the second input vector

Output Parameter:

  • w - the result

Level: advanced

See also: Vec, VecPointwiseDivide(), VecPointwiseMult(), VecPointwiseMin(), VecPointwiseMax(), VecMaxPointwiseDivide()

External Links

source
PETSc.LibPETSc.VecPointwiseMin — Method
VecPointwiseMin(petsclib::PetscLibType, w::AbstractPetscVec, x::AbstractPetscVec, y::AbstractPetscVec)

Computes the component-wise minimum w[i] = min(x[i], y[i]).

Logically Collective

Input Parameters:

  • x - the first input vector
  • y - the second input vector

Output Parameter:

  • w - the result

Level: advanced

See also: Vec, VecPointwiseDivide(), VecPointwiseMult(), VecPointwiseMaxAbs(), VecMaxPointwiseDivide()

External Links

source
PETSc.LibPETSc.VecPointwiseMult — Method
VecPointwiseMult(petsclib::PetscLibType, w::AbstractPetscVec, x::AbstractPetscVec, y::AbstractPetscVec)

Computes the component-wise multiplication w[i] = x[i] * y[i].

Logically Collective

Input Parameters:

  • x - the first vector
  • y - the second vector

Output Parameter:

  • w - the result

Level: advanced

See also: Vec, VecPointwiseDivide(), VecPointwiseMax(), VecPointwiseMin(), VecPointwiseMaxAbs(), VecMaxPointwiseDivide()

External Links

source
PETSc.LibPETSc.VecPointwiseSign — Method
VecPointwiseSign(petsclib::PetscLibType, y::AbstractPetscVec, x::AbstractPetscVec, sign_type::VecSignMode)

Computes the component-wise sign y[i] = sign(x[i]).

Logically Collective

Input Parameters:

  • x - the input vector
  • sign_type - VecSignMode indicating how the function should map zero values.

Output Parameter:

  • y - the sign vector of x

Level: beginner

See also: Vec, VecSignMode

External Links

source
PETSc.LibPETSc.VecPow — Method
VecPow(petsclib::PetscLibType, v::AbstractPetscVec, p::PetscScalar)

Replaces each component of a vector by x_i^p

Logically Collective

Input Parameters:

  • v - the vector
  • p - the exponent to use on each element

Level: intermediate

See also: Vec

External Links

source
PETSc.LibPETSc.VecRealPart — Method
VecRealPart(petsclib::PetscLibType, v::AbstractPetscVec)

Replaces a complex vector with its real part

Collective

Input Parameter:

  • v - the vector

Level: beginner

See also: Vec, VecNorm(), VecImaginaryPart()

External Links

source
PETSc.LibPETSc.VecReciprocal — Method
VecReciprocal(petsclib::PetscLibType, vec::AbstractPetscVec)

Replaces each component of a vector by its reciprocal.

Logically Collective

Input Parameter:

  • vec - the vector

Output Parameter:

  • vec - the vector reciprocal

Level: intermediate

See also: Vec, VecLog(), VecExp(), VecSqrtAbs()

External Links

source
PETSc.LibPETSc.VecRegister — Method
VecRegister(petsclib::PetscLibType, sname::String, fnc::external)

Adds a new vector component implementation

Not Collective, No Fortran Support

Input Parameters:

  • sname - The name of a new user-defined creation routine
  • function - The creation routine

See also: VecRegisterAll(), VecRegisterDestroy()

External Links

source
PETSc.LibPETSc.VecRegisterAll — Method
VecRegisterAll(petsclib::PetscLibType)

Registers all of the vector types in the Vec package.

Not Collective

Level: advanced

See also: Vec, VecType, VecRegister(), VecRegisterDestroy()

External Links

source
PETSc.LibPETSc.VecReplaceArray — Method
VecReplaceArray(petsclib::PetscLibType, vec::AbstractPetscVec, 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 vector
  • array - the array

Level: developer

See also: Vec, VecGetArray(), VecRestoreArray(), VecPlaceArray(), VecResetArray()

External Links

source
PETSc.LibPETSc.VecResetArray — Method
VecResetArray(petsclib::PetscLibType, vec::AbstractPetscVec)

Resets a vector to use its default memory. Call this after the use of VecPlaceArray().

Not Collective

Input Parameter:

  • vec - the vector

Level: developer

See also: Vec, VecGetArray(), VecRestoreArray(), VecReplaceArray(), VecPlaceArray()

External Links

source
PETSc.LibPETSc.VecRestoreArray — Method
VecRestoreArray(petsclib::PetscLibType, x::AbstractPetscVec, a::Union{Ptr, AbstractArray{PetscScalar}})

Restores a vector after VecGetArray() has been called and the array is no longer needed

Logically Collective

Input Parameters:

  • x - the vector
  • a - location of pointer to array obtained from VecGetArray()

Level: beginner

See also: Vec, VecGetArray(), VecRestoreArrayRead(), VecRestoreArrays(), VecPlaceArray(), VecRestoreArray2d(), VecGetArrayPair(), VecRestoreArrayPair()

External Links

source
PETSc.LibPETSc.VecRestoreArray1d — Method
VecRestoreArray1d(petsclib::PetscLibType, x::AbstractPetscVec, m::PetscInt, mstart::PetscInt, a::PetscArray{PetscScalar, 1})

Restores a vector after VecGetArray1d() has been called.

Logically Collective

Input Parameters:

  • x - the vector
  • m - first dimension of two dimensional array
  • mstart - first index you will use in first coordinate direction (often 0)
  • a - location of pointer to array obtained from VecGetArray1d()

Level: developer

See also: Vec, VecGetArray(), VecRestoreArray(), VecRestoreArrays(), VecPlaceArray(), VecGetArray2d(), VecGetArray3d(), VecRestoreArray3d(), DMDAVecGetArray(), DMDAVecRestoreArray() VecGetArray1d(), VecRestoreArray2d(), VecGetArray4d(), VecRestoreArray4d()

External Links

source
PETSc.LibPETSc.VecRestoreArray1dRead — Method
VecRestoreArray1dRead(petsclib::PetscLibType, x::AbstractPetscVec, m::PetscInt, mstart::PetscInt, a::PetscArray{PetscScalar, 1})

Restores a vector after VecGetArray1dRead() has been called.

Logically Collective

Input Parameters:

  • x - the vector
  • m - first dimension of two dimensional array
  • mstart - first index you will use in first coordinate direction (often 0)
  • a - location of pointer to array obtained from VecGetArray1dRead()

Level: developer

See also: Vec, VecGetArray(), VecRestoreArray(), VecRestoreArrays(), VecPlaceArray(), VecGetArray2d(), VecGetArray3d(), VecRestoreArray3d(), DMDAVecGetArray(), DMDAVecRestoreArray() VecGetArray1d(), VecRestoreArray2d(), VecGetArray4d(), VecRestoreArray4d()

External Links

source
PETSc.LibPETSc.VecRestoreArray1dWrite — Method
VecRestoreArray1dWrite(petsclib::PetscLibType, x::AbstractPetscVec, m::PetscInt, mstart::PetscInt, a::PetscArray{PetscScalar, 1})

Restores a vector after VecGetArray1dWrite() has been called.

Logically Collective

Input Parameters:

  • x - the vector
  • m - first dimension of two dimensional array
  • mstart - first index you will use in first coordinate direction (often 0)
  • a - location of pointer to array obtained from VecGetArray1d()

Level: developer

See also: Vec, VecGetArray(), VecRestoreArray(), VecRestoreArrays(), VecPlaceArray(), VecGetArray2d(), VecGetArray3d(), VecRestoreArray3d(), DMDAVecGetArray(), DMDAVecRestoreArray() VecGetArray1d(), VecRestoreArray2d(), VecGetArray4d(), VecRestoreArray4d()

External Links

source
PETSc.LibPETSc.VecRestoreArray2d — Method
VecRestoreArray2d(petsclib::PetscLibType, x::AbstractPetscVec, 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 vector
  • m - first dimension of two dimensional array
  • n - second dimension of the two dimensional array
  • mstart - 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

See also: Vec, VecGetArray(), VecRestoreArray(), VecRestoreArrays(), VecPlaceArray(), VecGetArray2d(), VecGetArray3d(), VecRestoreArray3d(), DMDAVecGetArray(), DMDAVecRestoreArray() VecGetArray1d(), VecRestoreArray1d(), VecGetArray4d(), VecRestoreArray4d()

External Links

source
PETSc.LibPETSc.VecRestoreArray2dRead — Method
VecRestoreArray2dRead(petsclib::PetscLibType, x::AbstractPetscVec, 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 vector
  • m - first dimension of two dimensional array
  • n - second dimension of the two dimensional array
  • mstart - 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

See also: Vec, VecGetArray(), VecRestoreArray(), VecRestoreArrays(), VecPlaceArray(), VecGetArray2d(), VecGetArray3d(), VecRestoreArray3d(), DMDAVecGetArray(), DMDAVecRestoreArray() VecGetArray1d(), VecRestoreArray1d(), VecGetArray4d(), VecRestoreArray4d()

External Links

source
PETSc.LibPETSc.VecRestoreArray2dWrite — Method
VecRestoreArray2dWrite(petsclib::PetscLibType, x::AbstractPetscVec, 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 vector
  • m - first dimension of two dimensional array
  • n - second dimension of the two dimensional array
  • mstart - 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

See also: Vec, VecGetArray(), VecRestoreArray(), VecRestoreArrays(), VecPlaceArray(), VecGetArray2d(), VecGetArray3d(), VecRestoreArray3d(), DMDAVecGetArray(), DMDAVecRestoreArray() VecGetArray1d(), VecRestoreArray1d(), VecGetArray4d(), VecRestoreArray4d()

External Links

source
PETSc.LibPETSc.VecRestoreArray3d — Method
VecRestoreArray3d(petsclib::PetscLibType, x::AbstractPetscVec, 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 vector
  • m - first dimension of three dimensional array
  • n - second dimension of the three dimensional array
  • p - third dimension of the three dimensional array
  • mstart - 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

See also: Vec, VecGetArray(), VecRestoreArray(), VecRestoreArrays(), VecPlaceArray(), VecGetArray2d(), VecGetArray3d(), DMDAVecGetArray(), DMDAVecRestoreArray() VecGetArray1d(), VecRestoreArray1d(), VecGetArray4d(), VecRestoreArray4d()

External Links

source
PETSc.LibPETSc.VecRestoreArray3dRead — Method
VecRestoreArray3dRead(petsclib::PetscLibType, x::AbstractPetscVec, 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 vector
  • m - first dimension of three dimensional array
  • n - second dimension of the three dimensional array
  • p - third dimension of the three dimensional array
  • mstart - 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 VecGetArray3dRead()

Level: developer

See also: Vec, VecGetArray(), VecRestoreArray(), VecRestoreArrays(), VecPlaceArray(), VecGetArray2d(), VecGetArray3d(), VecRestoreArray3d(), DMDAVecGetArray(), DMDAVecRestoreArray() VecGetArray1d(), VecRestoreArray1d(), VecGetArray4d(), VecRestoreArray4d()

External Links

source
PETSc.LibPETSc.VecRestoreArray3dWrite — Method
VecRestoreArray3dWrite(petsclib::PetscLibType, x::AbstractPetscVec, 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 vector
  • m - first dimension of three dimensional array
  • n - second dimension of the three dimensional array
  • p - third dimension of the three dimensional array
  • mstart - 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

See also: Vec, VecGetArray(), VecRestoreArray(), VecRestoreArrays(), VecPlaceArray(), VecGetArray2d(), VecGetArray3d(), VecRestoreArray3d(), DMDAVecGetArray(), DMDAVecRestoreArray() VecGetArray1d(), VecRestoreArray1d(), VecGetArray4d(), VecRestoreArray4d()

External Links

source
PETSc.LibPETSc.VecRestoreArray4d — Method
VecRestoreArray4d(petsclib::PetscLibType, x::AbstractPetscVec, 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 vector
  • m - first dimension of four dimensional array
  • n - second dimension of the four dimensional array
  • p - third dimension of the four dimensional array
  • q - fourth dimension of the four dimensional array
  • mstart - 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

See also: Vec, VecGetArray(), VecRestoreArray(), VecRestoreArrays(), VecPlaceArray(), VecGetArray2d(), VecGetArray3d(), VecRestoreArray3d(), DMDAVecGetArray(), DMDAVecRestoreArray() VecGetArray1d(), VecRestoreArray1d(), VecGetArray4d()

External Links

source
PETSc.LibPETSc.VecRestoreArray4dRead — Method
VecRestoreArray4dRead(petsclib::PetscLibType, x::AbstractPetscVec, 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 vector
  • m - first dimension of four dimensional array
  • n - second dimension of the four dimensional array
  • p - third dimension of the four dimensional array
  • q - fourth dimension of the four dimensional array
  • mstart - 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 VecGetArray4dRead()

Level: beginner

See also: Vec, VecGetArray(), VecRestoreArray(), VecRestoreArrays(), VecPlaceArray(), VecGetArray2d(), VecGetArray3d(), VecRestoreArray3d(), DMDAVecGetArray(), DMDAVecRestoreArray() VecGetArray1d(), VecRestoreArray1d(), VecGetArray4d(), VecRestoreArray4d()

External Links

source
PETSc.LibPETSc.VecRestoreArray4dWrite — Method
VecRestoreArray4dWrite(petsclib::PetscLibType, x::AbstractPetscVec, 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 vector
  • m - first dimension of four dimensional array
  • n - second dimension of the four dimensional array
  • p - third dimension of the four dimensional array
  • q - fourth dimension of the four dimensional array
  • mstart - 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

See also: Vec, VecGetArray(), VecRestoreArray(), VecRestoreArrays(), VecPlaceArray(), VecGetArray2d(), VecGetArray3d(), VecRestoreArray3d(), DMDAVecGetArray(), DMDAVecRestoreArray() VecGetArray1d(), VecRestoreArray1d(), VecGetArray4d(), VecRestoreArray4d()

External Links

source
PETSc.LibPETSc.VecRestoreArrayAndMemType — Method
VecRestoreArrayAndMemType(petsclib::PetscLibType, x::AbstractPetscVec, a::Union{Ptr, AbstractArray{PetscScalar}})

Restores a vector after VecGetArrayAndMemType() has been called.

Logically Collective; No Fortran Support

Input Parameters:

  • x - the vector
  • a - location of pointer to array obtained from VecGetArrayAndMemType()

Level: beginner

See also: Vec, VecGetArrayAndMemType(), VecGetArray(), VecRestoreArrayRead(), VecRestoreArrays(), VecPlaceArray(), VecRestoreArray2d(), VecGetArrayPair(), VecRestoreArrayPair()

External Links

source
PETSc.LibPETSc.VecRestoreArrayRead — Method
VecRestoreArrayRead(petsclib::PetscLibType, x::AbstractPetscVec, a::Union{Ptr, AbstractArray{PetscScalar}})

Restore array obtained with VecGetArrayRead()

Not Collective

Input Parameters:

  • x - the vector
  • a - the array

Level: beginner

See also: Vec, VecGetArray(), VecRestoreArray(), VecGetArrayPair(), VecRestoreArrayPair()

External Links

source
PETSc.LibPETSc.VecRestoreArrayReadAndMemType — Method
VecRestoreArrayReadAndMemType(petsclib::PetscLibType, x::AbstractPetscVec, a::Union{Ptr, AbstractArray{PetscScalar}})

Restore array obtained with VecGetArrayReadAndMemType()

Not Collective; No Fortran Support

Input Parameters:

  • x - the vector
  • a - the array

Level: beginner

See also: Vec, VecGetArrayReadAndMemType(), VecRestoreArrayAndMemType(), VecRestoreArrayWriteAndMemType(), VecGetArray(), VecRestoreArray(), VecGetArrayPair(), VecRestoreArrayPair()

External Links

source
PETSc.LibPETSc.VecRestoreArrayWrite — Method
VecRestoreArrayWrite(petsclib::PetscLibType, x::AbstractPetscVec, a::Union{Ptr, AbstractArray{PetscScalar}})

Restores a vector after VecGetArrayWrite() has been called.

Logically Collective

Input Parameters:

  • x - the vector
  • a - location of pointer to array obtained from VecGetArray()

Level: beginner

See also: Vec, VecGetArray(), VecRestoreArrayRead(), VecRestoreArrays(), VecPlaceArray(), VecRestoreArray2d(), VecGetArrayPair(), VecRestoreArrayPair(), VecGetArrayWrite()

External Links

source
PETSc.LibPETSc.VecRestoreArrayWriteAndMemType — Method
VecRestoreArrayWriteAndMemType(petsclib::PetscLibType, x::AbstractPetscVec, a::Union{Ptr, AbstractArray{PetscScalar}})

Restore array obtained with VecGetArrayWriteAndMemType()

Logically Collective; No Fortran Support

Input Parameters:

  • x - the vector
  • a - the array

Level: beginner

See also: Vec, VecGetArrayWriteAndMemType(), VecRestoreArrayAndMemType(), VecGetArray(), VecRestoreArray(), VecGetArrayPair(), VecRestoreArrayPair()

External Links

source
PETSc.LibPETSc.VecRestoreArrays — Method
VecRestoreArrays(petsclib::PetscLibType, x::Vector{<:AbstractPetscVec}, n::PetscInt, a::Vector{PetscScalar})

Restores a group of vectors after VecGetArrays() has been called.

Logically Collective; No Fortran Support

Input Parameters:

  • x - the vector
  • n - the number of vectors
  • a - location of pointer to arrays obtained from VecGetArrays()

See also: Vec, VecGetArrays(), VecRestoreArray()

External Links

source
PETSc.LibPETSc.VecRestoreLocalVector — Method
VecRestoreLocalVector(petsclib::PetscLibType, v::AbstractPetscVec, w::AbstractPetscVec)

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 into w using VecGetLocalVector().
  • w - The vector into which the local portion of v was mapped.

Level: beginner

See also: Vec, VecCreateLocalVector(), VecGetLocalVector(), VecGetLocalVectorRead(), VecRestoreLocalVectorRead(), LocalVectorRead(), VecGetArrayRead(), VecGetArray()

External Links

source
PETSc.LibPETSc.VecRestoreLocalVectorRead — Method
VecRestoreLocalVectorRead(petsclib::PetscLibType, v::AbstractPetscVec, w::AbstractPetscVec)

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 into w using VecGetLocalVectorRead().
  • w - The vector into which the local portion of v was mapped.

Level: beginner

See also: Vec, VecCreateLocalVector(), VecGetLocalVectorRead(), VecGetLocalVector(), VecGetArrayRead(), VecGetArray()

External Links

source
PETSc.LibPETSc.VecRestoreSubVector — Method
VecRestoreSubVector(petsclib::PetscLibType, X::AbstractPetscVec, is::AbstractIS, Y::AbstractPetscVec)

Restores a subvector extracted using VecGetSubVector()

Collective

Input Parameters:

  • X - vector from which subvector was obtained
  • is - index set representing the subset of X
  • Y - subvector being restored

Level: advanced

See also: Vec, IS, VecGetSubVector()

External Links

source
PETSc.LibPETSc.VecTDot — Method
val::PetscScalar = VecTDot(petsclib::PetscLibType, x::AbstractPetscVec, y::AbstractPetscVec)

Computes an indefinite vector dot product. That is, this routine does NOT use the complex conjugate.

Collective

Input Parameters:

  • x - first vector
  • y - second vector

Output Parameter:

  • val - the dot product

Level: intermediate

Notes for Users of Complex Numbers: For complex vectors, VecTDot() computes the indefinite form $val = (x,y) = y^T x,$ where y^T denotes the transpose of y.

Use VecDot() for the inner product $val = (x,y) = y^H x,$ where y^H denotes the conjugate transpose of y.

See also: Vec, VecDot(), VecMTDot()

External Links

source
PETSc.LibPETSc.VecTDotBegin — Method
result::PetscScalar = VecTDotBegin(petsclib::PetscLibType, x::AbstractPetscVec, y::AbstractPetscVec)

Starts a split phase transpose dot product computation.

Input Parameters:

  • x - the first vector
  • y - the second vector
  • result - where the result will go (can be NULL)

Level: advanced

See also: VecTDotEnd(), VecNormBegin(), VecNormEnd(), VecNorm(), VecDot(), VecMDot(), VecDotBegin(), VecDotEnd(), PetscCommSplitReductionBegin()

External Links

source
PETSc.LibPETSc.VecTDotEnd — Method
result::PetscScalar = VecTDotEnd(petsclib::PetscLibType, x::AbstractPetscVec, y::AbstractPetscVec)

Ends a split phase transpose dot product computation.

Input Parameters:

  • x - the first vector (can be NULL)
  • y - the second vector (can be NULL)
  • result - where the result will go

Level: advanced

See also: VecTDotBegin(), VecNormBegin(), VecNormEnd(), VecNorm(), VecDot(), VecMDot(), VecDotBegin(), VecDotEnd()

External Links

source
PETSc.LibPETSc.VecUniqueEntries — Method
n::PetscInt,e::Vector{PetscScalar} = VecUniqueEntries(petsclib::PetscLibType, vec::AbstractPetscVec)

Compute the number of unique entries, and those entries

Collective

Input Parameter:

  • vec - the vector

Output Parameters:

  • n - The number of unique entries
  • e - The entries, each MPI process receives all the unique entries

Level: intermediate

See also: Vec

External Links

source
PETSc.LibPETSc.VecView — Method
VecView(petsclib::PetscLibType, vec::AbstractPetscVec, viewer::PetscViewer)

Views a vector object.

Collective

Input Parameters:

  • vec - the vector
  • viewer - an optional PetscViewer visualization context

Level: beginner

See also: Vec, VecViewFromOptions(), PetscViewerASCIIOpen(), PetscViewerDrawOpen(), PetscDrawLGCreate(), PetscViewerSocketOpen(), PetscViewerBinaryOpen(), VecLoad(), PetscViewerCreate(), PetscRealView(), PetscScalarView(), PetscIntView(), PetscViewerHDF5SetTimestep()

External Links

source
PETSc.LibPETSc.VecViewFromOptions — Method
VecViewFromOptions(petsclib::PetscLibType, A::AbstractPetscVec, obj, name::String)

View a vector based on values in the options database

Collective

Input Parameters:

  • A - the vector
  • obj - optional object that provides the options prefix for this viewing, use NULL to use the prefix of A
  • name - command line option

Options Database Key:

  • -name [viewertype][:...] - option name and values. See PetscObjectViewFromOptions() for the possible arguments

Level: intermediate

See also: Vec, VecView, PetscObjectViewFromOptions(), VecCreate()

External Links

source
PETSc.LibPETSc.VecViewNative — Method
VecViewNative(petsclib::PetscLibType, vec::AbstractPetscVec, viewer::PetscViewer)

Views a vector object with the original type specific viewer

Collective

Input Parameters:

  • vec - the vector
  • viewer - an optional PetscViewer visualization context

Level: developer

See also: Vec, PetscViewerASCIIOpen(), PetscViewerDrawOpen(), PetscDrawLGCreate(), VecView(), PetscViewerSocketOpen(), PetscViewerBinaryOpen(), VecLoad(), PetscViewerCreate(), PetscRealView(), PetscScalarView(), PetscIntView(), PetscViewerHDF5SetTimestep()

External Links

source
PETSc.LibPETSc.VecWAXPY — Method
VecWAXPY(petsclib::PetscLibType, w::AbstractPetscVec, alpha::PetscScalar, x::AbstractPetscVec, y::AbstractPetscVec)

Computes w = alpha x + y.

Logically Collective

Input Parameters:

  • alpha - the scalar
  • x - first vector, multiplied by alpha
  • y - second vector

Output Parameter:

  • w - the result

Level: intermediate

See also: Vec, VecAXPY(), VecAYPX(), VecAXPBY(), VecMAXPY(), VecAXPBYPCZ()

External Links

source
PETSc.LibPETSc.VecWhichBetween — Method
S::IS = VecWhichBetween(petsclib::PetscLibType, VecLow::AbstractPetscVec, V::AbstractPetscVec, VecHigh::AbstractPetscVec)

Creates an index set containing the indices where VecLow < V < VecHigh

Collective

Input Parameters:

  • VecLow - lower bound
  • V - Vector to compare
  • VecHigh - higher bound

Output Parameter:

  • S - The index set containing the indices i where veclow[i] < v[i] < vechigh[i]

Level: advanced

See also: Vec

External Links

source
PETSc.LibPETSc.VecWhichBetweenOrEqual — Method
S::IS = VecWhichBetweenOrEqual(petsclib::PetscLibType, VecLow::AbstractPetscVec, V::AbstractPetscVec, VecHigh::AbstractPetscVec)

Creates an index set containing the indices where VecLow <= V <= VecHigh

Collective

Input Parameters:

  • VecLow - lower bound
  • V - Vector to compare
  • VecHigh - higher bound

Output Parameter:

  • S - The index set containing the indices i where veclow[i] <= v[i] <= vechigh[i]

Level: advanced

See also: Vec

External Links

source
PETSc.LibPETSc.VecWhichEqual — Method
S::IS = VecWhichEqual(petsclib::PetscLibType, Vec1::AbstractPetscVec, Vec2::AbstractPetscVec)

Creates an index set containing the indices where the vectors Vec1 and Vec2 have identical elements.

Collective

Input Parameters:

  • Vec1 - the first vector to compare
  • Vec2 - the second two vector to compare

Output Parameter:

  • S - The index set containing the indices i where vec1[i] == vec2[i]

Level: advanced

See also: Vec

External Links

source
PETSc.LibPETSc.VecWhichGreaterThan — Method
S::IS = VecWhichGreaterThan(petsclib::PetscLibType, Vec1::AbstractPetscVec, Vec2::AbstractPetscVec)

Creates an index set containing the indices where the vectors Vec1 > Vec2

Collective

Input Parameters:

  • Vec1 - the first vector to compare
  • Vec2 - the second vector to compare

Output Parameter:

  • S - The index set containing the indices i where vec1[i] > vec2[i]

Level: advanced

See also: Vec

External Links

source
PETSc.LibPETSc.VecWhichInactive — Method
S::IS = VecWhichInactive(petsclib::PetscLibType, VecLow::AbstractPetscVec, V::AbstractPetscVec, D::AbstractPetscVec, VecHigh::AbstractPetscVec, Strong::PetscBool)

Creates an IS based on a set of vectors

Collective

Input Parameters:

  • VecLow - lower bound
  • V - Vector to compare
  • D - Direction to compare
  • VecHigh - higher bound
  • Strong - indicator for applying strongly inactive test

Output Parameter:

  • S - The index set containing the indices i where the bound is inactive

Level: advanced

See also: Vec

External Links

source
PETSc.LibPETSc.VecWhichLessThan — Method
S::IS = VecWhichLessThan(petsclib::PetscLibType, Vec1::AbstractPetscVec, Vec2::AbstractPetscVec)

Creates an index set containing the indices where the vectors Vec1 < Vec2

Collective

Input Parameters:

  • Vec1 - the first vector to compare
  • Vec2 - the second vector to compare

Output Parameter:

  • S - The index set containing the indices i where vec1[i] < vec2[i]

Level: advanced

See also: Vec

External Links

source
PETSc.LibPETSc.VecZeroEntries — Method
VecZeroEntries(petsclib::PetscLibType, vec::AbstractPetscVec)

puts a 0.0 in each element of a vector

Logically Collective

Input Parameter:

  • vec - The vector

Level: beginner

See also: Vec, VecCreate(), VecSetOptionsPrefix(), VecSet(), VecSetValues()

External Links

source
PETSc.LibPETSc.VecSFischer — Method
VecSFischer(petsclib::PetscLibType, X::AbstractPetscVec, F::AbstractPetscVec, L::AbstractPetscVec, U::AbstractPetscVec, mu::PetscReal, FB::AbstractPetscVec)

Evaluates the Smoothed Fischer-Burmeister function for complementarity problems.

Logically Collective

Input Parameters:

  • X - current point
  • F - function evaluated at x
  • L - lower bounds
  • U - upper bounds
  • mu - smoothing parameter

Output Parameter:

  • FB - The Smoothed Fischer-Burmeister function vector

See also: Vec, VecFischer(), MatDFischer(), MatDSFischer()

External Links

source
PETSc.LibPETSc.VecScale — Method
VecScale(petsclib::PetscLibType, x::AbstractPetscVec, alpha::PetscScalar)

Scales a vector.

Logically Collective

Input Parameters:

  • x - the vector
  • alpha - the scalar

Level: intermediate

See also: Vec, VecSet()

External Links

source
PETSc.LibPETSc.VecScatterBegin — Method
VecScatterBegin(petsclib::PetscLibType, sf::VecScatter, x::AbstractPetscVec, y::AbstractPetscVec, 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 by VecScatterCreate()
  • x - the vector from which we scatter
  • y - the vector to which we scatter
  • addv - either ADD_VALUES, MAX_VALUES, MIN_VALUES or INSERT_VALUES, with INSERT_VALUES mode any location

not scattered to retains its old value; i.e. the vector is NOT first zeroed.

  • mode - the scattering mode, usually SCATTER_FORWARD. The available modes are: SCATTER_FORWARD or SCATTER_REVERSE

Level: intermediate

See also: VecScatter, VecScatterCreate(), VecScatterEnd(), InsertMode, ScatterMode

External Links

source
PETSc.LibPETSc.VecScatterCopy — Method
newsf::VecScatter = VecScatterCopy(petsclib::PetscLibType, sf::VecScatter)

Makes a copy of a scatter context.

Collective

Input Parameter:

  • sf - the scatter context

Output Parameter:

  • newsf - the context copy

Level: advanced

See also: VecScatter, VecScatterType, VecScatterCreate(), VecScatterDestroy()

External Links

source
PETSc.LibPETSc.VecScatterCreate — Method
newsf::VecScatter = VecScatterCreate(petsclib::PetscLibType, x::AbstractPetscVec, ix::AbstractIS, y::AbstractPetscVec, iy::AbstractIS)

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 scatter
  • y - a vector that defines the shape (parallel data layout of the vector) of vectors to which we scatter
  • ix - the indices of x to scatter (if NULL scatters all values)
  • iy - the indices of y to hold results (if NULL fills entire vector yin in 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

See also: VecScatter, VecScatterDestroy(), VecScatterCreateToAll(), VecScatterCreateToZero(), PetscSFCreate(), VecScatterType, InsertMode, ScatterMode, VecScatterBegin(), VecScatterEnd()

External Links

source
PETSc.LibPETSc.VecScatterCreateToAll — Method
ctx::VecScatter,vout::PetscVec = VecScatterCreateToAll(petsclib::PetscLibType, vin::AbstractPetscVec)

Creates a vector and a scatter context that copies all vector values to each processor

Collective

Input Parameter:

  • vin - an MPIVEC

Output Parameters:

  • ctx - scatter context
  • vout - output SEQVEC that is large enough to scatter into

Level: intermediate

See also: VecScatter, VecScatterCreate(), VecScatterCreateToZero(), VecScatterBegin(), VecScatterEnd()

External Links

source
PETSc.LibPETSc.VecScatterCreateToZero — Method
ctx::VecScatter,vout::PetscVec = VecScatterCreateToZero(petsclib::PetscLibType, vin::AbstractPetscVec)

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 - Vec of type MPIVEC

Output Parameters:

  • ctx - scatter context
  • vout - output SEQVEC that is large enough to scatter into on processor 0 and

of length zero on all other processors

Level: intermediate

See also: VecScatter, VecScatterCreate(), VecScatterCreateToAll(), VecScatterBegin(), VecScatterEnd()

External Links

source
PETSc.LibPETSc.VecScatterDestroy — Method
VecScatterDestroy(petsclib::PetscLibType, sf::Union{VecScatter, Ref{VecScatter}})

Destroys a scatter context created by VecScatterCreate()

Collective

Input Parameter:

  • sf - the scatter context

Level: intermediate

See also: VecScatter, VecScatterCreate(), VecScatterCopy()

External Links

source
PETSc.LibPETSc.VecScatterEnd — Method
VecScatterEnd(petsclib::PetscLibType, sf::VecScatter, x::AbstractPetscVec, y::AbstractPetscVec, 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 by VecScatterCreate()
  • x - the vector from which we scatter
  • y - the vector to which we scatter
  • addv - one of ADD_VALUES, MAX_VALUES, MIN_VALUES or INSERT_VALUES
  • mode - the scattering mode, usually SCATTER_FORWARD. The available modes are: SCATTER_FORWARD, SCATTER_REVERSE

Level: intermediate

See also: VecScatter, VecScatterBegin(), VecScatterCreate()

External Links

source
PETSc.LibPETSc.VecScatterFFTWToPetsc — Method
VecScatterFFTWToPetsc(petsclib::PetscLibType, A::AbstractPetscMat, x::AbstractPetscVec, y::AbstractPetscVec)

Converts MATFFTW output vector to a PETSc vector.

Collective

Input Parameters:

  • A - MATFFTW matrix
  • x - FFTW vector

Output Parameter:

  • y - PETSc vector

Level: intermediate

See also: Mat, VecScatterPetscToFFTW(), MATFFTW, MatCreateVecsFFTW()

External Links

source
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 with VecScatterCreate()

Output Parameter:

  • flg - PETSC_TRUE if the VecScatterBegin()/VecScatterEnd() are all done during the VecScatterBegin()

Level: developer

See also: VecScatter, VecScatterCreate(), VecScatterEnd(), VecScatterBegin()

External Links

source
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

See also: VecScatter, VecScatterType, VecScatterSetType(), VecScatterCreate()

External Links

source
PETSc.LibPETSc.VecScatterPetscToFFTW — Method
VecScatterPetscToFFTW(petsclib::PetscLibType, A::AbstractPetscMat, x::AbstractPetscVec, y::AbstractPetscVec)

Copies a PETSc vector to the vector that goes into MATFFTW calls.

Collective

Input Parameters:

  • A - FFTW matrix
  • x - the PETSc vector

Output Parameter:

  • y - the FFTW vector

Level: intermediate

See also: Mat, MATFFTW, VecScatterFFTWToPetsc(), MatCreateVecsFFTW()

External Links

source
PETSc.LibPETSc.VecScatterRegister — Method
VecScatterRegister(petsclib::PetscLibType, sname::String, fnc::external)

Adds a new vector scatter component implementation

Not Collective

Input Parameters:

  • sname - The name of a new user-defined creation routine
  • function - The creation routine

Level: advanced

See also: VecScatter, VecScatterType, VecRegister()

External Links

source
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 context
  • tomap - remapping plan for "to" indices (may be NULL).
  • frommap - remapping plan for "from" indices (may be NULL)

Level: developer

See also: VecScatter, VecScatterCreate()

External Links

source
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

See also: VecScatter, VecScatterCreate(), VecScatterDestroy(), VecScatterSetUp()

External Links

source
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 - The VecScatter object
  • type - The name of the vector scatter type

Options Database Key:

  • -sf_type type - Sets the VecScatterType

Level: intermediate

See also: VecScatter, VecScatterType, VecScatterGetType(), VecScatterCreate()

External Links

source
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

See also: VecScatter, VecScatterCreate(), VecScatterCopy()

External Links

source
PETSc.LibPETSc.VecScatterView — Method
VecScatterView(petsclib::PetscLibType, sf::VecScatter, viewer::PetscViewer)

Views a vector scatter context.

Collective

Input Parameters:

  • sf - the scatter context
  • viewer - the viewer for displaying the context

Level: intermediate

See also: VecScatter, PetscViewer, VecScatterViewFromOptions(), PetscObjectViewFromOptions(), VecScatterCreate()

External Links

source
PETSc.LibPETSc.VecScatterViewFromOptions — Method
VecScatterViewFromOptions(petsclib::PetscLibType, sf::VecScatter, obj, name::String)

View a VecScatter object based on values in the options database

Collective

Input Parameters:

  • sf - the scatter context
  • obj - Optional object
  • name - command line option

Options Database Key:

  • -name [viewertype][:...] - option name and values. See PetscObjectViewFromOptions() for the possible arguments

Level: intermediate

See also: VecScatter, VecScatterView(), PetscObjectViewFromOptions(), VecScatterCreate()

External Links

source
PETSc.LibPETSc.VecSet — Method
VecSet(petsclib::PetscLibType, x::AbstractPetscVec, alpha::PetscScalar)

Sets all components of a vector to a single scalar value.

Logically Collective

Input Parameters:

  • x - the vector
  • alpha - the scalar

Level: beginner

See also: Vec, VecSetValues(), VecSetValuesBlocked(), VecSetRandom()

External Links

source
PETSc.LibPETSc.VecSetBindingPropagates — Method
VecSetBindingPropagates(petsclib::PetscLibType, v::AbstractPetscVec, 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 vector
  • flg - flag indicating whether the boundtocpu flag should be propagated

Level: developer

See also: Vec, MatSetBindingPropagates(), VecGetBindingPropagates()

External Links

source
PETSc.LibPETSc.VecSetBlockSize — Method
VecSetBlockSize(petsclib::PetscLibType, v::AbstractPetscVec, bs::PetscInt)

Sets the block size for future calls to VecSetValuesBlocked() and VecSetValuesBlockedLocal().

Logically Collective

Input Parameters:

  • v - the vector
  • bs - the blocksize

Level: advanced

See also: Vec, VecSetValuesBlocked(), VecSetLocalToGlobalMapping(), VecGetBlockSize()

External Links

source
PETSc.LibPETSc.VecSetDM — Method
VecSetDM(petsclib::PetscLibType, v::AbstractPetscVec, dm::AbstractPetscDM)

Sets the DM defining the data layout of the vector.

Not Collective

Input Parameters:

  • v - The Vec
  • dm - The DM

Level: developer

See also: DM, VecGetDM(), DMGetLocalVector(), DMGetGlobalVector(), DMSetVecType()

External Links

source
PETSc.LibPETSc.VecSetFromOptions — Method
VecSetFromOptions(petsclib::PetscLibType, vec::AbstractPetscVec)

Configures the vector from the options database.

Collective

Input Parameter:

  • vec - The vector

Level: beginner

See also: Vec, VecCreate(), VecSetOptionsPrefix()

External Links

source
PETSc.LibPETSc.VecSetLayout — Method
VecSetLayout(petsclib::PetscLibType, x::AbstractPetscVec, map::PetscLayout)

set PetscLayout describing vector layout

Not Collective

Input Parameters:

  • x - the vector
  • map - the layout

Level: developer

See also: Vec, PetscLayout, VecGetLayout(), VecGetSize(), VecGetOwnershipRange(), VecGetOwnershipRanges()

External Links

source
PETSc.LibPETSc.VecSetLocalToGlobalMapping — Method
VecSetLocalToGlobalMapping(petsclib::PetscLibType, x::AbstractPetscVec, 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 - vector
  • mapping - mapping created with ISLocalToGlobalMappingCreate() or ISLocalToGlobalMappingCreateIS()

Level: intermediate

See also: Vec, VecAssemblyBegin(), VecAssemblyEnd(), VecSetValues(), VecSetValuesLocal(), VecGetLocalToGlobalMapping(), VecSetValuesBlockedLocal()

External Links

source
PETSc.LibPETSc.VecSetOperation — Method
VecSetOperation(petsclib::PetscLibType, vec::AbstractPetscVec, op::VecOperation, f::Ptr{Cvoid})

Allows the user to override a particular vector operation.

Logically Collective; No Fortran Support

Input Parameters:

  • vec - The vector to modify
  • op - The name of the operation
  • f - The function that provides the operation.

Level: advanced

See also: Vec, VecCreate(), VecGetOperation(), MatSetOperation(), MatShellSetOperation()

External Links

source
PETSc.LibPETSc.VecSetOption — Method
VecSetOption(petsclib::PetscLibType, x::AbstractPetscVec, op::VecOption, flag::PetscBool)

Sets an option for controlling a vector's behavior with VecSetValues() and related routines

Collective

Input Parameters:

  • x - the vector
  • op - the VecOption
  • flag - turn the option on or off

Level: intermediate

See also: Vec, VecSetValues(), VecOption, MatSetOption()

External Links

source
PETSc.LibPETSc.VecSetOptionsPrefix — Method
VecSetOptionsPrefix(petsclib::PetscLibType, v::AbstractPetscVec, prefix::String)

Sets the prefix used for searching for all Vec options in the database.

Logically Collective

Input Parameters:

  • v - the Vec context
  • prefix - the prefix to prepend to all option names

Level: advanced

See also: Vec, VecSetFromOptions()

External Links

source
PETSc.LibPETSc.VecSetPinnedMemoryMin — Method
VecSetPinnedMemoryMin(petsclib::PetscLibType, v::AbstractPetscVec, 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 vector
  • mbytes - 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

See also: Vec, VecGetPinnedMemoryMin()

External Links

source
PETSc.LibPETSc.VecSetPreallocationCOO — Method
VecSetPreallocationCOO(petsclib::PetscLibType, x::AbstractPetscVec, 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 preallocated
  • ncoo - number of entries
  • coo_i - entry indices

Level: beginner

See also: Vec, VecSetValuesCOO(), VecSetPreallocationCOOLocal()

External Links

source
PETSc.LibPETSc.VecSetPreallocationCOOLocal — Method
VecSetPreallocationCOOLocal(petsclib::PetscLibType, x::AbstractPetscVec, 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 preallocated
  • ncoo - number of entries
  • coo_i - row indices (local numbering; may be modified)

Level: beginner

See also: Vec, VecSetPreallocationCOO(), VecSetValuesCOO()

External Links

source
PETSc.LibPETSc.VecSetRandom — Method
VecSetRandom(petsclib::PetscLibType, x::AbstractPetscVec, rctx::PetscRandom)

Sets all components of a vector to random numbers.

Logically Collective

Input Parameters:

  • x - the vector
  • rctx - the random number context, formed by PetscRandomCreate(), or use NULL and it will create one internally.

Output Parameter:

  • x - the vector

Example of Usage: $PetscRandomCreate(PETSC_COMM_WORLD,&rctx); VecSetRandom(x,rctx); PetscRandomDestroy(&rctx);$

Level: intermediate

See also: Vec, VecSet(), VecSetValues(), PetscRandomCreate(), PetscRandomDestroy()

External Links

source
PETSc.LibPETSc.VecSetRandomGaussian — Method
VecSetRandomGaussian(petsclib::PetscLibType, v::AbstractPetscVec, rng::PetscRandom, mean::PetscReal, std_dev::PetscReal)

Fills a vector with Gaussian random values of the given mean and standard deviation.

Collective

Input Parameters:

  • v - the vector to fill
  • rng - PETSc random number generator
  • mean - desired mean of the Gaussian samples
  • std_dev - desired standard deviation

Level: advanced

See also: PetscDA, PetscRandom, PetscRandomSetInterval(), VecSetRandom()

External Links

source
PETSc.LibPETSc.VecSetSizes — Method
VecSetSizes(petsclib::PetscLibType, v::AbstractPetscVec, n::PetscInt, M_N::PetscInt)

Sets the local and global sizes, and checks to determine compatibility of the sizes

Collective

Input Parameters:

  • v - the vector
  • n - the local size (or PETSC_DECIDE to have it set)
  • N - the global size (or PETSC_DETERMINE to have it set)

Level: intermediate

See also: Vec, VecCreate(), VecCreateSeq(), VecCreateMPI(), VecGetSize(), PetscSplitOwnership(), PetscLayout, VecGetOwnershipRange(), VecGetOwnershipRanges(), MatSetSizes()

External Links

source
PETSc.LibPETSc.VecSetType — Method
VecSetType(petsclib::PetscLibType, vec::AbstractPetscVec, newType::String)

Builds a vector, for a particular vector implementation.

Collective

Input Parameters:

  • vec - The vector object
  • newType - The name of the vector type

Options Database Key:

  • -vec_type type - Sets the vector type; see VecType

Level: intermediate

See also: Vec, VecType, VecGetType(), VecCreate(), VecDuplicate(), VecDuplicateVecs()

External Links

source
PETSc.LibPETSc.VecSetUp — Method
VecSetUp(petsclib::PetscLibType, v::AbstractPetscVec)

Sets up the internal vector data structures for the later use.

Collective

Input Parameter:

  • v - the Vec context

Level: advanced

See also: Vec, VecCreate(), VecDestroy()

External Links

source
PETSc.LibPETSc.VecSetValues — Method
VecSetValues(petsclib::PetscLibType, x::AbstractPetscVec, 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 in
  • ni - number of elements to add
  • ix - indices where to add
  • y - array of values. Pass NULL to set all zeroes.
  • iora - either INSERT_VALUES to replace the current values or ADD_VALUES to add values to any existing entries

Level: beginner

See also: Vec, VecAssemblyBegin(), VecAssemblyEnd(), VecSetValuesLocal(), VecSetValue(), VecSetValuesBlocked(), InsertMode, INSERT_VALUES, ADD_VALUES, VecGetValues(), VecOption, VecSetOption()

External Links

source
PETSc.LibPETSc.VecSetValuesBlocked — Method
VecSetValuesBlocked(petsclib::PetscLibType, x::AbstractPetscVec, 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 in
  • ni - number of blocks to add
  • ix - indices where to add in block count, rather than element count
  • y - array of values. Pass NULL to set all zeroes.
  • iora - either INSERT_VALUES replaces existing entries with new values, ADD_VALUES, adds values to any existing entries

Level: intermediate

See also: Vec, VecAssemblyBegin(), VecAssemblyEnd(), VecSetValuesBlockedLocal(), VecSetValues()

External Links

source
PETSc.LibPETSc.VecSetValuesBlockedLocal — Method
VecSetValuesBlockedLocal(petsclib::PetscLibType, x::AbstractPetscVec, 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 in
  • ni - number of blocks to add
  • ix - indices where to add in block count, not element count
  • y - array of values. Pass NULL to set all zeroes.
  • iora - either INSERT_VALUES replaces existing entries with new values, ADD_VALUES adds values to any existing entries

Level: intermediate

See also: Vec, VecAssemblyBegin(), VecAssemblyEnd(), VecSetValues(), VecSetValuesBlocked(), VecSetLocalToGlobalMapping()

External Links

source
PETSc.LibPETSc.VecSetValuesCOO — Method
VecSetValuesCOO(petsclib::PetscLibType, x::AbstractPetscVec, coo_v::Vector{PetscScalar}, imode::InsertMode)

set values at once in a vector preallocated using VecSetPreallocationCOO()

Collective

Input Parameters:

  • x - vector being set
  • coo_v - the value array
  • imode - the insert mode

Level: beginner

See also: Vec, VecSetPreallocationCOO(), VecSetPreallocationCOOLocal(), VecSetValues()

External Links

source
PETSc.LibPETSc.VecSetValuesLocal — Method
VecSetValuesLocal(petsclib::PetscLibType, x::AbstractPetscVec, 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 in
  • ni - number of elements to add
  • ix - indices where to add
  • y - array of values. Pass NULL to set all zeroes.
  • iora - either INSERT_VALUES replaces existing entries with new values, ADD_VALUES adds values to any existing entries

Level: intermediate

See also: Vec, VecAssemblyBegin(), VecAssemblyEnd(), VecSetValues(), VecSetLocalToGlobalMapping(), VecSetValuesBlockedLocal()

External Links

source
PETSc.LibPETSc.VecSetValuesSection — Method
VecSetValuesSection(petsclib::PetscLibType, v::AbstractPetscVec, 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 - the Vec
  • s - the organizing PetscSection
  • point - the point
  • values - the array of input values
  • mode - the insertion mode, either ADD_VALUES or INSERT_VALUES

Level: developer

See also: PetscSection, PetscSectionCreate(), VecGetValuesSection()

External Links

source
PETSc.LibPETSc.VecShift — Method
VecShift(petsclib::PetscLibType, v::AbstractPetscVec, shift::PetscScalar)

Shifts all of the components of a vector by computing x[i] = x[i] + shift.

Logically Collective

Input Parameters:

  • v - the vector
  • shift - the shift

Level: intermediate

See also: Vec, VecISShift()

External Links

source
PETSc.LibPETSc.VecSqrtAbs — Method
VecSqrtAbs(petsclib::PetscLibType, v::AbstractPetscVec)

Replaces each component of a vector by the square root of its magnitude.

Not Collective

Input Parameter:

  • v - The vector

Level: beginner

See also: Vec, VecLog(), VecExp(), VecReciprocal(), VecAbs()

External Links

source
PETSc.LibPETSc.VecStashGetInfo — Method
nstash::PetscInt,reallocs::PetscInt,bnstash::PetscInt,breallocs::PetscInt = VecStashGetInfo(petsclib::PetscLibType, vec::AbstractPetscVec)

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 stash
  • reallocs - the number of additional mallocs incurred in building the stash
  • bnstash - the size of the block stash
  • breallocs - the number of additional mallocs incurred in building the block stash (from VecSetValuesBlocked())

Level: advanced

See also: Vec, VecAssemblyBegin(), VecAssemblyEnd(), VecStashSetInitialSize(), VecStashView()

External Links

source
PETSc.LibPETSc.VecStashSetInitialSize — Method
VecStashSetInitialSize(petsclib::PetscLibType, vec::AbstractPetscVec, size::PetscInt, bsize::PetscInt)

sets the sizes of the vec-stash, that is 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 vector
  • size - 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

See also: Vec, VecSetBlockSize(), VecSetValues(), VecSetValuesBlocked(), VecStashView()

External Links

source
PETSc.LibPETSc.VecStashView — Method
VecStashView(petsclib::PetscLibType, v::AbstractPetscVec, viewer::PetscViewer)

Prints the entries in the vector stash and block stash.

Collective

Input Parameters:

  • v - the vector
  • viewer - the viewer

Level: advanced

See also: Vec, VecSetBlockSize(), VecSetValues(), VecSetValuesBlocked()

External Links

source
PETSc.LibPETSc.VecStashViewFromOptions — Method
VecStashViewFromOptions(petsclib::PetscLibType, obj::AbstractPetscVec, bobj, name::String)

Processes command line options to determine if/how a VecStash object is to be viewed.

Collective

Input Parameters:

  • obj - the Vec containing a stash
  • bobj - optional other object that provides the prefix
  • name - option to activate viewing

Options Database Key:

  • -name [viewertype][:...] - option name and values. See PetscObjectViewFromOptions() for the possible arguments

Level: intermediate

See also: Vec, VecStashSetInitialSize()

External Links

source
PETSc.LibPETSc.VecStepBoundInfo — Method
boundmin::PetscReal,wolfemin::PetscReal,boundmax::PetscReal = VecStepBoundInfo(petsclib::PetscLibType, X::AbstractPetscVec, DX::AbstractPetscVec, XL::AbstractPetscVec, XU::AbstractPetscVec)

See below

Collective

Input Parameters:

  • X - vector with no negative entries
  • XL - lower bounds
  • XU - upper bounds
  • DX - step direction, can have negative, positive or zero entries

Output Parameters:

  • boundmin - (may be NULL this it is not computed) maximum value so that XL[i] <= X[i] + boundmax*DX[i] <= XU[i]
  • wolfemin - (may be NULL this it is not computed)
  • boundmax - (may be NULL this it is not computed) minimum value so that X[i] + boundmaxDX[i] <= XL[i] or XU[i] <= X[i] + boundmaxDX[i]

Level: advanced

See also: Vec

External Links

source
PETSc.LibPETSc.VecStepMax — Method
step::PetscReal = VecStepMax(petsclib::PetscLibType, X::AbstractPetscVec, DX::AbstractPetscVec)

Returns the largest value so that x[i] + step*DX[i] >= 0 for all i

Collective

Input Parameters:

  • X - vector with no negative entries
  • DX - 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

See also: Vec

External Links

source
PETSc.LibPETSc.VecStepMaxBounded — Method
stepmax::PetscReal = VecStepMaxBounded(petsclib::PetscLibType, X::AbstractPetscVec, DX::AbstractPetscVec, XL::AbstractPetscVec, XU::AbstractPetscVec)

See below

Collective

Input Parameters:

  • X - vector with no negative entries
  • XL - lower bounds
  • XU - upper bounds
  • DX - 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

See also: Vec

External Links

source
PETSc.LibPETSc.VecStrideGather — Method
VecStrideGather(petsclib::PetscLibType, v::AbstractPetscVec, start::PetscInt, s::AbstractPetscVec, addv::InsertMode)

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

Collective

Input Parameters:

  • v - the vector
  • start - starting point of the subvector (defined by a stride)
  • addv - one of ADD_VALUES, INSERT_VALUES, MAX_VALUES

Output Parameter:

  • s - the location where the subvector is stored

Level: advanced

See also: Vec, VecStrideNorm(), VecStrideScatter(), VecStrideMin(), VecStrideMax(), VecStrideGatherAll(), VecStrideScatterAll()

External Links

source
PETSc.LibPETSc.VecStrideGatherAll — Method
VecStrideGatherAll(petsclib::PetscLibType, v::AbstractPetscVec, s::Vector{<:AbstractPetscVec}, addv::InsertMode)

Gathers all the single components from a multi-component vector into separate vectors.

Collective

Input Parameters:

  • v - the vector
  • addv - one of ADD_VALUES, INSERT_VALUES, MAX_VALUES

Output Parameter:

  • s - the location where the subvectors are stored

Level: advanced

See also: Vec, VecStrideNorm(), VecStrideScatter(), VecStrideMin(), VecStrideMax(), VecStrideGather(), VecStrideScatterAll()

External Links

source
PETSc.LibPETSc.VecStrideMax — Method
idex::PetscInt,nrm::PetscReal = VecStrideMax(petsclib::PetscLibType, v::AbstractPetscVec, 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 vector
  • start - starting point of the subvector (defined by a stride)

Output Parameters:

  • idex - the location where the maximum occurred (pass NULL if not required)
  • nrm - the maximum value in the subvector

Level: advanced

See also: Vec, VecMax(), VecStrideNorm(), VecStrideGather(), VecStrideScatter(), VecStrideMin()

External Links

source
PETSc.LibPETSc.VecStrideMaxAll — Method
VecStrideMaxAll(petsclib::PetscLibType, v::AbstractPetscVec, idex::Vector{PetscInt}, nrm::Vector{PetscReal})

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, pass NULL,

if you need this, send mail to petsc-maint@mcs.anl.gov to request it)

  • nrm - the maximum values of each subvector

Level: advanced

See also: Vec, VecMax(), VecStrideNorm(), VecStrideGather(), VecStrideScatter(), VecStrideMin()

External Links

source
PETSc.LibPETSc.VecStrideMin — Method
idex::PetscInt,nrm::PetscReal = VecStrideMin(petsclib::PetscLibType, v::AbstractPetscVec, 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 vector
  • start - starting point of the subvector (defined by a stride)

Output Parameters:

  • idex - the location where the minimum occurred. (pass NULL if not required)
  • nrm - the minimum value in the subvector

Level: advanced

See also: Vec, VecMin(), VecStrideNorm(), VecStrideGather(), VecStrideScatter(), VecStrideMax()

External Links

source
PETSc.LibPETSc.VecStrideMinAll — Method
VecStrideMinAll(petsclib::PetscLibType, v::AbstractPetscVec, idex::Vector{PetscInt}, nrm::Vector{PetscReal})

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, pass NULL,

if you need this, send mail to petsc-maint@mcs.anl.gov to request it)

  • nrm - the minimums of each subvector

Level: advanced

See also: Vec, VecMin(), VecStrideNorm(), VecStrideGather(), VecStrideScatter(), VecStrideMax()

External Links

source
PETSc.LibPETSc.VecStrideNorm — Method
nrm::PetscReal = VecStrideNorm(petsclib::PetscLibType, v::AbstractPetscVec, 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 vector
  • start - starting point of the subvector (defined by a stride)
  • ntype - type of norm, one of NORM_1, NORM_2, NORM_INFINITY

Output Parameter:

  • nrm - the norm

Level: advanced

See also: Vec, VecNorm(), VecStrideGather(), VecStrideScatter(), VecStrideMin(), VecStrideMax()

External Links

source
PETSc.LibPETSc.VecStrideNormAll — Method
VecStrideNormAll(petsclib::PetscLibType, v::AbstractPetscVec, ntype::NormType, nrm::Vector{PetscReal})

Computes the norms of subvectors of a vector defined by a starting point and a stride.

Collective

Input Parameters:

  • v - the vector
  • ntype - type of norm, one of NORM_1, NORM_2, NORM_INFINITY

Output Parameter:

  • nrm - the norms

Level: advanced

See also: Vec, VecNorm(), VecStrideGather(), VecStrideScatter(), VecStrideMin(), VecStrideMax()

External Links

source
PETSc.LibPETSc.VecStrideScale — Method
VecStrideScale(petsclib::PetscLibType, v::AbstractPetscVec, start::PetscInt, scale::PetscScalar)

Scales a subvector of a vector defined by a starting point and a stride.

Logically Collective

Input Parameters:

  • v - the vector
  • start - starting point of the subvector (defined by a stride)
  • scale - value to multiply each subvector entry by

Level: advanced

See also: Vec, VecNorm(), VecStrideGather(), VecStrideScatter(), VecStrideMin(), VecStrideMax()

External Links

source
PETSc.LibPETSc.VecStrideScaleAll — Method
VecStrideScaleAll(petsclib::PetscLibType, v::AbstractPetscVec, scales::Vector{PetscScalar})

Scales the subvectors of a vector defined by a starting point and a stride.

Logically Collective

Input Parameters:

  • v - the vector
  • scales - values to multiply each subvector entry by

Level: advanced

See also: Vec, VecNorm(), VecStrideScale(), VecScale(), VecStrideGather(), VecStrideScatter(), VecStrideMin(), VecStrideMax()

External Links

source
PETSc.LibPETSc.VecStrideScatter — Method
VecStrideScatter(petsclib::PetscLibType, s::AbstractPetscVec, start::PetscInt, v::AbstractPetscVec, addv::InsertMode)

Scatters a single component from a vector into a multi-component vector.

Collective

Input Parameters:

  • s - the single-component vector
  • start - starting point of the subvector (defined by a stride)
  • addv - one of ADD_VALUES, INSERT_VALUES, MAX_VALUES

Output Parameter:

  • v - the location where the subvector is scattered (the multi-component vector)

Level: advanced

See also: Vec, VecStrideNorm(), VecStrideGather(), VecStrideMin(), VecStrideMax(), VecStrideGatherAll(), VecStrideScatterAll(), VecStrideSubSetScatter(), VecStrideSubSetGather()

External Links

source
PETSc.LibPETSc.VecStrideScatterAll — Method
VecStrideScatterAll(petsclib::PetscLibType, s::Vector{<:AbstractPetscVec}, v::AbstractPetscVec, 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 stored
  • addv - one of ADD_VALUES, INSERT_VALUES, MAX_VALUES

Output Parameter:

  • v - the multicomponent vector

Level: advanced

See also: Vec, VecStrideNorm(), VecStrideScatter(), VecStrideMin(), VecStrideMax(), VecStrideGather()

External Links

source
PETSc.LibPETSc.VecStrideSet — Method
VecStrideSet(petsclib::PetscLibType, v::AbstractPetscVec, 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 vector
  • start - starting point of the subvector (defined by a stride)
  • s - value to set for each entry in that subvector

Level: advanced

See also: Vec, VecNorm(), VecStrideGather(), VecStrideScatter(), VecStrideMin(), VecStrideMax(), VecStrideScale()

External Links

source
PETSc.LibPETSc.VecStrideSubSetGather — Method
VecStrideSubSetGather(petsclib::PetscLibType, v::AbstractPetscVec, nidx::PetscInt, idxv::Vector{PetscInt}, idxs::Vector{PetscInt}, s::AbstractPetscVec, addv::InsertMode)

Gathers a subset of components from a multi-component vector into another vector.

Collective

Input Parameters:

  • v - the vector
  • nidx - the number of indices
  • idxv - the indices of the components 0 <= idxv[0] ...idxv[nidx-1] < bs(v), they need not be sorted
  • idxs - 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 is PETSC_DETERMINE
  • addv - one of ADD_VALUES, INSERT_VALUES, MAX_VALUES

Output Parameter:

  • s - the location where the subvector is stored

Level: advanced

See also: Vec, VecStrideNorm(), VecStrideScatter(), VecStrideGather(), VecStrideSubSetScatter(), VecStrideMin(), VecStrideMax(), VecStrideGatherAll(), VecStrideScatterAll()

External Links

source
PETSc.LibPETSc.VecStrideSubSetScatter — Method
VecStrideSubSetScatter(petsclib::PetscLibType, s::AbstractPetscVec, nidx::PetscInt, idxs::Vector{PetscInt}, idxv::Vector{PetscInt}, v::AbstractPetscVec, addv::InsertMode)

Scatters components from a vector into a subset of components of a multi-component vector.

Collective

Input Parameters:

  • s - the smaller-component vector
  • nidx - the number of indices in idx
  • idxs - 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 is PETSC_DETERMINE
  • idxv - the indices of the components in the larger-component vector, 0 <= idx[0] ...idx[nidx-1] < bs(v) they need not be sorted
  • addv - one of ADD_VALUES, INSERT_VALUES, MAX_VALUES

Output Parameter:

  • v - the location where the subvector is into scattered (the multi-component vector)

Level: advanced

See also: Vec, VecStrideNorm(), VecStrideGather(), VecStrideSubSetGather(), VecStrideMin(), VecStrideMax(), VecStrideGatherAll(), VecStrideScatterAll()

External Links

source
PETSc.LibPETSc.VecStrideSum — Method
sum::PetscScalar = VecStrideSum(petsclib::PetscLibType, v::AbstractPetscVec, start::PetscInt)

Computes the sum of subvector of a vector defined by a starting point and a stride.

Collective

Input Parameters:

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

Output Parameter:

  • sum - the sum

Level: advanced

See also: Vec, VecSum(), VecStrideGather(), VecStrideScatter(), VecStrideMin(), VecStrideMax()

External Links

source
PETSc.LibPETSc.VecStrideSumAll — Method
VecStrideSumAll(petsclib::PetscLibType, v::AbstractPetscVec, sums::Vector{PetscScalar})

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

See also: Vec, VecSum(), VecStrideGather(), VecStrideScatter(), VecStrideMin(), VecStrideMax()

External Links

source
PETSc.LibPETSc.VecSum — Method
sum::PetscScalar = VecSum(petsclib::PetscLibType, v::AbstractPetscVec)

Computes the sum of all the components of a vector.

Collective

Input Parameter:

  • v - the vector

Output Parameter:

  • sum - the result

Level: beginner

See also: Vec, VecMean(), VecNorm()

External Links

source
PETSc.LibPETSc.VecSwap — Method
VecSwap(petsclib::PetscLibType, x::AbstractPetscVec, y::AbstractPetscVec)

Swaps the values between two vectors, x and y.

Logically Collective

Input Parameters:

  • x - the first vector
  • y - the second vector

Level: advanced

See also: Vec, VecSet()

External Links

source
PETSc.LibPETSc.VecsCreateSeq — Method
x::Vecs = VecsCreateSeq(petsclib::PetscLibType, comm::MPI_Comm, p::PetscInt, m::PetscInt)

Creates a Vecs object holding p sequential Vecs of length m, all stored contiguously in a single underlying Vec

Collective

Input Parameters:

  • comm - the MPI communicator (typically PETSC_COMM_SELF)
  • p - the number of vectors
  • m - the length of each vector

Output Parameter:

  • x - the newly created Vecs

Level: advanced

See also: Vecs, VecsCreateSeqWithArray(), VecsDuplicate(), VecsDestroy(), VecCreateSeq()

External Links

source
PETSc.LibPETSc.VecsCreateSeqWithArray — Method
a::PetscScalar,x::Vecs = VecsCreateSeqWithArray(petsclib::PetscLibType, comm::MPI_Comm, p::PetscInt, m::PetscInt)

Creates a Vecs object holding p sequential Vecs of length m that use a user-provided contiguous array as storage

Collective

Input Parameters:

  • comm - the MPI communicator (typically PETSC_COMM_SELF)
  • p - the number of vectors
  • m - the length of each vector
  • a - the array of length p*m used as storage for the vectors

Output Parameter:

  • x - the newly created Vecs

Level: advanced

See also: Vecs, VecsCreateSeq(), VecsDuplicate(), VecsDestroy(), VecCreateSeqWithArray()

External Links

source
PETSc.LibPETSc.VecsDestroy — Method
VecsDestroy(petsclib::PetscLibType, x::Vecs)

Destroys a Vecs collection of vectors

Collective

Input Parameter:

  • x - the Vecs object to destroy

Level: advanced

See also: Vecs, VecsCreateSeq(), VecsCreateSeqWithArray(), VecsDuplicate()

External Links

source
PETSc.LibPETSc.VecsDuplicate — Method
y::Vecs = VecsDuplicate(petsclib::PetscLibType, x::Vecs)

Creates a new Vecs with the same size and layout as an existing Vecs, but does not copy the values

Collective

Input Parameter:

  • x - the existing Vecs

Output Parameter:

  • y - the newly created Vecs

Level: advanced

See also: Vecs, VecsCreateSeq(), VecsCreateSeqWithArray(), VecsDestroy(), VecDuplicate()

External Links

source
PETSc.LibPETSc.VecTaggerAbsoluteGetBox — Method
box::Ptr{VecTaggerBox} = VecTaggerAbsoluteGetBox(petsclib::PetscLibType, tagger::VecTagger)

Get the box defining the values to be tagged by the tagger.

Logically Collective

Input Parameter:

  • tagger - the VecTagger context

Output Parameter:

  • box - the box: a blocksize array of VecTaggerBox boxes

Level: advanced

See also: VecTagger, VecTaggerBox, VecTaggerAbsoluteSetBox()

External Links

source
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 - the VecTagger context
  • box - the box: a blocksize array of VecTaggerBox boxes

Level: advanced

See also: VecTagger, VecTaggerBox, VecTaggerAbsoluteGetBox()

External Links

source
PETSc.LibPETSc.VecTaggerAndGetSubs — Method
nsubs::PetscInt,subs::Vector{VecTagger} = VecTaggerAndGetSubs(petsclib::PetscLibType, tagger::VecTagger)

Get the sub VecTaggers whose intersection defines the outer VecTagger

Not Collective

Input Parameter:

  • tagger - the VecTagger context

Output Parameters:

  • nsubs - the number of sub VecTaggers
  • subs - the sub VecTaggers

Level: advanced

See also: VecTagger, VecTaggerAndSetSubs()

External Links

source
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 - the VecTagger context
  • nsubs - the number of sub VecTaggers
  • subs - the sub VecTaggers
  • mode - the copy mode to use for subs

Level: advanced

See also: VecTagger

External Links

source
PETSc.LibPETSc.VecTaggerCDFGetBox — Method
box::Ptr{VecTaggerBox} = VecTaggerCDFGetBox(petsclib::PetscLibType, tagger::VecTagger)

Get the cumulative box (multi-dimensional 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 Parameter:

  • tagger - the VecTagger context

Output Parameter:

  • box - a blocksize array of VecTaggerBox boxes

Level: advanced

See also: VecTagger, VecTaggerCDFSetBox(), VecTaggerBox

External Links

source
PETSc.LibPETSc.VecTaggerCDFGetMethod — Method
method::VecTaggerCDFMethod = VecTaggerCDFGetMethod(petsclib::PetscLibType, tagger::VecTagger)

Get the method used to compute absolute boxes from CDF boxes

Logically Collective

Input Parameter:

  • tagger - the VecTagger context

Output Parameter:

  • method - the method

Level: advanced

See also: Vec, VecTagger, VecTaggerCDFMethod

External Links

source
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 - the VecTagger context

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 guess
  • atol - the acceptable absolute tolerance in the absolute values from the initial guess

Level: advanced

See also: VecTagger, VecTaggerCDFSetMethod()

External Links

source
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 - the VecTagger context
  • 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 guess
  • atol - the acceptable absolute tolerance in the absolute values from the initial guess

Level: advanced

See also: VecTagger, VecTaggerCDFSetMethod()

External Links

source
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 - the VecTagger context
  • box - a blocksize array of VecTaggerBox boxes

Level: advanced

See also: VecTagger, VecTaggerCDFGetBox(), VecTaggerBox

External Links

source
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 - the VecTagger context
  • method - the method

Level: advanced

See also: Vec, VecTagger, VecTaggerCDFMethod

External Links

source
PETSc.LibPETSc.VecTaggerComputeBoxes — Method
numBoxes::PetscInt,boxes::Vector{VecTaggerBox},listed::PetscBool = VecTaggerComputeBoxes(petsclib::PetscLibType, tagger::VecTagger, vec::AbstractPetscVec)

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 - the VecTagger context
  • vec - the vec to tag

Output Parameters:

  • numBoxes - the number of boxes in the tag definition
  • boxes - a newly allocated list of boxes. This is a flat array of (BlockSize * numBoxes) pairs that the user can free with PetscFree().
  • listed - PETSC_TRUE if a list was created, pass in NULL if not needed

Level: advanced

See also: VecTaggerComputeIS(), VecTagger, VecTaggerCreate()

External Links

source
PETSc.LibPETSc.VecTaggerComputeIS — Method
listed::PetscBool = VecTaggerComputeIS(petsclib::PetscLibType, tagger::VecTagger, vec::AbstractPetscVec, is::Vector{<:AbstractIS})

Use a VecTagger context to tag a set of indices based on a vector's values

Collective

Input Parameters:

  • tagger - the VecTagger context
  • vec - 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 is VecGetLocalSize() and bs is VecTaggerGetBlockSize().
  • listed - routine was able to compute the IS, pass in NULL if not needed

Level: advanced

See also: VecTaggerComputeBoxes(), VecTagger, VecTaggerCreate()

External Links

source
PETSc.LibPETSc.VecTaggerCreate — Method
tagger::VecTagger = VecTaggerCreate(petsclib::PetscLibType, comm::MPI_Comm)

create a VecTagger context.

Collective

Input Parameter:

  • comm - communicator on which the VecTagger will operate

Output Parameter:

  • tagger - new Vec tagger context

Level: advanced

See also: VecTagger, VecTaggerSetBlockSize(), VecTaggerSetFromOptions(), VecTaggerSetUp(), VecTaggerComputeIS(), VecTaggerComputeBoxes(), VecTaggerDestroy()

External Links

source
PETSc.LibPETSc.VecTaggerDestroy — Method
VecTaggerDestroy(petsclib::PetscLibType, tagger::Union{VecTagger, Ref{VecTagger}})

destroy a VecTagger context

Collective

Input Parameter:

  • tagger - address of tagger

Level: advanced

See also: VecTaggerCreate(), VecTaggerSetType(), VecTagger

External Links

source
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

See also: VecTaggerComputeIS(), VecTaggerSetBlockSize(), VecTagger, VecTaggerCreate()

External Links

source
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_TRUE to invert, PETSC_FALSE to use the indices as is

Level: advanced

See also: VecTaggerComputeIS(), VecTaggerSetInvert(), VecTagger, VecTaggerCreate()

External Links

source
PETSc.LibPETSc.VecTaggerGetType — Method
type::String = VecTaggerGetType(petsclib::PetscLibType, tagger::VecTagger)

Gets the VecTaggerType name (as a string) from the VecTagger.

Not Collective

Input Parameter:

  • tagger - The VecTagger context

Output Parameter:

  • type - The VecTagger type name

Level: advanced

See also: VecTaggerSetType(), VecTaggerCreate(), VecTaggerSetFromOptions(), VecTagger, VecTaggerType

External Links

source
PETSc.LibPETSc.VecTaggerOrGetSubs — Method
nsubs::PetscInt,subs::Vector{VecTagger} = VecTaggerOrGetSubs(petsclib::PetscLibType, tagger::VecTagger)

Get the sub VecTaggers whose union defines the outer VecTagger

Not Collective

Input Parameter:

  • tagger - the VecTagger context

Output Parameters:

  • nsubs - the number of sub VecTaggers
  • subs - the sub VecTaggers

Level: advanced

See also: VecTaggerOrSetSubs()

External Links

source
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 - the VecTagger context
  • nsubs - the number of sub VecTaggers
  • subs - the sub VecTaggers
  • mode - the copy mode to use for subs

Level: advanced

See also: VecTaggetOrGetStubs()

External Links

source
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 implementation
  • function - routine to create method context

Level: advanced

See also: VecTaggerType, VecTaggerCreate(), VecTagger, VecTaggerRegisterAll(), VecTaggerRegisterDestroy()

External Links

source
PETSc.LibPETSc.VecTaggerRelativeGetBox — Method
box::Ptr{VecTaggerBox} = VecTaggerRelativeGetBox(petsclib::PetscLibType, tagger::VecTagger)

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

See also: VecTaggerRelativeSetBox()

External Links

source
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 context
  • box - a blocksize list of VecTaggerBox boxes

Level: advanced

See also: VecTaggerRelativeGetBox()

External Links

source
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 tagger
  • blocksize - block size of the criteria used to tagger vectors

Level: advanced

See also: VecTaggerComputeIS(), VecTaggerGetBlockSize(), VecSetBlockSize(), VecGetBlockSize(), VecTagger, VecTaggerCreate()

External Links

source
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, see VecTaggerSetType()
  • -vec_tagger_block_size - set the block size, see VecTaggerSetBlockSize()
  • -vec_tagger_invert - invert the index set returned by VecTaggerComputeIS()

Level: advanced

See also: VecTagger, VecTaggerCreate(), VecTaggerSetUp()

External Links

source
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 tagger
  • invert - PETSC_TRUE to invert, PETSC_FALSE to use the indices as is

Level: advanced

See also: VecTaggerComputeIS(), VecTaggerGetInvert(), VecTagger, VecTaggerCreate()

External Links

source
PETSc.LibPETSc.VecTaggerSetType — Method
VecTaggerSetType(petsclib::PetscLibType, tagger::VecTagger, type::String)

set the Vec tagger implementation

Collective

Input Parameters:

  • tagger - the VecTagger context
  • type - a known method

Options Database Key:

  • -vec_tagger_type type - Sets the method; see VecTaggerType

Level: advanced

See also: VecTaggerType, VecTaggerCreate(), VecTagger

External Links

source
PETSc.LibPETSc.VecTaggerSetUp — Method
VecTaggerSetUp(petsclib::PetscLibType, tagger::VecTagger)

set up a VecTagger context

Collective

Input Parameter:

  • tagger - Vec tagger object

Level: advanced

See also: VecTaggerSetFromOptions(), VecTaggerSetType(), VecTagger, VecTaggerCreate()

External Links

source
PETSc.LibPETSc.VecTaggerView — Method
VecTaggerView(petsclib::PetscLibType, tagger::VecTagger, viewer::PetscViewer)

view a VecTagger context

Collective

Input Parameters:

  • tagger - vec tagger
  • viewer - viewer to display tagger, for example PETSC_VIEWER_STDOUT_WORLD

Level: advanced

See also: VecTaggerCreate(), VecTagger

External Links

source