PC (Preconditioners) - Low-level Interface

The PC (Preconditioner) component provides methods for preconditioning linear systems to accelerate the convergence of iterative solvers. Preconditioners are essential for efficiently solving large sparse linear systems with KSP.

Overview

Preconditioners transform the linear system $Ax = b$ into an equivalent system that is easier to solve iteratively. PETSc provides a wide variety of preconditioners:

  • Basic methods: Jacobi, block Jacobi, SOR, ILU, ICC
  • Multigrid: Algebraic multigrid (GAMG, HYPRE BoomerAMG), geometric multigrid (MG)
  • Domain decomposition: Additive Schwarz (ASM), block Jacobi with local solves
  • Direct solvers: LU, Cholesky (using external packages like MUMPS, SuperLU, UMFPACK)
  • Sparse approximations: ILU(k), ICC(k), approximate inverses
  • Physics-based: Field-split, composite preconditioners for coupled systems
  • Matrix-free: Shell preconditioners for matrix-free implementations

The PC object can be used standalone or automatically by KSP during the solution process.

Basic Usage

using PETSc, MPI

# Initialize MPI and PETSc
MPI.Init()
petsclib = PETSc.getlib()
PETSc.initialize(petsclib)

# Create a PC object
pc = LibPETSc.PCCreate(petsclib, LibPETSc.PETSC_COMM_SELF)

# Set the preconditioner type (a String or one of the LibPETSc.PC* constants)
LibPETSc.PCSetType(petsclib, pc, LibPETSc.PCILU)

# Set the operator matrix
# LibPETSc.PCSetOperators(petsclib, pc, A, A)

# Configure preconditioner-specific options
# For ILU: set fill level
# LibPETSc.PCFactorSetLevels(petsclib, pc, 2)

# Set options from command line/options database
LibPETSc.PCSetFromOptions(petsclib, pc)

# Set up the preconditioner
LibPETSc.PCSetUp(petsclib, pc)

# Apply the preconditioner: y = P^{-1} x
# LibPETSc.PCApply(petsclib, pc, x_vec, y_vec)

# Cleanup
LibPETSc.PCDestroy(petsclib, pc)

# Finalize PETSc and MPI
PETSc.finalize(petsclib)
MPI.Finalize()

Integration with KSP

Preconditioners are typically used with KSP solvers:

# Create KSP and get its PC (owned by the KSP)
ksp = LibPETSc.KSPCreate(petsclib, LibPETSc.PETSC_COMM_SELF)
pc = LibPETSc.KSPGetPC(petsclib, ksp)

# Configure the preconditioner
LibPETSc.PCSetType(petsclib, pc, "gamg")

# For GAMG, set additional options
LibPETSc.PCGAMGSetType(petsclib, pc, LibPETSc.PCGAMGAGG)
LibPETSc.PCGAMGSetNlevels(petsclib, pc, 10)

Common Preconditioner Types

Available through PCSetType:

Direct Solvers

  • PCLU: LU factorization
  • PCCHOLESKY: Cholesky factorization (symmetric positive definite)
  • PCQR: QR factorization

Incomplete Factorizations

  • PCILU: Incomplete LU factorization
  • PCICC: Incomplete Cholesky factorization
  • Configure fill with PCFactorSetLevels

Iterative/Relaxation Methods

  • PCJACOBI: Jacobi (diagonal scaling)
  • PCSOR: Successive over-relaxation
  • PCPBJACOBI: Point-block Jacobi
  • PCBJACOBI: Block Jacobi with local solves

Multigrid Methods

  • PCMG: Geometric multigrid
  • PCGAMG: Algebraic multigrid (PETSc's built-in)
  • PCHYPRE: HYPRE preconditioners (BoomerAMG, ParaSails, etc.)
  • PCML: ML algebraic multigrid (Trilinos)

Domain Decomposition

  • PCASM: Additive Schwarz method
  • PCGASM: Generalized additive Schwarz
  • PCBDDC: Balancing domain decomposition by constraints

Physics-Based

  • PCFIELDSPLIT: Field-split for coupled systems
  • PCLSC: Least-squares commutators (for saddle-point problems)
  • PCCOMPOSITE: Combine multiple preconditioners

Special Purpose

  • PCSHELL: User-defined shell preconditioner
  • PCNONE: No preconditioning (identity)
  • PCKSP: Use another KSP as preconditioner
  • PCREDISTRIBUTE: Redistribute matrix for better load balancing

Multigrid Configuration

For geometric multigrid (PCMG):

LibPETSc.PCSetType(petsclib, pc, LibPETSc.PCMG)
LibPETSc.PCMGSetLevels(petsclib, pc, nlevels, C_NULL)  # C_NULL: one communicator for all levels
# Set up grid hierarchy, smoothers, coarse solver

For algebraic multigrid (PCGAMG):

LibPETSc.PCSetType(petsclib, pc, LibPETSc.PCGAMG)
LibPETSc.PCGAMGSetType(petsclib, pc, LibPETSc.PCGAMGAGG)  # Aggregation
LibPETSc.PCGAMGSetNSmooths(petsclib, pc, 1)
LibPETSc.PCGAMGSetThreshold(petsclib, pc, [0.0], 1)

Field Split for Coupled Systems

For systems with multiple fields (e.g., velocity-pressure):

LibPETSc.PCSetType(petsclib, pc, LibPETSc.PCFIELDSPLIT)
LibPETSc.PCFieldSplitSetType(petsclib, pc, LibPETSc.PC_COMPOSITE_SCHUR)

# Define fields using index sets
# LibPETSc.PCFieldSplitSetIS(petsclib, pc, "velocity", velocity_is)
# LibPETSc.PCFieldSplitSetIS(petsclib, pc, "pressure", pressure_is)

External Solver Packages

PETSc can use external direct solver packages:

  • MUMPS: Parallel direct solver
  • SuperLU: Sparse direct solver
  • UMFPACK: Unsymmetric multifrontal solver
  • Pardiso: Intel MKL parallel direct solver
  • STRUMPACK: Structured sparse solver

Set via PCFactorSetMatSolverType after choosing PCLU or PCCHOLESKY.

Performance Considerations

  • Jacobi/Block Jacobi: Fast to apply, limited effectiveness
  • ILU/ICC: Good for moderately difficult problems, configure fill with PCFactorSetLevels
  • AMG: Excellent for elliptic PDEs, automatic coarse grid construction
  • Direct solvers: Robust but memory-intensive for large 3D problems
  • Field split: Essential for coupled multi-physics problems

Function Reference

PETSc.LibPETSc.PCASMCreateSubdomains — Method
outis::Vector{IS} = PCASMCreateSubdomains(petsclib::PetscLibType, A::AbstractPetscMat, n::PetscInt)

Creates the index sets for the overlapping Schwarz preconditioner, PCASM, for any problem on a general grid.

Collective

Input Parameters:

  • A - The global matrix operator
  • n - the number of local blocks

Output Parameter:

  • outis - the array of index sets defining the subdomains

Level: advanced

See also: PCASM, PCASMSetLocalSubdomains(), PCASMDestroySubdomains()

External Links

source
PETSc.LibPETSc.PCASMCreateSubdomains2D — Method
Nsub::PetscInt,is::Vector{IS},is_local::Vector{IS} = PCASMCreateSubdomains2D(petsclib::PetscLibType, m::PetscInt, n::PetscInt, M_M::PetscInt, M_N::PetscInt, dof::PetscInt, overlap::PetscInt)

Creates the index sets for the overlapping Schwarz preconditioner, PCASM, for a two-dimensional problem on a regular grid.

Not Collective

Input Parameters:

  • m - the number of mesh points in the x direction
  • n - the number of mesh points in the y direction
  • M - the number of subdomains in the x direction
  • N - the number of subdomains in the y direction
  • dof - degrees of freedom per node
  • overlap - overlap in mesh lines

Output Parameters:

  • Nsub - the number of subdomains created
  • is - array of index sets defining overlapping (if overlap > 0) subdomains
  • is_local - array of index sets defining non-overlapping subdomains

Level: advanced

See also: PCASM, PCASMSetTotalSubdomains(), PCASMSetLocalSubdomains(), PCASMGetSubKSP(), PCASMSetOverlap()

External Links

source
PETSc.LibPETSc.PCASMDestroySubdomains — Function
PCASMDestroySubdomains(petsclib::PetscLibType, n::PetscInt, is::Union{Ptr, AbstractVector{<:AbstractIS}}, is_local = nothing)

Destroys the index sets created with PCASMCreateSubdomains(). Should be called after setting subdomains with PCASMSetLocalSubdomains().

Collective

Input Parameters:

  • n - the number of index sets
  • is - the vector of index sets, or the raw pointer to a PETSc array of them
  • is_local - the vector of local index sets, or the raw pointer to a PETSc array of them, can be nothing

With vectors, each index set is destroyed and left with a null pointer: the creators have already freed PETSc's array. With pointers, PETSc destroys the index sets and frees both arrays.

Level: advanced

See also: PCASM, PCASMCreateSubdomains(), PCASMSetLocalSubdomains()

External Links

source
PETSc.LibPETSc.PCASMGetDMSubdomains — Method
flg::PetscBool = PCASMGetDMSubdomains(petsclib::PetscLibType, pc::AbstractPC)

Returns flag indicating whether to use DMCreateDomainDecomposition() to define the subdomains, whenever possible.

Not Collective

Input Parameter:

  • pc - the preconditioner

Output Parameter:

  • flg - boolean indicating whether to use subdomains defined by the DM

Level: intermediate

See also: PCASM, PCASMSetDMSubdomains(), PCASMSetTotalSubdomains(), PCASMSetOverlap(), PCASMCreateSubdomains2D(), PCASMSetLocalSubdomains(), PCASMGetLocalSubdomains()

External Links

source
PETSc.LibPETSc.PCASMGetLocalSubdomains — Method
n::PetscInt,is::Vector{IS},is_local::Vector{IS} = PCASMGetLocalSubdomains(petsclib::PetscLibType, pc::AbstractPC)

Gets the local subdomains (for this processor only) for the additive Schwarz preconditioner, PCASM.

Not Collective

Input Parameter:

  • pc - the preconditioner context

Output Parameters:

  • n - if requested, the number of subdomains for this processor (default value = 1)
  • is - if requested, the index sets that define the subdomains for this processor
  • is_local - if requested, the index sets that define the local part of the subdomains for this processor (can be NULL)

Level: advanced

See also: PCASM, PCASMSetTotalSubdomains(), PCASMSetOverlap(), PCASMGetSubKSP(), PCASMCreateSubdomains2D(), PCASMSetLocalSubdomains(), PCASMGetLocalSubmatrices()

External Links

source
PETSc.LibPETSc.PCASMGetLocalSubmatrices — Method
n::PetscInt,mat::Vector{PetscMat} = PCASMGetLocalSubmatrices(petsclib::PetscLibType, pc::AbstractPC)

Gets the local submatrices (for this processor only) for the additive Schwarz preconditioner, PCASM.

Not Collective

Input Parameter:

  • pc - the preconditioner context

Output Parameters:

  • n - if requested, the number of matrices for this processor (default value = 1)
  • mat - if requested, the matrices

Level: advanced

See also: PCASM, PCASMSetTotalSubdomains(), PCASMSetOverlap(), PCASMGetSubKSP(), PCASMCreateSubdomains2D(), PCASMSetLocalSubdomains(), PCASMGetLocalSubdomains(), PCSetModifySubMatrices()

External Links

source
PETSc.LibPETSc.PCASMGetLocalType — Method
type::PCCompositeType = PCASMGetLocalType(petsclib::PetscLibType, pc::AbstractPC)

Gets the type of composition used for local problems in the additive Schwarz method, PCASM.

Logically Collective

Input Parameter:

  • pc - the preconditioner context

Output Parameter:

  • type - type of composition, one of

$PC_COMPOSITE_ADDITIVE - local additive combination PC_COMPOSITE_MULTIPLICATIVE - local multiplicative combination$

Options Database Key:

  • -pc_asm_local_type [additive,multiplicative] - Sets local solver composition type

Level: intermediate

See also: PCASM, PCASMSetType(), PCASMGetType(), PCASMSetLocalType(), PCASMType, PCCompositeType

External Links

source
PETSc.LibPETSc.PCASMGetSubKSP — Method
n_local::PetscInt,first_local::PetscInt,ksp::Vector{KSP} = PCASMGetSubKSP(petsclib::PetscLibType, pc::AbstractPC)

Gets the local KSP contexts for all blocks on this processor.

Collective iff first_local is requested

Input Parameter:

  • pc - the preconditioner context

Output Parameters:

  • n_local - the number of blocks on this processor or NULL
  • first_local - the global number of the first block on this processor or NULL, all processors must request or all must pass NULL
  • ksp - the array of KSP contexts

Level: advanced

See also: PCASM, PCASMSetTotalSubdomains(), PCASMSetOverlap(), PCASMCreateSubdomains2D()

External Links

source
PETSc.LibPETSc.PCASMGetSubMatType — Method
sub_mat_type::String = PCASMGetSubMatType(petsclib::PetscLibType, pc::AbstractPC)

Gets the matrix type used for PCASM subsolves, as a string.

Not Collective

Input Parameter:

  • pc - the PC

Output Parameter:

  • sub_mat_type - name of matrix type

Level: advanced

See also: PCASM, PCASMSetSubMatType(), PCSetType(), VecSetType(), MatType, Mat

External Links

source
PETSc.LibPETSc.PCASMGetType — Method
type::PCASMType = PCASMGetType(petsclib::PetscLibType, pc::AbstractPC)

Gets the type of restriction and interpolation used for local problems in the additive Schwarz method, PCASM.

Logically Collective

Input Parameter:

  • pc - the preconditioner context

Output Parameter:

  • type - variant of PCASM, one of

$PC_ASM_BASIC - full interpolation and restriction PC_ASM_RESTRICT - full restriction, local processor interpolation PC_ASM_INTERPOLATE - full interpolation, local processor restriction PC_ASM_NONE - local processor restriction and interpolation$

Options Database Key:

  • -pc_asm_type [basic,restrict,interpolate,none] - Sets PCASM type

Level: intermediate

See also: PCASM, PCASMSetTotalSubdomains(), PCASMGetSubKSP(), PCGASM, PCASMCreateSubdomains2D(), PCASMType, PCASMSetType(), PCASMSetLocalType(), PCASMGetLocalType()

External Links

source
PETSc.LibPETSc.PCASMSetDMSubdomains — Method
PCASMSetDMSubdomains(petsclib::PetscLibType, pc::AbstractPC, flg::PetscBool)

Indicates whether to use DMCreateDomainDecomposition() to define the subdomains, whenever possible.

Logically Collective

Input Parameters:

  • pc - the preconditioner
  • flg - boolean indicating whether to use subdomains defined by the DM

Options Database Key:

  • -pc_asm_dm_subdomains (true|false) - use subdomains defined by the DM with DMCreateDomainDecomposition()

Level: intermediate

See also: PCASM, PCASMGetDMSubdomains(), PCASMSetTotalSubdomains(), PCASMSetOverlap(), PCASMCreateSubdomains2D(), PCASMSetLocalSubdomains(), PCASMGetLocalSubdomains()

External Links

source
PETSc.LibPETSc.PCASMSetLocalSubdomains — Method
PCASMSetLocalSubdomains(petsclib::PetscLibType, pc::AbstractPC, n::PetscInt, is::Vector{<:AbstractIS}, is_local::Vector{<:AbstractIS})

Sets the local subdomains (for this processor only) for the additive Schwarz preconditioner PCASM.

Collective

Input Parameters:

  • pc - the preconditioner context
  • n - the number of subdomains for this processor (default value = 1)
  • is - the index set that defines the subdomains for this processor (or NULL for PETSc to determine subdomains)

the values of the is array are copied so you can free the array (not the IS in the array) after this call

  • is_local - the index sets that define the local part of the subdomains for this processor, not used unless PCASMType is PC_ASM_RESTRICT

(or NULL to not provide these). The values of the is_local array are copied so you can free the array (not the IS in the array) after this call

Options Database Key:

  • -pc_asm_local_blocks blks - Sets number of local blocks

Level: advanced

See also: PCASM, PCASMSetTotalSubdomains(), PCASMSetOverlap(), PCASMGetSubKSP(), PCASMCreateSubdomains2D(), PCASMGetLocalSubdomains(), PCASMType, PCASMSetType(), PCGASM

External Links

source
PETSc.LibPETSc.PCASMSetLocalType — Method
PCASMSetLocalType(petsclib::PetscLibType, pc::AbstractPC, type::PCCompositeType)

Sets the type of composition used for local problems in the additive Schwarz method, PCASM.

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • type - type of composition, one of

$PC_COMPOSITE_ADDITIVE - local additive combination PC_COMPOSITE_MULTIPLICATIVE - local multiplicative combination$

Options Database Key:

  • -pc_asm_local_type [additive,multiplicative] - Sets local solver composition type

Level: intermediate

See also: PCASM, PCASMSetType(), PCASMGetType(), PCASMGetLocalType(), PCASMType, PCCompositeType

External Links

source
PETSc.LibPETSc.PCASMSetOverlap — Method
PCASMSetOverlap(petsclib::PetscLibType, pc::AbstractPC, ovl::PetscInt)

Sets the overlap between a pair of subdomains for the additive Schwarz preconditioner, PCASM.

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • ovl - the amount of overlap between subdomains (ovl >= 0, default value = 1)

Options Database Key:

  • -pc_asm_overlap ovl - Sets overlap

Level: intermediate

See also: PCASM, PCASMSetTotalSubdomains(), PCASMSetLocalSubdomains(), PCASMGetSubKSP(), PCASMCreateSubdomains2D(), PCASMGetLocalSubdomains(), MatIncreaseOverlap(), PCGASM

External Links

source
PETSc.LibPETSc.PCASMSetSortIndices — Method
PCASMSetSortIndices(petsclib::PetscLibType, pc::AbstractPC, doSort::PetscBool)

Determines whether subdomain indices are sorted.

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • doSort - sort the subdomain indices

Level: intermediate

See also: PCASM, PCASMSetLocalSubdomains(), PCASMSetTotalSubdomains(), PCASMGetSubKSP(), PCASMCreateSubdomains2D()

External Links

source
PETSc.LibPETSc.PCASMSetSubMatType — Method
PCASMSetSubMatType(petsclib::PetscLibType, pc::AbstractPC, sub_mat_type::String)

Set the type of matrix used for PCASM subsolves

Collective

Input Parameters:

  • pc - the PC object
  • sub_mat_type - the MatType

Options Database Key:

  • -pc_asm_sub_mat_type sub_mat_type - Sets the matrix type used for subsolves, for example, seqaijviennacl.

If you specify a base name like aijviennacl, the corresponding sequential type is assumed.

See also: PCASM, PCASMGetSubMatType(), PCSetType(), VecSetType(), MatType, Mat

External Links

source
PETSc.LibPETSc.PCASMSetTotalSubdomains — Method
PCASMSetTotalSubdomains(petsclib::PetscLibType, pc::AbstractPC, N::PetscInt, is::Vector{<:AbstractIS}, is_local::Vector{<:AbstractIS})

Sets the subdomains for all processors for the additive Schwarz preconditioner, PCASM.

Collective, all MPI ranks must pass in the same array of IS

Input Parameters:

  • pc - the preconditioner context
  • N - the number of subdomains for all processors
  • is - the index sets that define the subdomains for all processors (or NULL to ask PETSc to determine the subdomains)

the values of the is array are copied so you can free the array (not the IS in the array) after this call

  • is_local - the index sets that define the local part of the subdomains for this processor (or NULL to not provide this information)

The values of the is_local array are copied so you can free the array (not the IS in the array) after this call

Options Database Key:

  • -pc_asm_blocks blks - Sets total blocks

Level: advanced

See also: PCASM, PCASMSetLocalSubdomains(), PCASMSetOverlap(), PCASMGetSubKSP(), PCASMCreateSubdomains2D(), PCGASM

External Links

source
PETSc.LibPETSc.PCASMSetType — Method
PCASMSetType(petsclib::PetscLibType, pc::AbstractPC, type::PCASMType)

Sets the type of restriction and interpolation used for local problems in the additive Schwarz method, PCASM.

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • type - variant of PCASM, one of

$PC_ASM_BASIC - full interpolation and restriction PC_ASM_RESTRICT - full restriction, local processor interpolation (default) PC_ASM_INTERPOLATE - full interpolation, local processor restriction PC_ASM_NONE - local processor restriction and interpolation$

Options Database Key:

  • -pc_asm_type [basic,restrict,interpolate,none] - Sets PCASMType

Level: intermediate

See also: PCASM, PCASMSetTotalSubdomains(), PCASMGetSubKSP(), PCASMCreateSubdomains2D(), PCASMType, PCASMSetLocalType(), PCASMGetLocalType(), PCGASM

External Links

source
PETSc.LibPETSc.PCAppendOptionsPrefix — Method
PCAppendOptionsPrefix(petsclib::PetscLibType, pc::AbstractPC, prefix::String)

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

Logically Collective

Input Parameters:

  • pc - the PC preconditioner context
  • prefix - the prefix string to prepend to all PC option requests

Level: advanced

See also: PC, PCSetFromOptions(), PCSetOptionsPrefix(), PCGetOptionsPrefix()

External Links

source
PETSc.LibPETSc.PCApply — Method
PCApply(petsclib::PetscLibType, pc::AbstractPC, x::AbstractPetscVec, y::AbstractPetscVec)

Applies the preconditioner to a vector.

Collective

Input Parameters:

  • pc - the PC preconditioner context
  • x - input vector

Output Parameter:

  • y - output vector

Level: developer

See also: PC, PCApplyTranspose(), PCApplyBAorAB()

External Links

source
PETSc.LibPETSc.PCApplyBAorAB — Method
PCApplyBAorAB(petsclib::PetscLibType, pc::AbstractPC, side::PCSide, x::AbstractPetscVec, y::AbstractPetscVec, work::AbstractPetscVec)

Applies the preconditioner and operator to a vector. y = BAx or y = ABx.

Collective

Input Parameters:

  • pc - the PC preconditioner context
  • side - indicates the preconditioner side, one of PC_LEFT, PC_RIGHT, or PC_SYMMETRIC
  • x - input vector
  • work - work vector

Output Parameter:

  • y - output vector

Level: developer

See also: PC, PCApply(), PCApplyTranspose(), PCApplyBAorABTranspose()

External Links

source
PETSc.LibPETSc.PCApplyBAorABTranspose — Method
PCApplyBAorABTranspose(petsclib::PetscLibType, pc::AbstractPC, side::PCSide, x::AbstractPetscVec, y::AbstractPetscVec, work::AbstractPetscVec)

Applies the transpose of the preconditioner and operator to a vector. That is, applies B^T * A^T with left preconditioning, NOT (BA)^T = A^TB^T.

Collective

Input Parameters:

  • pc - the PC preconditioner context
  • side - indicates the preconditioner side, one of PC_LEFT, PC_RIGHT, or PC_SYMMETRIC
  • x - input vector
  • work - work vector

Output Parameter:

  • y - output vector

Level: developer

See also: PC, PCApply(), PCApplyTranspose(), PCApplyBAorAB()

External Links

source
PETSc.LibPETSc.PCApplyRichardson — Method
outits::PetscInt,reason::PCRiCchardsonConvergedReason = PCApplyRichardson(petsclib::PetscLibType, pc::AbstractPC, b::AbstractPetscVec, y::AbstractPetscVec, w::AbstractPetscVec, rtol::PetscReal, abstol::PetscReal, dtol::PetscReal, its::PetscInt, guesszero::PetscBool)

Applies several steps of Richardson iteration with the particular preconditioner. This routine is usually used by the Krylov solvers and not the application code directly.

Collective

Input Parameters:

  • pc - the PC preconditioner context
  • b - the right-hand side
  • w - one work vector
  • rtol - relative decrease in residual norm convergence criteria
  • abstol - absolute residual norm convergence criteria
  • dtol - divergence residual norm increase criteria
  • its - the number of iterations to apply.
  • guesszero - if the input x contains nonzero initial guess

Output Parameters:

  • outits - number of iterations actually used (for SOR this always equals its)
  • reason - the reason the apply terminated
  • y - the solution (also contains initial guess if guesszero is PETSC_FALSE

Level: developer

See also: PC, PCApplyRichardsonExists()

External Links

source
PETSc.LibPETSc.PCApplyRichardsonExists — Method
exists::PetscBool = PCApplyRichardsonExists(petsclib::PetscLibType, pc::AbstractPC)

Determines whether a particular preconditioner has a built-in fast application of Richardson's method.

Not Collective

Input Parameter:

  • pc - the preconditioner

Output Parameter:

  • exists - PETSC_TRUE or PETSC_FALSE

Level: developer

See also: PC, KSPRICHARDSON, PCApplyRichardson()

External Links

source
PETSc.LibPETSc.PCApplySymmetricLeft — Method
PCApplySymmetricLeft(petsclib::PetscLibType, pc::AbstractPC, x::AbstractPetscVec, y::AbstractPetscVec)

Applies the left part of a symmetric preconditioner to a vector.

Collective

Input Parameters:

  • pc - the PC preconditioner context
  • x - input vector

Output Parameter:

  • y - output vector

Level: developer

See also: PC, PCApply(), PCApplySymmetricRight()

External Links

source
PETSc.LibPETSc.PCApplySymmetricRight — Method
PCApplySymmetricRight(petsclib::PetscLibType, pc::AbstractPC, x::AbstractPetscVec, y::AbstractPetscVec)

Applies the right part of a symmetric preconditioner to a vector.

Collective

Input Parameters:

  • pc - the PC preconditioner context
  • x - input vector

Output Parameter:

  • y - output vector

Level: developer

See also: PC, PCApply(), PCApplySymmetricLeft()

External Links

source
PETSc.LibPETSc.PCApplyTranspose — Method
PCApplyTranspose(petsclib::PetscLibType, pc::AbstractPC, x::AbstractPetscVec, y::AbstractPetscVec)

Applies the transpose of preconditioner to a vector.

Collective

Input Parameters:

  • pc - the PC preconditioner context
  • x - input vector

Output Parameter:

  • y - output vector

Level: developer

See also: PC, PCApply(), PCApplyBAorAB(), PCApplyBAorABTranspose(), PCApplyTransposeExists()

External Links

source
PETSc.LibPETSc.PCApplyTransposeExists — Method
flg::PetscBool = PCApplyTransposeExists(petsclib::PetscLibType, pc::AbstractPC)

Test whether the preconditioner has a transpose apply operation

Collective

Input Parameter:

  • pc - the PC preconditioner context

Output Parameter:

  • flg - PETSC_TRUE if a transpose operation is defined

Level: developer

See also: PC, PCApplyTranspose()

External Links

source
PETSc.LibPETSc.PCBDDCCreateFETIDPOperators — Method
fetidp_mat::PetscMat,fetidp_pc::PC = PCBDDCCreateFETIDPOperators(petsclib::PetscLibType, pc::AbstractPC, fully_redundant::PetscBool, prefix::String)

Create FETI-DP operators

Collective

Input Parameters:

  • pc - the PCBDDC preconditioning context (setup should have been called before)
  • fully_redundant - true for a fully redundant set of Lagrange multipliers
  • prefix - optional options database prefix for the objects to be created (can be NULL)

Output Parameters:

  • fetidp_mat - shell FETI-DP matrix object
  • fetidp_pc - shell Dirichlet preconditioner for FETI-DP matrix

Level: developer

See also: KSPFETIDP, PCBDDC, PCBDDCMatFETIDPGetRHS(), PCBDDCMatFETIDPGetSolution()

External Links

source
PETSc.LibPETSc.PCBDDCGetDirichletBoundaries — Method
DirichletBoundaries::IS = PCBDDCGetDirichletBoundaries(petsclib::PetscLibType, pc::AbstractPC)

Get parallel IS for Dirichlet boundaries

Collective

Input Parameter:

  • pc - the preconditioning context

Output Parameter:

  • DirichletBoundaries - index set defining the Dirichlet boundaries

Level: intermediate

See also: PCBDDC, PCBDDCSetDirichletBoundaries()

External Links

source
PETSc.LibPETSc.PCBDDCGetDirichletBoundariesLocal — Method
DirichletBoundaries::IS = PCBDDCGetDirichletBoundariesLocal(petsclib::PetscLibType, pc::AbstractPC)

Get parallel IS for Dirichlet boundaries (in local ordering)

Collective

Input Parameter:

  • pc - the preconditioning context

Output Parameter:

  • DirichletBoundaries - index set defining the subdomain part of Dirichlet boundaries

Level: intermediate

See also: PCBDDC, PCBDDCGetDirichletBoundaries(), PCBDDCSetDirichletBoundaries()

External Links

source
PETSc.LibPETSc.PCBDDCGetNeumannBoundaries — Method
NeumannBoundaries::IS = PCBDDCGetNeumannBoundaries(petsclib::PetscLibType, pc::AbstractPC)

Get parallel IS for Neumann boundaries

Not Collective

Input Parameter:

  • pc - the preconditioning context

Output Parameter:

  • NeumannBoundaries - index set defining the Neumann boundaries

Level: intermediate

See also: PCBDDC, PCBDDCSetNeumannBoundaries(), PCBDDCGetDirichletBoundaries(), PCBDDCSetDirichletBoundaries()

External Links

source
PETSc.LibPETSc.PCBDDCGetNeumannBoundariesLocal — Method
NeumannBoundaries::IS = PCBDDCGetNeumannBoundariesLocal(petsclib::PetscLibType, pc::AbstractPC)

Get parallel IS for Neumann boundaries (in local ordering)

Not Collective

Input Parameter:

  • pc - the preconditioning context

Output Parameter:

  • NeumannBoundaries - index set defining the subdomain part of Neumann boundaries

Level: intermediate

See also: PCBDDC, PCBDDCSetNeumannBoundaries(), PCBDDCSetNeumannBoundariesLocal(), PCBDDCGetNeumannBoundaries()

External Links

source
PETSc.LibPETSc.PCBDDCGetPrimalVerticesIS — Method
is::IS = PCBDDCGetPrimalVerticesIS(petsclib::PetscLibType, pc::AbstractPC)

Get user defined primal vertices set with PCBDDCSetPrimalVerticesIS()

Collective

Input Parameter:

  • pc - the preconditioning context

Output Parameter:

  • is - index set of primal vertices in global numbering (NULL if not set)

Level: intermediate

See also: PCBDDC, PCBDDCSetPrimalVerticesIS(), PCBDDCSetPrimalVerticesLocalIS(), PCBDDCGetPrimalVerticesLocalIS()

External Links

source
PETSc.LibPETSc.PCBDDCGetPrimalVerticesLocalIS — Method
is::IS = PCBDDCGetPrimalVerticesLocalIS(petsclib::PetscLibType, pc::AbstractPC)

Get user defined primal vertices set with PCBDDCSetPrimalVerticesLocalIS()

Collective

Input Parameter:

  • pc - the preconditioning context

Output Parameter:

  • is - index set of primal vertices in local numbering (NULL if not set)

Level: intermediate

See also: PCBDDC, PCBDDCSetPrimalVerticesIS(), PCBDDCGetPrimalVerticesIS(), PCBDDCSetPrimalVerticesLocalIS()

External Links

source
PETSc.LibPETSc.PCBDDCMatFETIDPGetRHS — Method
PCBDDCMatFETIDPGetRHS(petsclib::PetscLibType, fetidp_mat::AbstractPetscMat, standard_rhs::AbstractPetscVec, fetidp_flux_rhs::AbstractPetscVec)

Compute the right-hand side for a FETI-DP linear system using the physical right-hand side

Collective

Input Parameters:

  • fetidp_mat - the FETI-DP matrix object obtained by a call to PCBDDCCreateFETIDPOperators()
  • standard_rhs - the right-hand side of the original linear system

Output Parameter:

  • fetidp_flux_rhs - the right-hand side for the FETI-DP linear system

Level: developer

See also: PCBDDC, PCBDDCCreateFETIDPOperators(), PCBDDCMatFETIDPGetSolution()

External Links

source
PETSc.LibPETSc.PCBDDCMatFETIDPGetSolution — Method
PCBDDCMatFETIDPGetSolution(petsclib::PetscLibType, fetidp_mat::AbstractPetscMat, fetidp_flux_sol::AbstractPetscVec, standard_sol::AbstractPetscVec)

Compute the physical solution using the solution of the FETI-DP linear system

Collective

Input Parameters:

  • fetidp_mat - the FETI-DP matrix obtained by a call to PCBDDCCreateFETIDPOperators()
  • fetidp_flux_sol - the solution of the FETI-DP linear system`

Output Parameter:

  • standard_sol - the solution defined on the physical domain

Level: developer

See also: PCBDDC, PCBDDCCreateFETIDPOperators(), PCBDDCMatFETIDPGetRHS()

External Links

source
PETSc.LibPETSc.PCBDDCSetChangeOfBasisMat — Method
PCBDDCSetChangeOfBasisMat(petsclib::PetscLibType, pc::AbstractPC, change::AbstractPetscMat, interior::PetscBool)

Set user defined change of basis for dofs

Collective

Input Parameters:

  • pc - the preconditioning context
  • change - the change of basis matrix
  • interior - whether or not the change of basis modifies interior dofs

Level: intermediate

See also: PCBDDC

External Links

source
PETSc.LibPETSc.PCBDDCSetCoarseningRatio — Method
PCBDDCSetCoarseningRatio(petsclib::PetscLibType, pc::AbstractPC, k::PetscInt)

Set coarsening ratio used in the multi-level version of PCBDDC

Logically Collective

Input Parameters:

  • pc - the preconditioning context
  • k - coarsening ratio (H/h at the coarser level)

Options Database Key:

  • -pc_bddc_coarsening_ratio k - Set the coarsening ratio used in multi-level coarsening

Level: intermediate

See also: PCBDDC, PCBDDCSetLevels()

External Links

source
PETSc.LibPETSc.PCBDDCSetDirichletBoundaries — Method
PCBDDCSetDirichletBoundaries(petsclib::PetscLibType, pc::AbstractPC, DirichletBoundaries::AbstractIS)

Set the IS defining Dirichlet boundaries for the global problem.

Collective

Input Parameters:

  • pc - the preconditioning context
  • DirichletBoundaries - parallel IS defining the Dirichlet boundaries

Level: intermediate

See also: PCBDDC, PCBDDCSetDirichletBoundariesLocal(), MatZeroRows(), MatZeroRowsColumns()

External Links

source
PETSc.LibPETSc.PCBDDCSetDirichletBoundariesLocal — Method
PCBDDCSetDirichletBoundariesLocal(petsclib::PetscLibType, pc::AbstractPC, DirichletBoundaries::AbstractIS)

Set the IS defining Dirichlet boundaries for the global problem in local ordering.

Collective

Input Parameters:

  • pc - the preconditioning context
  • DirichletBoundaries - parallel IS defining the Dirichlet boundaries (in local ordering)

Level: intermediate

See also: PCBDDC, PCBDDCSetDirichletBoundaries(), MatZeroRows(), MatZeroRowsColumns()

External Links

source
PETSc.LibPETSc.PCBDDCSetDiscreteGradient — Method
PCBDDCSetDiscreteGradient(petsclib::PetscLibType, pc::AbstractPC, G::AbstractPetscMat, order::PetscInt, field::PetscInt, glob::PetscBool, conforming::PetscBool)

Sets the discrete gradient to be used by the PCBDDC preconditioner

Collective

Input Parameters:

  • pc - the preconditioning context
  • G - the discrete gradient matrix (in MATAIJ format)
  • order - the order of the Nedelec space (1 for the lowest order)
  • field - the field id of the Nedelec dofs (not used if the fields have not been specified)
  • global - the type of global ordering for the rows of G
  • conforming - whether the mesh is conforming or not

Level: advanced

See also: PCBDDC, PCBDDCSetDofsSplitting(), PCBDDCSetDofsSplittingLocal(), MATAIJ, PCBDDCSetDivergenceMat()

External Links

source
PETSc.LibPETSc.PCBDDCSetDivergenceMat — Method
PCBDDCSetDivergenceMat(petsclib::PetscLibType, pc::AbstractPC, divudotp::AbstractPetscMat, trans::PetscBool, vl2l::AbstractIS)

Sets the linear operator representing \int_\Omega \div {\bf u} \cdot p dx for the PCBDDC preconditioner

Collective

Input Parameters:

  • pc - the preconditioning context
  • divudotp - the matrix (must be of type MATIS)
  • trans - if PETSC_FALSE (resp. PETSC_TRUE), then pressures are in the test (trial) space and velocities are in the trial (test) space.
  • vl2l - optional index set describing the local (wrt the local matrix in divudotp) to local (wrt the local matrix

in the matrix used to construct the preconditioner) map for the velocities

Level: advanced

See also: PCBDDC, PCBDDCSetDiscreteGradient()

External Links

source
PETSc.LibPETSc.PCBDDCSetDofsSplitting — Method
PCBDDCSetDofsSplitting(petsclib::PetscLibType, pc::AbstractPC, n_is::PetscInt, ISForDofs::Vector{<:AbstractIS})

Set the IS defining fields of the global matrix

Collective

Input Parameters:

  • pc - the preconditioning context
  • n_is - number of index sets defining the fields
  • ISForDofs - array of IS describing the fields in global ordering

Level: intermediate

See also: PCBDDC, PCBDDCSetDofsSplittingLocal()

External Links

source
PETSc.LibPETSc.PCBDDCSetDofsSplittingLocal — Method
PCBDDCSetDofsSplittingLocal(petsclib::PetscLibType, pc::AbstractPC, n_is::PetscInt, ISForDofs::Vector{<:AbstractIS})

Set the IS defining fields of the local subdomain matrix

Collective

Input Parameters:

  • pc - the preconditioning context
  • n_is - number of index sets defining the fields, must be the same on all MPI processes
  • ISForDofs - array of IS describing the fields in local ordering

Level: intermediate

See also: PCBDDC, PCBDDCSetDofsSplitting()

External Links

source
PETSc.LibPETSc.PCBDDCSetLevels — Method
PCBDDCSetLevels(petsclib::PetscLibType, pc::AbstractPC, levels::PetscInt)

Sets the maximum number of additional levels allowed for multilevel PCBDDC

Logically Collective

Input Parameters:

  • pc - the preconditioning context
  • levels - the maximum number of levels

Options Database Key:

  • -pc_bddc_levels levels - Set maximum number of levels for multilevel

Level: intermediate

See also: PCBDDC, PCBDDCSetCoarseningRatio()

External Links

source
PETSc.LibPETSc.PCBDDCSetLocalAdjacencyGraph — Method
PCBDDCSetLocalAdjacencyGraph(petsclib::PetscLibType, pc::AbstractPC, nvtxs::PetscInt, xadj::Vector{PetscInt}, adjncy::Vector{PetscInt}, copymode::PetscCopyMode)

Set adjacency structure (CSR graph) of the local degrees of freedom.

Not collective

Input Parameters:

  • pc - the preconditioning context.
  • nvtxs - number of local vertices of the graph (i.e., the number of local dofs).
  • xadj - CSR format row pointers for the connectivity of the dofs
  • adjncy - CSR format column pointers for the connectivity of the dofs
  • copymode - supported modes are PETSC_COPY_VALUES, PETSC_USE_POINTER or PETSC_OWN_POINTER.

Level: intermediate

See also: PCBDDC, PetscCopyMode

External Links

source
PETSc.LibPETSc.PCBDDCSetNeumannBoundaries — Method
PCBDDCSetNeumannBoundaries(petsclib::PetscLibType, pc::AbstractPC, NeumannBoundaries::AbstractIS)

Set the IS defining Neumann boundaries for the global problem.

Collective

Input Parameters:

  • pc - the preconditioning context
  • NeumannBoundaries - parallel IS defining the Neumann boundaries

Level: intermediate

See also: PCBDDC, PCBDDCSetNeumannBoundariesLocal()

External Links

source
PETSc.LibPETSc.PCBDDCSetNeumannBoundariesLocal — Method
PCBDDCSetNeumannBoundariesLocal(petsclib::PetscLibType, pc::AbstractPC, NeumannBoundaries::AbstractIS)

Set the IS defining Neumann boundaries for the global problem in local ordering.

Collective

Input Parameters:

  • pc - the preconditioning context
  • NeumannBoundaries - parallel IS defining the subdomain part of Neumann boundaries (in local ordering)

Level: intermediate

See also: PCBDDC, PCBDDCSetNeumannBoundaries(), PCBDDCGetDirichletBoundaries()

External Links

source
PETSc.LibPETSc.PCBDDCSetPrimalVerticesIS — Method
PCBDDCSetPrimalVerticesIS(petsclib::PetscLibType, pc::AbstractPC, PrimalVertices::AbstractIS)

Set additional user defined primal vertices in PCBDDC

Collective

Input Parameters:

  • pc - the preconditioning context
  • PrimalVertices - index set of primal vertices in global numbering (can be empty)

Level: intermediate

See also: PCBDDC, PCBDDCGetPrimalVerticesIS(), PCBDDCSetPrimalVerticesLocalIS(), PCBDDCGetPrimalVerticesLocalIS()

External Links

source
PETSc.LibPETSc.PCBDDCSetPrimalVerticesLocalIS — Method
PCBDDCSetPrimalVerticesLocalIS(petsclib::PetscLibType, pc::AbstractPC, PrimalVertices::AbstractIS)

Set additional user defined primal vertices in PCBDDC

Collective

Input Parameters:

  • pc - the preconditioning context
  • PrimalVertices - index set of primal vertices in local numbering (can be empty)

Level: intermediate

See also: PCBDDC, PCBDDCSetPrimalVerticesIS(), PCBDDCGetPrimalVerticesIS(), PCBDDCGetPrimalVerticesLocalIS()

External Links

source
PETSc.LibPETSc.PCBJacobiGetLocalBlocks — Method
blocks::PetscInt = PCBJacobiGetLocalBlocks(petsclib::PetscLibType, pc::AbstractPC, lens::Union{Ptr, AbstractArray{PetscInt}})

Gets the local number of blocks for the block Jacobi, PCBJACOBI, preconditioner.

Not Collective

Input Parameters:

  • pc - the preconditioner context
  • blocks - the number of blocks
  • lens - [optional] integer array containing size of each block

Level: intermediate

See also: PCBJACOBI, PCSetUseAmat(), PCBJacobiGetTotalBlocks()

External Links

source
PETSc.LibPETSc.PCBJacobiGetSubKSP — Method
n_local::PetscInt,first_local::PetscInt,ksp::Vector{KSP} = PCBJacobiGetSubKSP(petsclib::PetscLibType, pc::AbstractPC)

Gets the local KSP contexts for all blocks on this processor.

Not Collective

Input Parameter:

  • pc - the preconditioner context

Output Parameters:

  • n_local - the number of blocks on this processor, or NULL
  • first_local - the global number of the first block on this processor, or NULL
  • ksp - the array of KSP contexts

Level: advanced

See also: PCBJACOBI, PCASM, PCASMGetSubKSP()

External Links

source
PETSc.LibPETSc.PCBJacobiGetTotalBlocks — Method
blocks::PetscInt,lens::Vector{PetscInt} = PCBJacobiGetTotalBlocks(petsclib::PetscLibType, pc::AbstractPC)

Gets the global number of blocks for the block Jacobi, PCBJACOBI, preconditioner.

Not Collective

Input Parameter:

  • pc - the preconditioner context

Output Parameters:

  • blocks - the number of blocks
  • lens - integer array containing the size of each block

Level: intermediate

See also: PCBJACOBI, PCSetUseAmat(), PCBJacobiGetLocalBlocks()

External Links

source
PETSc.LibPETSc.PCBJacobiSetLocalBlocks — Method
PCBJacobiSetLocalBlocks(petsclib::PetscLibType, pc::AbstractPC, blocks::PetscInt, lens::Vector{PetscInt})

Sets the local number of blocks for the block Jacobi, PCBJACOBI, preconditioner.

Not Collective

Input Parameters:

  • pc - the preconditioner context
  • blocks - the number of blocks
  • lens - [optional] integer array containing size of each block

Options Database Key:

  • -pc_bjacobi_local_blocks blocks - Sets the number of local blocks

Level: intermediate

See also: PCBJACOBI, PCSetUseAmat(), PCBJacobiSetTotalBlocks()

External Links

source
PETSc.LibPETSc.PCBJacobiSetTotalBlocks — Method
PCBJacobiSetTotalBlocks(petsclib::PetscLibType, pc::AbstractPC, blocks::PetscInt, lens::Vector{PetscInt})

Sets the global number of blocks for the block Jacobi preconditioner.

Collective

Input Parameters:

  • pc - the preconditioner context
  • blocks - the number of blocks
  • lens - [optional] integer array containing the size of each block

Options Database Key:

  • -pc_bjacobi_blocks blocks - Sets the number of global blocks

Level: intermediate

See also: PCBJACOBI, PCSetUseAmat(), PCBJacobiSetLocalBlocks()

External Links

source
PETSc.LibPETSc.PCCompositeAddPC — Method
PCCompositeAddPC(petsclib::PetscLibType, pc::AbstractPC, subpc::AbstractPC)

Adds another PC to the composite PC.

Collective

Input Parameters:

  • pc - the preconditioner context
  • subpc - the new preconditioner

Level: intermediate

See also: PCCOMPOSITE, PCCompositeAddPCType(), PCCompositeGetNumberPC()

External Links

source
PETSc.LibPETSc.PCCompositeAddPCType — Method
PCCompositeAddPCType(petsclib::PetscLibType, pc::AbstractPC, type::String)

Adds another PC of the given type to the composite PC.

Collective

Input Parameters:

  • pc - the preconditioner context
  • type - the type of the new preconditioner

Level: intermediate

See also: PCCOMPOSITE, PCCompositeAddPC(), PCCompositeGetNumberPC()

External Links

source
PETSc.LibPETSc.PCCompositeGetNumberPC — Method
num::PetscInt = PCCompositeGetNumberPC(petsclib::PetscLibType, pc::AbstractPC)

Gets the number of PC objects in the composite PC.

Not Collective

Input Parameter:

  • pc - the preconditioner context

Output Parameter:

  • num - the number of sub pcs

Level: developer

See also: PCCOMPOSITE, PCCompositeGetPC(), PCCompositeAddPC(), PCCompositeAddPCType()

External Links

source
PETSc.LibPETSc.PCCompositeGetPC — Method
subpc::PC = PCCompositeGetPC(petsclib::PetscLibType, pc::AbstractPC, n::PetscInt)

Gets one of the PC objects in the composite PC.

Not Collective

Input Parameters:

  • pc - the preconditioner context
  • n - the number of the pc requested

Output Parameter:

  • subpc - the PC requested

Level: intermediate

See also: PCCOMPOSITE, PCCompositeAddPCType(), PCCompositeGetNumberPC(), PCSetOperators()

External Links

source
PETSc.LibPETSc.PCCompositeGetType — Method
type::PCCompositeType = PCCompositeGetType(petsclib::PetscLibType, pc::AbstractPC)

Gets the type of composite preconditioner.

Logically Collective

Input Parameter:

  • pc - the preconditioner context

Output Parameter:

  • type - PC_COMPOSITE_ADDITIVE (default), PC_COMPOSITE_MULTIPLICATIVE, PC_COMPOSITE_SPECIAL

Level: advanced

See also: PCCOMPOSITE, PC_COMPOSITE_ADDITIVE, PC_COMPOSITE_MULTIPLICATIVE, PC_COMPOSITE_SPECIAL, PCCompositeType, PCCompositeSetType()

External Links

source
PETSc.LibPETSc.PCCompositeSetType — Method
PCCompositeSetType(petsclib::PetscLibType, pc::AbstractPC, type::PCCompositeType)

Sets the type of composite preconditioner.

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • type - PC_COMPOSITE_ADDITIVE (default), PC_COMPOSITE_MULTIPLICATIVE, PC_COMPOSITE_SPECIAL

Options Database Key:

  • -pc_composite_type (multiplicative|additive|symmetric_multiplicative|special) - Sets composite preconditioner type

Level: advanced

See also: PCCOMPOSITE, PC_COMPOSITE_ADDITIVE, PC_COMPOSITE_MULTIPLICATIVE, PC_COMPOSITE_SPECIAL, PCCompositeType, PCCompositeGetType()

External Links

source
PETSc.LibPETSc.PCCompositeSpecialSetAlpha — Method
PCCompositeSpecialSetAlpha(petsclib::PetscLibType, pc::AbstractPC, alpha::PetscScalar)

Sets alpha for the special composite preconditioner, PC_COMPOSITE_SPECIAL, for \alpha I + R + S

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • alpha - scale on identity

Level: developer

See also: PCCOMPOSITE, PC_COMPOSITE_ADDITIVE, PC_COMPOSITE_MULTIPLICATIVE, PC_COMPOSITE_SPECIAL, PCCompositeType, PCCompositeSetType(), PCCompositeGetType()

External Links

source
PETSc.LibPETSc.PCCompositeSpecialSetAlphaMat — Method
PCCompositeSpecialSetAlphaMat(petsclib::PetscLibType, pc::AbstractPC, alpha_mat::AbstractPetscMat)

Sets the matrix alpha_mat used in place of a scalar \alpha I term for the special composite preconditioner, PC_COMPOSITE_SPECIAL, for M + R + S

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • alpha_mat - the matrix M

Level: developer

See also: PCCOMPOSITE, PC_COMPOSITE_ADDITIVE, PC_COMPOSITE_MULTIPLICATIVE, PC_COMPOSITE_SPECIAL, PCCompositeType, PCCompositeSetType(), PCCompositeSpecialSetAlpha()

External Links

source
PETSc.LibPETSc.PCComputeOperator — Method
mat::PetscMat = PCComputeOperator(petsclib::PetscLibType, pc::AbstractPC, mattype::String)

Computes the explicit preconditioned operator as a matrix Mat.

Collective

Input Parameters:

  • pc - the PC preconditioner object
  • mattype - the MatType to be used for the operator

Output Parameter:

  • mat - the explicit preconditioned operator

Level: advanced

See also: PC, KSPComputeOperator(), MatType

External Links

source
PETSc.LibPETSc.PCCreate — Method
newpc::PC = PCCreate(petsclib::PetscLibType, comm::MPI_Comm)

Creates a preconditioner context, PC

Collective

Input Parameter:

  • comm - MPI communicator

Output Parameter:

  • newpc - location to put the PC preconditioner context

Level: developer

See also: PC, PCType, PCSetType, PCSetUp(), PCApply(), PCDestroy(), KSP, KSPGetPC()

External Links

source
PETSc.LibPETSc.PCDeflationGetCoarseKSP — Method
ksp::KSP = PCDeflationGetCoarseKSP(petsclib::PetscLibType, pc::AbstractPC)

Returns the coarse problem KSP.

Not Collective

Input Parameter:

  • pc - preconditioner context

Output Parameter:

  • ksp - coarse problem KSP context

Level: advanced

See also: PCDEFLATION, PCDeflationSetCoarseMat()

External Links

source
PETSc.LibPETSc.PCDeflationGetPC — Method
apc::PC = PCDeflationGetPC(petsclib::PetscLibType, pc::AbstractPC)

Returns the additional preconditioner M^{-1}.

Not Collective

Input Parameter:

  • pc - the preconditioner context

Output Parameter:

  • apc - additional preconditioner

Level: advanced

See also: PCDEFLATION, PCDeflationGetCoarseKSP()

External Links

source
PETSc.LibPETSc.PCDeflationSetCoarseMat — Method
PCDeflationSetCoarseMat(petsclib::PetscLibType, pc::AbstractPC, mat::AbstractPetscMat)

Set the coarse problem Mat.

Collective

Input Parameters:

  • pc - preconditioner context
  • mat - coarse problem mat

Level: developer

See also: PCDEFLATION, PCDeflationGetCoarseKSP()

External Links

source
PETSc.LibPETSc.PCDeflationSetCorrectionFactor — Method
PCDeflationSetCorrectionFactor(petsclib::PetscLibType, pc::AbstractPC, fact::PetscScalar)

Set coarse problem correction factor. The preconditioner becomes PM^{-1} + factQ.

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • fact - correction factor

Options Database Keys:

  • -pc_deflation_correction (true|false) - if true apply coarse problem correction
  • -pc_deflation_correction_factor fact - sets coarse problem correction factor

See also: PCDEFLATION, PCDeflationSetLevels(), PCDeflationSetReductionFactor()

External Links

source
PETSc.LibPETSc.PCDeflationSetInitOnly — Method
PCDeflationSetInitOnly(petsclib::PetscLibType, pc::AbstractPC, flg::PetscBool)

Do only initialization step. Sets initial guess to the solution on the deflation space but does not apply the deflation preconditioner. The additional preconditioner is still applied.

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • flg - default PETSC_FALSE

Options Database Key:

  • -pc_deflation_init_only (true|false) - if true computes only the special guess

Level: intermediate

See also: PCDEFLATION

External Links

source
PETSc.LibPETSc.PCDeflationSetLevels — Method
PCDeflationSetLevels(petsclib::PetscLibType, pc::AbstractPC, max::PetscInt)

Set the maximum level of deflation nesting.

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • max - maximum deflation level

Options Database Key:

  • -pc_deflation_max_lvl max - maximum number of levels for multilevel deflation

Level: intermediate

See also: PCDeflationSetSpaceToCompute(), PCDeflationSetSpace(), PCDEFLATION

External Links

source
PETSc.LibPETSc.PCDeflationSetReductionFactor — Method
PCDeflationSetReductionFactor(petsclib::PetscLibType, pc::AbstractPC, red::PetscInt)

Set reduction factor for the PCDEFLATION

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • red - reduction factor (or PETSC_DETERMINE)

Options Database Key:

  • -pc_deflation_reduction_factor red - reduction factor on bottom level coarse problem for PCDEFLATION

See also: PCTELESCOPE, PCDEFLATION, PCDeflationSetLevels()

External Links

source
PETSc.LibPETSc.PCDeflationSetSpace — Method
PCDeflationSetSpace(petsclib::PetscLibType, pc::AbstractPC, W::AbstractPetscMat, transpose::PetscBool)

Set the deflation space matrix (or its (Hermitian) transpose).

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • W - deflation matrix
  • transpose - indicates that W is an explicit transpose of the deflation matrix

Level: intermediate

See also: PCDeflationSetLevels(), PCDEFLATION, PCDeflationSetProjectionNullSpaceMat()

External Links

source
PETSc.LibPETSc.PCDeflationSetSpaceToCompute — Method
PCDeflationSetSpaceToCompute(petsclib::PetscLibType, pc::AbstractPC, type::PCDeflationSpaceType, size::PetscInt)

Set deflation space type and size to compute.

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • type - deflation space type to compute (or PETSC_IGNORE)
  • size - size of the space to compute (or PETSC_DEFAULT)

Options Database Keys:

  • -pc_deflation_compute_space type - compute PCDeflationSpaceType deflation space
  • -pc_deflation_compute_space_size size - size of the deflation space

See also: PCDeflationSetLevels(), PCDEFLATION

External Links

source
PETSc.LibPETSc.PCDestroy — Method
PCDestroy(petsclib::PetscLibType, pc::AbstractPC)

Destroys PC context that was created with PCCreate().

Collective

Input Parameter:

  • pc - the PC preconditioner context

Level: developer

See also: PC, PCCreate(), PCSetUp()

External Links

source
PETSc.LibPETSc.PCDiagonalScaleLeft — Method
PCDiagonalScaleLeft(petsclib::PetscLibType, pc::AbstractPC, in::AbstractPetscVec, out::AbstractPetscVec)

Scales a vector by the left scaling as needed by certain time-stepping codes.

Logically Collective

Input Parameters:

  • pc - the PC preconditioner context
  • in - input vector
  • out - scaled vector (maybe the same as in)

Level: intermediate

See also: PCCreate(), PCSetUp(), PCSetDiagonalScale(), PCDiagonalScaleRight(), MatDiagonalScale()

External Links

source
PETSc.LibPETSc.PCDiagonalScaleRight — Method
PCDiagonalScaleRight(petsclib::PetscLibType, pc::AbstractPC, in::AbstractPetscVec, out::AbstractPetscVec)

Scales a vector by the right scaling as needed by certain time-stepping codes.

Logically Collective

Input Parameters:

  • pc - the PC preconditioner context
  • in - input vector
  • out - scaled vector (maybe the same as in)

Level: intermediate

See also: PCCreate(), PCSetUp(), PCDiagonalScaleLeft(), PCSetDiagonalScale(), MatDiagonalScale()

External Links

source
PETSc.LibPETSc.PCEisenstatGetNoDiagonalScaling — Method
flg::PetscBool = PCEisenstatGetNoDiagonalScaling(petsclib::PetscLibType, pc::AbstractPC)

Tells if the Eisenstat preconditioner not to do additional diagonal preconditioning. For matrices with a constant along the diagonal, this may save a small amount of work.

Logically Collective

Input Parameter:

  • pc - the preconditioner context

Output Parameter:

  • flg - PETSC_TRUE means there is no diagonal scaling applied

Options Database Key:

  • -pc_eisenstat_no_diagonal_scaling - Activates PCEisenstatSetNoDiagonalScaling()

Level: intermediate

See also: PCEISENSTAT, PCEisenstatGetOmega()

External Links

source
PETSc.LibPETSc.PCEisenstatGetOmega — Method
omega::PetscReal = PCEisenstatGetOmega(petsclib::PetscLibType, pc::AbstractPC)

Gets the SSOR relaxation coefficient, omega, to use with Eisenstat's trick (where omega = 1.0 by default).

Logically Collective

Input Parameter:

  • pc - the preconditioner context

Output Parameter:

  • omega - relaxation coefficient (0 < omega < 2)

Options Database Key:

  • -pc_eisenstat_omega omega - Sets omega

See also: PCEISENSTAT, PCSORGetOmega(), PCEisenstatSetOmega()

External Links

source
PETSc.LibPETSc.PCEisenstatSetNoDiagonalScaling — Method
PCEisenstatSetNoDiagonalScaling(petsclib::PetscLibType, pc::AbstractPC, flg::PetscBool)

Causes the Eisenstat preconditioner, PCEISENSTAT not to do additional diagonal preconditioning. For matrices with a constant along the diagonal, this may save a small amount of work.

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • flg - PETSC_TRUE turns off diagonal scaling inside the algorithm

Options Database Key:

  • -pc_eisenstat_no_diagonal_scaling - Activates PCEisenstatSetNoDiagonalScaling()

Level: intermediate

See also: PCEisenstatSetOmega(), PCEISENSTAT

External Links

source
PETSc.LibPETSc.PCEisenstatSetOmega — Method
PCEisenstatSetOmega(petsclib::PetscLibType, pc::AbstractPC, omega::PetscReal)

Sets the SSOR relaxation coefficient, omega, to use with Eisenstat's trick (where omega = 1.0 by default)

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • omega - relaxation coefficient (0 < omega < 2)

Options Database Key:

  • -pc_eisenstat_omega omega - Sets omega

Level: intermediate

See also: PCSORSetOmega(), PCEISENSTAT

External Links

source
PETSc.LibPETSc.PCExoticSetType — Method
PCExoticSetType(petsclib::PetscLibType, pc::AbstractPC, type::PCExoticType)

Sets the type of coarse grid interpolation to use

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • type - either PC_EXOTIC_FACE or PC_EXOTIC_WIREBASKET (defaults to face)

Options Database Keys:

  • -pc_exotic_type (face|wirebasket) - use a coarse grid point for each face, or edge and vertex

See also: PCEXOTIC, PCExoticType()

External Links

source
PETSc.LibPETSc.PCFactorGetAllowDiagonalFill — Method
flg::PetscBool = PCFactorGetAllowDiagonalFill(petsclib::PetscLibType, pc::AbstractPC)

Determines if all diagonal matrix entries are treated as level 0 fill even if there is no non-zero location.

Logically Collective

Input Parameter:

  • pc - the preconditioner context

Output Parameter:

  • flg - PETSC_TRUE to turn on, PETSC_FALSE to turn off

See also: PCILU, PCICC, PCFactorSetAllowDiagonalFill()

External Links

source
PETSc.LibPETSc.PCFactorGetLevels — Method
levels::PetscInt = PCFactorGetLevels(petsclib::PetscLibType, pc::AbstractPC)

Gets the number of levels of fill to use.

Logically Collective

Input Parameter:

  • pc - the preconditioner context

Output Parameter:

  • levels - number of levels of fill

Level: intermediate

See also: PCILU, PCICC, PCFactorSetLevels()

External Links

source
PETSc.LibPETSc.PCFactorGetMatSolverType — Method
stype::String = PCFactorGetMatSolverType(petsclib::PetscLibType, pc::AbstractPC)

gets the solver package that is used to perform the factorization

Not Collective

Input Parameter:

  • pc - the preconditioner context

Output Parameter:

  • stype - for example, MATSOLVERSUPERLU, MATSOLVERSUPERLU_DIST, MATSOLVERMUMPS

Level: intermediate

See also: PCLU, PCCHOLESKY, MatGetFactor(), MatSolverType, MATSOLVERSUPERLU, MATSOLVERSUPERLU_DIST, MATSOLVERMUMPS

External Links

source
PETSc.LibPETSc.PCFactorGetMatrix — Method
mat::PetscMat = PCFactorGetMatrix(petsclib::PetscLibType, pc::AbstractPC)

Gets the factored matrix from the preconditioner context. This routine is valid only for the PCLU, PCILU, PCCHOLESKY, and PCICC methods.

Not Collective though mat is parallel if pc is parallel

Input Parameter:

  • pc - the PC preconditioner context

Output Parameters:

  • mat - the factored matrix

Level: advanced

See also: PC, PCLU, PCILU, PCCHOLESKY, PCICC

External Links

source
PETSc.LibPETSc.PCFactorGetShiftAmount — Method
shift::PetscReal = PCFactorGetShiftAmount(petsclib::PetscLibType, pc::AbstractPC)

Gets the tolerance used to define a zero privot

Not Collective

Input Parameter:

  • pc - the preconditioner context

Output Parameter:

  • shift - how much to shift the diagonal entry

Level: intermediate

See also: PCLU, PCCHOLESKY, PCFactorSetShiftAmount(), PCFactorSetShiftType(), PCFactorGetShiftType()

External Links

source
PETSc.LibPETSc.PCFactorGetShiftType — Method
type::MatFactorShiftType = PCFactorGetShiftType(petsclib::PetscLibType, pc::AbstractPC)

Gets the type of shift, if any, done when a zero pivot is detected

Not Collective

Input Parameter:

  • pc - the preconditioner context

Output Parameter:

  • type - one of MAT_SHIFT_NONE, MAT_SHIFT_NONZERO, MAT_SHIFT_POSITIVE_DEFINITE, or MAT_SHIFT_INBLOCKS

Level: intermediate

See also: PCLU, PCCHOLESKY, PCFactorSetShiftType(), MatFactorShiftType, PCFactorSetShiftAmount(), PCFactorGetShiftAmount()

External Links

source
PETSc.LibPETSc.PCFactorGetUseInPlace — Method
flg::PetscBool = PCFactorGetUseInPlace(petsclib::PetscLibType, pc::AbstractPC)

Determines if an in-place factorization is being used.

Logically Collective

Input Parameter:

  • pc - the preconditioner context

Output Parameter:

  • flg - PETSC_TRUE to enable, PETSC_FALSE to disable

Level: intermediate

See also: PCLU, PCCHOLESKY, PCILU, PCICC, PCFactorSetUseInPlace()

External Links

source
PETSc.LibPETSc.PCFactorGetZeroPivot — Method
pivot::PetscReal = PCFactorGetZeroPivot(petsclib::PetscLibType, pc::AbstractPC)

Gets the tolerance used to define a zero privot

Not Collective

Input Parameter:

  • pc - the preconditioner context

Output Parameter:

  • pivot - the tolerance

Level: intermediate

See also: PCLU, PCCHOLESKY, PCFactorSetZeroPivot()

External Links

source
PETSc.LibPETSc.PCFactorReorderForNonzeroDiagonal — Method
PCFactorReorderForNonzeroDiagonal(petsclib::PetscLibType, pc::AbstractPC, rtol::PetscReal)

reorders rows/columns of matrix to remove zeros from diagonal

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • rtol - diagonal entries smaller than this in absolute value are considered zero

Options Database Key:

  • -pc_factor_nonzeros_along_diagonal tol - perform the reordering with the given tolerance

Level: intermediate

See also: PCILU, PCICC, PCFactorSetFill(), PCFactorSetShiftAmount(), PCFactorSetZeroPivot(), MatReorderForNonzeroDiagonal()

External Links

source
PETSc.LibPETSc.PCFactorSetAllowDiagonalFill — Method
PCFactorSetAllowDiagonalFill(petsclib::PetscLibType, pc::AbstractPC, flg::PetscBool)

Causes all diagonal matrix entries to be treated as level 0 fill even if there is no non-zero location.

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • flg - PETSC_TRUE to turn on, PETSC_FALSE to turn off

Options Database Key:

  • -pc_factor_diagonal_fill (true|false) - allow the diagonal fill

See also: PCILU, PCICC, PCFactorGetAllowDiagonalFill()

External Links

source
PETSc.LibPETSc.PCFactorSetColumnPivot — Method
PCFactorSetColumnPivot(petsclib::PetscLibType, pc::AbstractPC, dtcol::PetscReal)

Determines when column pivoting is done during matrix factorization. For PETSc dense matrices column pivoting is always done, for PETSc sparse matrices it is never done. For the MATLAB and MATSOLVERSUPERLU factorization this is used.

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • dtcol - 0.0 implies no pivoting, 1.0 complete pivoting (slower, requires more memory but more stable)

Options Database Key:

  • -pc_factor_pivoting dtcol - perform the pivoting with the given tolerance

Level: intermediate

See also: PCLU, PCCHOLESKY, PCILU, PCICC, PCILUSetMatOrdering(), PCFactorSetPivotInBlocks()

External Links

source
PETSc.LibPETSc.PCFactorSetDropTolerance — Method
PCFactorSetDropTolerance(petsclib::PetscLibType, pc::AbstractPC, dt::PetscReal, dtcol::PetscReal, maxrowcount::PetscInt)

The preconditioner will use an PCILU based on a drop tolerance.

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • dt - the drop tolerance, try from 1.e-10 to .1
  • dtcol - tolerance for column pivot, good values [0.1 to 0.01]
  • maxrowcount - the max number of nonzeros allowed in a row, best value

depends on the number of nonzeros in row of original matrix

Options Database Key:

  • -pc_factor_drop_tolerance dt,dtcol,maxrowcount - Sets drop tolerance

Level: intermediate

See also: PCILU

External Links

source
PETSc.LibPETSc.PCFactorSetFill — Method
PCFactorSetFill(petsclib::PetscLibType, pc::AbstractPC, fill::PetscReal)

Indicate the amount of fill you expect in the factored matrix, fill = number nonzeros in factor/number nonzeros in original matrix.

Not Collective, each process can expect a different amount of fill

Input Parameters:

  • pc - the preconditioner context
  • fill - amount of expected fill

Options Database Key:

  • -pc_factor_fill fill - Sets fill amount

Level: intermediate

See also: PCLU, PCCHOLESKY, PCILU, PCICC, PCFactorSetReuseFill()

External Links

source
PETSc.LibPETSc.PCFactorSetLevels — Method
PCFactorSetLevels(petsclib::PetscLibType, pc::AbstractPC, levels::PetscInt)

Sets the number of levels of fill to use.

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • levels - number of levels of fill

Options Database Key:

  • -pc_factor_levels levels - Sets fill level

Level: intermediate

See also: PCILU, PCICC, PCFactorGetLevels()

External Links

source
PETSc.LibPETSc.PCFactorSetMatOrderingType — Method
PCFactorSetMatOrderingType(petsclib::PetscLibType, pc::AbstractPC, ordering::String)

Sets the ordering routine (to reduce fill) to be used in the PCLU, PCCHOLESKY, PCILU, or PCICC preconditioners

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • ordering - the matrix ordering name, for example, MATORDERINGND or MATORDERINGRCM

Options Database Key:

  • -pc_factor_mat_ordering_type ordering - Sets the ordering routine

Level: intermediate

See also: PCLU, PCCHOLESKY, PCILU, PCICC, MatOrderingType, MATORDERINGEXTERNAL, MATORDERINGND, MATORDERINGRCM

External Links

source
PETSc.LibPETSc.PCFactorSetMatSolverType — Method
PCFactorSetMatSolverType(petsclib::PetscLibType, pc::AbstractPC, stype::String)

sets the solver package that is used to perform the factorization

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • stype - for example, MATSOLVERSUPERLU, MATSOLVERSUPERLU_DIST, MATSOLVERMUMPS

Options Database Key:

  • -pc_factor_mat_solver_type stype - petsc, superlu, superlu_dist, mumps, cusparse

Level: intermediate

See also: PCLU, PCCHOLESKY, MatGetFactor(), MatSolverType, PCFactorGetMatSolverType(), MatSolverTypeRegister(), MatInitializePackage(), MATSOLVERSUPERLU, MATSOLVERSUPERLU_DIST, MATSOLVERMUMPS, MatSolverTypeGet()

External Links

source
PETSc.LibPETSc.PCFactorSetPivotInBlocks — Method
PCFactorSetPivotInBlocks(petsclib::PetscLibType, pc::AbstractPC, pivot::PetscBool)

Determines if pivoting is done while factoring each block with MATBAIJ or MATSBAIJ matrices

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • pivot - PETSC_TRUE or PETSC_FALSE

Options Database Key:

  • -pc_factor_pivot_in_blocks (true|false) - Pivot inside matrix dense blocks for MATBAIJ and MATSBAIJ

Level: intermediate

See also: PCLU, PCCHOLESKY, PCILU, PCICC, PCILUSetMatOrdering(), PCFactorSetColumnPivot()

External Links

source
PETSc.LibPETSc.PCFactorSetReuseFill — Method
PCFactorSetReuseFill(petsclib::PetscLibType, pc::AbstractPC, flag::PetscBool)

When matrices with different nonzero structure are factored, this causes later ones to use the fill ratio computed in the initial factorization.

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • flag - PETSC_TRUE to reuse else PETSC_FALSE

Options Database Key:

  • -pc_factor_reuse_fill - Activates PCFactorSetReuseFill()

Level: intermediate

See also: PCLU, PCCHOLESKY, PCILU, PCICC, PCFactorSetReuseOrdering(), PCFactorSetFill()

External Links

source
PETSc.LibPETSc.PCFactorSetReuseOrdering — Method
PCFactorSetReuseOrdering(petsclib::PetscLibType, pc::AbstractPC, flag::PetscBool)

When similar matrices are factored, this causes the ordering computed in the first factor to be used for all following factors.

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • flag - PETSC_TRUE to reuse else PETSC_FALSE

Options Database Key:

  • -pc_factor_reuse_ordering - Activate PCFactorSetReuseOrdering()

Level: intermediate

See also: PCLU, PCCHOLESKY, PCFactorSetReuseFill()

External Links

source
PETSc.LibPETSc.PCFactorSetShiftAmount — Method
PCFactorSetShiftAmount(petsclib::PetscLibType, pc::AbstractPC, shiftamount::PetscReal)

adds a quantity to the diagonal of the matrix during numerical factorization, thus the matrix has nonzero pivots

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • shiftamount - amount of shift or PETSC_DECIDE for the default

Options Database Key:

  • -pc_factor_shift_amount shiftamount - Sets shift amount or -1 for the default

Level: intermediate

See also: PCCHOLESKY, PCLU, PCFactorSetZeroPivot(), PCFactorSetShiftType()

External Links

source
PETSc.LibPETSc.PCFactorSetShiftType — Method
PCFactorSetShiftType(petsclib::PetscLibType, pc::AbstractPC, shifttype::MatFactorShiftType)

adds a particular type of quantity to the diagonal of the matrix during numerical factorization, thus the matrix has nonzero pivots

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • shifttype - type of shift; one of MAT_SHIFT_NONE, MAT_SHIFT_NONZERO, MAT_SHIFT_POSITIVE_DEFINITE, MAT_SHIFT_INBLOCKS

Options Database Key:

  • -pc_factor_shift_type shifttype - Sets shift type; see MatFactorShiftType

Level: intermediate

See also: PCCHOLESKY, PCLU, PCFactorSetZeroPivot(), PCFactorSetShiftAmount()

External Links

source
PETSc.LibPETSc.PCFactorSetUpMatSolverType — Method
PCFactorSetUpMatSolverType(petsclib::PetscLibType, pc::AbstractPC)

Can be called after KSPSetOperators() or PCSetOperators(), causes MatGetFactor() to be called so then one may set the options for that particular factorization object.

Input Parameter:

  • pc - the preconditioner context

Level: intermediate

See also: PCCHOLESKY, PCLU, PCFactorSetMatSolverType(), PCFactorGetMatrix()

External Links

source
PETSc.LibPETSc.PCFactorSetUseInPlace — Method
PCFactorSetUseInPlace(petsclib::PetscLibType, pc::AbstractPC, flg::PetscBool)

Tells the preconditioner to do an in-place factorization.

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • flg - PETSC_TRUE to enable, PETSC_FALSE to disable

Options Database Key:

  • -pc_factor_in_place (true|false) - Activate/deactivate in-place factorization

See also: PC, Mat, PCLU, PCCHOLESKY, PCILU, PCICC, PCFactorGetUseInPlace()

External Links

source
PETSc.LibPETSc.PCFactorSetZeroPivot — Method
PCFactorSetZeroPivot(petsclib::PetscLibType, pc::AbstractPC, zero::PetscReal)

Sets the size at which smaller pivots are declared to be zero

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • zero - all pivots smaller than this will be considered zero

Options Database Key:

  • -pc_factor_zeropivot zero - Sets tolerance for what is considered a zero pivot

Level: intermediate

See also: PCCHOLESKY, PCLU, PCFactorSetShiftType(), PCFactorSetShiftAmount()

External Links

source
PETSc.LibPETSc.PCFieldSplitGetDMSplits — Method
flg::PetscBool = PCFieldSplitGetDMSplits(petsclib::PetscLibType, pc::AbstractPC)

Returns flag indicating whether DMCreateFieldDecomposition() should be used to define the splits in a PCFIELDSPLIT, whenever possible.

Logically Collective

Input Parameter:

  • pc - the preconditioner context

Output Parameter:

  • flg - boolean indicating whether to use field splits defined by the DM

Level: intermediate

See also: PC, PCFIELDSPLIT, PCFieldSplitSetDMSplits(), DMCreateFieldDecomposition(), PCFieldSplitSetFields(), PCFieldSplitSetIS()

External Links

source
PETSc.LibPETSc.PCFieldSplitGetDetectSaddlePoint — Method
flg::PetscBool = PCFieldSplitGetDetectSaddlePoint(petsclib::PetscLibType, pc::AbstractPC)

Returns flag indicating whether PCFIELDSPLIT will attempt to automatically determine fields based on zero diagonal entries.

Logically Collective

Input Parameter:

  • pc - the preconditioner context

Output Parameter:

  • flg - boolean indicating whether to detect fields or not

Level: intermediate

See also: PC, PCFIELDSPLIT, PCFieldSplitSetDetectSaddlePoint()

External Links

source
PETSc.LibPETSc.PCFieldSplitGetDiagUseAmat — Method
flg::PetscBool = PCFieldSplitGetDiagUseAmat(petsclib::PetscLibType, pc::AbstractPC)

get the flag indicating whether to extract diagonal blocks from Amat (rather than Pmat) to build the sub-matrices associated with each split. Where KSPSetOperators(ksp,Amat,Pmat) was used to supply the operators.

Logically Collective

Input Parameter:

  • pc - the preconditioner object

Output Parameter:

  • flg - boolean flag indicating whether or not to use Amat to extract the diagonal blocks from

Level: intermediate

See also: PC, PCSetOperators(), KSPSetOperators(), PCFieldSplitSetDiagUseAmat(), PCFieldSplitGetOffDiagUseAmat(), PCFIELDSPLIT

External Links

source
PETSc.LibPETSc.PCFieldSplitGetIS — Method
is::IS = PCFieldSplitGetIS(petsclib::PetscLibType, pc::AbstractPC, splitname::String)

Retrieves the elements for a split as an IS

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • splitname - name of this split

Output Parameter:

  • is - the index set that defines the elements in this split, or NULL if the split is not found

Level: intermediate

See also: PC, PCFieldSplitGetSubKSP(), PCFIELDSPLIT, PCFieldSplitSetIS(), PCFieldSplitGetISByIndex()

External Links

source
PETSc.LibPETSc.PCFieldSplitGetISByIndex — Method
is::IS = PCFieldSplitGetISByIndex(petsclib::PetscLibType, pc::AbstractPC, index::PetscInt)

Retrieves the elements for a given split as an IS

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • index - index of this split

Output Parameter:

  • is - the index set that defines the elements in this split

Level: intermediate

See also: PC, PCFieldSplitGetSubKSP(), PCFIELDSPLIT, PCFieldSplitGetIS(), PCFieldSplitSetIS()

External Links

source
PETSc.LibPETSc.PCFieldSplitGetOffDiagUseAmat — Method
flg::PetscBool = PCFieldSplitGetOffDiagUseAmat(petsclib::PetscLibType, pc::AbstractPC)

get the flag indicating whether to extract off-diagonal blocks from Amat (rather than Pmat) to build the sub-matrices associated with each split. Where KSPSetOperators(ksp,Amat,Pmat) was used to supply the operators.

Logically Collective

Input Parameter:

  • pc - the preconditioner object

Output Parameter:

  • flg - boolean flag indicating whether or not to use Amat to extract the off-diagonal blocks from

Level: intermediate

See also: PC, PCSetOperators(), KSPSetOperators(), PCFieldSplitSetOffDiagUseAmat(), PCFieldSplitGetDiagUseAmat(), PCFIELDSPLIT

External Links

source
PETSc.LibPETSc.PCFieldSplitGetSchurBlocks — Method
A00::PetscMat,A01::PetscMat,A10::PetscMat,A11::PetscMat = PCFieldSplitGetSchurBlocks(petsclib::PetscLibType, pc::AbstractPC)

Gets all matrix blocks for the Schur complement

Collective

Input Parameter:

  • pc - the preconditioner context

Output Parameters:

  • A00 - the (0,0) block
  • A01 - the (0,1) block
  • A10 - the (1,0) block
  • A11 - the (1,1) block

Level: advanced

See also: PC, PCFIELDSPLIT, MatSchurComplementGetSubMatrices(), MatSchurComplementSetSubMatrices()

External Links

source
PETSc.LibPETSc.PCFieldSplitGetSchurPre — Method
ptype::PCFieldSplitSchurPreType,pre::PetscMat = PCFieldSplitGetSchurPre(petsclib::PetscLibType, pc::AbstractPC)

For Schur complement fieldsplit, determine how the Schur complement will be preconditioned. See PCFieldSplitSetSchurPre() for details.

Logically Collective

Input Parameter:

  • pc - the preconditioner context

Output Parameters:

  • ptype - which matrix to use for preconditioning the Schur complement: PC_FIELDSPLIT_SCHUR_PRE_A11, PC_FIELDSPLIT_SCHUR_PRE_SELF, PC_FIELDSPLIT_SCHUR_PRE_USER
  • pre - matrix to use for preconditioning (with PC_FIELDSPLIT_SCHUR_PRE_USER), or NULL

Level: intermediate

See also: PC, PCFieldSplitSetSchurPre(), PCFieldSplitGetSubKSP(), PCFIELDSPLIT, PCFieldSplitSetFields(), PCFieldSplitSchurPreType, PCLSC

External Links

source
PETSc.LibPETSc.PCFieldSplitGetSubKSP — Method
n::PetscInt,subksp::Vector{KSP} = PCFieldSplitGetSubKSP(petsclib::PetscLibType, pc::AbstractPC)

Gets the KSP contexts for all splits

Collective

Input Parameter:

  • pc - the preconditioner context

Output Parameters:

  • n - the number of splits
  • subksp - the array of KSP contexts

Level: advanced

See also: PC, PCFIELDSPLIT, PCFieldSplitSetFields(), PCFieldSplitSetIS(), PCFieldSplitSchurGetSubKSP()

External Links

source
PETSc.LibPETSc.PCFieldSplitGetType — Method
type::PCCompositeType = PCFieldSplitGetType(petsclib::PetscLibType, pc::AbstractPC)

Gets the type, PCCompositeType, of a PCFIELDSPLIT

Not collective

Input Parameter:

  • pc - the preconditioner context

Output Parameter:

  • type - PC_COMPOSITE_ADDITIVE, PC_COMPOSITE_MULTIPLICATIVE (default), PC_COMPOSITE_SYMMETRIC_MULTIPLICATIVE, PC_COMPOSITE_SPECIAL, PC_COMPOSITE_SCHUR

Level: intermediate

See also: PC, PCCompositeSetType(), PCFIELDSPLIT, PCCompositeType, PC_COMPOSITE_ADDITIVE, PC_COMPOSITE_MULTIPLICATIVE, PC_COMPOSITE_SYMMETRIC_MULTIPLICATIVE, PC_COMPOSITE_SPECIAL, PC_COMPOSITE_SCHUR

External Links

source
PETSc.LibPETSc.PCFieldSplitRestrictIS — Method
PCFieldSplitRestrictIS(petsclib::PetscLibType, pc::AbstractPC, isy::AbstractIS)

Restricts the fieldsplit ISs to be within a given IS.

Input Parameters:

  • pc - the preconditioner context
  • isy - the index set that defines the indices to which the fieldsplit is to be restricted

Level: advanced

See also: PCFIELDSPLIT, PCFieldSplitSetFields(), PCFieldSplitSetIS()

External Links

source
PETSc.LibPETSc.PCFieldSplitSchurGetS — Method
S::PetscMat = PCFieldSplitSchurGetS(petsclib::PetscLibType, pc::AbstractPC)

extract the MATSCHURCOMPLEMENT object used by this PCFIELDSPLIT in case it needs to be configured separately

Not Collective

Input Parameter:

  • pc - the preconditioner context

Output Parameter:

  • S - the Schur complement matrix

Level: advanced

See also: PC, PCFieldSplitGetSubKSP(), PCFIELDSPLIT, PCFieldSplitSchurPreType, PCFieldSplitSetSchurPre(), MATSCHURCOMPLEMENT, PCFieldSplitSchurRestoreS(), MatCreateSchurComplement(), MatSchurComplementGetKSP(), MatSchurComplementComputeExplicitOperator(), MatGetSchurComplement()

External Links

source
PETSc.LibPETSc.PCFieldSplitSchurGetSubKSP — Method
n::PetscInt,subksp::Vector{KSP} = PCFieldSplitSchurGetSubKSP(petsclib::PetscLibType, pc::AbstractPC)

Gets the KSP contexts used inside the Schur complement based PCFIELDSPLIT

Collective

Input Parameter:

  • pc - the preconditioner context

Output Parameters:

  • n - the number of splits
  • subksp - the array of KSP contexts

Level: advanced

See also: PC, PCFIELDSPLIT, PCFieldSplitSetFields(), PCFieldSplitSetIS(), PCFieldSplitGetSubKSP()

External Links

source
PETSc.LibPETSc.PCFieldSplitSchurRestoreS — Method
PCFieldSplitSchurRestoreS(petsclib::PetscLibType, pc::AbstractPC, S::AbstractPetscMat)

returns the MATSCHURCOMPLEMENT matrix used by this PC

Not Collective

Input Parameters:

  • pc - the preconditioner context
  • S - the Schur complement matrix

Level: advanced

See also: PC, PCFieldSplitGetSubKSP(), PCFIELDSPLIT, PCFieldSplitSchurPreType, PCFieldSplitSetSchurPre(), MatSchurComplement, PCFieldSplitSchurGetS()

External Links

source
PETSc.LibPETSc.PCFieldSplitSetBlockSize — Method
PCFieldSplitSetBlockSize(petsclib::PetscLibType, pc::AbstractPC, bs::PetscInt)

Sets the block size for defining where fields start in the fieldsplit preconditioner when calling PCFieldSplitSetFields(). If not set the matrix block size is used.

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • bs - the block size

Level: intermediate

See also: PC, PCFieldSplitGetSubKSP(), PCFIELDSPLIT, PCFieldSplitSetFields(), PCFieldSplitSetIS()

External Links

source
PETSc.LibPETSc.PCFieldSplitSetDMSplits — Method
PCFieldSplitSetDMSplits(petsclib::PetscLibType, pc::AbstractPC, flg::PetscBool)

Flags whether DMCreateFieldDecomposition() should be used to define the splits in a PCFIELDSPLIT, whenever possible.

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • flg - boolean indicating whether to use field splits defined by the DM

Options Database Key:

  • -pc_fieldsplit_dm_splits (true|false) - use the field splits defined by the DM

Level: intermediate

See also: PC, PCFIELDSPLIT, PCFieldSplitGetDMSplits(), DMCreateFieldDecomposition(), PCFieldSplitSetFields(), PCFieldSplitSetIS()

External Links

source
PETSc.LibPETSc.PCFieldSplitSetDetectSaddlePoint — Method
PCFieldSplitSetDetectSaddlePoint(petsclib::PetscLibType, pc::AbstractPC, flg::PetscBool)

Sets flag indicating whether PCFIELDSPLIT will attempt to automatically determine fields based on zero diagonal entries.

Logically Collective

Input Parameter:

  • pc - the preconditioner context

Output Parameter:

  • flg - boolean indicating whether to detect fields or not

Options Database Key:

  • -pc_fieldsplit_detect_saddle_point (true|false) - detect and use the saddle point

Level: intermediate

See also: PC, PCFIELDSPLIT, PCFieldSplitGetDetectSaddlePoint(), PCFieldSplitSetType(), PCFieldSplitSetSchurPre(), PC_FIELDSPLIT_SCHUR_PRE_SELF

External Links

source
PETSc.LibPETSc.PCFieldSplitSetDiagUseAmat — Method
PCFieldSplitSetDiagUseAmat(petsclib::PetscLibType, pc::AbstractPC, flg::PetscBool)

set flag indicating whether to extract diagonal blocks from Amat (rather than Pmat) to build the sub-matrices associated with each split. Where KSPSetOperators(ksp,Amat,Pmat) was used to supply the operators.

Logically Collective

Input Parameters:

  • pc - the preconditioner object
  • flg - boolean flag indicating whether or not to use Amat to extract the diagonal blocks from

Options Database Key:

  • -pc_fieldsplit_diag_use_amat - use the Amat to provide the diagonal blocks

Level: intermediate

See also: PC, PCSetOperators(), KSPSetOperators(), PCFieldSplitGetDiagUseAmat(), PCFieldSplitSetOffDiagUseAmat(), PCFIELDSPLIT

External Links

source
PETSc.LibPETSc.PCFieldSplitSetFields — Method
PCFieldSplitSetFields(petsclib::PetscLibType, pc::AbstractPC, splitname::String, n::PetscInt, fields::Vector{PetscInt}, fields_col::Vector{PetscInt})

Sets the fields that define one particular split in PCFIELDSPLIT

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • splitname - name of this split, if NULL the number of the split is used
  • n - the number of fields in this split
  • fields - the fields in this split
  • fields_col - generally the same as fields, if it does not match fields then the submatrix that is solved for this set of fields comes from an off-diagonal block

of the matrix and fields_col provides the column indices for that block

Options Database Key:

  • -pc_fieldsplit_%d_fields a,b,... - indicates the fields to be used in the %d'th split

Level: intermediate

See also: PC, PCFieldSplitGetSubKSP(), PCFIELDSPLIT, PCFieldSplitSetBlockSize(), PCFieldSplitSetIS(), PCFieldSplitRestrictIS(), MatSetBlockSize(), MatCreateNest()

External Links

source
PETSc.LibPETSc.PCFieldSplitSetGKBDelay — Method
PCFieldSplitSetGKBDelay(petsclib::PetscLibType, pc::AbstractPC, delay::PetscInt)

Sets the delay in the lower bound error estimate in the generalized Golub-Kahan bidiagonalization {cite}arioli2013 in PCFIELDSPLIT preconditioner.

Collective

Input Parameters:

  • pc - the preconditioner context
  • delay - the delay window in the lower bound estimate

Options Database Key:

  • -pc_fieldsplit_gkb_delay delay - default is 5

Level: intermediate

See also: PC, PCFIELDSPLIT, PCFieldSplitSetGKBNu(), PCFieldSplitSetGKBTol(), PCFieldSplitSetGKBMaxit()

External Links

source
PETSc.LibPETSc.PCFieldSplitSetGKBMaxit — Method
PCFieldSplitSetGKBMaxit(petsclib::PetscLibType, pc::AbstractPC, maxit::PetscInt)

Sets the maximum number of iterations for the generalized Golub-Kahan bidiagonalization preconditioner {cite}arioli2013 in PCFIELDSPLIT

Collective

Input Parameters:

  • pc - the preconditioner context
  • maxit - the maximum number of iterations

Options Database Key:

  • -pc_fieldsplit_gkb_maxit maxit - default is 100

Level: intermediate

See also: PC, PCFIELDSPLIT, PCFieldSplitSetGKBDelay(), PCFieldSplitSetGKBTol(), PCFieldSplitSetGKBNu()

External Links

source
PETSc.LibPETSc.PCFieldSplitSetGKBNu — Method
PCFieldSplitSetGKBNu(petsclib::PetscLibType, pc::AbstractPC, nu::PetscReal)

Sets the scalar value nu >= 0 in the transformation H = A00 + nuA01A01' of the (1,1) block in the Golub-Kahan bidiagonalization preconditioner {cite}arioli2013 in PCFIELDSPLIT

Collective

Input Parameters:

  • pc - the preconditioner context
  • nu - the shift parameter

Options Database Key:

  • -pc_fieldsplit_gkb_nu nu - default is 1

Level: intermediate

See also: PC, PCFIELDSPLIT, PCFieldSplitSetGKBDelay(), PCFieldSplitSetGKBTol(), PCFieldSplitSetGKBMaxit()

External Links

source
PETSc.LibPETSc.PCFieldSplitSetGKBTol — Method
PCFieldSplitSetGKBTol(petsclib::PetscLibType, pc::AbstractPC, tolerance::PetscReal)

Sets the solver tolerance for the generalized Golub-Kahan bidiagonalization preconditioner {cite}arioli2013 in PCFIELDSPLIT

Collective

Input Parameters:

  • pc - the preconditioner context
  • tolerance - the solver tolerance

Options Database Key:

  • -pc_fieldsplit_gkb_tol tolerance - default is 1e-5

Level: intermediate

See also: PC, PCFIELDSPLIT, PCFieldSplitSetGKBDelay(), PCFieldSplitSetGKBNu(), PCFieldSplitSetGKBMaxit()

External Links

source
PETSc.LibPETSc.PCFieldSplitSetIS — Method
PCFieldSplitSetIS(petsclib::PetscLibType, pc::AbstractPC, splitname::String, is::AbstractIS)

Sets the exact elements for a split in a PCFIELDSPLIT

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • splitname - name of this split, if NULL the number of the split is used
  • is - the index set that defines the elements in this split

Level: intermediate

See also: PC, PCFieldSplitGetSubKSP(), PCFIELDSPLIT, PCFieldSplitSetBlockSize(), PCFieldSplitSetFields()

External Links

source
PETSc.LibPETSc.PCFieldSplitSetOffDiagUseAmat — Method
PCFieldSplitSetOffDiagUseAmat(petsclib::PetscLibType, pc::AbstractPC, flg::PetscBool)

set flag indicating whether to extract off-diagonal blocks from Amat (rather than Pmat) to build the sub-matrices associated with each split. Where KSPSetOperators(ksp,Amat,Pmat) was used to supply the operators.

Logically Collective

Input Parameters:

  • pc - the preconditioner object
  • flg - boolean flag indicating whether or not to use Amat to extract the off-diagonal blocks from

Options Database Key:

  • -pc_fieldsplit_off_diag_use_amat (true|false) - use the Amat to extract the off-diagonal blocks

Level: intermediate

See also: PC, PCSetOperators(), KSPSetOperators(), PCFieldSplitGetOffDiagUseAmat(), PCFieldSplitSetDiagUseAmat(), PCFIELDSPLIT

External Links

source
PETSc.LibPETSc.PCFieldSplitSetSchurFactType — Method
PCFieldSplitSetSchurFactType(petsclib::PetscLibType, pc::AbstractPC, ftype::PCFieldSplitSchurFactType)

sets which blocks of the approximate block factorization to retain in the preconditioner {cite}murphy2000note and {cite}ipsen2001note

Collective

Input Parameters:

  • pc - the preconditioner context
  • ftype - which blocks of factorization to retain, PC_FIELDSPLIT_SCHUR_FACT_FULL is default

Options Database Key:

  • -pc_fieldsplit_schur_fact_type (diag|lower|upper|full) - default is full

Level: intermediate

See also: PC, PCFieldSplitGetSubKSP(), PCFIELDSPLIT, PCFieldSplitSetFields(), PCFieldSplitSchurPreType, PCFieldSplitSetSchurScale(), PCFieldSplitSetSchurPre()

External Links

source
PETSc.LibPETSc.PCFieldSplitSetSchurPre — Method
PCFieldSplitSetSchurPre(petsclib::PetscLibType, pc::AbstractPC, ptype::PCFieldSplitSchurPreType, pre::AbstractPetscMat)

Indicates from what operator the preconditioner is constructed for the Schur complement. The default is the A11 matrix.

Collective

Input Parameters:

  • pc - the preconditioner context
  • ptype - which matrix to use for preconditioning the Schur complement: PC_FIELDSPLIT_SCHUR_PRE_A11 (default),

PC_FIELDSPLIT_SCHUR_PRE_SELF, PC_FIELDSPLIT_SCHUR_PRE_USER, PC_FIELDSPLIT_SCHUR_PRE_SELFP, and PC_FIELDSPLIT_SCHUR_PRE_FULL

  • pre - matrix to use for preconditioning, or NULL

Options Database Keys:

  • -pc_fieldsplit_schur_precondition (self|selfp|user|a11|full) - default is a11. See notes for meaning of various arguments
  • -fieldsplit_1_pc_type pctype - the preconditioner algorithm that is used to construct the preconditioner from the operator

Level: intermediate

See also: PC, PCFieldSplitGetSchurPre(), PCFieldSplitGetSubKSP(), PCFIELDSPLIT, PCFieldSplitSetFields(), PCFieldSplitSchurPreType, MatSchurComplementSetAinvType(), PCLSC, PCFieldSplitSetSchurFactType()

External Links

source
PETSc.LibPETSc.PCFieldSplitSetSchurScale — Method
PCFieldSplitSetSchurScale(petsclib::PetscLibType, pc::AbstractPC, scale::PetscScalar)

Controls the sign flip of S for PC_FIELDSPLIT_SCHUR_FACT_DIAG.

Collective

Input Parameters:

  • pc - the preconditioner context
  • scale - scaling factor for the Schur complement

Options Database Key:

  • -pc_fieldsplit_schur_scale scale - default is -1.0

Level: intermediate

See also: PC, PCFIELDSPLIT, PCFieldSplitSetFields(), PCFieldSplitSchurFactType, PCFieldSplitSetSchurFactType()

External Links

source
PETSc.LibPETSc.PCFieldSplitSetType — Method
PCFieldSplitSetType(petsclib::PetscLibType, pc::AbstractPC, type::PCCompositeType)

Sets the type, PCCompositeType, of a PCFIELDSPLIT

Collective

Input Parameters:

  • pc - the preconditioner context
  • type - PC_COMPOSITE_ADDITIVE, PC_COMPOSITE_MULTIPLICATIVE (default), PC_COMPOSITE_SYMMETRIC_MULTIPLICATIVE, PC_COMPOSITE_SPECIAL, PC_COMPOSITE_SCHUR,

PC_COMPOSITE_GKB

Options Database Key:

  • -pc_fieldsplit_type (multiplicative|additive|symmetric_multiplicative|special|schur) - Sets fieldsplit preconditioner type

Level: intermediate

See also: PC, PCFIELDSPLIT, PCCompositeType, PCCompositeGetType(), PC_COMPOSITE_ADDITIVE, PC_COMPOSITE_MULTIPLICATIVE, PC_COMPOSITE_SYMMETRIC_MULTIPLICATIVE, PC_COMPOSITE_SPECIAL, PC_COMPOSITE_SCHUR, PCFieldSplitSetSchurFactType()

External Links

source
PETSc.LibPETSc.PCGAMGASMSetHEM — Method
PCGAMGASMSetHEM(petsclib::PetscLibType, pc::AbstractPC, n::PetscInt)

Sets the number of HEM matching passed

Collective

Input Parameters:

  • pc - the preconditioner
  • n - number of HEM matching passed to construct ASM subdomains

Options Database Key:

  • -pc_gamg_asm_hem n - set the number of HEM matching passed

Level: intermediate

See also: the Users Manual section on PCGAMG, the Users Manual section on PCMG, PCGAMG

External Links

source
PETSc.LibPETSc.PCGAMGASMSetUseAggs — Method
PCGAMGASMSetUseAggs(petsclib::PetscLibType, pc::AbstractPC, flg::PetscBool)

Have the PCGAMG smoother on each level use PCASM where the aggregates defined by the coarsening process are used as the subdomains for the additive Schwarz preconditioner smoother

Collective

Input Parameters:

  • pc - the preconditioner context
  • flg - PETSC_TRUE to use aggregates, PETSC_FALSE to not

Options Database Key:

  • -pc_gamg_asm_use_agg (true|false) - use aggregates to define the additive Schwarz subdomains

Level: intermediate

See also: the Users Manual section on PCGAMG, the Users Manual section on PCMG, PCGAMG, PCASM, PCSetType

External Links

source
PETSc.LibPETSc.PCGAMGClassicalGetType — Method
type::String = PCGAMGClassicalGetType(petsclib::PetscLibType, pc::AbstractPC)

Gets the type of classical interpolation to use with PCGAMG

Collective

Input Parameter:

  • pc - the preconditioner context

Output Parameter:

  • type - the type used, see PCGAMGClassicalType()

Level: intermediate

See also: PCGAMG, PCGAMGClassicalType, PCGAMGClassicalSetType()

External Links

source
PETSc.LibPETSc.PCGAMGClassicalSetType — Method
PCGAMGClassicalSetType(petsclib::PetscLibType, pc::AbstractPC, type::String)

Sets the type of classical interpolation to use with PCGAMG

Collective

Input Parameters:

  • pc - the preconditioner context
  • type - the interpolation to use, see PCGAMGClassicalType()

Options Database Key:

  • -pc_gamg_classical_type (direct|standard) - set type of classical AMG prolongation

Level: intermediate

See also: PCGAMG, PCGAMGClassicalType, PCGAMGClassicalGetType()

External Links

source
PETSc.LibPETSc.PCGAMGCreateGraph — Method
G::PetscMat = PCGAMGCreateGraph(petsclib::PetscLibType, pc::AbstractPC, A::AbstractPetscMat)

Creates a graph that is used by the PCGAMGType in the coarsening process

Input Parameters:

  • pc - the PCGAMG
  • A - the matrix, for any level

Output Parameter:

  • G - the graph

Level: advanced

See also: PCGAMGType, PCGAMG, PCGAMGSetType()

External Links

source
PETSc.LibPETSc.PCGAMGGetType — Method
type::String = PCGAMGGetType(petsclib::PetscLibType, pc::AbstractPC)

Get the type of algorithm PCGAMG will use

Collective

Input Parameter:

  • pc - the preconditioner context

Output Parameter:

  • type - the type of algorithm used

Level: intermediate

See also: the Users Manual section on PCGAMG, the Users Manual section on PCMG, PCGAMG, PCGAMGSetType(), PCGAMGType

External Links

source
PETSc.LibPETSc.PCGAMGMISkSetAggressive — Method
PCGAMGMISkSetAggressive(petsclib::PetscLibType, pc::AbstractPC, n::PetscInt)

Number (k) distance in MIS coarsening (> 2 is aggressive)

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • n - 1 or more (default = 2)

Options Database Key:

  • -pc_gamg_aggressive_mis_k n - the distance to use

Level: intermediate

See also: the Users Manual section on PCGAMG, the Users Manual section on PCMG, PCGAMG, PCGAMGSetThreshold(), PCGAMGSetAggressiveLevels(), PCGAMGSetAggressiveSquareGraph(), PCGAMGMISkSetMinDegreeOrdering(), PCGAMGSetLowMemoryFilter()

External Links

source
PETSc.LibPETSc.PCGAMGMISkSetMinDegreeOrdering — Method
PCGAMGMISkSetMinDegreeOrdering(petsclib::PetscLibType, pc::AbstractPC, b::PetscBool)

Use minimum degree ordering in greedy MIS algorithm

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • b - default false

Options Database Key:

  • -pc_gamg_mis_k_minimum_degree_ordering (true|false) - use the minimum degree ordering

Level: intermediate

See also: the Users Manual section on PCGAMG, the Users Manual section on PCMG, PCGAMG, PCGAMGSetThreshold(), PCGAMGSetAggressiveLevels(), PCGAMGMISkSetAggressive(), PCGAMGSetAggressiveSquareGraph(), PCGAMGSetLowMemoryFilter()

External Links

source
PETSc.LibPETSc.PCGAMGRegister — Method
PCGAMGRegister(petsclib::PetscLibType, type::String, create::external)

Register a PCGAMG implementation.

Input Parameters:

  • type - string that will be used as the name of the PCGAMG type.
  • create - function for creating the gamg context.

Level: developer

See also: PCGAMGType, PCGAMG, PCGAMGSetType()

External Links

source
PETSc.LibPETSc.PCGAMGSetAggressiveLevels — Method
PCGAMGSetAggressiveLevels(petsclib::PetscLibType, pc::AbstractPC, n::PetscInt)

Use aggressive coarsening on first n levels

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • n - 0, 1 or more, the default is 1

Options Database Key:

  • -pc_gamg_aggressive_coarsening n - the number of coarsenings to do aggressively

Level: intermediate

See also: the Users Manual section on PCGAMG, the Users Manual section on PCMG, PCGAMG, PCGAMGSetThreshold(), PCGAMGMISkSetAggressive(), PCGAMGSetAggressiveSquareGraph(), PCGAMGMISkSetMinDegreeOrdering(), PCGAMGSetLowMemoryFilter()

External Links

source
PETSc.LibPETSc.PCGAMGSetAggressiveSquareGraph — Method
PCGAMGSetAggressiveSquareGraph(petsclib::PetscLibType, pc::AbstractPC, b::PetscBool)

Use graph square (A^T A) for aggressive coarsening. Coarsening is slower than the alternative (MIS-2), which is faster and uses less memory

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • b - default true

Options Database Key:

  • -pc_gamg_aggressive_square_graph (true|false) - whether to use the graph square to aggressively coarsen

Level: intermediate

See also: the Users Manual section on PCGAMG, the Users Manual section on PCMG, PCGAMG, PCGAMGSetThreshold(), PCGAMGSetAggressiveLevels(), PCGAMGMISkSetAggressive(), PCGAMGMISkSetMinDegreeOrdering(), PCGAMGSetLowMemoryFilter()

External Links

source
PETSc.LibPETSc.PCGAMGSetCoarseEqLim — Method
PCGAMGSetCoarseEqLim(petsclib::PetscLibType, pc::AbstractPC, n::PetscInt)

Set maximum number of equations on the coarsest grid of PCGAMG

Collective

Input Parameters:

  • pc - the preconditioner context
  • n - maximum number of equations to aim for

Options Database Key:

  • -pc_gamg_coarse_eq_limit limit - set the limit

Level: intermediate

See also: the Users Manual section on PCGAMG, the Users Manual section on PCMG, PCGAMG, PCGAMGSetProcEqLim(), PCGAMGSetRankReductionFactors(), PCGAMGSetRepartition(), PCGAMGSetParallelCoarseGridSolve()

External Links

source
PETSc.LibPETSc.PCGAMGSetCoarseGridLayoutType — Method
PCGAMGSetCoarseGridLayoutType(petsclib::PetscLibType, pc::AbstractPC, flg::PCGAMGLayoutType)

place coarse grids on processors with natural order (compact type)

Collective

Input Parameters:

  • pc - the preconditioner context
  • flg - PCGAMGLayoutType type, either PCGAMG_LAYOUT_COMPACT or PCGAMG_LAYOUT_SPREAD

Options Database Key:

  • -pc_gamg_coarse_grid_layout_type (compact|spread) - place the coarse grids with natural ordering

Level: intermediate

See also: the Users Manual section on PCGAMG, the Users Manual section on PCMG, PCGAMG, PCGAMGSetParallelCoarseGridSolve(), PCGAMGSetCpuPinCoarseGrids(), PCGAMGLayoutType, PCGAMG_LAYOUT_COMPACT, PCGAMG_LAYOUT_SPREAD

External Links

source
PETSc.LibPETSc.PCGAMGSetCpuPinCoarseGrids — Method
PCGAMGSetCpuPinCoarseGrids(petsclib::PetscLibType, pc::AbstractPC, flg::PetscBool)

pin the coarse grids created in PCGAMG to run only on the CPU since the problems may be too small to run efficiently on the GPUs

Collective

Input Parameters:

  • pc - the preconditioner context
  • flg - PETSC_TRUE to pin coarse grids to the CPU

Options Database Key:

  • -pc_gamg_cpu_pin_coarse_grids (true|false) - pin the coarse grids to the CPU

Level: intermediate

See also: the Users Manual section on PCGAMG, the Users Manual section on PCMG, PCGAMG, PCGAMGSetCoarseGridLayoutType(), PCGAMGSetParallelCoarseGridSolve()

External Links

source
PETSc.LibPETSc.PCGAMGSetEigenvalues — Method
PCGAMGSetEigenvalues(petsclib::PetscLibType, pc::AbstractPC, emax::PetscReal, emin::PetscReal)

Set WHAT eigenvalues WHY?

Collective

Input Parameters:

  • pc - the preconditioner context
  • emax - max eigenvalue
  • emin - min eigenvalue

Options Database Key:

  • -pc_gamg_eigenvalues emin,emax - estimates of the eigenvalues

Level: intermediate

See also: the Users Manual section on PCGAMG, the Users Manual section on PCMG, PCGAMG, PCGAMGSetUseSAEstEig()

External Links

source
PETSc.LibPETSc.PCGAMGSetGraphSymmetrize — Method
PCGAMGSetGraphSymmetrize(petsclib::PetscLibType, pc::AbstractPC, b::PetscBool)

Symmetrize graph used for coarsening. Defaults to true, but if matrix has symmetric attribute, then not needed since the graph is already known to be symmetric

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • b - default true

Options Database Key:

  • -pc_gamg_graph_symmetrize (true|false) - symmetrize the graph

Level: intermediate

See also: the Users Manual section on PCGAMG, the Users Manual section on PCMG, PCGAMG, PCGAMGSetThreshold(), PCGAMGSetAggressiveLevels(), MatCreateGraph(), PCGAMGMISkSetAggressive(), PCGAMGSetAggressiveSquareGraph(), PCGAMGMISkSetMinDegreeOrdering()

External Links

source
PETSc.LibPETSc.PCGAMGSetInjectionIndex — Method
PCGAMGSetInjectionIndex(petsclib::PetscLibType, pc::AbstractPC, n::PetscInt, idx::Vector{PetscInt})

Array of subset of variables per vertex to inject into coarse grid space

Logically Collective

Input Parameters:

  • pc - the coarsen context
  • n - number of indices
  • idx - array of indices

Options Database Key:

  • -pc_gamg_injection_index - array of subset of variables per vertex to use for injection coarse grid space

Level: intermediate

See also: the Users Manual section on PCGAMG, the Users Manual section on PCMG, PCGAMG

External Links

source
PETSc.LibPETSc.PCGAMGSetLowMemoryFilter — Method
PCGAMGSetLowMemoryFilter(petsclib::PetscLibType, pc::AbstractPC, b::PetscBool)

Use low memory graph/matrix filter

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • b - default false

Options Database Key:

  • -pc_gamg_low_memory_threshold_filter (true|false) - use the low memory filter

Level: intermediate

See also: the Users Manual section on PCGAMG, the Users Manual section on PCMG, PCGAMG, PCGAMGSetThreshold(), PCGAMGSetAggressiveLevels(), PCGAMGMISkSetAggressive(), PCGAMGSetAggressiveSquareGraph(), PCGAMGMISkSetMinDegreeOrdering()

External Links

source
PETSc.LibPETSc.PCGAMGSetNSmooths — Method
PCGAMGSetNSmooths(petsclib::PetscLibType, pc::AbstractPC, n::PetscInt)

Set number of smoothing steps (1 is typical) used to construct the prolongation operator

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • n - the number of smooths, default is 1

Options Database Key:

  • -pc_gamg_agg_nsmooths nsmooth - number of smoothing steps to use

Level: intermediate

See also: the Users Manual section on PCGAMG, the Users Manual section on PCMG, PCMG, PCGAMG

External Links

source
PETSc.LibPETSc.PCGAMGSetNlevels — Method
PCGAMGSetNlevels(petsclib::PetscLibType, pc::AbstractPC, n::PetscInt)

Sets the maximum number of levels PCGAMG will use

Collective

Input Parameters:

  • pc - the preconditioner
  • n - the maximum number of levels to use

Options Database Key:

  • -pc_mg_levels n - set the maximum number of levels to allow

Level: intermediate

See also: the Users Manual section on PCGAMG, the Users Manual section on PCMG, PCGAMG

External Links

source
PETSc.LibPETSc.PCGAMGSetParallelCoarseGridSolve — Method
PCGAMGSetParallelCoarseGridSolve(petsclib::PetscLibType, pc::AbstractPC, flg::PetscBool)

allow a parallel coarse grid solver

Collective

Input Parameters:

  • pc - the preconditioner context
  • flg - PETSC_TRUE to not force coarse grid onto one processor

Options Database Key:

  • -pc_gamg_parallel_coarse_grid_solver (true|false) - use a parallel coarse grid solver

Level: intermediate

See also: the Users Manual section on PCGAMG, the Users Manual section on PCMG, PCGAMG, PCGAMGSetCoarseGridLayoutType(), PCGAMGSetCpuPinCoarseGrids(), PCGAMGSetRankReductionFactors()

External Links

source
PETSc.LibPETSc.PCGAMGSetProcEqLim — Method
PCGAMGSetProcEqLim(petsclib::PetscLibType, pc::AbstractPC, n::PetscInt)

Set number of equations to aim for per process on the coarse grids via processor reduction in PCGAMG

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • n - the number of equations

Options Database Key:

  • -pc_gamg_process_eq_limit limit - set the limit

Level: intermediate

See also: the Users Manual section on PCGAMG, the Users Manual section on PCMG, PCGAMG, PCGAMGSetCoarseEqLim(), PCGAMGSetRankReductionFactors(), PCGAMGSetRepartition()

External Links

source
PETSc.LibPETSc.PCGAMGSetRankReductionFactors — Method
PCGAMGSetRankReductionFactors(petsclib::PetscLibType, pc::AbstractPC, v::Vector{PetscInt}, n::PetscInt)

Set a manual schedule for MPI process reduction on coarse grids

Collective

Input Parameters:

  • pc - the preconditioner context
  • v - array of reduction factors. 0 for first value forces a reduction to one process/device on first level in CUDA
  • n - number of values provided in array

Options Database Key:

  • -pc_gamg_rank_reduction_factors r0,r1,... - provide the schedule

Level: intermediate

See also: the Users Manual section on PCGAMG, the Users Manual section on PCMG, PCGAMG, PCGAMGSetProcEqLim(), PCGAMGSetCoarseEqLim(), PCGAMGSetParallelCoarseGridSolve()

External Links

source
PETSc.LibPETSc.PCGAMGSetRecomputeEstEig — Method
PCGAMGSetRecomputeEstEig(petsclib::PetscLibType, pc::AbstractPC, b::PetscBool)

Set flag for Chebyshev smoothers to recompute the eigenvalue estimates when a new matrix is used

Collective

Input Parameters:

  • pc - the preconditioner context
  • b - flag, default is PETSC_TRUE

Options Database Key:

  • -pc_gamg_recompute_esteig (true|false) - recompute the eigenvalue estimate

Level: advanced

See also: the Users Manual section on PCGAMG, the Users Manual section on PCMG, PCGAMG, KSPChebyshevSetEigenvalues(), KSPChebyshevEstEigSet()

External Links

source
PETSc.LibPETSc.PCGAMGSetRepartition — Method
PCGAMGSetRepartition(petsclib::PetscLibType, pc::AbstractPC, n::PetscBool)

Repartition the degrees of freedom across the processors on the coarser grids when reducing the number of MPI processes used

Collective

Input Parameters:

  • pc - the preconditioner context
  • n - PETSC_TRUE or PETSC_FALSE

Options Database Key:

  • -pc_gamg_repartition (true|false) - turn on the repartitioning

Level: intermediate

See also: the Users Manual section on PCGAMG, the Users Manual section on PCMG, PCGAMG, PCGAMGSetProcEqLim(), PCGAMGSetRankReductionFactors()

External Links

source
PETSc.LibPETSc.PCGAMGSetReuseInterpolation — Method
PCGAMGSetReuseInterpolation(petsclib::PetscLibType, pc::AbstractPC, n::PetscBool)

Reuse prolongation when rebuilding a PCGAMG algebraic multigrid preconditioner when the matrix has changed

Collective

Input Parameters:

  • pc - the preconditioner context
  • n - PETSC_TRUE or PETSC_FALSE

Options Database Key:

  • -pc_gamg_reuse_interpolation (true|false) - reuse the previous interpolation

Level: intermediate

See also: the Users Manual section on PCGAMG, the Users Manual section on PCMG, PCGAMG

External Links

source
PETSc.LibPETSc.PCGAMGSetThreshold — Method
PCGAMGSetThreshold(petsclib::PetscLibType, pc::AbstractPC, v::Vector{PetscReal}, n::PetscInt)

Relative threshold to use for dropping edges in aggregation graph

Not Collective

Input Parameters:

  • pc - the preconditioner context
  • v - array of threshold values for finest n levels; 0.0 means keep all nonzero entries in the graph; negative means keep even zero entries in the graph
  • n - number of threshold values provided in array

Options Database Key:

  • -pc_gamg_threshold l0,l1,... - the thresholds to drop edges

Level: intermediate

See also: the Users Manual section on PCGAMG, the Users Manual section on PCMG, PCGAMG, PCGAMGSetAggressiveLevels(), PCGAMGMISkSetAggressive(), PCGAMGMISkSetMinDegreeOrdering(), PCGAMGSetThresholdScale()

External Links

source
PETSc.LibPETSc.PCGAMGSetThresholdScale — Method
PCGAMGSetThresholdScale(petsclib::PetscLibType, pc::AbstractPC, v::PetscReal)

Relative threshold reduction at each level

Not Collective

Input Parameters:

  • pc - the preconditioner context
  • v - the threshold value reduction, usually < 1.0

Options Database Key:

  • -pc_gamg_threshold_scale v - set the relative threshold reduction on each level

Level: advanced

See also: the Users Manual section on PCGAMG, the Users Manual section on PCMG, PCGAMG, PCGAMGSetThreshold()

External Links

source
PETSc.LibPETSc.PCGAMGSetType — Method
PCGAMGSetType(petsclib::PetscLibType, pc::AbstractPC, type::String)

Set the type of algorithm PCGAMG should use

Collective

Input Parameters:

  • pc - the preconditioner context
  • type - PCGAMGAGG, PCGAMGGEO, or PCGAMGCLASSICAL

Options Database Key:

  • -pc_gamg_type (agg|geo|classical) - type of algebraic multigrid to apply - only agg is supported

Level: intermediate

See also: the Users Manual section on PCGAMG, the Users Manual section on PCMG, PCGAMGGetType(), PCGAMG, PCGAMGType

External Links

source
PETSc.LibPETSc.PCGAMGSetUseSAEstEig — Method
PCGAMGSetUseSAEstEig(petsclib::PetscLibType, pc::AbstractPC, b::PetscBool)

Use the eigenvalue estimate from smoothed aggregation for the Chebyshev smoother during the solution process

Collective

Input Parameters:

  • pc - the preconditioner context
  • b - flag

Options Database Key:

  • -pc_gamg_use_sa_esteig (true|false) - use the eigen estimate

Level: advanced

See also: the Users Manual section on PCGAMG, the Users Manual section on PCMG, PCGAMG, KSPChebyshevSetEigenvalues(), KSPChebyshevEstEigSet(), PCGAMGSetRecomputeEstEig()

External Links

source
PETSc.LibPETSc.PCGASMCreateSubdomains — Method
M_n::PetscInt,iis::Vector{IS} = PCGASMCreateSubdomains(petsclib::PetscLibType, A::AbstractPetscMat, N::PetscInt)

Creates n index sets defining n nonoverlapping subdomains on this MPI process for the PCGASM additive Schwarz preconditioner for a any problem based on its matrix.

Collective

Input Parameters:

  • A - The global matrix operator
  • N - the number of global subdomains requested

Output Parameters:

  • n - the number of subdomains created on this MPI process
  • iis - the array of index sets defining the local inner subdomains (on which the correction is applied)

Level: advanced

See also: PCGASM, PCGASMSetSubdomains(), PCGASMDestroySubdomains()

External Links

source
PETSc.LibPETSc.PCGASMCreateSubdomains2D — Method
nsub::PetscInt,iis::Vector{IS},ois::Vector{IS} = PCGASMCreateSubdomains2D(petsclib::PetscLibType, pc::AbstractPC, M::PetscInt, N::PetscInt, Mdomains::PetscInt, Ndomains::PetscInt, dof::PetscInt, overlap::PetscInt)

Creates the index sets for the PCGASM overlapping Schwarz preconditioner for a two-dimensional problem on a regular grid.

Collective

Input Parameters:

  • pc - the preconditioner context
  • M - the global number of grid points in the x direction
  • N - the global number of grid points in the y direction
  • Mdomains - the global number of subdomains in the x direction
  • Ndomains - the global number of subdomains in the y direction
  • dof - degrees of freedom per node
  • overlap - overlap in mesh lines

Output Parameters:

  • nsub - the number of local subdomains created
  • iis - array of index sets defining inner (nonoverlapping) subdomains
  • ois - array of index sets defining outer (overlapping, if overlap > 0) subdomains

Level: advanced

See also: PCGASM, PCGASMSetSubdomains(), PCGASMGetSubKSP(), PCGASMSetOverlap(), PCASMCreateSubdomains2D(), PCGASMDestroySubdomains()

External Links

source
PETSc.LibPETSc.PCGASMDestroySubdomains — Function
PCGASMDestroySubdomains(petsclib::PetscLibType, n::PetscInt, iis::Union{Ptr, AbstractVector{<:AbstractIS}}, ois = nothing)

Destroys the index sets created with PCGASMCreateSubdomains() or PCGASMCreateSubdomains2D(). Should be called after setting subdomains with PCGASMSetSubdomains().

Collective

Input Parameters:

  • n - the number of index sets
  • iis - the vector of inner subdomains, or the raw pointer to a PETSc array of them
  • ois - the vector of outer subdomains, or the raw pointer to a PETSc array of them, can be nothing

With vectors, each index set is destroyed and left with a null pointer: the creators have already freed PETSc's array. With pointers, PETSc destroys the index sets and frees both arrays.

Level: intermediate

See also: PCGASM, PCGASMCreateSubdomains(), PCGASMSetSubdomains()

External Links

source
PETSc.LibPETSc.PCGASMGetSubKSP — Method
n_local::PetscInt,first_local::PetscInt,ksp::Vector{KSP} = PCGASMGetSubKSP(petsclib::PetscLibType, pc::AbstractPC)

Gets the local KSP contexts for all subdomains on this MPI process.

Collective iff first_local is requested

Input Parameter:

  • pc - the preconditioner context

Output Parameters:

  • n_local - the number of blocks on this MPI process or NULL
  • first_local - the global number of the first block on this process or NULL, all processes must request or all must pass NULL
  • ksp - the array of KSP contexts

Level: advanced

See also: PCGASM, PCGASMSetSubdomains(), PCGASMSetOverlap(), PCGASMCreateSubdomains2D()

External Links

source
PETSc.LibPETSc.PCGASMGetSubdomains — Method
n::PetscInt,iis::Vector{IS},ois::Vector{IS} = PCGASMGetSubdomains(petsclib::PetscLibType, pc::AbstractPC)

Gets the subdomains supported on this MPI process for the PCGASM additive Schwarz preconditioner.

Not Collective

Input Parameter:

  • pc - the preconditioner context

Output Parameters:

  • n - the number of subdomains for this MPI process (default value = 1)
  • iis - the index sets that define the inner subdomains (without overlap) supported on this process (can be NULL)
  • ois - the index sets that define the outer subdomains (with overlap) supported on this process (can be NULL)

Level: advanced

See also: PCGASM, PCGASMSetOverlap(), PCGASMGetSubKSP(), PCGASMCreateSubdomains2D(), PCGASMSetSubdomains(), PCGASMGetSubmatrices(), PCGASMDestroySubdomains()

External Links

source
PETSc.LibPETSc.PCGASMGetSubmatrices — Method
n::PetscInt,mat::Vector{PetscMat} = PCGASMGetSubmatrices(petsclib::PetscLibType, pc::AbstractPC)

Gets the local submatrices (for this MPI process only) for the PCGASM additive Schwarz preconditioner.

Not Collective

Input Parameter:

  • pc - the preconditioner context

Output Parameters:

  • n - the number of matrices for this MPI process (default value = 1)
  • mat - the matrices

Level: advanced

See also: PCGASM, PCGASMSetOverlap(), PCGASMGetSubKSP(), PCGASMCreateSubdomains2D(), PCGASMSetSubdomains(), PCGASMGetSubdomains()

External Links

source
PETSc.LibPETSc.PCGASMGetUseDMSubdomains — Method
flg::PetscBool = PCGASMGetUseDMSubdomains(petsclib::PetscLibType, pc::AbstractPC)

Returns flag indicating whether to use DMCreateDomainDecomposition() to define the subdomains, whenever possible with PCGASM

Not Collective

Input Parameter:

  • pc - the preconditioner

Output Parameter:

  • flg - boolean indicating whether to use subdomains defined by the DM

Level: intermediate

See also: PCGASM, PCGASMSetUseDMSubdomains(), PCGASMSetOverlap(), PCGASMCreateSubdomains2D()

External Links

source
PETSc.LibPETSc.PCGASMSetOverlap — Method
PCGASMSetOverlap(petsclib::PetscLibType, pc::AbstractPC, ovl::PetscInt)

Sets the overlap between a pair of subdomains for the additive Schwarz preconditioner PCGASM. Either all or no MPI processes in the pc communicator must call this routine.

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • ovl - the amount of overlap between subdomains (ovl >= 0, default value = 0)

Options Database Key:

  • -pc_gasm_overlap overlap - Sets overlap

Level: intermediate

See also: PCGASM, PCGASMSetSubdomains(), PCGASMGetSubKSP(), PCGASMCreateSubdomains2D(), PCGASMGetSubdomains()

External Links

source
PETSc.LibPETSc.PCGASMSetSortIndices — Method
PCGASMSetSortIndices(petsclib::PetscLibType, pc::AbstractPC, doSort::PetscBool)

Determines whether subdomain indices are sorted.

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • doSort - sort the subdomain indices

Level: intermediate

See also: PCGASM, PCGASMSetSubdomains(), PCGASMGetSubKSP(), PCGASMCreateSubdomains2D()

External Links

source
PETSc.LibPETSc.PCGASMSetSubdomains — Method
PCGASMSetSubdomains(petsclib::PetscLibType, pc::AbstractPC, n::PetscInt, iis::Vector{<:AbstractIS}, ois::Vector{<:AbstractIS})

Sets the subdomains for this MPI process for the additive Schwarz preconditioner with multiple MPI processes per subdomain, PCGASM

Collective

Input Parameters:

  • pc - the preconditioner object
  • n - the number of subdomains for this MPI process
  • iis - the index sets that define the inner subdomains (or NULL for PETSc to determine subdomains), the iis array is

copied so may be freed after this call.

  • ois - the index sets that define the outer subdomains (or NULL to use the same as iis, or to construct by expanding iis by

the requested overlap), the ois array is copied so may be freed after this call.

Level: advanced

See also: PCGASM, PCGASMSetOverlap(), PCGASMGetSubKSP(), PCGASMDestroySubdomains(), PCGASMCreateSubdomains2D(), PCGASMGetSubdomains()

External Links

source
PETSc.LibPETSc.PCGASMSetTotalSubdomains — Method
PCGASMSetTotalSubdomains(petsclib::PetscLibType, pc::AbstractPC, N::PetscInt)

sets the total number of subdomains to use across the communicator for PCGASM

Logically Collective

Input Parameters:

  • pc - the preconditioner
  • N - total number of subdomains

Level: beginner

See also: PCGASM, PCGASMSetSubdomains(), PCGASMSetOverlap(), PCGASMCreateSubdomains2D()

External Links

source
PETSc.LibPETSc.PCGASMSetType — Method
PCGASMSetType(petsclib::PetscLibType, pc::AbstractPC, type::PCGASMType)

Sets the type of restriction and interpolation used for local problems in the PCGASM additive Schwarz method.

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • type - variant of PCGASM, one of

$`PC_GASM_BASIC` - full interpolation and restriction `PC_GASM_RESTRICT` - full restriction, local MPI process interpolation `PC_GASM_INTERPOLATE` - full interpolation, local MPI process restriction `PC_GASM_NONE` - local MPI process restriction and interpolation$

Options Database Key:

  • -pc_gasm_type [basic,restrict,interpolate,none] - Sets PCGASM type

Level: intermediate

See also: PCGASM, PCGASMSetSubdomains(), PCGASMGetSubKSP(), PCGASMCreateSubdomains2D(), PCASM, PCASMSetType()

External Links

source
PETSc.LibPETSc.PCGASMSetUseDMSubdomains — Method
PCGASMSetUseDMSubdomains(petsclib::PetscLibType, pc::AbstractPC, flg::PetscBool)

Indicates whether to use DMCreateDomainDecomposition() to define the subdomains, whenever possible for PCGASM

Logically Collective

Input Parameters:

  • pc - the preconditioner
  • flg - boolean indicating whether to use subdomains defined by the DM

Options Database Key:

  • -pc_gasm_dm_subdomains - configure subdomains
  • -pc_gasm_overlap - set overlap
  • -pc_gasm_total_subdomains - set number of subdomains

Level: intermediate

See also: PCGASM, PCGASMGetUseDMSubdomains(), PCGASMSetSubdomains(), PCGASMSetOverlap(), PCGASMCreateSubdomains2D()

External Links

source
PETSc.LibPETSc.PCGalerkinGetKSP — Method
ksp::KSP = PCGalerkinGetKSP(petsclib::PetscLibType, pc::AbstractPC)

Gets the KSP object in the PCGALERKIN

Not Collective

Input Parameter:

  • pc - the preconditioner context

Output Parameter:

  • ksp - the KSP object

Level: intermediate

See also: PC, PCCreate(), PCSetType(), PCType, PCGALERKIN, PCGalerkinSetRestriction(), PCGalerkinSetInterpolation(), PCGalerkinSetComputeSubmatrix()

External Links

source
PETSc.LibPETSc.PCGalerkinSetComputeSubmatrix — Method
PCGalerkinSetComputeSubmatrix(petsclib::PetscLibType, pc::AbstractPC, computeAsub::external, ctx::Ptr{Cvoid})

Provide a routine that will be called to compute the Galerkin submatrix

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • computeAsub - routine that computes the submatrix from the global matrix
  • ctx - context used by the routine, or NULL

Calling sequence of computeAsub:

  • pc - the PCGALERKIN preconditioner
  • A - the matrix in the PCGALERKIN
  • Ap - the computed submatrix from any previous computation, if NULL it has not previously been computed
  • cAp - the submatrix computed by this routine
  • ctx - optional user-defined function context

Level: intermediate

See also: PC, PCCreate(), PCSetType(), PCType, PCGALERKIN, PCGalerkinSetRestriction(), PCGalerkinSetInterpolation(), PCGalerkinGetKSP()

External Links

source
PETSc.LibPETSc.PCGalerkinSetInterpolation — Method
PCGalerkinSetInterpolation(petsclib::PetscLibType, pc::AbstractPC, P::AbstractPetscMat)

Sets the interpolation operator for the PCGALERKIN preconditioner

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • P - the interpolation operator

Level: intermediate

See also: PC, PCCreate(), PCSetType(), PCType, PCGALERKIN, PCGalerkinSetRestriction(), PCGalerkinGetKSP()

External Links

source
PETSc.LibPETSc.PCGalerkinSetRestriction — Method
PCGalerkinSetRestriction(petsclib::PetscLibType, pc::AbstractPC, R::AbstractPetscMat)

Sets the restriction operator for the PCGALERKIN preconditioner

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • R - the restriction operator

Level: intermediate

See also: PC, PCCreate(), PCSetType(), PCType, PCGALERKIN, PCGalerkinSetInterpolation(), PCGalerkinGetKSP()

External Links

source
PETSc.LibPETSc.PCGetApplicationContext — Method
ctx::Ptr{Cvoid} = PCGetApplicationContext(petsclib::PetscLibType, pc::AbstractPC)

Gets the user-defined context for the preconditioner set with PCSetApplicationContext()

Not Collective

Input Parameter:

  • pc - PC context

Output Parameter:

  • ctx - application context

Level: intermediate

See also: PC, PCSetApplicationContext(), KSPSetApplicationContext(), KSPGetApplicationContext()

External Links

source
PETSc.LibPETSc.PCGetCoarseOperators — Method
num_levels::PetscInt,coarseOperators::Vector{PetscMat} = PCGetCoarseOperators(petsclib::PetscLibType, pc::AbstractPC)

Gets coarse operator matrices for all levels (except the finest level)

Logically Collective

Input Parameter:

  • pc - the precondition context

Output Parameters:

  • num_levels - the number of levels
  • coarseOperators - the coarse operator matrices (size of num_levels-1)

Level: advanced

See also: PC, PCMG, PCMGGetRestriction(), PCMGSetInterpolation(), PCMGGetRScale(), PCMGGetInterpolation(), PCGetInterpolations()

External Links

source
PETSc.LibPETSc.PCGetDM — Method
dm::PetscDM = PCGetDM(petsclib::PetscLibType, pc::AbstractPC)

Gets the DM that may be used by some preconditioners

Not Collective

Input Parameter:

  • pc - the preconditioner context

Output Parameter:

  • dm - the DM

Level: intermediate

See also: PC, DM, PCSetDM(), KSPSetDM(), KSPGetDM()

External Links

source
PETSc.LibPETSc.PCGetDiagonalScale — Method
flag::PetscBool = PCGetDiagonalScale(petsclib::PetscLibType, pc::AbstractPC)

Indicates if the preconditioner applies an additional left and right scaling as needed by certain time-stepping codes.

Logically Collective

Input Parameter:

  • pc - the PC preconditioner context

Output Parameter:

  • flag - PETSC_TRUE if it applies the scaling

Level: developer

See also: PC, PCCreate(), PCSetUp(), PCDiagonalScaleLeft(), PCDiagonalScaleRight(), PCSetDiagonalScale()

External Links

source
PETSc.LibPETSc.PCGetFailedReason — Method
reason::PCFailedReason = PCGetFailedReason(petsclib::PetscLibType, pc::AbstractPC)

Gets the reason a PCSetUp() failed or PC_NOERROR if it did not fail

Not Collective

Input Parameter:

  • pc - the PC preconditioner context

Output Parameter:

  • reason - the reason it failed

Level: advanced

See also: PC, PCCreate(), PCApply(), PCDestroy(), PCSetFailedReason(), PCFailedReason

External Links

source
PETSc.LibPETSc.PCGetInterpolations — Method
num_levels::PetscInt,interpolations::Vector{PetscMat} = PCGetInterpolations(petsclib::PetscLibType, pc::AbstractPC)

Gets interpolation matrices for all levels (except level 0)

Logically Collective

Input Parameter:

  • pc - the precondition context

Output Parameters:

  • num_levels - the number of levels
  • interpolations - the interpolation matrices (size of num_levels-1)

Level: advanced

See also: PC, PCMG, PCMGGetRestriction(), PCMGSetInterpolation(), PCMGGetInterpolation(), PCGetCoarseOperators()

External Links

source
PETSc.LibPETSc.PCGetKSPNestLevel — Method
level::PetscInt = PCGetKSPNestLevel(petsclib::PetscLibType, pc::AbstractPC)

gets the amount of nesting the KSP that contains this PC has

Not Collective

Input Parameter:

  • pc - the PC

Output Parameter:

  • level - the nest level

Level: developer

See also: KSPSetUp(), KSPSolve(), KSPDestroy(), KSP, KSPGMRES, KSPType, KSPSetNestLevel(), PCSetKSPNestLevel(), KSPGetNestLevel()

External Links

source
PETSc.LibPETSc.PCGetOperators — Method
Amat::PetscMat,Pmat::PetscMat = PCGetOperators(petsclib::PetscLibType, pc::AbstractPC)

Gets the matrix associated with the linear system and possibly a different one which is used to construct the preconditioner.

Not Collective, though parallel Mats are returned if pc is parallel

Input Parameter:

  • pc - the PC preconditioner context

Output Parameters:

  • Amat - the matrix defining the linear system
  • Pmat - the matrix from which the preconditioner is constructed, usually the same as Amat.

Level: intermediate

See also: PC, PCSetOperators(), KSPGetOperators(), KSPSetOperators(), PCGetOperatorsSet()

External Links

source
PETSc.LibPETSc.PCGetOperatorsSet — Method
mat::PetscBool,pmat::PetscBool = PCGetOperatorsSet(petsclib::PetscLibType, pc::AbstractPC)

Determines if the matrix associated with the linear system and possibly a different one associated with the preconditioner have been set in the PC.

Not Collective, though the results on all processes should be the same

Input Parameter:

  • pc - the PC preconditioner context

Output Parameters:

  • mat - the matrix associated with the linear system was set
  • pmat - matrix associated with the preconditioner was set, usually the same

Level: intermediate

See also: PC, PCSetOperators(), KSPGetOperators(), KSPSetOperators(), PCGetOperators()

External Links

source
PETSc.LibPETSc.PCGetOptionsPrefix — Method
prefix::String = PCGetOptionsPrefix(petsclib::PetscLibType, pc::AbstractPC)

Gets the prefix used for searching for all PC options in the database.

Not Collective

Input Parameter:

  • pc - the PC preconditioner context

Output Parameter:

  • prefix - pointer to the prefix string used, is returned

Level: advanced

See also: PC, PCSetFromOptions(), PCSetOptionsPrefix(), PCAppendOptionsPrefix()

External Links

source
PETSc.LibPETSc.PCGetReusePreconditioner — Method
flag::PetscBool = PCGetReusePreconditioner(petsclib::PetscLibType, pc::AbstractPC)

Determines if the PC reuses the current preconditioner even if the operator in the preconditioner has changed.

Not Collective

Input Parameter:

  • pc - the PC preconditioner context

Output Parameter:

  • flag - PETSC_TRUE do not compute a new preconditioner, PETSC_FALSE do compute a new preconditioner

Level: intermediate

See also: PC, PCGetOperators(), MatZeroEntries(), PCSetReusePreconditioner()

External Links

source
PETSc.LibPETSc.PCGetType — Method
type::String = PCGetType(petsclib::PetscLibType, pc::AbstractPC)

Gets the PCType (as a string) from the PC context.

Not Collective

Input Parameter:

  • pc - the preconditioner context

Output Parameter:

  • type - name of preconditioner method

Level: intermediate

See also: PC, PCType, PCSetType(), PetscObjectTypeCompare(), PetscObjectTypeCompareAny()

External Links

source
PETSc.LibPETSc.PCGetUseAmat — Method
flg::PetscBool = PCGetUseAmat(petsclib::PetscLibType, pc::AbstractPC)

Gets the flag that indicates that when the preconditioner needs to apply (part of) the operator during the preconditioning process it applies the Amat provided to TSSetRHSJacobian(), TSSetIJacobian(), SNESSetJacobian(), KSPSetOperators() or PCSetOperators() not the Pmat.

Logically Collective

Input Parameter:

  • pc - the PC preconditioner context

Output Parameter:

  • flg - PETSC_TRUE to use the Amat, PETSC_FALSE to use the Pmat

Level: intermediate

See also: PC, PCSetUseAmat(), PCBJACOBI, PCMG, PCFIELDSPLIT, PCCOMPOSITE

External Links

source
PETSc.LibPETSc.PCHMGSetCoarseningComponent — Method
PCHMGSetCoarseningComponent(petsclib::PetscLibType, pc::AbstractPC, component::PetscInt)

Set which component of the PDE is used for the subspace-based coarsening algorithm in the preconditioner PCHMG

Logically Collective

Input Parameters:

  • pc - the PCHMG context
  • component - which component PC will coarsen

Options Database Key:

  • -pc_hmg_coarsening_component i - Which component is chosen for the subspace-based coarsening algorithm

Level: beginner

See also: PCHMG, PCType, PCGAMG, PCHMGSetReuseInterpolation(), PCHMGSetUseSubspaceCoarsening(), PCHMGSetInnerPCType()

External Links

source
PETSc.LibPETSc.PCHMGSetInnerPCType — Method
PCHMGSetInnerPCType(petsclib::PetscLibType, pc::AbstractPC, type::String)

Set an inner PC type to be used in the PCHMG preconditioner. That is the method used to compute the hierarchy of restriction operators.

Logically Collective

Input Parameters:

  • pc - the PCHMG context
  • type - PCHYPRE or PCGAMG coarsening algorithm

Options Database Key:

  • -hmg_inner_pc_type (hypre|gamg) - What method is used to coarsen matrix

Level: beginner

See also: PCHMG, PCType, PCHMGSetReuseInterpolation(), PCHMGSetUseSubspaceCoarsening(), PCHMGSetCoarseningComponent()

External Links

source
PETSc.LibPETSc.PCHMGSetReuseInterpolation — Method
PCHMGSetReuseInterpolation(petsclib::PetscLibType, pc::AbstractPC, reuse::PetscBool)

Reuse the interpolation matrices in PCHMG after changing the matrices numerical values

Logically Collective

Input Parameters:

  • pc - the PCHMG context
  • reuse - PETSC_TRUE indicates that PCHMG will reuse the interpolations

Options Database Key:

  • -pc_hmg_reuse_interpolation (true|false) - Whether or not to reuse the interpolations. If true, it potentially save the compute time.

Level: beginner

See also: PCHMG, PCGAMG, PCHMGSetUseSubspaceCoarsening(), PCHMGSetCoarseningComponent(), PCHMGSetInnerPCType()

External Links

source
PETSc.LibPETSc.PCHMGSetUseSubspaceCoarsening — Method
PCHMGSetUseSubspaceCoarsening(petsclib::PetscLibType, pc::AbstractPC, subspace::PetscBool)

Use subspace coarsening in PCHMG

Logically Collective

Input Parameters:

  • pc - the PCHMG context
  • subspace - PETSC_TRUE indicates that PCHMG will use the subspace coarsening

Options Database Key:

  • -pc_hmg_use_subspace_coarsening (true|false) - Whether or not to use subspace coarsening (that is, coarsen a submatrix).

Level: beginner

See also: PCHMG, PCHMGSetReuseInterpolation(), PCHMGSetCoarseningComponent(), PCHMGSetInnerPCType()

External Links

source
PETSc.LibPETSc.PCHMGUseMatMAIJ — Method
PCHMGUseMatMAIJ(petsclib::PetscLibType, pc::AbstractPC, usematmaij::PetscBool)

Set a flag that indicates if or not to use MATMAIJ for the interpolation matrices to save memory

Logically Collective

Input Parameters:

  • pc - the PCHMG context
  • usematmaij - PETSC_TRUE (default) to use MATMAIJ for interpolations.

Options Database Key:

  • -pc_hmg_use_matmaij (true|false) - use MATMAIJ for interpolations

Level: beginner

See also: PCHMG, PCType, PCGAMG

External Links

source
PETSc.LibPETSc.PCHYPREAMSSetInteriorNodes — Method
PCHYPREAMSSetInteriorNodes(petsclib::PetscLibType, pc::AbstractPC, interior::AbstractPetscVec)

Set the list of interior nodes to a zero-conductivity region for PCHYPRE of type AMS

Collective

Input Parameters:

  • pc - the preconditioning context
  • interior - vector. node is interior if its entry in the array is 1.0.

Level: intermediate

See also: PCHYPRE, PCHYPRESetDiscreteGradient(), PCHYPRESetDiscreteCurl(), PCHYPRESetAlphaPoissonMatrix()

External Links

source
PETSc.LibPETSc.PCHYPREGetCFMarkers — Method
n_per_level::Ptr{PetscInt},CFMarkers::Ptr{PetscBT} = PCHYPREGetCFMarkers(petsclib::PetscLibType, pc::AbstractPC)

Gets CF marker arrays for all levels (except the finest level)

Logically Collective

Input Parameter:

  • pc - the preconditioner context

Output Parameters:

  • n_per_level - the number of nodes per level (size of num_levels)
  • CFMarkers - the Coarse/Fine Boolean arrays (size of num_levels - 1)

Level: advanced

See also: PC, PCMG, PCMGGetRestriction(), PCMGSetInterpolation(), PCMGGetRScale(), PCMGGetInterpolation(), PCGetInterpolations()

External Links

source
PETSc.LibPETSc.PCHYPREGetType — Method
name::String = PCHYPREGetType(petsclib::PetscLibType, pc::AbstractPC)

Gets which hypre preconditioner you are using

Input Parameter:

  • pc - the preconditioner context

Output Parameter:

  • name - either euclid, ilu, pilut, parasails, boomeramg, ams, or ads

Level: intermediate

See also: PCCreate(), PCHYPRESetType(), PCType, PC, PCHYPRE

External Links

source
PETSc.LibPETSc.PCHYPRESetAlphaPoissonMatrix — Method
PCHYPRESetAlphaPoissonMatrix(petsclib::PetscLibType, pc::AbstractPC, A::AbstractPetscMat)

Set the vector Poisson matrix for PCHYPRE of type AMS

Collective

Input Parameters:

  • pc - the preconditioning context
  • A - the matrix

Level: intermediate

See also: PCHYPRE, PCHYPRESetDiscreteGradient(), PCHYPRESetDiscreteCurl(), PCHYPRESetBetaPoissonMatrix()

External Links

source
PETSc.LibPETSc.PCHYPRESetBetaPoissonMatrix — Method
PCHYPRESetBetaPoissonMatrix(petsclib::PetscLibType, pc::AbstractPC, A::AbstractPetscMat)

Set the Poisson matrix for PCHYPRE of type AMS

Collective

Input Parameters:

  • pc - the preconditioning context
  • A - the matrix, or NULL to turn it off

Level: intermediate

See also: PCHYPRE, PCHYPRESetDiscreteGradient(), PCHYPRESetDiscreteCurl(), PCHYPRESetAlphaPoissonMatrix()

External Links

source
PETSc.LibPETSc.PCHYPRESetDiscreteCurl — Method
PCHYPRESetDiscreteCurl(petsclib::PetscLibType, pc::AbstractPC, C::AbstractPetscMat)

Set the discrete curl matrix for PCHYPRE type of ADS

Collective

Input Parameters:

  • pc - the preconditioning context
  • C - the discrete curl

Level: intermediate

See also: PCHYPRE, PCHYPRESetDiscreteGradient()

External Links

source
PETSc.LibPETSc.PCHYPRESetDiscreteGradient — Method
PCHYPRESetDiscreteGradient(petsclib::PetscLibType, pc::AbstractPC, G::AbstractPetscMat)

Set the discrete gradient matrix for PCHYPRE type of AMS or ADS

Collective

Input Parameters:

  • pc - the preconditioning context
  • G - the discrete gradient

Level: intermediate

See also: PCHYPRE, PCHYPRESetDiscreteCurl()

External Links

source
PETSc.LibPETSc.PCHYPRESetEdgeConstantVectors — Method
PCHYPRESetEdgeConstantVectors(petsclib::PetscLibType, pc::AbstractPC, ozz::AbstractPetscVec, zoz::AbstractPetscVec, zzo::AbstractPetscVec)

Set the representation of the constant vector fields in the edge element basis for PCHYPRE of type AMS

Collective

Input Parameters:

  • pc - the preconditioning context
  • ozz - vector representing (1,0,0) (or (1,0) in 2D)
  • zoz - vector representing (0,1,0) (or (0,1) in 2D)
  • zzo - vector representing (0,0,1) (use NULL in 2D)

Level: intermediate

See also: PCHYPRE, PCHYPRESetDiscreteGradient(), PCHYPRESetDiscreteCurl(), PCHYPRESetAlphaPoissonMatrix()

External Links

source
PETSc.LibPETSc.PCHYPRESetInterpolations — Method
PCHYPRESetInterpolations(petsclib::PetscLibType, pc::AbstractPC, dim::PetscInt, RT_PiFull::AbstractPetscMat, RT_Pi::Vector{<:AbstractPetscMat}, ND_PiFull::AbstractPetscMat, ND_Pi::Vector{<:AbstractPetscMat})

Set the interpolation matrices for PCHYPRE type of AMS or ADS

Collective

Input Parameters:

  • pc - the preconditioning context
  • dim - the dimension of the problem, only used in AMS
  • RT_PiFull - Raviart-Thomas interpolation matrix
  • RT_Pi - x/y/z component of Raviart-Thomas interpolation matrix
  • ND_PiFull - Nedelec interpolation matrix
  • ND_Pi - x/y/z component of Nedelec interpolation matrix

Level: intermediate

See also: PCHYPRE

External Links

source
PETSc.LibPETSc.PCHYPRESetType — Method
PCHYPRESetType(petsclib::PetscLibType, pc::AbstractPC, name::String)

Sets which hypre preconditioner you wish to use

Input Parameters:

  • pc - the preconditioner context
  • name - either euclid, ilu, pilut, parasails, boomeramg, ams, or ads

Options Database Key:

  • pc_hypre_type - One of euclid, ilu, pilut, parasails, boomeramg, ams, or ads

Level: intermediate

See also: PCCreate(), PCSetType(), PCType, PC, PCHYPRE

External Links

source
PETSc.LibPETSc.PCISApplyInvSchur — Method
PCISApplyInvSchur(petsclib::PetscLibType, pc::AbstractPC, b::AbstractPetscVec, x::AbstractPetscVec, vec1_N::AbstractPetscVec, vec2_N::AbstractPetscVec)

Solves the Neumann problem related to applying the inverse of the Schur complement.

Input Parameters:

  • pc - preconditioner context
  • b - vector of local interface nodes (including ghosts)
  • x - vector of local interface nodes (including ghosts); returns the application of the inverse of the Schur complement to b
  • vec1_N - vector of local nodes (interior and interface, including ghosts); used as work space
  • vec2_N - vector of local nodes (interior and interface, including ghosts); used as work space

Level: advanced

See also: PCBDDC, PCNN, PCISSetUseStiffnessScaling(), PCISSetSubdomainDiagonalScaling(), PCISScatterArrayNToVecB(), PCISSetSubdomainScalingFactor(), PCISReset(), PCISInitialize()

External Links

source
PETSc.LibPETSc.PCISApplySchur — Method
PCISApplySchur(petsclib::PetscLibType, pc::AbstractPC, v::AbstractPetscVec, vec1_B::AbstractPetscVec, vec2_B::AbstractPetscVec, vec1_D::AbstractPetscVec, vec2_D::AbstractPetscVec)

applies the Schur complement arising from the MATIS inside the PCNN preconditioner

Input Parameters:

  • pc - preconditioner context
  • v - vector to which the Schur complement is to be applied (it is NOT modified inside this function, UNLESS vec2_B is null)
  • vec1_B - location to store the result of Schur complement applied to chunk
  • vec2_B - workspace or NULL, v is used as workspace in that case
  • vec1_D - work space
  • vec2_D - work space

Level: advanced

See also: PCBDDC, PCNN, PCISSetUseStiffnessScaling(), PCISSetSubdomainDiagonalScaling(), PCISScatterArrayNToVecB(), PCISSetSubdomainScalingFactor(), PCISApplyInvSchur(), PCISReset(), PCISInitialize()

External Links

source
PETSc.LibPETSc.PCISInitialize — Method
PCISInitialize(petsclib::PetscLibType, pc::AbstractPC)

initializes the PC_IS portion of PCNN and PCBDDC preconditioner context

Input Parameter:

  • pc - the PC object, must be of type PCNN or PCBDDC

Level: advanced

See also: PCBDDC, PCNN, PCISSetUseStiffnessScaling(), PCISSetSubdomainDiagonalScaling(), PCISScatterArrayNToVecB(), PCISSetSubdomainScalingFactor(), PCISReset(), PCISApplySchur(), PCISApplyInvSchur()

External Links

source
PETSc.LibPETSc.PCISReset — Method
PCISReset(petsclib::PetscLibType, pc::AbstractPC)

Removes all the PC_IS parts of the PC implementation data structure

Input Parameter:

  • pc - the PC object, must be of type PCNN or PCBDDC

Level: advanced

See also: PCISSetUseStiffnessScaling(), PCISSetSubdomainDiagonalScaling(), PCISScatterArrayNToVecB(), PCISSetSubdomainScalingFactor(), PCISInitialize(), PCISApplySchur(), PCISApplyInvSchur()

External Links

source
PETSc.LibPETSc.PCISScatterArrayNToVecB — Method
array_N::PetscScalar = PCISScatterArrayNToVecB(petsclib::PetscLibType, pc::AbstractPC, v_B::AbstractPetscVec, imode::InsertMode, smode::ScatterMode)

Scatters interface node values from a big array (of all local nodes, interior or interface, including ghosts) into an interface vector, when in SCATTER_FORWARD mode, or vice-versa, when in SCATTER_REVERSE mode.

Input Parameters:

  • pc - preconditioner context
  • array_N - [when in SCATTER_FORWARD mode] Array to be scattered into the vector otherwise output array
  • imode - insert mode, ADD_VALUES or INSERT_VALUES
  • smode - scatter mode, SCATTER_FORWARD or SCATTER_REVERSE mode]
  • v_B - [when in SCATTER_REVERSE mode] Vector to be scattered into the array, otherwise output vector

Level: advanced

See also: PCBDDC, PCNN, PCISSetUseStiffnessScaling(), PCISSetSubdomainDiagonalScaling(), PCISSetSubdomainScalingFactor(), PCISApplySchur(), PCISApplyInvSchur(), PCISReset(), PCISInitialize(), InsertMode

External Links

source
PETSc.LibPETSc.PCISSetSubdomainDiagonalScaling — Method
PCISSetSubdomainDiagonalScaling(petsclib::PetscLibType, pc::AbstractPC, scaling_factors::AbstractPetscVec)

Set diagonal scaling for PCIS.

Logically Collective

Input Parameters:

  • pc - the preconditioning context
  • scaling_factors - scaling factors for the subdomain

Level: intermediate

See also: PCBDDC, PCNN, PCISScatterArrayNToVecB(), PCISSetSubdomainScalingFactor(), PCISSetUseStiffnessScaling(), PCISReset(), PCISInitialize(), PCISApplyInvSchur(), PCISApplySchur()

External Links

source
PETSc.LibPETSc.PCISSetSubdomainScalingFactor — Method
PCISSetSubdomainScalingFactor(petsclib::PetscLibType, pc::AbstractPC, scal::PetscScalar)

Set scaling factor for PCIS.

Not Collective

Input Parameters:

  • pc - the preconditioning context
  • scal - scaling factor for the subdomain

Level: intermediate

See also: PCBDDC, PCNN, PCISScatterArrayNToVecB(), PCISSetSubdomainDiagonalScaling(), PCISSetUseStiffnessScaling(), PCISReset(), PCISInitialize(), PCISApplyInvSchur(), PCISApplySchur()

External Links

source
PETSc.LibPETSc.PCISSetUp — Method
PCISSetUp(petsclib::PetscLibType, pc::AbstractPC, computematrices::PetscBool, computesolvers::PetscBool)

sets up the PC_IS portion of PCNN and PCBDDC preconditioner context as part of their setup process

Input Parameters:

  • pc - the PC object, must be of type PCNN or PCBDDC
  • computematrices - Extract the blocks A_II, A_BI, A_IB and A_BB from the matrix
  • computesolvers - Create the KSP for the local Dirichlet and Neumann problems

Level: advanced

See also: PCBDDC, PCNN, PCISSetUseStiffnessScaling(), PCISSetSubdomainDiagonalScaling(), PCISScatterArrayNToVecB(), PCISSetSubdomainScalingFactor(), PCISReset(), PCISApplySchur(), PCISApplyInvSchur()

External Links

source
PETSc.LibPETSc.PCISSetUseStiffnessScaling — Method
PCISSetUseStiffnessScaling(petsclib::PetscLibType, pc::AbstractPC, use::PetscBool)

Tells PCIS to construct partition of unity using the local matrices' diagonal entries

Logically Collective

Input Parameters:

  • pc - the preconditioning context
  • use - whether or not it should use matrix diagonal to build partition of unity.

Level: intermediate

See also: PCBDDC, PCNN, PCISSetSubdomainDiagonalScaling(), PCISScatterArrayNToVecB(), PCISSetSubdomainScalingFactor(), PCISReset(), PCISInitialize(), PCISApplyInvSchur(), PCISApplySchur()

External Links

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

This function initializes everything in the PC package. It is called from PetscDLLibraryRegister_petscksp() when using dynamic libraries, and on the first call to PCCreate() when using shared static libraries.

Level: developer

See also: PetscInitialize(), PCFinalizePackage()

External Links

source
PETSc.LibPETSc.PCJacobiGetDiagonal — Method
PCJacobiGetDiagonal(petsclib::PetscLibType, pc::AbstractPC, diagonal::AbstractPetscVec, diagonal_sqrt::AbstractPetscVec)

Returns copy of the diagonal and/or diagonal squareroot Vec

Logically Collective

Input Parameter:

  • pc - the preconditioner context

Output Parameters:

  • diagonal - Copy of Vec of the inverted diagonal
  • diagonal_sqrt - Copy of Vec of the inverted square root diagonal

Level: developer

See also: PCJACOBI, PCJacobiSetType()

External Links

source
PETSc.LibPETSc.PCJacobiGetFixDiagonal — Method
flg::PetscBool = PCJacobiGetFixDiagonal(petsclib::PetscLibType, pc::AbstractPC)

Determines if the Jacobi preconditioner PCJACOBI checks for zero diagonal terms

Logically Collective

Input Parameter:

  • pc - the preconditioner context

Output Parameter:

  • flg - the boolean flag

Options Database Key:

  • -pc_jacobi_fixdiagonal (true|false) - Fix 0 terms on diagonal by using 1

Level: intermediate

See also: PCJACOBI, PCJacobiSetType(), PCJacobiSetFixDiagonal()

External Links

source
PETSc.LibPETSc.PCJacobiGetRowl1Scale — Method
scale::PetscReal = PCJacobiGetRowl1Scale(petsclib::PetscLibType, pc::AbstractPC)

Get scaling of off-diagonal elements summed into l1-norm diagonal

Logically Collective

Input Parameter:

  • pc - the preconditioner context

Output Parameter:

  • scale - scaling

Level: intermediate

See also: PCJACOBI, PCJacobiSetType(), PCJacobiSetRowl1Scale(), PCJacobiGetType()

External Links

source
PETSc.LibPETSc.PCJacobiGetType — Method
type::PCJacobiType = PCJacobiGetType(petsclib::PetscLibType, pc::AbstractPC)

Gets how the diagonal matrix is produced for the preconditioner

Not Collective

Input Parameter:

  • pc - the preconditioner context

Output Parameter:

  • type - PC_JACOBI_DIAGONAL, PC_JACOBI_ROWL1, PC_JACOBI_ROWMAX, PC_JACOBI_ROWSUM

Level: intermediate

See also: PCJACOBI, PCJacobiSetUseAbs(), PCJacobiSetType()

External Links

source
PETSc.LibPETSc.PCJacobiGetUseAbs — Method
flg::PetscBool = PCJacobiGetUseAbs(petsclib::PetscLibType, pc::AbstractPC)

Determines if the Jacobi preconditioner PCJACOBI uses the absolute values of the diagonal divisors in the preconditioner

Logically Collective

Input Parameter:

  • pc - the preconditioner context

Output Parameter:

  • flg - whether to use absolute values or not

Level: intermediate

See also: PCJACOBI, PCJacobiSetType(), PCJacobiSetUseAbs(), PCJacobiGetType()

External Links

source
PETSc.LibPETSc.PCJacobiSetFixDiagonal — Method
PCJacobiSetFixDiagonal(petsclib::PetscLibType, pc::AbstractPC, flg::PetscBool)

Check for zero values on the diagonal and replace them with 1.0

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • flg - the boolean flag

Options Database Key:

  • -pc_jacobi_fixdiagonal (true|false) - check for zero values on the diagonal

See also: PCJACOBI, PCJacobiSetType(), PCJacobiGetFixDiagonal(), PCJacobiSetUseAbs()

External Links

source
PETSc.LibPETSc.PCJacobiSetRowl1Scale — Method
PCJacobiSetRowl1Scale(petsclib::PetscLibType, pc::AbstractPC, scale::PetscReal)

Set scaling of off-diagonal of operator when computing l1 row norms, eg, Remark 6.1 in "Multigrid Smoothers for Ultraparallel Computing", Baker et al, with 0.5 scaling

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • scale - scaling

Options Database Key:

  • -pc_jacobi_rowl1_scale scale - scaling of off diagonal values

Level: intermediate

See also: PCJACOBI, PCJacobiSetType(), PCJacobiGetRowl1Scale()

External Links

source
PETSc.LibPETSc.PCJacobiSetType — Method
PCJacobiSetType(petsclib::PetscLibType, pc::AbstractPC, type::PCJacobiType)

Causes the Jacobi preconditioner to use either the diagonal, the maximum entry in each row, of the sum of rows entries for the diagonal preconditioner

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • type - PC_JACOBI_DIAGONAL, PC_JACOBI_ROWL1, PC_JACOBI_ROWMAX, PC_JACOBI_ROWSUM

Options Database Key:

  • -pc_jacobi_type [diagonal, rowl1, rowmax, rowsum] - the type of diagonal matrix to use for Jacobi

Level: intermediate

See also: PCJACOBI, PCJacobiSetUseAbs(), PCJacobiGetType()

External Links

source
PETSc.LibPETSc.PCJacobiSetUseAbs — Method
PCJacobiSetUseAbs(petsclib::PetscLibType, pc::AbstractPC, flg::PetscBool)

Causes the Jacobi preconditioner PCJACOBI to use the absolute values of the diagonal divisors in the preconditioner

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • flg - whether to use absolute values or not

Options Database Key:

  • -pc_jacobi_abs (true|false) - use absolute values

See also: PCJACOBI, PCJacobiSetType(), PCJacobiGetUseAbs()

External Links

source
PETSc.LibPETSc.PCKSPGetKSP — Method
ksp::KSP = PCKSPGetKSP(petsclib::PetscLibType, pc::AbstractPC)

Gets the KSP context for a PCKSP.

Not Collective but ksp returned is parallel if pc was parallel

Input Parameter:

  • pc - the preconditioner context

Output Parameter:

  • ksp - the KSP solver

See also: PCKSP, PCKSPSetKSP()

External Links

source
PETSc.LibPETSc.PCKSPSetKSP — Method
PCKSPSetKSP(petsclib::PetscLibType, pc::AbstractPC, ksp::AbstractKSP)

Sets the KSP context for a PCKSP.

Collective

Input Parameters:

  • pc - the preconditioner context
  • ksp - the KSP solver

Level: advanced

See also: PCKSP, PCKSPGetKSP()

External Links

source
PETSc.LibPETSc.PCLMVMClearIS — Method
PCLMVMClearIS(petsclib::PetscLibType, pc::AbstractPC)

Removes the inactive variable index set from a PCLMVM

Input Parameter:

  • pc - An PCLMVM preconditioner

Level: intermediate

See also: PCLMVMSetIS()

External Links

source
PETSc.LibPETSc.PCLMVMGetMatLMVM — Method
B::PetscMat = PCLMVMGetMatLMVM(petsclib::PetscLibType, pc::AbstractPC)

Returns a pointer to the underlying MATLMVM matrix.

Input Parameter:

  • pc - An PCLMVM preconditioner

Output Parameter:

  • B - MATLMVM matrix used by the preconditioner

Level: intermediate

See also: PCLMVMSetMatLMVM()

External Links

source
PETSc.LibPETSc.PCLMVMSetIS — Method
PCLMVMSetIS(petsclib::PetscLibType, pc::AbstractPC, inactive::AbstractIS)

Sets the index sets that reduce the PC application.

Input Parameters:

  • pc - An PCLMVM preconditioner
  • inactive - Index set defining the variables removed from the problem

Level: intermediate

See also: PCLMVMClearIS()

External Links

source
PETSc.LibPETSc.PCLMVMSetMatLMVM — Method
PCLMVMSetMatLMVM(petsclib::PetscLibType, pc::AbstractPC, B::AbstractPetscMat)

Replaces the MATLMVM matrix inside the preconditioner with the one provided by the user.

Input Parameters:

  • pc - An PCLMVM preconditioner
  • B - An MATLMVM type matrix

Level: intermediate

See also: PCLMVMGetMatLMVM()

External Links

source
PETSc.LibPETSc.PCLMVMSetUpdateVec — Method
PCLMVMSetUpdateVec(petsclib::PetscLibType, pc::AbstractPC, X::AbstractPetscVec)

Set the vector to be used as solution update for the internal LMVM matrix.

Input Parameters:

  • pc - The preconditioner
  • X - Solution vector

Level: intermediate

See also: MatLMVMUpdate(), PCLMVMSetMatLMVM()

External Links

source
PETSc.LibPETSc.PCLoad — Method
PCLoad(petsclib::PetscLibType, newdm::AbstractPC, viewer::PetscViewer)

Loads a PC that has been stored in binary with PCView().

Collective

Input Parameters:

  • newdm - the newly loaded PC, this needs to have been created with PCCreate() or

some related function before a call to PCLoad().

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

Level: intermediate

See also: PC, PetscViewerBinaryOpen(), PCView(), MatLoad(), VecLoad(), PETSCVIEWERBINARY

External Links

source
PETSc.LibPETSc.PCMGGalerkinGetMatProductAlgorithm — Method
name::String = PCMGGalerkinGetMatProductAlgorithm(petsclib::PetscLibType, pc::AbstractPC)

Get type of sparse matrix-matrix product for hypre's BoomerAMG to use on GPUs

Not Collective

Input Parameter:

  • pc - the multigrid context

Output Parameter:

  • name - one of cusparse, hypre

Level: intermediate

See also: PCHYPRE, PCMGGalerkinSetMatProductAlgorithm()

External Links

source
PETSc.LibPETSc.PCMGGalerkinSetMatProductAlgorithm — Method
PCMGGalerkinSetMatProductAlgorithm(petsclib::PetscLibType, pc::AbstractPC, name::String)

Set type of sparse matrix-matrix product for hypre's BoomerAMG to use on GPUs

Logically Collective

Input Parameters:

  • pc - the hypre context
  • name - one of cusparse, hypre

Options Database Key:

  • -pc_mg_galerkin_mat_product_algorithm (cusparse|hypre) - Type of sparse matrix-matrix product to use in hypre

Level: intermediate

See also: PCHYPRE, PCMGGalerkinGetMatProductAlgorithm()

External Links

source
PETSc.LibPETSc.PCMGGetAdaptCR — Method
cr::PetscBool = PCMGGetAdaptCR(petsclib::PetscLibType, pc::AbstractPC)

Get the flag to monitor coarse space quality using an auxiliary solve with compatible relaxation.

Not Collective

Input Parameter:

  • pc - the multigrid context

Output Parameter:

  • cr - flag for compatible relaxaion

Level: intermediate

See also: PCMGSetAdaptCR(), PCMGGetAdaptInterpolation(), PCMGSetGalerkin(), PCMGGetAdaptCoarseSpaceType(), PCMGSetAdaptCoarseSpaceType()

External Links

source
PETSc.LibPETSc.PCMGGetAdaptCoarseSpaceType — Method
ctype::PCMGCoarseSpaceType = PCMGGetAdaptCoarseSpaceType(petsclib::PetscLibType, pc::AbstractPC)

Get the type of adaptive coarse space.

Not Collective

Input Parameter:

  • pc - the multigrid context

Output Parameter:

  • ctype - the type of coarse space

Level: intermediate

See also: PCMG, PCMGCoarseSpaceType, PCMGSetAdaptCoarseSpaceType(), PCMGSetGalerkin(), PCMGSetAdaptInterpolation()

External Links

source
PETSc.LibPETSc.PCMGGetAdaptInterpolation — Method
adapt::PetscBool = PCMGGetAdaptInterpolation(petsclib::PetscLibType, pc::AbstractPC)

Get the flag to adapt the interpolator based upon a vector space which should be accurately captured by the next coarser mesh, and thus accurately interpolated.

Not Collective

Input Parameter:

  • pc - the multigrid context

Output Parameter:

  • adapt - flag for adaptation of the interpolator

Level: intermediate

See also: PCMG, PCMGSetAdaptInterpolation(), PCMGSetGalerkin(), PCMGGetAdaptCoarseSpaceType(), PCMGSetAdaptCoarseSpaceType()

External Links

source
PETSc.LibPETSc.PCMGGetCoarseSolve — Method
ksp::KSP = PCMGGetCoarseSolve(petsclib::PetscLibType, pc::AbstractPC)

Gets the solver context to be used on the coarse grid.

Not Collective

Input Parameter:

  • pc - the multigrid context

Output Parameter:

  • ksp - the coarse grid solver context

Level: advanced

See also: PCMG, PCMGGetSmootherUp(), PCMGGetSmootherDown(), PCMGGetSmoother()

External Links

source
PETSc.LibPETSc.PCMGGetCoarseSpaceConstructor — Method
fnc::Ptr{Cvoid} = PCMGGetCoarseSpaceConstructor(petsclib::PetscLibType, name::String)

Returns the given coarse space construction method.

Not Collective, No Fortran Support

Input Parameter:

  • name - name of the constructor

Output Parameter:

  • function - constructor routine

Level: advanced

See also: PCMGCoarseSpaceConstructorFn, PCMG, PCMGRegisterCoarseSpaceConstructor(), PCRegister()

External Links

source
PETSc.LibPETSc.PCMGGetGalerkin — Method
galerkin::PCMGGalerkinType = PCMGGetGalerkin(petsclib::PetscLibType, pc::AbstractPC)

Checks if Galerkin multigrid is being used, i.e. A{i-1} = ri * Ai * pi.

Not Collective

Input Parameter:

  • pc - the multigrid context

Output Parameter:

  • galerkin - one of PC_MG_GALERKIN_BOTH,PC_MG_GALERKIN_PMAT,PC_MG_GALERKIN_MAT, PC_MG_GALERKIN_NONE, or PC_MG_GALERKIN_EXTERNAL

Level: intermediate

See also: PCMG, PCMGSetGalerkin(), PCMGGalerkinType, PC_MG_GALERKIN_BOTH, PC_MG_GALERKIN_PMAT, PC_MG_GALERKIN_MAT, PC_MG_GALERKIN_NONE, PC_MG_GALERKIN_EXTERNAL

External Links

source
PETSc.LibPETSc.PCMGGetGridComplexity — Method
gc::PetscReal,oc::PetscReal = PCMGGetGridComplexity(petsclib::PetscLibType, pc::AbstractPC)

compute operator and grid complexity of the PCMG hierarchy

Input Parameter:

  • pc - the preconditioner context

Output Parameters:

  • gc - grid complexity, \frac{\sumi ni}{n0}, where n0 is the number of unknowns on the finest grid
  • oc - operator complexity, \frac{\sumi nnzi}{nnz0}, where nnz0 is the number of nonzeros on the finest grid

Level: advanced

See also: PCMG, PCMGGetLevels(), PCMGSetLevels()

External Links

source
PETSc.LibPETSc.PCMGGetInjection — Method
mat::PetscMat = PCMGGetInjection(petsclib::PetscLibType, pc::AbstractPC, l::PetscInt)

Gets the function to be used to inject primal vectors (i.e. solutions) from level l to l-1.

Logically Collective

Input Parameters:

  • pc - the multigrid context
  • l - the level (0 is coarsest) to supply [Do not supply 0]

Output Parameter:

  • mat - the restriction matrix (may be NULL if no injection is available).

Level: advanced

See also: PCMG, PCMGSetInjection(), PCMGetGetRestriction()

External Links

source
PETSc.LibPETSc.PCMGGetInterpolation — Method
mat::PetscMat = PCMGGetInterpolation(petsclib::PetscLibType, pc::AbstractPC, l::PetscInt)

Gets the function to be used to calculate the interpolation from l-1 to the lth level

Logically Collective

Input Parameters:

  • pc - the multigrid context
  • l - the level (0 is coarsest) to supply [Do not supply 0]

Output Parameter:

  • mat - the interpolation matrix, can be NULL

Level: advanced

See also: PCMG, PCMGGetRestriction(), PCMGSetInterpolation(), PCMGGetRScale()

External Links

source
PETSc.LibPETSc.PCMGGetLevels — Method
levels::PetscInt = PCMGGetLevels(petsclib::PetscLibType, pc::AbstractPC)

Gets the number of levels to use with PCMG.

Not Collective

Input Parameter:

  • pc - the preconditioner context

Output Parameter:

  • levels - the number of levels

Level: advanced

See also: PCMG, PCMGSetLevels()

External Links

source
PETSc.LibPETSc.PCMGGetRScale — Method
PCMGGetRScale(petsclib::PetscLibType, pc::AbstractPC, l::PetscInt, rscale::AbstractPetscVec)

Gets the pointwise scaling for the restriction operator from level l to l-1.

Collective

Input Parameters:

  • pc - the multigrid context
  • rscale - the scaling
  • l - the level (0 is coarsest) to supply [Do not supply 0]

Level: advanced

See also: PCMG, PCMGSetInterpolation(), PCMGGetRestriction(), PCMGGetInjection()

External Links

source
PETSc.LibPETSc.PCMGGetRestriction — Method
mat::PetscMat = PCMGGetRestriction(petsclib::PetscLibType, pc::AbstractPC, l::PetscInt)

Gets the function to be used to restrict dual (i.e. residual) vectors from level l to l-1.

Logically Collective

Input Parameters:

  • pc - the multigrid context
  • l - the level (0 is coarsest) to supply [Do not supply 0]

Output Parameter:

  • mat - the restriction matrix

Level: advanced

See also: PCMG, PCMGGetInterpolation(), PCMGSetRestriction(), PCMGGetRScale(), PCMGGetInjection()

External Links

source
PETSc.LibPETSc.PCMGGetSmoother — Method
ksp::KSP = PCMGGetSmoother(petsclib::PetscLibType, pc::AbstractPC, l::PetscInt)

Gets the KSP context to be used as smoother for both pre- and post-smoothing. Call both PCMGGetSmootherUp() and PCMGGetSmootherDown() to use different functions for pre- and post-smoothing.

Not Collective, ksp returned is parallel if pc is

Input Parameters:

  • pc - the multigrid context
  • l - the level (0 is coarsest) to supply

Output Parameter:

  • ksp - the smoother

See also: PCMG, PCMGGetSmootherUp(), PCMGGetSmootherDown(), PCMGGetCoarseSolve()

External Links

source
PETSc.LibPETSc.PCMGGetSmootherDown — Method
ksp::KSP = PCMGGetSmootherDown(petsclib::PetscLibType, pc::AbstractPC, l::PetscInt)

Gets the KSP context to be used as smoother before coarse grid correction (pre-smoother).

Not Collective, ksp returned is parallel if pc is

Input Parameters:

  • pc - the multigrid context
  • l - the level (0 is coarsest) to supply

Output Parameter:

  • ksp - the smoother

Level: advanced

See also: PCMG, PCMGGetSmootherUp(), PCMGGetSmoother()

External Links

source
PETSc.LibPETSc.PCMGGetSmootherUp — Method
ksp::KSP = PCMGGetSmootherUp(petsclib::PetscLibType, pc::AbstractPC, l::PetscInt)

Gets the KSP context to be used as smoother after coarse grid correction (post-smoother).

Not Collective, ksp returned is parallel if pc is

Input Parameters:

  • pc - the multigrid context
  • l - the level (0 is coarsest) to supply

Output Parameter:

  • ksp - the smoother

Level: advanced

See also: PCMG, PCMGGetSmootherDown()

External Links

source
PETSc.LibPETSc.PCMGGetType — Method
type::PCMGType = PCMGGetType(petsclib::PetscLibType, pc::AbstractPC)

Finds the form of multigrid the PCMG is using multiplicative, additive, full, or the Kaskade algorithm.

Logically Collective

Input Parameter:

  • pc - the preconditioner context

Output Parameter:

  • type - one of PC_MG_MULTIPLICATIVE, PC_MG_ADDITIVE, PC_MG_FULL, PC_MG_KASKADE, PCMGCycleType

Level: advanced

See also: PCMGType, PCMG, PCMGGetLevels(), PCMGSetLevels(), PCMGSetType(), PC_MG_MULTIPLICATIVE, PC_MG_ADDITIVE, PC_MG_FULL, PC_MG_KASKADE

External Links

source
PETSc.LibPETSc.PCMGMatResidualDefault — Method
PCMGMatResidualDefault(petsclib::PetscLibType, mat::AbstractPetscMat, b::AbstractPetscMat, x::AbstractPetscMat, r::AbstractPetscMat)

Default routine to calculate the residual.

Collective

Input Parameters:

  • mat - the matrix
  • b - the right-hand side
  • x - the approximate solution

Output Parameter:

  • r - location to store the residual

Level: developer

See also: PCMG, PCMGSetMatResidual(), PCMGResidualDefault()

External Links

source
PETSc.LibPETSc.PCMGMatResidualTransposeDefault — Method
PCMGMatResidualTransposeDefault(petsclib::PetscLibType, mat::AbstractPetscMat, b::AbstractPetscMat, x::AbstractPetscMat, r::AbstractPetscMat)

Default routine to calculate the residual of the transposed linear system

Collective

Input Parameters:

  • mat - the matrix
  • b - the right-hand side
  • x - the approximate solution

Output Parameter:

  • r - location to store the residual

Level: developer

See also: PCMG, PCMGSetMatResidualTranspose()

External Links

source
PETSc.LibPETSc.PCMGMultiplicativeSetCycles — Method
PCMGMultiplicativeSetCycles(petsclib::PetscLibType, pc::AbstractPC, n::PetscInt)

Sets the number of cycles to use for each preconditioner step of multigrid when PCMGType is PC_MG_MULTIPLICATIVE

Logically Collective

Input Parameters:

  • pc - the multigrid context
  • n - number of cycles (default is 1)

Options Database Key:

  • -pc_mg_multiplicative_cycles n - set the number of cycles

Level: advanced

See also: PCMGSetCycleTypeOnLevel(), PCMGSetCycleType(), PCMGCycleType, PCMGType, PC_MG_MULTIPLICATIVE

External Links

source
PETSc.LibPETSc.PCMGRegisterCoarseSpaceConstructor — Method
PCMGRegisterCoarseSpaceConstructor(petsclib::PetscLibType, name::String, fnc::Ptr{Cvoid})

Adds a method to the PCMG package for coarse space construction.

Not Collective, No Fortran Support

Input Parameters:

  • name - name of the constructor
  • function - constructor routine, see PCMGCoarseSpaceConstructorFn

Level: advanced

See also: PCMGCoarseSpaceConstructorFn, PCMG, PCMGGetCoarseSpaceConstructor(), PCRegister(), PCMGSetAdaptCoarseSpaceType(), PCMG_ADAPT_EIGENVECTOR, PCMG_ADAPT_GENERALIZED_EIGENVECTOR

External Links

source
PETSc.LibPETSc.PCMGResidualDefault — Method
PCMGResidualDefault(petsclib::PetscLibType, mat::AbstractPetscMat, b::AbstractPetscVec, x::AbstractPetscVec, r::AbstractPetscVec)

Default routine to calculate the residual.

Collective

Input Parameters:

  • mat - the matrix
  • b - the right-hand side
  • x - the approximate solution

Output Parameter:

  • r - location to store the residual

Level: developer

See also: PCMG, PCMGSetResidual(), PCMGSetMatResidual()

External Links

source
PETSc.LibPETSc.PCMGResidualTransposeDefault — Method
PCMGResidualTransposeDefault(petsclib::PetscLibType, mat::AbstractPetscMat, b::AbstractPetscVec, x::AbstractPetscVec, r::AbstractPetscVec)

Default routine to calculate the residual of the transposed linear system

Collective

Input Parameters:

  • mat - the matrix
  • b - the right-hand side
  • x - the approximate solution

Output Parameter:

  • r - location to store the residual

Level: developer

See also: PCMG, PCMGSetResidualTranspose(), PCMGMatResidualTransposeDefault()

External Links

source
PETSc.LibPETSc.PCMGSetAdaptCR — Method
PCMGSetAdaptCR(petsclib::PetscLibType, pc::AbstractPC, cr::PetscBool)

Monitor the coarse space quality using an auxiliary solve with compatible relaxation.

Logically Collective

Input Parameters:

  • pc - the multigrid context
  • cr - flag for compatible relaxation

Options Database Key:

  • -pc_mg_adapt_cr (true|false) - Turn on compatible relaxation

Level: intermediate

See also: PCMG, PCMGGetAdaptCR(), PCMGSetAdaptInterpolation(), PCMGSetGalerkin(), PCMGGetAdaptCoarseSpaceType(), PCMGSetAdaptCoarseSpaceType()

External Links

source
PETSc.LibPETSc.PCMGSetAdaptCoarseSpaceType — Method
PCMGSetAdaptCoarseSpaceType(petsclib::PetscLibType, pc::AbstractPC, ctype::PCMGCoarseSpaceType)

Set the type of adaptive coarse space. Adapts or creates the interpolator based upon a vector space which should be accurately captured by the next coarser mesh, and thus accurately interpolated.

Logically Collective

Input Parameters:

  • pc - the multigrid context
  • ctype - the type of coarse space

Options Database Keys:

  • -pc_mg_adapt_interp_n nmodes - The number of modes to use
  • -pc_mg_adapt_interp_coarse_space (none|polynomial|harmonic|eigenvector|generalized_eigenvector|gdsw) - The type of coarse space to use

Level: intermediate

See also: PCMG, PCMGCoarseSpaceType, PCMGGetAdaptCoarseSpaceType(), PCMGSetGalerkin(), PCMGSetAdaptInterpolation(), DM, PCMG_ADAPT_NONE, PCMG_ADAPT_POLYNOMIAL, PCMG_ADAPT_HARMONIC, PCMG_ADAPT_EIGENVECTOR, PCMG_ADAPT_GENERALIZED_EIGENVECTOR, PCMG_ADAPT_GDSW

External Links

source
PETSc.LibPETSc.PCMGSetAdaptInterpolation — Method
PCMGSetAdaptInterpolation(petsclib::PetscLibType, pc::AbstractPC, adapt::PetscBool)

Adapt the interpolator based upon a vector space which should be accurately captured by the next coarser mesh, and thus accurately interpolated.

Logically Collective

Input Parameters:

  • pc - the multigrid context
  • adapt - flag for adaptation of the interpolator

Level: intermediate

See also: PCMG, PCMGGetAdaptInterpolation(), PCMGSetGalerkin(), PCMGGetAdaptCoarseSpaceType(), PCMGSetAdaptCoarseSpaceType()

External Links

source
PETSc.LibPETSc.PCMGSetCycleType — Method
PCMGSetCycleType(petsclib::PetscLibType, pc::AbstractPC, n::PCMGCycleType)

Sets the type of cycles to use. Use PCMGSetCycleTypeOnLevel() for more complicated cycling.

Logically Collective

Input Parameters:

  • pc - the multigrid context
  • n - either PC_MG_CYCLE_V or PC_MG_CYCLE_W

Options Database Key:

  • -pc_mg_cycle_type (v|w) - provide the cycle desired

Level: advanced

See also: PCMG, PCMGSetCycleTypeOnLevel(), PCMGType, PCMGCycleType, PC_MG_CYCLE_V, PC_MG_CYCLE_W

External Links

source
PETSc.LibPETSc.PCMGSetCycleTypeOnLevel — Method
PCMGSetCycleTypeOnLevel(petsclib::PetscLibType, pc::AbstractPC, l::PetscInt, c::PCMGCycleType)

Sets the type of cycle (aka cycle index) to run on the specified level.

Logically Collective

Input Parameters:

  • pc - the multigrid context
  • l - the level (0 is coarsest)
  • c - either PC_MG_CYCLE_V or PC_MG_CYCLE_W

Level: advanced

See also: PCMG, PCMGCycleType, PCMGSetCycleType()

External Links

source
PETSc.LibPETSc.PCMGSetDistinctSmoothUp — Method
PCMGSetDistinctSmoothUp(petsclib::PetscLibType, pc::AbstractPC)

sets the up (post) smoother to be a separate KSP from the down (pre) smoother on all levels and adds the suffix _up to the options name

Logically Collective

Input Parameter:

  • pc - the preconditioner context

Options Database Key:

  • -pc_mg_distinct_smoothup (true|false) - use distinct smoothing objects

Level: advanced

See also: PCMG, PCMGSetNumberSmooth()

External Links

source
PETSc.LibPETSc.PCMGSetGalerkin — Method
PCMGSetGalerkin(petsclib::PetscLibType, pc::AbstractPC, use::PCMGGalerkinType)

Causes the coarser grid matrices to be computed from the finest grid via the Galerkin process: A{i-1} = ri * Ai * pi.

Logically Collective

Input Parameters:

  • pc - the multigrid context
  • use - one of PC_MG_GALERKIN_BOTH, PC_MG_GALERKIN_PMAT, PC_MG_GALERKIN_MAT, or PC_MG_GALERKIN_NONE

Options Database Key:

  • -pc_mg_galerkin (both|pmat|mat|none) - set the matrices to form via the Galerkin process

Level: intermediate

See also: PCMG, PCMGGetGalerkin(), PCMGGalerkinType, PC_MG_GALERKIN_BOTH, PC_MG_GALERKIN_PMAT, PC_MG_GALERKIN_MAT, PC_MG_GALERKIN_NONE

External Links

source
PETSc.LibPETSc.PCMGSetInjection — Method
PCMGSetInjection(petsclib::PetscLibType, pc::AbstractPC, l::PetscInt, mat::AbstractPetscMat)

Sets the function to be used to inject primal (i.e. solution) vectors from level l to l-1.

Logically Collective

Input Parameters:

  • pc - the multigrid context
  • l - the level (0 is coarsest) to supply [Do not supply 0]
  • mat - the injection matrix

Level: advanced

See also: PCMG, PCMGSetRestriction()

External Links

source
PETSc.LibPETSc.PCMGSetInterpolation — Method
PCMGSetInterpolation(petsclib::PetscLibType, pc::AbstractPC, l::PetscInt, mat::AbstractPetscMat)

Sets the function to be used to calculate the interpolation from l-1 to the lth level

Logically Collective

Input Parameters:

  • pc - the multigrid context
  • mat - the interpolation operator
  • l - the level (0 is coarsest) to supply [do not supply 0]

Level: advanced

See also: PCMG, PCMGSetRestriction()

External Links

source
PETSc.LibPETSc.PCMGSetLevels — Method
PCMGSetLevels(petsclib::PetscLibType, pc::AbstractPC, levels::PetscInt, comms::Union{Ptr, Vector{MPI_Comm}})

Sets the number of levels to use with PCMG. Must be called before any other PCMG routine.

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • levels - the number of levels
  • comms - optional communicators for each level; this is to allow solving the coarser problems

on smaller sets of processes. For processes that are not included in the computation you must pass MPI_COMM_NULL. Use comms = NULL to specify that all processes should participate in each level of problem.

Options Database Key:

  • -pc_mg_levels levels - set the number of levels to use

Level: intermediate

See also: PCMGSetType(), PCMGGetLevels()

External Links

source
PETSc.LibPETSc.PCMGSetNumberSmooth — Method
PCMGSetNumberSmooth(petsclib::PetscLibType, pc::AbstractPC, n::PetscInt)

Sets the number of pre and post-smoothing steps to use on all levels. Use PCMGDistinctSmoothUp() to create separate up and down smoothers if you want different numbers of pre- and post-smoothing steps.

Logically Collective

Input Parameters:

  • pc - the multigrid context
  • n - the number of smoothing steps

Options Database Key:

  • -mg_levels_ksp_max_it n - Sets number of pre and post-smoothing steps

Level: advanced

See also: PCMG, PCMGSetDistinctSmoothUp()

External Links

source
PETSc.LibPETSc.PCMGSetOperators — Method
PCMGSetOperators(petsclib::PetscLibType, pc::AbstractPC, l::PetscInt, Amat::AbstractPetscMat, Pmat::AbstractPetscMat)

Sets operator and matrix from which to construct a preconditioner for lth level

Logically Collective

Input Parameters:

  • pc - the multigrid context
  • Amat - the operator
  • Pmat - the preconditioning operator
  • l - the level (0 is the coarsest) to supply

Level: advanced

See also: PCMG, PCMGSetGalerkin(), PCMGSetRestriction(), PCMGSetInterpolation()

External Links

source
PETSc.LibPETSc.PCMGSetR — Method
PCMGSetR(petsclib::PetscLibType, pc::AbstractPC, l::PetscInt, c::AbstractPetscVec)

Sets the vector to be used to store the residual on a particular level.

Logically Collective

Input Parameters:

  • pc - the multigrid context
  • l - the level (0 is coarsest) this is to be used for
  • c - the Vec

Level: advanced

See also: PCMG, PCMGSetRhs(), PCMGSetX()

External Links

source
PETSc.LibPETSc.PCMGSetRScale — Method
PCMGSetRScale(petsclib::PetscLibType, pc::AbstractPC, l::PetscInt, rscale::AbstractPetscVec)

Sets the pointwise scaling for the restriction operator from level l to l-1.

Logically Collective

Input Parameters:

  • pc - the multigrid context
  • l - the level (0 is coarsest) to supply [Do not supply 0]
  • rscale - the scaling

Level: advanced

See also: PCMG, PCMGSetInterpolation(), PCMGSetRestriction(), PCMGGetRScale(), PCMGSetInjection()

External Links

source
PETSc.LibPETSc.PCMGSetResidual — Method
PCMGSetResidual(petsclib::PetscLibType, pc::AbstractPC, l::PetscInt, residual::external, mat::AbstractPetscMat)

Sets the function to be used to calculate the residual on the lth level.

Logically Collective

Input Parameters:

  • pc - the multigrid context
  • l - the level (0 is coarsest) to supply
  • residual - function used to form residual, if none is provided the previously provide one is used, if no

previous one were provided then a default is used

  • mat - matrix associated with residual

Level: advanced

See also: PCMG, PCMGResidualDefault()

External Links

source
PETSc.LibPETSc.PCMGSetResidualTranspose — Method
PCMGSetResidualTranspose(petsclib::PetscLibType, pc::AbstractPC, l::PetscInt, residualt::external, mat::AbstractPetscMat)

Sets the function to be used to calculate the residual of the transposed linear system on the lth level.

Logically Collective

Input Parameters:

  • pc - the multigrid context
  • l - the level (0 is coarsest) to supply
  • residualt - function used to form transpose of residual, if none is provided the previously provide one is used, if no

previous one were provided then a default is used

  • mat - matrix associated with residual

Level: advanced

See also: PCMG, PCMGResidualTransposeDefault()

External Links

source
PETSc.LibPETSc.PCMGSetRestriction — Method
PCMGSetRestriction(petsclib::PetscLibType, pc::AbstractPC, l::PetscInt, mat::AbstractPetscMat)

Sets the function to be used to restrict dual vectors from level l to l-1.

Logically Collective

Input Parameters:

  • pc - the multigrid context
  • l - the level (0 is coarsest) to supply [Do not supply 0]
  • mat - the restriction matrix

Level: advanced

See also: PCMG, PCMGSetInterpolation()

External Links

source
PETSc.LibPETSc.PCMGSetRhs — Method
PCMGSetRhs(petsclib::PetscLibType, pc::AbstractPC, l::PetscInt, c::AbstractPetscVec)

Sets the vector to be used to store the right-hand side on a particular level.

Logically Collective

Input Parameters:

  • pc - the multigrid context
  • l - the level (0 is coarsest) this is to be used for
  • c - the Vec

Level: advanced

See also: PCMG, PCMGSetX(), PCMGSetR()

External Links

source
PETSc.LibPETSc.PCMGSetType — Method
PCMGSetType(petsclib::PetscLibType, pc::AbstractPC, form::PCMGType)

Determines the type of multigrid to use, either multiplicative, additive, full, or the Kaskade algorithm.

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • form - multigrid form, one of PC_MG_MULTIPLICATIVE, PC_MG_ADDITIVE, PC_MG_FULL, PC_MG_KASKADE

Options Database Key:

  • -pc_mg_type (multiplicative|additive|full|kaskade) - Sets the type

Level: advanced

See also: PCMGType, PCMG, PCMGGetLevels(), PCMGSetLevels(), PCMGGetType(), PCMGCycleType, PC_MG_MULTIPLICATIVE, PC_MG_ADDITIVE, PC_MG_FULL, PC_MG_KASKADE

External Links

source
PETSc.LibPETSc.PCMGSetX — Method
PCMGSetX(petsclib::PetscLibType, pc::AbstractPC, l::PetscInt, c::AbstractPetscVec)

Sets the vector to be used to store the solution on a particular level.

Logically Collective

Input Parameters:

  • pc - the multigrid context
  • l - the level (0 is coarsest) this is to be used for (do not supply the finest level)
  • c - the Vec

Level: advanced

See also: PCMG, PCMGSetRhs(), PCMGSetR()

External Links

source
PETSc.LibPETSc.PCMPIGetKSP — Method
innerksp::KSP = PCMPIGetKSP(petsclib::PetscLibType, pc::AbstractPC)

Gets the KSP created by the PCMPI

Not Collective

Input Parameter:

  • pc - the preconditioner context

Output Parameter:

  • innerksp - the inner KSP

Level: advanced

See also: KSP, PCMPI, PCREDISTRIBUTE

External Links

source
PETSc.LibPETSc.PCMPIServerAddressesDestroy — Method
PCMPIServerAddressesDestroy(petsclib::PetscLibType, ctx::Ptr{Cvoid})

Destroys a PCMPIServerAddresses context, unmapping its shared-memory addresses

Logically Collective

Input Parameter:

  • ctx - pointer to the PCMPIServerAddresses structure to free

Level: developer

See also: PCMPI, PetscShmgetMapAddresses(), PetscShmgetUnmapAddresses(), PetscObjectContainerCompose()

External Links

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

starts a server that runs on the rank != 0 MPI processes waiting to process requests for parallel KSP solves and management of parallel KSP objects.

Logically Collective on all MPI processes except rank 0

Options Database Keys:

  • -mpi_linear_solver_server - causes the PETSc program to start in MPI linear solver server mode where only the first MPI rank runs user code
  • -mpi_linear_solver_server_view - displays information about all the linear systems solved by the MPI linear solver server at the conclusion of the program
  • -mpi_linear_solver_server_use_shared_memory - use shared memory when communicating matrices and vectors to server processes (default where supported)

Level: developer

See also: PCMPIServerEnd(), PCMPI, KSPCheckPCMPI()

External Links

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

ends a server that runs on the rank != 0 MPI processes waiting to process requests for parallel KSP solves and management of parallel KSP objects.

Logically Collective on all MPI ranks except 0

Level: developer

See also: PCMPIServerBegin(), PCMPI, KSPCheckPCMPI()

External Links

source
PETSc.LibPETSc.PCMatApply — Method
PCMatApply(petsclib::PetscLibType, pc::AbstractPC, X::AbstractPetscMat, Y::AbstractPetscMat)

Applies the preconditioner to multiple vectors stored as a MATDENSE. Like PCApply(), Y and X must be different matrices.

Collective

Input Parameters:

  • pc - the PC preconditioner context
  • X - block of input vectors

Output Parameter:

  • Y - block of output vectors

Level: developer

See also: PC, PCApply(), KSPMatSolve()

External Links

source
PETSc.LibPETSc.PCMatApplyTranspose — Method
PCMatApplyTranspose(petsclib::PetscLibType, pc::AbstractPC, X::AbstractPetscMat, Y::AbstractPetscMat)

Applies the transpose of preconditioner to multiple vectors stored as a MATDENSE. Like PCApplyTranspose(), Y and X must be different matrices.

Collective

Input Parameters:

  • pc - the PC preconditioner context
  • X - block of input vectors

Output Parameter:

  • Y - block of output vectors

Level: developer

See also: PC, PCApplyTranspose(), KSPMatSolveTranspose()

External Links

source
PETSc.LibPETSc.PCMatGetApplyOperation — Method
matop::MatOperation = PCMatGetApplyOperation(petsclib::PetscLibType, pc::AbstractPC)

Get which matrix operation of the matrix implements PCApply() for PCMAT.

Logically collective

Input Parameter:

  • pc - An instance of PCMAT

Output Parameter:

  • matop - The MatOperation

Level: intermediate

See also: PCMAT, PCMatSetApplyOperation(), PCApply(), MatOperation

External Links

source
PETSc.LibPETSc.PCMatSetApplyOperation — Method
PCMatSetApplyOperation(petsclib::PetscLibType, pc::AbstractPC, matop::MatOperation)

Set which matrix operation of the matrix implements PCApply() for PCMAT.

Logically collective

Input Parameters:

  • pc - An instance of PCMAT
  • matop - The selected MatOperation

Level: intermediate

See also: PCMAT, PCMatGetApplyOperation(), PCApply(), MatOperation

External Links

source
PETSc.LibPETSc.PCModifySubMatrices — Method
PCModifySubMatrices(petsclib::PetscLibType, pc::AbstractPC, nsub::PetscInt, row::Vector{<:AbstractIS}, col::Vector{<:AbstractIS}, submat::Vector{<:AbstractPetscMat}, ctx::Ptr{Cvoid})

Calls an optional user-defined routine within certain preconditioners if one has been set with PCSetModifySubMatrices().

Collective

Input Parameters:

  • pc - the PC preconditioner context
  • nsub - the number of local submatrices
  • row - an array of index sets that contain the global row numbers

that comprise each local submatrix

  • col - an array of index sets that contain the global column numbers

that comprise each local submatrix

  • submat - array of local submatrices
  • ctx - optional user-defined context for private data for the

user-defined routine (may be NULL)

Output Parameter:

  • submat - array of local submatrices (the entries of which may

have been modified)

Level: developer

See also: PC, PCModifySubMatricesFn, PCSetModifySubMatrices()

External Links

source
PETSc.LibPETSc.PCPARMSSetFill — Method
PCPARMSSetFill(petsclib::PetscLibType, pc::AbstractPC, lfil0::PetscInt, lfil1::PetscInt, lfil2::PetscInt)

Sets the fill-in parameters for ILUT, ILUK and ARMS preconditioners. Consider the original matrix A = [B F; E C] and the approximate version M = [LB 0; E/UB I]*[UB LB\F; 0 S].

Collective

Input Parameters:

  • pc - the preconditioner context
  • lfil0 - the level of fill-in kept in LB, UB, E/UB and LB\F
  • lfil1 - the level of fill-in kept in S
  • lfil2 - the level of fill-in kept in the L and U parts of the LU factorization of S

Options Database Keys:

  • -pc_parms_lfil_ilu_arms - set the amount of fill-in for ilut, iluk and arms
  • -pc_parms_lfil_schur - set the amount of fill-in for schur
  • -pc_parms_lfil_ilut_L_U - set the amount of fill-in for ILUT L and U

Level: intermediate

See also: PCPARMS

External Links

source
PETSc.LibPETSc.PCPARMSSetGlobal — Method
PCPARMSSetGlobal(petsclib::PetscLibType, pc::AbstractPC, type::PCPARMSGlobalType)

Sets the global preconditioner to be used in PCPARMS.

Collective

Input Parameters:

  • pc - the preconditioner context
  • type - the global preconditioner type, one of

$PC_PARMS_GLOBAL_RAS - Restricted additive Schwarz PC_PARMS_GLOBAL_SCHUR - Schur complement PC_PARMS_GLOBAL_BJ - Block Jacobi$

Options Database Key:

  • -pc_parms_global [ras,schur,bj] - Sets global preconditioner

Level: intermediate

See also: PCPARMS, PCPARMSSetLocal()

External Links

source
PETSc.LibPETSc.PCPARMSSetLocal — Method
PCPARMSSetLocal(petsclib::PetscLibType, pc::AbstractPC, type::PCPARMSLocalType)

Sets the local preconditioner to be used in PCPARMS.

Collective

Input Parameters:

  • pc - the preconditioner context
  • type - the local preconditioner type, one of

$PC_PARMS_LOCAL_ILU0 - ILU0 preconditioner PC_PARMS_LOCAL_ILUK - ILU(k) preconditioner PC_PARMS_LOCAL_ILUT - ILUT preconditioner PC_PARMS_LOCAL_ARMS - ARMS preconditioner$

Options Database Keys:

  • pc_parms_local [ilu0,iluk,ilut,arms] - Sets local preconditioner

Level: intermediate

See also: PCPARMS, PCPARMSSetGlobal(), PCPARMSSetNonsymPerm()

External Links

source
PETSc.LibPETSc.PCPARMSSetNonsymPerm — Method
PCPARMSSetNonsymPerm(petsclib::PetscLibType, pc::AbstractPC, nonsym::PetscBool)

Sets the type of permutation for the ARMS preconditioner: the standard symmetric ARMS or the non-symmetric ARMS (ARMS-ddPQ).

Collective

Input Parameters:

  • pc - the preconditioner context
  • nonsym - PETSC_TRUE indicates the non-symmetric ARMS is used;

PETSC_FALSE indicates the symmetric ARMS is used

Options Database Key:

  • -pc_parms_nonsymmetric_perm - sets the use of nonsymmetric permutation

Level: intermediate

See also: PCPARMS

External Links

source
PETSc.LibPETSc.PCPARMSSetSolveRestart — Method
PCPARMSSetSolveRestart(petsclib::PetscLibType, pc::AbstractPC, restart::PetscInt)

Sets the number of iterations at which the inner GMRES solver restarts.

Collective

Input Parameters:

  • pc - the preconditioner context
  • restart - maximum dimension of the Krylov subspace

Options Database Key:

  • -pc_parms_max_dim - sets the inner Krylov dimension

Level: intermediate

See also: PCPARMS, PCPARMSSetSolveTolerances()

External Links

source
PETSc.LibPETSc.PCPARMSSetSolveTolerances — Method
PCPARMSSetSolveTolerances(petsclib::PetscLibType, pc::AbstractPC, tol::PetscReal, maxits::PetscInt)

Sets the convergence tolerance and the maximum iterations for the inner GMRES solver, when the Schur global preconditioner is used.

Collective

Input Parameters:

  • pc - the preconditioner context
  • tol - the convergence tolerance
  • maxits - the maximum number of iterations to use

Options Database Keys:

  • -pc_parms_solve_tol - set the tolerance for local solve
  • -pc_parms_max_it - set the maximum number of inner iterations

Level: intermediate

See also: PCPARMS, PCPARMSSetSolveRestart()

External Links

source
PETSc.LibPETSc.PCPatchGetCellNumbering — Method
cellNumbering::PetscSection = PCPatchGetCellNumbering(petsclib::PetscLibType, pc::AbstractPC)

Get the PetscSection that provides the numbering of the cells used to define patches in a PCPATCH preconditioner

Not Collective

Input Parameter:

  • pc - the PCPATCH preconditioner

Output Parameter:

  • cellNumbering - the PetscSection giving the cell numbering

Level: advanced

See also: PCPATCH, PCPatchSetCellNumbering(), PetscSection

External Links

source
PETSc.LibPETSc.PCPatchGetConstructType — Method
ctype::PCPatchConstructType = PCPatchGetConstructType(petsclib::PetscLibType, pc::AbstractPC, noname::Ptr{Cvoid})

Get the strategy currently used to construct patches for a PCPATCH preconditioner

Not Collective

Input Parameter:

  • pc - the PCPATCH preconditioner

Output Parameters:

  • ctype - the PCPatchConstructType
  • func - the callback that builds the patches when ctype is PC_PATCH_USER or PC_PATCH_PYTHON; otherwise unchanged
  • ctx - the application context associated with func; otherwise unchanged

Calling sequence of func:

  • pc - the PCPATCH preconditioner
  • npatch - number of patches
  • patches - the IS that define each patch
  • patchIterationSet - how the patches are iterated over
  • ctx - optional application context

Level: advanced

See also: PCPATCH, PCPatchSetConstructType(), PCPatchConstructType

External Links

source
PETSc.LibPETSc.PCPatchGetPartitionOfUnity — Method
flg::PetscBool = PCPatchGetPartitionOfUnity(petsclib::PetscLibType, pc::AbstractPC)

Get whether the patch contributions are weighted by a partition of unity when combining local solves

Not Collective

Input Parameter:

  • pc - the PCPATCH preconditioner

Output Parameter:

  • flg - PETSC_TRUE if local patch updates are weighted by a partition of unity, PETSC_FALSE if they are summed directly

Level: intermediate

See also: PCPATCH, PCPatchSetPartitionOfUnity()

External Links

source
PETSc.LibPETSc.PCPatchGetPrecomputeElementTensors — Method
flg::PetscBool = PCPatchGetPrecomputeElementTensors(petsclib::PetscLibType, pc::AbstractPC)

Get whether element tensors are precomputed once and reused when assembling each patch matrix

Not Collective

Input Parameter:

  • pc - the PCPATCH preconditioner

Output Parameter:

  • flg - PETSC_TRUE if the element tensors are precomputed, PETSC_FALSE if they are recomputed for each patch

Level: intermediate

See also: PCPATCH, PCPatchSetPrecomputeElementTensors(), PCPatchSetSaveOperators()

External Links

source
PETSc.LibPETSc.PCPatchGetSaveOperators — Method
flg::PetscBool = PCPatchGetSaveOperators(petsclib::PetscLibType, pc::AbstractPC)

Get whether the per-patch sub-matrices are built and kept between applications of the PCPATCH preconditioner

Not Collective

Input Parameter:

  • pc - the PCPATCH preconditioner

Output Parameter:

  • flg - PETSC_TRUE if the assembled sub-matrices are stored, PETSC_FALSE if they are rebuilt on demand

Level: intermediate

See also: PCPATCH, PCPatchSetSaveOperators(), PCPatchSetPrecomputeElementTensors()

External Links

source
PETSc.LibPETSc.PCPatchGetSubKSP — Method
npatch::PetscInt,ksp::Vector{KSP} = PCPatchGetSubKSP(petsclib::PetscLibType, pc::AbstractPC)

Get the per-patch KSP objects used to solve each local patch problem in a PCPATCH preconditioner

Not Collective

Input Parameter:

  • pc - the PCPATCH preconditioner

Output Parameters:

  • npatch - number of local patches (may be NULL)
  • ksp - newly allocated array of length npatch holding the per-patch KSP objects; the caller must free the array with PetscFree()

Level: advanced

See also: PCPATCH, KSP, PCASMGetSubKSP()

External Links

source
PETSc.LibPETSc.PCPatchGetSubMatType — Method
sub_mat_type::String = PCPatchGetSubMatType(petsclib::PetscLibType, pc::AbstractPC)

Get the MatType used to store the per-patch sub-matrices in a PCPATCH preconditioner

Not Collective

Input Parameter:

  • pc - the PCPATCH preconditioner

Output Parameter:

  • sub_mat_type - the MatType used for the per-patch sub-matrices

Level: advanced

See also: PCPATCH, PCPatchSetSubMatType(), MatType

External Links

source
PETSc.LibPETSc.PCPatchSetCellNumbering — Method
PCPatchSetCellNumbering(petsclib::PetscLibType, pc::AbstractPC, cellNumbering::PetscSection)

Set the PetscSection that provides a numbering of the cells used to define patches in a PCPATCH preconditioner

Logically Collective

Input Parameters:

  • pc - the PCPATCH preconditioner
  • cellNumbering - the PetscSection giving the cell numbering; its reference count is incremented

Level: advanced

See also: PCPATCH, PCPatchGetCellNumbering(), PetscSection

External Links

source
PETSc.LibPETSc.PCPatchSetComputeFunction — Method
PCPatchSetComputeFunction(petsclib::PetscLibType, pc::AbstractPC, func::external, ctx::Ptr{Cvoid})

Set the callback function used to compute patch residuals

Logically Collective

Input Parameters:

  • pc - The PC
  • func - The callback function
  • ctx - The application context

Calling sequence of func:

  • pc - The PC
  • point - The point
  • x - The input solution (not used in linear problems)
  • f - The patch residual vector
  • cellIS - An array of the cell numbers
  • n - The size of dofsArray
  • dofsArray - The dofmap for the dofs to be solved for
  • dofsArrayWithAll - The dofmap for all dofs on the patch
  • ctx - The application context

Level: advanced

See also: PCPatchSetComputeOperator(), PCPatchGetComputeOperator(), PCPatchSetDiscretisationInfo(), PCPatchSetComputeFunctionInteriorFacets()

External Links

source
PETSc.LibPETSc.PCPatchSetComputeFunctionExteriorFacets — Method
PCPatchSetComputeFunctionExteriorFacets(petsclib::PetscLibType, pc::AbstractPC, func::external, ctx::Ptr{Cvoid})

Set the callback function used to compute exterior facet integrals for patch residuals

Logically Collective

Input Parameters:

  • pc - The PC
  • func - The callback function
  • ctx - The application context

Calling sequence of func:

  • pc - The PC
  • point - The point
  • x - The input solution (not used in linear problems)
  • f - The patch residual vector
  • facetIS - An array of the facet numbers
  • n - The size of dofsArray
  • dofsArray - The dofmap for the dofs to be solved for
  • dofsArrayWithAll - The dofmap for all dofs on the patch
  • ctx - The application context

Level: advanced

See also: PCPatchSetComputeFunction(), PCPatchSetComputeFunctionInteriorFacets(), PCPatchSetComputeOperatorExteriorFacets(), PCPatchSetDiscretisationInfo()

External Links

source
PETSc.LibPETSc.PCPatchSetComputeFunctionInteriorFacets — Method
PCPatchSetComputeFunctionInteriorFacets(petsclib::PetscLibType, pc::AbstractPC, func::external, ctx::Ptr{Cvoid})

Set the callback function used to compute facet integrals for patch residuals

Logically Collective

Input Parameters:

  • pc - The PC
  • func - The callback function
  • ctx - The application context

Calling sequence of func:

  • pc - The PC
  • point - The point
  • x - The input solution (not used in linear problems)
  • f - The patch residual vector
  • facetIS - An array of the facet numbers
  • n - The size of dofsArray
  • dofsArray - The dofmap for the dofs to be solved for
  • dofsArrayWithAll - The dofmap for all dofs on the patch
  • ctx - The application context

Level: advanced

See also: PCPatchSetComputeOperator(), PCPatchGetComputeOperator(), PCPatchSetDiscretisationInfo(), PCPatchSetComputeFunction()

External Links

source
PETSc.LibPETSc.PCPatchSetComputeOperator — Method
PCPatchSetComputeOperator(petsclib::PetscLibType, pc::AbstractPC, func::external, ctx::Ptr{Cvoid})

Set the callback function used to compute patch matrices

Logically Collective

Input Parameters:

  • pc - The PC
  • func - The callback function
  • ctx - The application context

Calling sequence of func:

  • pc - The PC
  • point - The point
  • x - The input solution (not used in linear problems)
  • mat - The patch matrix
  • facetIS - An array of the cell numbers
  • n - The size of dofsArray
  • dofsArray - The dofmap for the dofs to be solved for
  • dofsArrayWithAll - The dofmap for all dofs on the patch
  • ctx - The application context

Level: advanced

See also: PCPatchGetComputeOperator(), PCPatchSetComputeFunction(), PCPatchSetDiscretisationInfo()

External Links

source
PETSc.LibPETSc.PCPatchSetComputeOperatorExteriorFacets — Method
PCPatchSetComputeOperatorExteriorFacets(petsclib::PetscLibType, pc::AbstractPC, func::external, ctx::Ptr{Cvoid})

Set the callback function used to compute exterior facet integrals for patch matrices

Logically Collective

Input Parameters:

  • pc - The PC
  • func - The callback function
  • ctx - The application context

Calling sequence of func:

  • pc - The PC
  • point - The point
  • x - The input solution (not used in linear problems)
  • mat - The patch matrix
  • facetIS - An array of the facet numbers
  • n - The size of dofsArray
  • dofsArray - The dofmap for the dofs to be solved for
  • dofsArrayWithAll - The dofmap for all dofs on the patch
  • ctx - The application context

Level: advanced

See also: PCPatchSetComputeOperator(), PCPatchSetComputeOperatorInteriorFacets(), PCPatchSetComputeFunctionExteriorFacets(), PCPatchSetDiscretisationInfo()

External Links

source
PETSc.LibPETSc.PCPatchSetComputeOperatorInteriorFacets — Method
PCPatchSetComputeOperatorInteriorFacets(petsclib::PetscLibType, pc::AbstractPC, func::external, ctx::Ptr{Cvoid})

Set the callback function used to compute facet integrals for patch matrices

Logically Collective

Input Parameters:

  • pc - The PC
  • func - The callback function
  • ctx - The application context

Calling sequence of func:

  • pc - The PC
  • point - The point
  • x - The input solution (not used in linear problems)
  • mat - The patch matrix
  • facetIS - An array of the facet numbers
  • n - The size of dofsArray
  • dofsArray - The dofmap for the dofs to be solved for
  • dofsArrayWithAll - The dofmap for all dofs on the patch
  • ctx - The application context

Level: advanced

See also: PCPatchGetComputeOperator(), PCPatchSetComputeFunction(), PCPatchSetDiscretisationInfo()

External Links

source
PETSc.LibPETSc.PCPatchSetConstructType — Method
PCPatchSetConstructType(petsclib::PetscLibType, pc::AbstractPC, ctype::PCPatchConstructType, func::external, ctx::Ptr{Cvoid})

Set the way patches are constructed for a PCPATCH preconditioner

Logically Collective

Input Parameters:

  • pc - the PCPATCH preconditioner
  • ctype - the PCPatchConstructType selecting the patch construction strategy (e.g. PC_PATCH_STAR, PC_PATCH_VANKA, PC_PATCH_PARDECOMP, PC_PATCH_USER, PC_PATCH_PYTHON)
  • func - user callback that builds the patches, used only when ctype is PC_PATCH_USER or PC_PATCH_PYTHON; may be NULL otherwise
  • ctx - optional application context passed to func

Calling sequence of func:

  • pc - the PCPATCH preconditioner
  • npatch - number of patches
  • patches - the IS that define each patch
  • patchIterationSet - how the patches are iterated over
  • ctx - optional application context

Level: advanced

See also: PCPATCH, PCPatchGetConstructType(), PCPatchConstructType

External Links

source
PETSc.LibPETSc.PCPatchSetDiscretisationInfo — Method
PCPatchSetDiscretisationInfo(petsclib::PetscLibType, pc::AbstractPC, nsubspaces::PetscInt, dms::Vector{<:AbstractPetscDM}, bs::Vector{PetscInt}, nodesPerCell::Vector{PetscInt}, cellNodeMap::PetscInt, subspaceOffsets::Vector{PetscInt}, numGhostBcs::PetscInt, ghostBcNodes::Vector{PetscInt}, numGlobalBcs::PetscInt, globalBcNodes::Vector{PetscInt})

Provide the per-subspace discretisation information required by a PCPATCH preconditioner to build patch problems

Logically Collective

Input Parameters:

  • pc - the PCPATCH preconditioner
  • nsubspaces - the number of discretisation subspaces (e.g. fields)
  • dms - array of length nsubspaces of DMs, one per subspace, from which the local sections and section PetscSFs are obtained
  • bs - array of length nsubspaces giving the block size of each subspace
  • nodesPerCell - array of length nsubspaces giving the number of nodes per cell for each subspace
  • cellNodeMap - array of length nsubspaces; entry i is a cell-to-node map (array) of length (cEnd - cStart) * nodesPerCell[i]
  • subspaceOffsets - array of length nsubspaces + 1 giving the starting global dof offset of each subspace
  • numGhostBcs - number of ghost (off-process) boundary-condition dofs
  • ghostBcNodes - array of length numGhostBcs of the ghost boundary-condition dof indices
  • numGlobalBcs - number of global boundary-condition dofs
  • globalBcNodes - array of length numGlobalBcs of the global boundary-condition dof indices

Level: advanced

See also: PCPATCH, PCPatchSetComputeOperator(), PCPatchSetComputeFunction()

External Links

source
PETSc.LibPETSc.PCPatchSetPartitionOfUnity — Method
PCPatchSetPartitionOfUnity(petsclib::PetscLibType, pc::AbstractPC, flg::PetscBool)

Set whether the patch contributions should be weighted by a partition of unity when combining local solves

Logically Collective

Input Parameters:

  • pc - the PCPATCH preconditioner
  • flg - PETSC_TRUE to weight local patch updates by a partition of unity, PETSC_FALSE to sum them directly

Level: intermediate

See also: PCPATCH, PCPatchGetPartitionOfUnity()

External Links

source
PETSc.LibPETSc.PCPatchSetPrecomputeElementTensors — Method
PCPatchSetPrecomputeElementTensors(petsclib::PetscLibType, pc::AbstractPC, flg::PetscBool)

Set whether element tensors should be precomputed once and reused when assembling each patch matrix

Logically Collective

Input Parameters:

  • pc - the PCPATCH preconditioner
  • flg - PETSC_TRUE to precompute the element tensors, PETSC_FALSE to recompute them for each patch

Level: intermediate

See also: PCPATCH, PCPatchGetPrecomputeElementTensors(), PCPatchSetSaveOperators()

External Links

source
PETSc.LibPETSc.PCPatchSetSaveOperators — Method
PCPatchSetSaveOperators(petsclib::PetscLibType, pc::AbstractPC, flg::PetscBool)

Set whether the per-patch sub-matrices should be built and kept, instead of being reassembled at each application

Logically Collective

Input Parameters:

  • pc - the PCPATCH preconditioner
  • flg - PETSC_TRUE to store the assembled sub-matrices for each patch, PETSC_FALSE to rebuild them on demand

Level: intermediate

See also: PCPATCH, PCPatchGetSaveOperators(), PCPatchSetPrecomputeElementTensors()

External Links

source
PETSc.LibPETSc.PCPatchSetSubMatType — Method
PCPatchSetSubMatType(petsclib::PetscLibType, pc::AbstractPC, sub_mat_type::String)

Set the MatType used to store the per-patch sub-matrices in a PCPATCH preconditioner

Logically Collective

Input Parameters:

  • pc - the PCPATCH preconditioner
  • sub_mat_type - the MatType to use for the per-patch sub-matrices (e.g. MATDENSE, MATSEQAIJ)

Level: advanced

See also: PCPATCH, PCPatchGetSubMatType(), MatType

External Links

source
PETSc.LibPETSc.PCPostSolve — Method
PCPostSolve(petsclib::PetscLibType, pc::AbstractPC, ksp::AbstractKSP)

Optional post-solve phase, intended for any preconditioner-specific actions that must be performed after the iterative solve itself.

Collective

Input Parameters:

  • pc - the PC preconditioner context
  • ksp - the KSP Krylov subspace context

See also: PC, KSPSetPostSolve(), KSPSetPreSolve(), PCPreSolve(), KSPSolve()

External Links

source
PETSc.LibPETSc.PCPreSolve — Method
PCPreSolve(petsclib::PetscLibType, pc::AbstractPC, ksp::AbstractKSP)

Optional pre-solve phase, intended for any preconditioner-specific actions that must be performed before the iterative solve itself. Used in conjunction with PCPostSolve()

Collective

Input Parameters:

  • pc - the PC preconditioner context
  • ksp - the Krylov subspace context

Level: developer

See also: PC, PCPostSolve(), KSP, PCSetPostSetUp(), KSPSetPreSolve(), KSPSetPostSolve()

External Links

source
PETSc.LibPETSc.PCPythonGetType — Method
pyname::String = PCPythonGetType(petsclib::PetscLibType, pc::AbstractPC)

Get the type of a PC object implemented in Python, a PCPYTHON.

Not Collective

Input Parameter:

  • pc - the preconditioner (PC) context.

Output Parameter:

  • pyname - full dotted Python name [package].module[.{class|function}]

Level: intermediate

See also: PC, PCSHELL, PCCreate(), PCSetType(), PCPYTHON, PetscPythonInitialize(), PCPythonSetType()

External Links

source
PETSc.LibPETSc.PCPythonSetType — Method
PCPythonSetType(petsclib::PetscLibType, pc::AbstractPC, pyname::String)

Initialize a PC object implemented in Python, a PCPYTHON.

Collective

Input Parameters:

  • pc - the preconditioner (PC) context.
  • pyname - full dotted Python name [package].module[.{class|function}]

Options Database Key:

  • -pc_python_type pyname - python class

Level: intermediate

See also: PC, PCSHELL, PCCreate(), PCSetType(), PCPYTHON, PetscPythonInitialize()

External Links

source
PETSc.LibPETSc.PCRedistributeGetKSP — Method
innerksp::KSP = PCRedistributeGetKSP(petsclib::PetscLibType, pc::AbstractPC)

Gets the KSP created by the PCREDISTRIBUTE

Not Collective

Input Parameter:

  • pc - the preconditioner context

Output Parameter:

  • innerksp - the inner KSP

Level: advanced

See also: KSP, PCREDISTRIBUTE

External Links

source
PETSc.LibPETSc.PCReduceFailedReason — Method
PCReduceFailedReason(petsclib::PetscLibType, pc::AbstractPC)

Reduce the failed reason among the MPI processes that share the PC

Collective

Input Parameter:

  • pc - the PC preconditioner context

Level: advanced

See also: PC, PCCreate(), PCApply(), PCDestroy(), PCGetFailedReason(), PCSetFailedReason(), PCFailedReason

External Links

source
PETSc.LibPETSc.PCRedundantGetKSP — Method
innerksp::KSP = PCRedundantGetKSP(petsclib::PetscLibType, pc::AbstractPC)

Gets the less parallel KSP created by the redundant PC.

Not Collective

Input Parameter:

  • pc - the preconditioner context

Output Parameter:

  • innerksp - the KSP on the smaller set of processes

Level: advanced

See also: PCREDUNDANT

External Links

source
PETSc.LibPETSc.PCRedundantGetOperators — Method
mat::PetscMat,pmat::PetscMat = PCRedundantGetOperators(petsclib::PetscLibType, pc::AbstractPC)

gets the sequential linear system matrix and matrix used to construct the preconditioner

Not Collective

Input Parameter:

  • pc - the preconditioner context

Output Parameters:

  • mat - the matrix
  • pmat - the (possibly different) matrix used to construct the preconditioner

Level: advanced

See also: PCREDUNDANT

External Links

source
PETSc.LibPETSc.PCRedundantSetNumber — Method
PCRedundantSetNumber(petsclib::PetscLibType, pc::AbstractPC, nredundant::PetscInt)

Sets the number of redundant preconditioner contexts.

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • nredundant - number of redundant preconditioner contexts; for example if you are using 64 MPI processes and

use an nredundant of 4 there will be 4 parallel solves each on 16 = 64/4 processes.

Level: advanced

See also: PCREDUNDANT

External Links

source
PETSc.LibPETSc.PCRedundantSetScatter — Method
PCRedundantSetScatter(petsclib::PetscLibType, pc::AbstractPC, in::VecScatter, out::VecScatter)

Sets the scatter used to copy values into the redundant local solve and the scatter to move them back into the global vector.

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • in - the scatter to move the values in
  • out - the scatter to move them out

Level: advanced

See also: PCREDUNDANT

External Links

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

Adds a method (PCType) to the PETSc preconditioner package.

Not collective. No Fortran Support

Input Parameters:

  • sname - name of a new user-defined solver
  • function - routine to create the method context which will be stored in a PC when PCSetType() is called

See also: PC, PCType, PCRegisterAll(), PCSetType(), PCShellSetContext(), PCShellSetApply(), PCSHELL

External Links

source
PETSc.LibPETSc.PCReset — Method
PCReset(petsclib::PetscLibType, pc::AbstractPC)

Resets a PC context to the state it was in before PCSetUp() was called, and removes any allocated Vec and Mat from its data structure

Collective

Input Parameter:

  • pc - the PC preconditioner context

Level: developer

See also: PC, PCCreate(), PCSetUp()

External Links

source
PETSc.LibPETSc.PCSORGetIterations — Method
its::PetscInt,lits::PetscInt = PCSORGetIterations(petsclib::PetscLibType, pc::AbstractPC)

Gets the number of inner iterations to be used by the SOR preconditioner. The default is 1.

Logically Collective

Input Parameter:

  • pc - the preconditioner context

Output Parameters:

  • lits - number of local iterations, smoothings over just variables on processor
  • its - number of parallel iterations to use; each parallel iteration has lits local iterations

Options Database Keys:

  • -pc_sor_its its - Sets number of iterations
  • -pc_sor_lits lits - Sets number of local iterations

Level: intermediate

See also: PCSOR, PCSORSetOmega(), PCSORSetSymmetric(), PCSORSetIterations()

External Links

source
PETSc.LibPETSc.PCSORGetOmega — Method
omega::PetscReal = PCSORGetOmega(petsclib::PetscLibType, pc::AbstractPC)

Gets the SOR relaxation coefficient, omega (where omega = 1.0 by default).

Logically Collective

Input Parameter:

  • pc - the preconditioner context

Output Parameter:

  • omega - relaxation coefficient (0 < omega < 2).

Options Database Key:

  • -pc_sor_omega omega - Sets omega

Level: intermediate

See also: PCSOR, PCSORSetSymmetric(), PCSORSetIterations(), PCEisenstatSetOmega(), PCSORSetOmega()

External Links

source
PETSc.LibPETSc.PCSORGetSymmetric — Method
flag::MatSORType = PCSORGetSymmetric(petsclib::PetscLibType, pc::AbstractPC)

Gets the form the SOR preconditioner is using; backward, or forward relaxation. The local variants perform SOR on each processor. By default forward relaxation is used.

Logically Collective

Input Parameter:

  • pc - the preconditioner context

Output Parameter:

  • flag - one of the following

$SOR_FORWARD_SWEEP SOR_BACKWARD_SWEEP SOR_SYMMETRIC_SWEEP SOR_LOCAL_FORWARD_SWEEP SOR_LOCAL_BACKWARD_SWEEP SOR_LOCAL_SYMMETRIC_SWEEP$

Options Database Keys:

  • -pc_sor_symmetric - Activates symmetric version
  • -pc_sor_backward - Activates backward version
  • -pc_sor_local_forward - Activates local forward version
  • -pc_sor_local_symmetric - Activates local symmetric version
  • -pc_sor_local_backward - Activates local backward version

See also: PCSOR, PCEisenstatSetOmega(), PCSORSetIterations(), PCSORSetOmega(), PCSORSetSymmetric()

External Links

source
PETSc.LibPETSc.PCSORSetIterations — Method
PCSORSetIterations(petsclib::PetscLibType, pc::AbstractPC, its::PetscInt, lits::PetscInt)

Sets the number of inner iterations to be used by the SOR preconditioner. The default is 1.

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • lits - number of local iterations, smoothings over just variables on processor
  • its - number of parallel iterations to use; each parallel iteration has lits local iterations

Options Database Keys:

  • -pc_sor_its its - Sets number of iterations
  • -pc_sor_lits lits - Sets number of local iterations

Level: intermediate

See also: PCSOR, PCSORSetOmega(), PCSORSetSymmetric()

External Links

source
PETSc.LibPETSc.PCSORSetOmega — Method
PCSORSetOmega(petsclib::PetscLibType, pc::AbstractPC, omega::PetscReal)

Sets the SOR relaxation coefficient, omega (where omega = 1.0 by default).

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • omega - relaxation coefficient (0 < omega < 2).

Options Database Key:

  • -pc_sor_omega omega - Sets omega

Level: intermediate

See also: PCSOR, PCSORSetSymmetric(), PCSORSetIterations(), PCEisenstatSetOmega(), MatSetOption()

External Links

source
PETSc.LibPETSc.PCSORSetSymmetric — Method
PCSORSetSymmetric(petsclib::PetscLibType, pc::AbstractPC, flag::MatSORType)

Sets the SOR preconditioner to use symmetric (SSOR), backward, or forward relaxation. The local variants perform SOR on each processor. By default forward relaxation is used.

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • flag - one of the following

$SOR_FORWARD_SWEEP SOR_BACKWARD_SWEEP SOR_SYMMETRIC_SWEEP SOR_LOCAL_FORWARD_SWEEP SOR_LOCAL_BACKWARD_SWEEP SOR_LOCAL_SYMMETRIC_SWEEP$

Options Database Keys:

  • -pc_sor_symmetric - Activates symmetric version
  • -pc_sor_backward - Activates backward version
  • -pc_sor_local_forward - Activates local forward version
  • -pc_sor_local_symmetric - Activates local symmetric version
  • -pc_sor_local_backward - Activates local backward version

See also: PCSOR, PCEisenstatSetOmega(), PCSORSetIterations(), PCSORSetOmega()

External Links

source
PETSc.LibPETSc.PCSPAISetBlockSize — Method
PCSPAISetBlockSize(petsclib::PetscLibType, pc::AbstractPC, block_size1::PetscInt)

set the block size for the PCSPAI preconditioner

Input Parameters:

  • pc - the preconditioner
  • block_size1 - block size (default 1)

Level: intermediate

See also: PCSPAI, PCSetType()

External Links

source
PETSc.LibPETSc.PCSPAISetCacheSize — Method
PCSPAISetCacheSize(petsclib::PetscLibType, pc::AbstractPC, cache_size::PetscInt)

specify cache size in the PCSPAI preconditioner

Input Parameters:

  • pc - the preconditioner
  • cache_size - cache size {0,1,2,3,4,5} (default 5)

Level: intermediate

See also: PCSPAI, PCSetType()

External Links

source
PETSc.LibPETSc.PCSPAISetEpsilon — Method
PCSPAISetEpsilon(petsclib::PetscLibType, pc::AbstractPC, epsilon1::PetscReal)
  • Set the tolerance for the PCSPAI preconditioner

Input Parameters:

  • pc - the preconditioner
  • epsilon1 - the tolerance (default .4)

Level: intermediate

See also: PCSPAI, PCSetType()

External Links

source
PETSc.LibPETSc.PCSPAISetMax — Method
PCSPAISetMax(petsclib::PetscLibType, pc::AbstractPC, max1::PetscInt)

set the size of various working buffers in the PCSPAI preconditioner

Input Parameters:

  • pc - the preconditioner
  • max1 - size (default is 5000)

Level: intermediate

See also: PCSPAI, PCSetType()

External Links

source
PETSc.LibPETSc.PCSPAISetMaxNew — Method
PCSPAISetMaxNew(petsclib::PetscLibType, pc::AbstractPC, maxnew1::PetscInt)

set maximum number of new nonzero candidates per step in the PCSPAI preconditioner

Input Parameters:

  • pc - the preconditioner
  • maxnew1 - maximum number (default 5)

Level: intermediate

See also: PCSPAI, PCSetType(), PCSPAISetNBSteps()

External Links

source
PETSc.LibPETSc.PCSPAISetNBSteps — Method
PCSPAISetNBSteps(petsclib::PetscLibType, pc::AbstractPC, nbsteps1::PetscInt)

set maximum number of improvement steps per row in the PCSPAI preconditioner

Input Parameters:

  • pc - the preconditioner
  • nbsteps1 - number of steps (default 5)

See also: PCSPAI, PCSetType(), PCSPAISetMaxNew()

External Links

source
PETSc.LibPETSc.PCSPAISetSp — Method
PCSPAISetSp(petsclib::PetscLibType, pc::AbstractPC, sp::PetscInt)

specify a symmetric matrix sparsity pattern in the PCSPAI preconditioner

Input Parameters:

  • pc - the preconditioner
  • sp - 0 or 1

Level: intermediate

See also: PCSPAI, PCSetType()

External Links

source
PETSc.LibPETSc.PCSPAISetVerbose — Method
PCSPAISetVerbose(petsclib::PetscLibType, pc::AbstractPC, verbose::PetscInt)

verbosity level for the PCSPAI preconditioner

Input Parameters:

  • pc - the preconditioner
  • verbose - level (default 1)

Level: intermediate

See also: PCSPAI, PCSetType()

External Links

source
PETSc.LibPETSc.PCSetApplicationContext — Method
PCSetApplicationContext(petsclib::PetscLibType, pc::AbstractPC, ctx::Ptr{Cvoid})

Sets the optional user-defined context for the preconditioner

Logically Collective

Input Parameters:

  • pc - the PC context
  • ctx - optional application context

Level: advanced

See also: PC, PCGetApplicationContext(), KSPSetApplicationContext(), KSPGetApplicationContext(), PetscObjectCompose()

External Links

source
PETSc.LibPETSc.PCSetCoordinates — Method
PCSetCoordinates(petsclib::PetscLibType, pc::AbstractPC, dim::PetscInt, nloc::PetscInt, coords::Vector{PetscReal})

sets the coordinates of all the nodes (degrees of freedom in the vector) on the local process

Collective

Input Parameters:

  • pc - the PC preconditioner context
  • dim - the dimension of the coordinates 1, 2, or 3
  • nloc - the blocked size of the coordinates array
  • coords - the coordinates array

Level: intermediate

See also: PC, MatSetNearNullSpace()

External Links

source
PETSc.LibPETSc.PCSetDM — Method
PCSetDM(petsclib::PetscLibType, pc::AbstractPC, dm::AbstractPetscDM)

Sets the DM that may be used by some preconditioners

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • dm - the DM, can be NULL to remove any current DM

Level: intermediate

See also: PC, DM, PCGetDM(), KSPSetDM(), KSPGetDM(), SNESSetDM(), TSSetDM()

External Links

source
PETSc.LibPETSc.PCSetDiagonalScale — Method
PCSetDiagonalScale(petsclib::PetscLibType, pc::AbstractPC, s::AbstractPetscVec)

Indicates the left scaling to use to apply an additional left and right scaling as needed by certain time-stepping codes.

Logically Collective

Input Parameters:

  • pc - the PC preconditioner context
  • s - scaling vector

Level: intermediate

See also: PCCreate(), PCSetUp(), PCDiagonalScaleLeft(), PCDiagonalScaleRight(), PCGetDiagonalScale()

External Links

source
PETSc.LibPETSc.PCSetErrorIfFailure — Method
PCSetErrorIfFailure(petsclib::PetscLibType, pc::AbstractPC, flg::PetscBool)

Causes PC to generate an error if a floating point exception, for example a zero pivot, is detected.

Logically Collective

Input Parameters:

  • pc - iterative context obtained from PCCreate()
  • flg - PETSC_TRUE indicates you want the error generated

Level: advanced

See also: PC, KSPSetErrorIfNotConverged(), PCGetInitialGuessNonzero(), PCSetInitialGuessKnoll(), PCGetInitialGuessKnoll()

External Links

source
PETSc.LibPETSc.PCSetFailedReason — Method
PCSetFailedReason(petsclib::PetscLibType, pc::AbstractPC, reason::PCFailedReason)

Sets the reason a PCSetUp() failed or PC_NOERROR if it did not fail

Logically Collective

Input Parameters:

  • pc - the PC preconditioner context
  • reason - the reason it failed

Level: advanced

See also: PC, PCCreate(), PCApply(), PCDestroy(), PCFailedReason

External Links

source
PETSc.LibPETSc.PCSetFromOptions — Method
PCSetFromOptions(petsclib::PetscLibType, pc::AbstractPC)

Sets PC options from the options database.

Collective

Input Parameter:

  • pc - the preconditioner context

Options Database Key:

  • -pc_type - name of type, for example bjacobi

Level: advanced

See also: PC, PCSetType(), PCType, KSPSetFromOptions()

External Links

source
PETSc.LibPETSc.PCSetKSPNestLevel — Method
PCSetKSPNestLevel(petsclib::PetscLibType, pc::AbstractPC, level::PetscInt)

sets the amount of nesting the KSP that contains this PC has

Collective

Input Parameters:

  • pc - the PC
  • level - the nest level

Level: developer

See also: KSPSetUp(), KSPSolve(), KSPDestroy(), KSP, KSPGMRES, KSPType, KSPGetNestLevel(), PCGetKSPNestLevel(), KSPSetNestLevel()

External Links

source
PETSc.LibPETSc.PCSetModifySubMatrices — Method
PCSetModifySubMatrices(petsclib::PetscLibType, pc::AbstractPC, func::Ptr{Cvoid}, ctx::Ptr{Cvoid})

Sets a user-defined routine for modifying the submatrices that arise within certain subdomain-based preconditioners such as PCASM

Logically Collective

Input Parameters:

  • pc - the PC preconditioner context
  • func - routine for modifying the submatrices, see PCModifySubMatricesFn
  • ctx - optional user-defined context (may be NULL)

Level: advanced

See also: PC, PCModifySubMatricesFn, PCBJACOBI, PCASM, PCModifySubMatrices()

External Links

source
PETSc.LibPETSc.PCSetOperators — Method
PCSetOperators(petsclib::PetscLibType, pc::AbstractPC, Amat::AbstractPetscMat, Pmat::AbstractPetscMat)

Sets the matrix associated with the linear system and a (possibly) different one from which the preconditioner will be constructed.

Logically Collective

Input Parameters:

  • pc - the PC preconditioner context
  • Amat - the matrix that defines the linear system
  • Pmat - the matrix to be used in constructing the preconditioner, usually the same as Amat.

Level: advanced

See also: PC, PCGetOperators(), MatZeroEntries()

External Links

source
PETSc.LibPETSc.PCSetOptionsPrefix — Method
PCSetOptionsPrefix(petsclib::PetscLibType, pc::AbstractPC, prefix::String)

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

Logically Collective

Input Parameters:

  • pc - the PC preconditioner context
  • prefix - the prefix string to prepend to all PC option requests

Level: advanced

See also: PC, PCSetFromOptions(), PCAppendOptionsPrefix(), PCGetOptionsPrefix()

External Links

source
PETSc.LibPETSc.PCSetPostSetUp — Method
PCSetPostSetUp(petsclib::PetscLibType, pc::AbstractPC, postsetup::external)

Sets function called at the end of PCSetUp() to adjust the computed preconditioner

Logically Collective

Input Parameters:

  • pc - the preconditioner object
  • postsetup - the function to call after PCSetUp()

Calling sequence of postsetup:

  • pc - the PC context

Level: developer

See also: PC, PCSetUp()

External Links

source
PETSc.LibPETSc.PCSetReusePreconditioner — Method
PCSetReusePreconditioner(petsclib::PetscLibType, pc::AbstractPC, flag::PetscBool)

reuse the current preconditioner even if the operator in the preconditioner PC has changed.

Logically Collective

Input Parameters:

  • pc - the PC preconditioner context
  • flag - PETSC_TRUE do not compute a new preconditioner, PETSC_FALSE do compute a new preconditioner

Level: intermediate

See also: PC, PCGetOperators(), MatZeroEntries(), PCGetReusePreconditioner(), KSPSetReusePreconditioner()

External Links

source
PETSc.LibPETSc.PCSetType — Method
PCSetType(petsclib::PetscLibType, pc::AbstractPC, type::String)

Builds PC for a particular preconditioner type

Collective

Input Parameters:

  • pc - the preconditioner context
  • type - a known method, see PCType for possible values

Options Database Key:

  • -pc_type type - Sets PC type

See also: KSPSetType(), PCType, PCRegister(), PCCreate(), KSPGetPC()

External Links

source
PETSc.LibPETSc.PCSetUp — Method
PCSetUp(petsclib::PetscLibType, pc::AbstractPC)

Prepares for the use of a preconditioner. Performs all the one-time operations needed before the preconditioner can be used with PCApply()

Collective

Input Parameter:

  • pc - the PC preconditioner context

Level: developer

See also: PC, PCCreate(), PCApply(), PCDestroy(), KSPSetUp(), PCSetUpOnBlocks()

External Links

source
PETSc.LibPETSc.PCSetUpOnBlocks — Method
PCSetUpOnBlocks(petsclib::PetscLibType, pc::AbstractPC)

Sets up the preconditioner for each block in the block Jacobi, overlapping Schwarz, and fieldsplit methods.

Collective

Input Parameter:

  • pc - the PC preconditioner context

Level: developer

See also: PC, PCSetUp(), PCCreate(), PCApply(), PCDestroy()

External Links

source
PETSc.LibPETSc.PCSetUseAmat — Method
PCSetUseAmat(petsclib::PetscLibType, pc::AbstractPC, flg::PetscBool)

Sets a flag to indicate that when the preconditioner needs to apply (part of) the operator during the preconditioning process it applies the Amat provided to TSSetRHSJacobian(), TSSetIJacobian(), SNESSetJacobian(), KSPSetOperators() or PCSetOperators() not the Pmat.

Logically Collective

Input Parameters:

  • pc - the PC preconditioner context
  • flg - PETSC_TRUE to use the Amat, PETSC_FALSE to use the Pmat (default is PETSC_FALSE)

Options Database Key:

  • -pc_use_amat (true|false) - use the Amat argument to KSPSetOperators() or PCSetOperators() to apply the operator

Level: intermediate

See also: PC, PCGetUseAmat(), PCBJACOBI, PCMG, PCFIELDSPLIT, PCCOMPOSITE, KSPSetOperators(), PCSetOperators()

External Links

source
PETSc.LibPETSc.PCShellGetContext — Method
ctx::Ptr{Cvoid} = PCShellGetContext(petsclib::PetscLibType, pc::AbstractPC)

Returns the user-provided context associated with a shell PC that was provided with PCShellSetContext()

Not Collective

Input Parameter:

  • pc - of type PCSHELL

Output Parameter:

  • ctx - the user provided context

Level: advanced

See also: PC, PCSHELL, PCShellSetContext(), PCShellSetApply(), PCShellSetDestroy()

External Links

source
PETSc.LibPETSc.PCShellGetName — Method
name::String = PCShellGetName(petsclib::PetscLibType, pc::AbstractPC)

Gets an optional name that the user has set for a PCSHELL with PCShellSetName() preconditioner.

Not Collective

Input Parameter:

  • pc - the preconditioner context

Output Parameter:

  • name - character string describing shell preconditioner (you should not free this)

Level: intermediate

See also: PCSHELL, PCShellSetName(), PetscObjectSetName(), PetscObjectGetName()

External Links

source
PETSc.LibPETSc.PCShellSetApply — Method
PCShellSetApply(petsclib::PetscLibType, pc::AbstractPC, apply::external)

Sets routine to use as preconditioner.

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • apply - the application-provided preconditioning routine

Calling sequence of apply:

  • pc - the preconditioner, get the application context with PCShellGetContext()
  • xin - input vector
  • xout - output vector

Level: intermediate

See also: PCSHELL, PCShellSetApplyRichardson(), PCShellSetSetUp(), PCShellSetApplyTranspose(), PCShellSetContext(), PCShellSetApplyBA(), PCShellSetApplySymmetricRight(), PCShellSetApplySymmetricLeft(), PCShellGetContext()

External Links

source
PETSc.LibPETSc.PCShellSetApplyBA — Method
PCShellSetApplyBA(petsclib::PetscLibType, pc::AbstractPC, applyBA::external)

Sets routine to use as the preconditioner times the operator.

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • applyBA - the application-provided BA routine

Calling sequence of applyBA:

  • pc - the preconditioner
  • side - PC_LEFT, PC_RIGHT, or PC_SYMMETRIC
  • xin - input vector
  • xout - output vector
  • w - work vector

Level: intermediate

See also: PCSHELL, PCShellSetApplyRichardson(), PCShellSetSetUp(), PCShellSetApplyTranspose(), PCShellSetContext(), PCShellSetApply(), PCShellGetContext(), PCSide

External Links

source
PETSc.LibPETSc.PCShellSetApplyRichardson — Method
PCShellSetApplyRichardson(petsclib::PetscLibType, pc::AbstractPC, apply::external)

Sets routine to use as preconditioner in Richardson iteration.

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • apply - the application-provided preconditioning routine

Calling sequence of apply:

  • pc - the preconditioner
  • b - right-hand side
  • x - current iterate
  • r - work space
  • rtol - relative tolerance of residual norm to stop at
  • abstol - absolute tolerance of residual norm to stop at
  • dtol - if residual norm increases by this factor than return
  • maxits - number of iterations to run
  • zeroinitialguess - PETSC_TRUE if x is known to be initially zero
  • its - returns the number of iterations used
  • reason - returns the reason the iteration has converged

Level: advanced

See also: PCSHELL, PCShellSetApply(), PCShellSetContext(), PCRichardsonConvergedReason(), PCShellGetContext(), KSPRICHARDSON

External Links

source
PETSc.LibPETSc.PCShellSetApplySymmetricLeft — Method
PCShellSetApplySymmetricLeft(petsclib::PetscLibType, pc::AbstractPC, apply::external)

Sets routine to use as left preconditioner (when the PC_SYMMETRIC is used).

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • apply - the application-provided left preconditioning routine

Calling sequence of apply:

  • pc - the preconditioner
  • xin - input vector
  • xout - output vector

Level: advanced

See also: PCSHELL, PCShellSetApply(), PCShellSetSetUp(), PCShellSetApplyTranspose(), PCShellSetContext()

External Links

source
PETSc.LibPETSc.PCShellSetApplySymmetricRight — Method
PCShellSetApplySymmetricRight(petsclib::PetscLibType, pc::AbstractPC, apply::external)

Sets routine to use as right preconditioner (when the PC_SYMMETRIC is used).

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • apply - the application-provided right preconditioning routine

Calling sequence of apply:

  • pc - the preconditioner
  • xin - input vector
  • xout - output vector

Level: advanced

See also: PCSHELL, PCShellSetApply(), PCShellSetApplySymmetricLeft(), PCShellSetSetUp(), PCShellSetApplyTranspose(), PCShellSetContext(), PCShellGetContext()

External Links

source
PETSc.LibPETSc.PCShellSetApplyTranspose — Method
PCShellSetApplyTranspose(petsclib::PetscLibType, pc::AbstractPC, applytranspose::external)

Sets routine to use as preconditioner transpose.

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • applytranspose - the application-provided preconditioning transpose routine

Calling sequence of applytranspose:

  • pc - the preconditioner
  • xin - input vector
  • xout - output vector

Level: intermediate

See also: PCSHELL, PCShellSetApplyRichardson(), PCShellSetSetUp(), PCShellSetApply(), PCShellSetContext(), PCShellSetApplyBA(), PCShellGetContext()

External Links

source
PETSc.LibPETSc.PCShellSetContext — Method
PCShellSetContext(petsclib::PetscLibType, pc::AbstractPC, ctx::Ptr{Cvoid})

sets the context for a shell PC that can be accessed with PCShellGetContext()

Logically Collective

Input Parameters:

  • pc - the PC of type PCSHELL
  • ctx - the context

Level: advanced

See also: PC, PCShellGetContext(), PCSHELL, PCShellSetApply(), PCShellSetDestroy()

External Links

source
PETSc.LibPETSc.PCShellSetDestroy — Method
PCShellSetDestroy(petsclib::PetscLibType, pc::AbstractPC, destroy::external)

Sets routine to use to destroy the user-provided application context that was provided with PCShellSetContext()

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • destroy - the application-provided destroy routine

Calling sequence of destroy:

  • pc - the preconditioner

Level: intermediate

See also: PCSHELL, PCShellSetApply(), PCShellSetContext(), PCShellGetContext()

External Links

source
PETSc.LibPETSc.PCShellSetMatApply — Method
PCShellSetMatApply(petsclib::PetscLibType, pc::AbstractPC, matapply::external)

Sets routine to use as preconditioner on a block of vectors.

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • matapply - the application-provided preconditioning routine

Calling sequence of matapply:

  • pc - the preconditioner
  • Xin - input block of vectors represented as a dense Mat
  • Xout - output block of vectors represented as a dense Mat

Level: advanced

See also: PCSHELL, PCShellSetApply(), PCShellSetContext(), PCShellGetContext()

External Links

source
PETSc.LibPETSc.PCShellSetMatApplyTranspose — Method
PCShellSetMatApplyTranspose(petsclib::PetscLibType, pc::AbstractPC, matapplytranspose::external)

Sets routine to use as preconditioner transpose.

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • matapplytranspose - the application-provided preconditioning transpose routine

Calling sequence of matapplytranspose:

  • pc - the preconditioner
  • xin - input matrix
  • xout - output matrix

Level: intermediate

See also: PCSHELL, PCShellSetApplyRichardson(), PCShellSetSetUp(), PCShellSetApply(), PCShellSetContext(), PCShellSetApplyBA(), PCShellGetContext()

External Links

source
PETSc.LibPETSc.PCShellSetName — Method
PCShellSetName(petsclib::PetscLibType, pc::AbstractPC, name::String)

Sets an optional name to associate with a PCSHELL preconditioner.

Not Collective

Input Parameters:

  • pc - the preconditioner context
  • name - character string describing shell preconditioner

Level: intermediate

See also: PCSHELL, PCShellGetName(), PetscObjectSetName(), PetscObjectGetName()

External Links

source
PETSc.LibPETSc.PCShellSetPostSolve — Method
PCShellSetPostSolve(petsclib::PetscLibType, pc::AbstractPC, postsolve::Ptr{Cvoid})

Sets routine to apply to the operators/vectors after a KSPSolve() is applied. This usually does something like scale the linear system in some application specific way.

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • postsolve - the application-provided postsolve routine, see PCShellPSolveFn

Level: advanced

See also: PCSHELL, PCShellPSolveFn, PCShellSetApplyRichardson(), PCShellSetSetUp(), PCShellSetApplyTranspose(), PCShellSetPreSolve(), PCShellSetContext(), PCShellGetContext()

External Links

source
PETSc.LibPETSc.PCShellSetPreSolve — Method
PCShellSetPreSolve(petsclib::PetscLibType, pc::AbstractPC, presolve::Ptr{Cvoid})

Sets routine to apply to the operators/vectors before a KSPSolve() is applied. This usually does something like scale the linear system in some application specific way.

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • presolve - the application-provided presolve routine, see PCShellPSolveFn

Level: advanced

See also: PCSHELL, PCShellPSolveFn, PCShellSetApplyRichardson(), PCShellSetSetUp(), PCShellSetApplyTranspose(), PCShellSetPostSolve(), PCShellSetContext(), PCShellGetContext()

External Links

source
PETSc.LibPETSc.PCShellSetSetUp — Method
PCShellSetSetUp(petsclib::PetscLibType, pc::AbstractPC, setup::external)

Sets routine to use to "setup" the preconditioner whenever the matrix operator is changed.

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • setup - the application-provided setup routine

Calling sequence of setup:

  • pc - the preconditioner

Level: intermediate

See also: PCSHELL, PCShellSetApplyRichardson(), PCShellSetApply(), PCShellSetContext(), PCShellGetContext()

External Links

source
PETSc.LibPETSc.PCShellSetView — Method
PCShellSetView(petsclib::PetscLibType, pc::AbstractPC, view::external)

Sets routine to use as viewer of a PCSHELL shell preconditioner

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • view - the application-provided view routine

Calling sequence of view:

  • pc - the preconditioner
  • v - viewer

Level: advanced

See also: PC, PCSHELL, PCShellSetApplyRichardson(), PCShellSetSetUp(), PCShellSetApplyTranspose(), PCShellSetContext(), PCShellGetContext()

External Links

source
PETSc.LibPETSc.PCTelescopeGetDM — Method
subdm::PetscDM = PCTelescopeGetDM(petsclib::PetscLibType, pc::AbstractPC)

Get the re-partitioned DM attached to the sub-KSP.

Not Collective

Input Parameter:

  • pc - the preconditioner context

Output Parameter:

  • subdm - The re-partitioned DM

Level: advanced

See also: DM, PCTELESCOPE, PCTelescopeSetIgnoreDM(), PCTelescopeSetUseCoarseDM(), PCTelescopeGetIgnoreKSPComputeOperators()

External Links

source
PETSc.LibPETSc.PCTelescopeGetIgnoreDM — Method
v::PetscBool = PCTelescopeGetIgnoreDM(petsclib::PetscLibType, pc::AbstractPC)

Get the flag indicating if any DM attached to the PC will be used in constructing the PC on the reduced number of MPI processes

Not Collective

Input Parameter:

  • pc - the preconditioner context

Output Parameter:

  • v - the flag

Level: advanced

See also: DM, PCTELESCOPE, PCTelescopeSetIgnoreDM()

External Links

source
PETSc.LibPETSc.PCTelescopeGetIgnoreKSPComputeOperators — Method
v::PetscBool = PCTelescopeGetIgnoreKSPComputeOperators(petsclib::PetscLibType, pc::AbstractPC)

Get the flag indicating if KSPComputeOperators() will be used to construct the matrix on the reduced number of MPI processes

Not Collective

Input Parameter:

  • pc - the preconditioner context

Output Parameter:

  • v - the flag

Level: advanced

See also: PCTELESCOPE, PCTelescopeSetIgnoreDM(), PCTelescopeSetUseCoarseDM(), PCTelescopeSetIgnoreKSPComputeOperators()

External Links

source
PETSc.LibPETSc.PCTelescopeGetKSP — Method
subksp::KSP = PCTelescopeGetKSP(petsclib::PetscLibType, pc::AbstractPC)

Gets the KSP created by the telescoping PC.

Not Collective

Input Parameter:

  • pc - the preconditioner context

Output Parameter:

  • subksp - the KSP defined on the smaller set of processes

Level: advanced

See also: PC, KSP, PCTELESCOPE

External Links

source
PETSc.LibPETSc.PCTelescopeGetReductionFactor — Method
fact::PetscInt = PCTelescopeGetReductionFactor(petsclib::PetscLibType, pc::AbstractPC)

Gets the factor by which the original number of MPI processes has been reduced by that was set by PCTelescopeSetReductionFactor()

Not Collective

Input Parameter:

  • pc - the preconditioner context

Output Parameter:

  • fact - the reduction factor

Level: advanced

See also: PC, PCTELESCOPE, PCTelescopeSetReductionFactor()

External Links

source
PETSc.LibPETSc.PCTelescopeGetSubcommType — Method
subcommtype::PetscSubcommType = PCTelescopeGetSubcommType(petsclib::PetscLibType, pc::AbstractPC)

Get the subcommunicator type PetscSubcommType (interlaced or contiguous) set with PCTelescopeSetSubcommType()

Not Collective

Input Parameter:

  • pc - the preconditioner context

Output Parameter:

  • subcommtype - the subcommunicator type (see PetscSubcommType)

Level: advanced

See also: PetscSubcomm, PetscSubcommType, PCTELESCOPE, PCTelescopeSetSubcommType()

External Links

source
PETSc.LibPETSc.PCTelescopeGetUseCoarseDM — Method
v::PetscBool = PCTelescopeGetUseCoarseDM(petsclib::PetscLibType, pc::AbstractPC)

Get the flag indicating if the coarse DM attached to DM associated with the PC will be used in constructing the PC on the reduced number of MPI processes

Not Collective

Input Parameter:

  • pc - the preconditioner context

Output Parameter:

  • v - the flag

Level: advanced

See also: DM, PCTELESCOPE, PCTelescopeSetIgnoreDM(), PCTelescopeSetUseCoarseDM()

External Links

source
PETSc.LibPETSc.PCTelescopeSetIgnoreDM — Method
PCTelescopeSetIgnoreDM(petsclib::PetscLibType, pc::AbstractPC, v::PetscBool)

Set a flag to ignore any DM attached to the PC when constructing the PC on the reduced number of MPI processes

Not Collective

Input Parameter:

  • pc - the preconditioner context

Output Parameter:

  • v - Use PETSC_TRUE to ignore any DM

Level: advanced

See also: DM, PCTELESCOPE, PCTelescopeGetIgnoreDM()

External Links

source
PETSc.LibPETSc.PCTelescopeSetIgnoreKSPComputeOperators — Method
PCTelescopeSetIgnoreKSPComputeOperators(petsclib::PetscLibType, pc::AbstractPC, v::PetscBool)

Set a flag to have PCTELESCOPE ignore the function provided to KSPComputeOperators() in constructint the matrix on the reduced number of MPI processes

Not Collective

Input Parameter:

  • pc - the preconditioner context

Output Parameter:

  • v - Use PETSC_TRUE to ignore the function (if defined) set via KSPSetComputeOperators() on pc

Level: advanced

See also: PCTELESCOPE, PCTelescopeSetIgnoreDM(), PCTelescopeSetUseCoarseDM(), PCTelescopeGetIgnoreKSPComputeOperators()

External Links

source
PETSc.LibPETSc.PCTelescopeSetReductionFactor — Method
PCTelescopeSetReductionFactor(petsclib::PetscLibType, pc::AbstractPC, fact::PetscInt)

Sets the factor by which the original number of MPI processes will been reduced by when constructing the subcommunicator to be used with the PCTELESCOPE.

Not Collective

Input Parameter:

  • pc - the preconditioner context

Output Parameter:

  • fact - the reduction factor

Level: advanced

See also: PCTELESCOPE, PCTelescopeGetReductionFactor()

External Links

source
PETSc.LibPETSc.PCTelescopeSetSubcommType — Method
PCTelescopeSetSubcommType(petsclib::PetscLibType, pc::AbstractPC, subcommtype::PetscSubcommType)

set subcommunicator type PetscSubcommType (interlaced or contiguous) to be used when the subcommunicator is generated from the given PC

Logically Collective

Input Parameters:

  • pc - the preconditioner context
  • subcommtype - the subcommunicator type (see PetscSubcommType)

Level: advanced

See also: PetscSubcommType, PetscSubcomm, PCTELESCOPE, PCTelescopeGetSubcommType()

External Links

source
PETSc.LibPETSc.PCTelescopeSetUseCoarseDM — Method
PCTelescopeSetUseCoarseDM(petsclib::PetscLibType, pc::AbstractPC, v::PetscBool)

Set a flag to query the DM attached to the PC if it also has a coarse DM and utilize that DM in constructing the PC on the reduced number of MPI processes

Not Collective

Input Parameter:

  • pc - the preconditioner context

Output Parameter:

  • v - Use PETSC_FALSE to ignore any coarse DM

Level: advanced

See also: DM, PCTELESCOPE, PCTelescopeSetIgnoreDM()

External Links

source
PETSc.LibPETSc.PCView — Method
PCView(petsclib::PetscLibType, pc::AbstractPC, viewer::PetscViewer)

Prints information about the PC

Collective

Input Parameters:

  • pc - the PC preconditioner context
  • viewer - optional PetscViewer visualization context

Level: intermediate

See also: PC, PetscViewer, PetscViewerType, KSPView(), PetscViewerASCIIOpen()

External Links

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

View (print or provide information about) the PC, based on options in the options database

Collective

Input Parameters:

  • A - the PC context
  • obj - Optional object that provides the options prefix
  • name - command line option name

Options Database Key:

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

Level: developer

See also: PC, PCView, PetscObjectViewFromOptions(), PCCreate()

External Links

source