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 factorizationPCCHOLESKY: Cholesky factorization (symmetric positive definite)PCQR: QR factorization
Incomplete Factorizations
PCILU: Incomplete LU factorizationPCICC: Incomplete Cholesky factorization- Configure fill with
PCFactorSetLevels
Iterative/Relaxation Methods
PCJACOBI: Jacobi (diagonal scaling)PCSOR: Successive over-relaxationPCPBJACOBI: Point-block JacobiPCBJACOBI: Block Jacobi with local solves
Multigrid Methods
PCMG: Geometric multigridPCGAMG: Algebraic multigrid (PETSc's built-in)PCHYPRE: HYPRE preconditioners (BoomerAMG, ParaSails, etc.)PCML: ML algebraic multigrid (Trilinos)
Domain Decomposition
PCASM: Additive Schwarz methodPCGASM: Generalized additive SchwarzPCBDDC: Balancing domain decomposition by constraints
Physics-Based
PCFIELDSPLIT: Field-split for coupled systemsPCLSC: Least-squares commutators (for saddle-point problems)PCCOMPOSITE: Combine multiple preconditioners
Special Purpose
PCSHELL: User-defined shell preconditionerPCNONE: No preconditioning (identity)PCKSP: Use another KSP as preconditionerPCREDISTRIBUTE: 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 solverFor 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 operatorn- 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
- PETSc Manual:
PC/PCASMCreateSubdomains
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 directionn- the number of mesh points in the y directionM- the number of subdomains in the x directionN- the number of subdomains in the y directiondof- degrees of freedom per nodeoverlap- overlap in mesh lines
Output Parameters:
Nsub- the number of subdomains createdis- array of index sets defining overlapping (if overlap > 0) subdomainsis_local- array of index sets defining non-overlapping subdomains
Level: advanced
See also: PCASM, PCASMSetTotalSubdomains(), PCASMSetLocalSubdomains(), PCASMGetSubKSP(), PCASMSetOverlap()
External Links
- PETSc Manual:
PC/PCASMCreateSubdomains2D
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 setsis- the vector of index sets, or the raw pointer to a PETSc array of themis_local- the vector of local index sets, or the raw pointer to a PETSc array of them, can benothing
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
- PETSc Manual:
PC/PCASMDestroySubdomains
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 theDM
Level: intermediate
See also: PCASM, PCASMSetDMSubdomains(), PCASMSetTotalSubdomains(), PCASMSetOverlap(), PCASMCreateSubdomains2D(), PCASMSetLocalSubdomains(), PCASMGetLocalSubdomains()
External Links
- PETSc Manual:
PC/PCASMGetDMSubdomains
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 processoris_local- if requested, the index sets that define the local part of the subdomains for this processor (can beNULL)
Level: advanced
See also: PCASM, PCASMSetTotalSubdomains(), PCASMSetOverlap(), PCASMGetSubKSP(), PCASMCreateSubdomains2D(), PCASMSetLocalSubdomains(), PCASMGetLocalSubmatrices()
External Links
- PETSc Manual:
PC/PCASMGetLocalSubdomains
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
- PETSc Manual:
PC/PCASMGetLocalSubmatrices
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
- PETSc Manual:
PC/PCASMGetLocalType
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 orNULLfirst_local- the global number of the first block on this processor orNULL, all processors must request or all must passNULLksp- the array ofKSPcontexts
Level: advanced
See also: PCASM, PCASMSetTotalSubdomains(), PCASMSetOverlap(), PCASMCreateSubdomains2D()
External Links
- PETSc Manual:
PC/PCASMGetSubKSP
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- thePC
Output Parameter:
sub_mat_type- name of matrix type
Level: advanced
See also: PCASM, PCASMSetSubMatType(), PCSetType(), VecSetType(), MatType, Mat
External Links
- PETSc Manual:
PC/PCASMGetSubMatType
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 ofPCASM, 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]- SetsPCASMtype
Level: intermediate
See also: PCASM, PCASMSetTotalSubdomains(), PCASMGetSubKSP(), PCGASM, PCASMCreateSubdomains2D(), PCASMType, PCASMSetType(), PCASMSetLocalType(), PCASMGetLocalType()
External Links
- PETSc Manual:
PC/PCASMGetType
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 preconditionerflg- boolean indicating whether to use subdomains defined by theDM
Options Database Key:
-pc_asm_dm_subdomains (true|false)- use subdomains defined by theDMwithDMCreateDomainDecomposition()
Level: intermediate
See also: PCASM, PCASMGetDMSubdomains(), PCASMSetTotalSubdomains(), PCASMSetOverlap(), PCASMCreateSubdomains2D(), PCASMSetLocalSubdomains(), PCASMGetLocalSubdomains()
External Links
- PETSc Manual:
PC/PCASMSetDMSubdomains
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 contextn- the number of subdomains for this processor (default value = 1)is- the index set that defines the subdomains for this processor (orNULLfor 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 unlessPCASMTypeisPC_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
- PETSc Manual:
PC/PCASMSetLocalSubdomains
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 contexttype- 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
- PETSc Manual:
PC/PCASMSetLocalType
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 contextovl- 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
- PETSc Manual:
PC/PCASMSetOverlap
PETSc.LibPETSc.PCASMSetSortIndices — Method
PCASMSetSortIndices(petsclib::PetscLibType, pc::AbstractPC, doSort::PetscBool)Determines whether subdomain indices are sorted.
Logically Collective
Input Parameters:
pc- the preconditioner contextdoSort- sort the subdomain indices
Level: intermediate
See also: PCASM, PCASMSetLocalSubdomains(), PCASMSetTotalSubdomains(), PCASMGetSubKSP(), PCASMCreateSubdomains2D()
External Links
- PETSc Manual:
PC/PCASMSetSortIndices
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- thePCobjectsub_mat_type- theMatType
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
- PETSc Manual:
PC/PCASMSetSubMatType
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 contextN- the number of subdomains for all processorsis- the index sets that define the subdomains for all processors (orNULLto 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 (orNULLto 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
- PETSc Manual:
PC/PCASMSetTotalSubdomains
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 contexttype- variant ofPCASM, 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]- SetsPCASMType
Level: intermediate
See also: PCASM, PCASMSetTotalSubdomains(), PCASMGetSubKSP(), PCASMCreateSubdomains2D(), PCASMType, PCASMSetLocalType(), PCASMGetLocalType(), PCGASM
External Links
- PETSc Manual:
PC/PCASMSetType
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- thePCpreconditioner contextprefix- the prefix string to prepend to allPCoption requests
Level: advanced
See also: PC, PCSetFromOptions(), PCSetOptionsPrefix(), PCGetOptionsPrefix()
External Links
- PETSc Manual:
PC/PCAppendOptionsPrefix
PETSc.LibPETSc.PCApply — Method
PCApply(petsclib::PetscLibType, pc::AbstractPC, x::AbstractPetscVec, y::AbstractPetscVec)Applies the preconditioner to a vector.
Collective
Input Parameters:
pc- thePCpreconditioner contextx- input vector
Output Parameter:
y- output vector
Level: developer
See also: PC, PCApplyTranspose(), PCApplyBAorAB()
External Links
- PETSc Manual:
PC/PCApply
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- thePCpreconditioner contextside- indicates the preconditioner side, one ofPC_LEFT,PC_RIGHT, orPC_SYMMETRICx- input vectorwork- work vector
Output Parameter:
y- output vector
Level: developer
See also: PC, PCApply(), PCApplyTranspose(), PCApplyBAorABTranspose()
External Links
- PETSc Manual:
PC/PCApplyBAorAB
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- thePCpreconditioner contextside- indicates the preconditioner side, one ofPC_LEFT,PC_RIGHT, orPC_SYMMETRICx- input vectorwork- work vector
Output Parameter:
y- output vector
Level: developer
See also: PC, PCApply(), PCApplyTranspose(), PCApplyBAorAB()
External Links
- PETSc Manual:
PC/PCApplyBAorABTranspose
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- thePCpreconditioner contextb- the right-hand sidew- one work vectorrtol- relative decrease in residual norm convergence criteriaabstol- absolute residual norm convergence criteriadtol- divergence residual norm increase criteriaits- 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 terminatedy- the solution (also contains initial guess if guesszero isPETSC_FALSE
Level: developer
See also: PC, PCApplyRichardsonExists()
External Links
- PETSc Manual:
PC/PCApplyRichardson
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_TRUEorPETSC_FALSE
Level: developer
See also: PC, KSPRICHARDSON, PCApplyRichardson()
External Links
- PETSc Manual:
PC/PCApplyRichardsonExists
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- thePCpreconditioner contextx- input vector
Output Parameter:
y- output vector
Level: developer
See also: PC, PCApply(), PCApplySymmetricRight()
External Links
- PETSc Manual:
PC/PCApplySymmetricLeft
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- thePCpreconditioner contextx- input vector
Output Parameter:
y- output vector
Level: developer
See also: PC, PCApply(), PCApplySymmetricLeft()
External Links
- PETSc Manual:
PC/PCApplySymmetricRight
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- thePCpreconditioner contextx- input vector
Output Parameter:
y- output vector
Level: developer
See also: PC, PCApply(), PCApplyBAorAB(), PCApplyBAorABTranspose(), PCApplyTransposeExists()
External Links
- PETSc Manual:
PC/PCApplyTranspose
PETSc.LibPETSc.PCApplyTransposeExists — Method
flg::PetscBool = PCApplyTransposeExists(petsclib::PetscLibType, pc::AbstractPC)Test whether the preconditioner has a transpose apply operation
Collective
Input Parameter:
pc- thePCpreconditioner context
Output Parameter:
flg-PETSC_TRUEif a transpose operation is defined
Level: developer
See also: PC, PCApplyTranspose()
External Links
- PETSc Manual:
PC/PCApplyTransposeExists
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- thePCBDDCpreconditioning context (setup should have been called before)fully_redundant- true for a fully redundant set of Lagrange multipliersprefix- optional options database prefix for the objects to be created (can beNULL)
Output Parameters:
fetidp_mat- shell FETI-DP matrix objectfetidp_pc- shell Dirichlet preconditioner for FETI-DP matrix
Level: developer
See also: KSPFETIDP, PCBDDC, PCBDDCMatFETIDPGetRHS(), PCBDDCMatFETIDPGetSolution()
External Links
- PETSc Manual:
PC/PCBDDCCreateFETIDPOperators
PETSc.LibPETSc.PCBDDCFinalizePackage — Method
PCBDDCFinalizePackage(petsclib::PetscLibType)This function frees everything from the PCBDDC package. It is called from PetscFinalize() automatically.
Level: developer
See also: PetscFinalize(), PCBDDCInitializePackage()
External Links
- PETSc Manual:
PC/PCBDDCFinalizePackage
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
- PETSc Manual:
PC/PCBDDCGetDirichletBoundaries
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
- PETSc Manual:
PC/PCBDDCGetDirichletBoundariesLocal
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
- PETSc Manual:
PC/PCBDDCGetNeumannBoundaries
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
- PETSc Manual:
PC/PCBDDCGetNeumannBoundariesLocal
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 (NULLif not set)
Level: intermediate
See also: PCBDDC, PCBDDCSetPrimalVerticesIS(), PCBDDCSetPrimalVerticesLocalIS(), PCBDDCGetPrimalVerticesLocalIS()
External Links
- PETSc Manual:
PC/PCBDDCGetPrimalVerticesIS
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 (NULLif not set)
Level: intermediate
See also: PCBDDC, PCBDDCSetPrimalVerticesIS(), PCBDDCGetPrimalVerticesIS(), PCBDDCSetPrimalVerticesLocalIS()
External Links
- PETSc Manual:
PC/PCBDDCGetPrimalVerticesLocalIS
PETSc.LibPETSc.PCBDDCInitializePackage — Method
PCBDDCInitializePackage(petsclib::PetscLibType)This function initializes everything in the PCBDDC package. It is called from PCInitializePackage().
Level: developer
See also: PetscInitialize(), PCBDDCFinalizePackage()
External Links
- PETSc Manual:
PC/PCBDDCInitializePackage
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 toPCBDDCCreateFETIDPOperators()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
- PETSc Manual:
PC/PCBDDCMatFETIDPGetRHS
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 toPCBDDCCreateFETIDPOperators()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
- PETSc Manual:
PC/PCBDDCMatFETIDPGetSolution
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 contextchange- the change of basis matrixinterior- whether or not the change of basis modifies interior dofs
Level: intermediate
See also: PCBDDC
External Links
- PETSc Manual:
PC/PCBDDCSetChangeOfBasisMat
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 contextk- 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
- PETSc Manual:
PC/PCBDDCSetCoarseningRatio
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 contextDirichletBoundaries- parallelISdefining the Dirichlet boundaries
Level: intermediate
See also: PCBDDC, PCBDDCSetDirichletBoundariesLocal(), MatZeroRows(), MatZeroRowsColumns()
External Links
- PETSc Manual:
PC/PCBDDCSetDirichletBoundaries
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 contextDirichletBoundaries- parallelISdefining the Dirichlet boundaries (in local ordering)
Level: intermediate
See also: PCBDDC, PCBDDCSetDirichletBoundaries(), MatZeroRows(), MatZeroRowsColumns()
External Links
- PETSc Manual:
PC/PCBDDCSetDirichletBoundariesLocal
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 contextG- the discrete gradient matrix (inMATAIJformat)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 ofGconforming- whether the mesh is conforming or not
Level: advanced
See also: PCBDDC, PCBDDCSetDofsSplitting(), PCBDDCSetDofsSplittingLocal(), MATAIJ, PCBDDCSetDivergenceMat()
External Links
- PETSc Manual:
PC/PCBDDCSetDiscreteGradient
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 contextdivudotp- the matrix (must be of typeMATIS)trans- ifPETSC_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 indivudotp) 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
- PETSc Manual:
PC/PCBDDCSetDivergenceMat
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 contextn_is- number of index sets defining the fieldsISForDofs- array ofISdescribing the fields in global ordering
Level: intermediate
See also: PCBDDC, PCBDDCSetDofsSplittingLocal()
External Links
- PETSc Manual:
PC/PCBDDCSetDofsSplitting
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 contextn_is- number of index sets defining the fields, must be the same on all MPI processesISForDofs- array ofISdescribing the fields in local ordering
Level: intermediate
See also: PCBDDC, PCBDDCSetDofsSplitting()
External Links
- PETSc Manual:
PC/PCBDDCSetDofsSplittingLocal
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 contextlevels- 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
- PETSc Manual:
PC/PCBDDCSetLevels
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 dofsadjncy- CSR format column pointers for the connectivity of the dofscopymode- supported modes arePETSC_COPY_VALUES,PETSC_USE_POINTERorPETSC_OWN_POINTER.
Level: intermediate
See also: PCBDDC, PetscCopyMode
External Links
- PETSc Manual:
PC/PCBDDCSetLocalAdjacencyGraph
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 contextNeumannBoundaries- parallelISdefining the Neumann boundaries
Level: intermediate
See also: PCBDDC, PCBDDCSetNeumannBoundariesLocal()
External Links
- PETSc Manual:
PC/PCBDDCSetNeumannBoundaries
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 contextNeumannBoundaries- parallelISdefining the subdomain part of Neumann boundaries (in local ordering)
Level: intermediate
See also: PCBDDC, PCBDDCSetNeumannBoundaries(), PCBDDCGetDirichletBoundaries()
External Links
- PETSc Manual:
PC/PCBDDCSetNeumannBoundariesLocal
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 contextPrimalVertices- index set of primal vertices in global numbering (can be empty)
Level: intermediate
See also: PCBDDC, PCBDDCGetPrimalVerticesIS(), PCBDDCSetPrimalVerticesLocalIS(), PCBDDCGetPrimalVerticesLocalIS()
External Links
- PETSc Manual:
PC/PCBDDCSetPrimalVerticesIS
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 contextPrimalVertices- index set of primal vertices in local numbering (can be empty)
Level: intermediate
See also: PCBDDC, PCBDDCSetPrimalVerticesIS(), PCBDDCGetPrimalVerticesIS(), PCBDDCGetPrimalVerticesLocalIS()
External Links
- PETSc Manual:
PC/PCBDDCSetPrimalVerticesLocalIS
PETSc.LibPETSc.PCBJKOKKOSGetKSP — Method
PCBJKOKKOSGetKSP(petsclib::PetscLibType, pc::AbstractPC, ksp::AbstractKSP)External Links
- PETSc Manual:
KSP/PCBJKOKKOSGetKSP
PETSc.LibPETSc.PCBJKOKKOSSetKSP — Method
PCBJKOKKOSSetKSP(petsclib::PetscLibType, pc::AbstractPC, ksp::AbstractKSP)External Links
- PETSc Manual:
KSP/PCBJKOKKOSSetKSP
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 contextblocks- the number of blockslens- [optional] integer array containing size of each block
Level: intermediate
See also: PCBJACOBI, PCSetUseAmat(), PCBJacobiGetTotalBlocks()
External Links
- PETSc Manual:
PC/PCBJacobiGetLocalBlocks
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 NULLfirst_local- the global number of the first block on this processor, or NULLksp- the array of KSP contexts
Level: advanced
See also: PCBJACOBI, PCASM, PCASMGetSubKSP()
External Links
- PETSc Manual:
PC/PCBJacobiGetSubKSP
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 blockslens- integer array containing the size of each block
Level: intermediate
See also: PCBJACOBI, PCSetUseAmat(), PCBJacobiGetLocalBlocks()
External Links
- PETSc Manual:
PC/PCBJacobiGetTotalBlocks
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 contextblocks- the number of blockslens- [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
- PETSc Manual:
PC/PCBJacobiSetLocalBlocks
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 contextblocks- the number of blockslens- [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
- PETSc Manual:
PC/PCBJacobiSetTotalBlocks
PETSc.LibPETSc.PCCompositeAddPC — Method
PCCompositeAddPC(petsclib::PetscLibType, pc::AbstractPC, subpc::AbstractPC)Adds another PC to the composite PC.
Collective
Input Parameters:
pc- the preconditioner contextsubpc- the new preconditioner
Level: intermediate
See also: PCCOMPOSITE, PCCompositeAddPCType(), PCCompositeGetNumberPC()
External Links
- PETSc Manual:
PC/PCCompositeAddPC
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 contexttype- the type of the new preconditioner
Level: intermediate
See also: PCCOMPOSITE, PCCompositeAddPC(), PCCompositeGetNumberPC()
External Links
- PETSc Manual:
PC/PCCompositeAddPCType
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
- PETSc Manual:
PC/PCCompositeGetNumberPC
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 contextn- the number of the pc requested
Output Parameter:
subpc- the PC requested
Level: intermediate
See also: PCCOMPOSITE, PCCompositeAddPCType(), PCCompositeGetNumberPC(), PCSetOperators()
External Links
- PETSc Manual:
PC/PCCompositeGetPC
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
- PETSc Manual:
PC/PCCompositeGetType
PETSc.LibPETSc.PCCompositeSetType — Method
PCCompositeSetType(petsclib::PetscLibType, pc::AbstractPC, type::PCCompositeType)Sets the type of composite preconditioner.
Logically Collective
Input Parameters:
pc- the preconditioner contexttype-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
- PETSc Manual:
PC/PCCompositeSetType
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 contextalpha- scale on identity
Level: developer
See also: PCCOMPOSITE, PC_COMPOSITE_ADDITIVE, PC_COMPOSITE_MULTIPLICATIVE, PC_COMPOSITE_SPECIAL, PCCompositeType, PCCompositeSetType(), PCCompositeGetType()
External Links
- PETSc Manual:
PC/PCCompositeSpecialSetAlpha
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 contextalpha_mat- the matrixM
Level: developer
See also: PCCOMPOSITE, PC_COMPOSITE_ADDITIVE, PC_COMPOSITE_MULTIPLICATIVE, PC_COMPOSITE_SPECIAL, PCCompositeType, PCCompositeSetType(), PCCompositeSpecialSetAlpha()
External Links
- PETSc Manual:
PC/PCCompositeSpecialSetAlphaMat
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- thePCpreconditioner objectmattype- theMatTypeto be used for the operator
Output Parameter:
mat- the explicit preconditioned operator
Level: advanced
See also: PC, KSPComputeOperator(), MatType
External Links
- PETSc Manual:
PC/PCComputeOperator
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 thePCpreconditioner context
Level: developer
See also: PC, PCType, PCSetType, PCSetUp(), PCApply(), PCDestroy(), KSP, KSPGetPC()
External Links
- PETSc Manual:
PC/PCCreate
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 problemKSPcontext
Level: advanced
See also: PCDEFLATION, PCDeflationSetCoarseMat()
External Links
- PETSc Manual:
PC/PCDeflationGetCoarseKSP
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
- PETSc Manual:
PC/PCDeflationGetPC
PETSc.LibPETSc.PCDeflationSetCoarseMat — Method
PCDeflationSetCoarseMat(petsclib::PetscLibType, pc::AbstractPC, mat::AbstractPetscMat)Set the coarse problem Mat.
Collective
Input Parameters:
pc- preconditioner contextmat- coarse problem mat
Level: developer
See also: PCDEFLATION, PCDeflationGetCoarseKSP()
External Links
- PETSc Manual:
PC/PCDeflationSetCoarseMat
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 contextfact- 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
- PETSc Manual:
PC/PCDeflationSetCorrectionFactor
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 contextflg- defaultPETSC_FALSE
Options Database Key:
-pc_deflation_init_only (true|false)- if true computes only the special guess
Level: intermediate
See also: PCDEFLATION
External Links
- PETSc Manual:
PC/PCDeflationSetInitOnly
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 contextmax- 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
- PETSc Manual:
PC/PCDeflationSetLevels
PETSc.LibPETSc.PCDeflationSetProjectionNullSpaceMat — Method
PCDeflationSetProjectionNullSpaceMat(petsclib::PetscLibType, pc::AbstractPC, mat::AbstractPetscMat)Set the projection null space matrix (W'*A).
Collective
Input Parameters:
pc- preconditioner contextmat- projection null space matrix
Level: developer
See also: PCDEFLATION, PCDeflationSetSpace()
External Links
- PETSc Manual:
PC/PCDeflationSetProjectionNullSpaceMat
PETSc.LibPETSc.PCDeflationSetReductionFactor — Method
PCDeflationSetReductionFactor(petsclib::PetscLibType, pc::AbstractPC, red::PetscInt)Set reduction factor for the PCDEFLATION
Logically Collective
Input Parameters:
pc- the preconditioner contextred- reduction factor (orPETSC_DETERMINE)
Options Database Key:
-pc_deflation_reduction_factor red- reduction factor on bottom level coarse problem forPCDEFLATION
See also: PCTELESCOPE, PCDEFLATION, PCDeflationSetLevels()
External Links
- PETSc Manual:
PC/PCDeflationSetReductionFactor
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 contextW- deflation matrixtranspose- indicates that W is an explicit transpose of the deflation matrix
Level: intermediate
See also: PCDeflationSetLevels(), PCDEFLATION, PCDeflationSetProjectionNullSpaceMat()
External Links
- PETSc Manual:
PC/PCDeflationSetSpace
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 contexttype- deflation space type to compute (orPETSC_IGNORE)size- size of the space to compute (orPETSC_DEFAULT)
Options Database Keys:
-pc_deflation_compute_space type- computePCDeflationSpaceTypedeflation space-pc_deflation_compute_space_size size- size of the deflation space
See also: PCDeflationSetLevels(), PCDEFLATION
External Links
- PETSc Manual:
PC/PCDeflationSetSpaceToCompute
PETSc.LibPETSc.PCDestroy — Method
PCDestroy(petsclib::PetscLibType, pc::AbstractPC)Destroys PC context that was created with PCCreate().
Collective
Input Parameter:
pc- thePCpreconditioner context
Level: developer
See also: PC, PCCreate(), PCSetUp()
External Links
- PETSc Manual:
PC/PCDestroy
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- thePCpreconditioner contextin- input vectorout- scaled vector (maybe the same as in)
Level: intermediate
See also: PCCreate(), PCSetUp(), PCSetDiagonalScale(), PCDiagonalScaleRight(), MatDiagonalScale()
External Links
- PETSc Manual:
PC/PCDiagonalScaleLeft
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- thePCpreconditioner contextin- input vectorout- scaled vector (maybe the same as in)
Level: intermediate
See also: PCCreate(), PCSetUp(), PCDiagonalScaleLeft(), PCSetDiagonalScale(), MatDiagonalScale()
External Links
- PETSc Manual:
PC/PCDiagonalScaleRight
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_TRUEmeans there is no diagonal scaling applied
Options Database Key:
-pc_eisenstat_no_diagonal_scaling- ActivatesPCEisenstatSetNoDiagonalScaling()
Level: intermediate
See also: PCEISENSTAT, PCEisenstatGetOmega()
External Links
- PETSc Manual:
PC/PCEisenstatGetNoDiagonalScaling
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
- PETSc Manual:
PC/PCEisenstatGetOmega
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 contextflg-PETSC_TRUEturns off diagonal scaling inside the algorithm
Options Database Key:
-pc_eisenstat_no_diagonal_scaling- ActivatesPCEisenstatSetNoDiagonalScaling()
Level: intermediate
See also: PCEisenstatSetOmega(), PCEISENSTAT
External Links
- PETSc Manual:
PC/PCEisenstatSetNoDiagonalScaling
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 contextomega- relaxation coefficient (0 < omega < 2)
Options Database Key:
-pc_eisenstat_omega omega- Sets omega
Level: intermediate
See also: PCSORSetOmega(), PCEISENSTAT
External Links
- PETSc Manual:
PC/PCEisenstatSetOmega
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 contexttype- eitherPC_EXOTIC_FACEorPC_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
- PETSc Manual:
PC/PCExoticSetType
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_TRUEto turn on,PETSC_FALSEto turn off
See also: PCILU, PCICC, PCFactorSetAllowDiagonalFill()
External Links
- PETSc Manual:
PC/PCFactorGetAllowDiagonalFill
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
- PETSc Manual:
PC/PCFactorGetLevels
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
- PETSc Manual:
PC/PCFactorGetMatSolverType
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- thePCpreconditioner context
Output Parameters:
mat- the factored matrix
Level: advanced
See also: PC, PCLU, PCILU, PCCHOLESKY, PCICC
External Links
- PETSc Manual:
PC/PCFactorGetMatrix
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
- PETSc Manual:
PC/PCFactorGetShiftAmount
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 ofMAT_SHIFT_NONE,MAT_SHIFT_NONZERO,MAT_SHIFT_POSITIVE_DEFINITE, orMAT_SHIFT_INBLOCKS
Level: intermediate
See also: PCLU, PCCHOLESKY, PCFactorSetShiftType(), MatFactorShiftType, PCFactorSetShiftAmount(), PCFactorGetShiftAmount()
External Links
- PETSc Manual:
PC/PCFactorGetShiftType
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_TRUEto enable,PETSC_FALSEto disable
Level: intermediate
See also: PCLU, PCCHOLESKY, PCILU, PCICC, PCFactorSetUseInPlace()
External Links
- PETSc Manual:
PC/PCFactorGetUseInPlace
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
- PETSc Manual:
PC/PCFactorGetZeroPivot
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 contextrtol- 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
- PETSc Manual:
PC/PCFactorReorderForNonzeroDiagonal
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 contextflg-PETSC_TRUEto turn on,PETSC_FALSEto turn off
Options Database Key:
-pc_factor_diagonal_fill (true|false)- allow the diagonal fill
See also: PCILU, PCICC, PCFactorGetAllowDiagonalFill()
External Links
- PETSc Manual:
PC/PCFactorSetAllowDiagonalFill
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 contextdtcol- 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
- PETSc Manual:
PC/PCFactorSetColumnPivot
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 contextdt- the drop tolerance, try from 1.e-10 to .1dtcol- 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
- PETSc Manual:
PC/PCFactorSetDropTolerance
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 contextfill- 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
- PETSc Manual:
PC/PCFactorSetFill
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 contextlevels- number of levels of fill
Options Database Key:
-pc_factor_levels levels- Sets fill level
Level: intermediate
See also: PCILU, PCICC, PCFactorGetLevels()
External Links
- PETSc Manual:
PC/PCFactorSetLevels
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 contextordering- the matrix ordering name, for example,MATORDERINGNDorMATORDERINGRCM
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
- PETSc Manual:
PC/PCFactorSetMatOrderingType
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 contextstype- 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
- PETSc Manual:
PC/PCFactorSetMatSolverType
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 contextpivot-PETSC_TRUEorPETSC_FALSE
Options Database Key:
-pc_factor_pivot_in_blocks (true|false)- Pivot inside matrix dense blocks forMATBAIJandMATSBAIJ
Level: intermediate
See also: PCLU, PCCHOLESKY, PCILU, PCICC, PCILUSetMatOrdering(), PCFactorSetColumnPivot()
External Links
- PETSc Manual:
PC/PCFactorSetPivotInBlocks
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 contextflag-PETSC_TRUEto reuse elsePETSC_FALSE
Options Database Key:
-pc_factor_reuse_fill- ActivatesPCFactorSetReuseFill()
Level: intermediate
See also: PCLU, PCCHOLESKY, PCILU, PCICC, PCFactorSetReuseOrdering(), PCFactorSetFill()
External Links
- PETSc Manual:
PC/PCFactorSetReuseFill
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 contextflag-PETSC_TRUEto reuse elsePETSC_FALSE
Options Database Key:
-pc_factor_reuse_ordering- ActivatePCFactorSetReuseOrdering()
Level: intermediate
See also: PCLU, PCCHOLESKY, PCFactorSetReuseFill()
External Links
- PETSc Manual:
PC/PCFactorSetReuseOrdering
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 contextshiftamount- amount of shift orPETSC_DECIDEfor 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
- PETSc Manual:
PC/PCFactorSetShiftAmount
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 contextshifttype- type of shift; one ofMAT_SHIFT_NONE,MAT_SHIFT_NONZERO,MAT_SHIFT_POSITIVE_DEFINITE,MAT_SHIFT_INBLOCKS
Options Database Key:
-pc_factor_shift_type shifttype- Sets shift type; seeMatFactorShiftType
Level: intermediate
See also: PCCHOLESKY, PCLU, PCFactorSetZeroPivot(), PCFactorSetShiftAmount()
External Links
- PETSc Manual:
PC/PCFactorSetShiftType
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
- PETSc Manual:
PC/PCFactorSetUpMatSolverType
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 contextflg-PETSC_TRUEto enable,PETSC_FALSEto 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
- PETSc Manual:
PC/PCFactorSetUseInPlace
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 contextzero- 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
- PETSc Manual:
PC/PCFactorSetZeroPivot
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 theDM
Level: intermediate
See also: PC, PCFIELDSPLIT, PCFieldSplitSetDMSplits(), DMCreateFieldDecomposition(), PCFieldSplitSetFields(), PCFieldSplitSetIS()
External Links
- PETSc Manual:
PC/PCFieldSplitGetDMSplits
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
- PETSc Manual:
PC/PCFieldSplitGetDetectSaddlePoint
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
- PETSc Manual:
PC/PCFieldSplitGetDiagUseAmat
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 contextsplitname- name of this split
Output Parameter:
is- the index set that defines the elements in this split, orNULLif the split is not found
Level: intermediate
See also: PC, PCFieldSplitGetSubKSP(), PCFIELDSPLIT, PCFieldSplitSetIS(), PCFieldSplitGetISByIndex()
External Links
- PETSc Manual:
PC/PCFieldSplitGetIS
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 contextindex- 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
- PETSc Manual:
PC/PCFieldSplitGetISByIndex
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
- PETSc Manual:
PC/PCFieldSplitGetOffDiagUseAmat
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) blockA01- the (0,1) blockA10- the (1,0) blockA11- the (1,1) block
Level: advanced
See also: PC, PCFIELDSPLIT, MatSchurComplementGetSubMatrices(), MatSchurComplementSetSubMatrices()
External Links
- PETSc Manual:
PC/PCFieldSplitGetSchurBlocks
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_USERpre- matrix to use for preconditioning (withPC_FIELDSPLIT_SCHUR_PRE_USER), orNULL
Level: intermediate
See also: PC, PCFieldSplitSetSchurPre(), PCFieldSplitGetSubKSP(), PCFIELDSPLIT, PCFieldSplitSetFields(), PCFieldSplitSchurPreType, PCLSC
External Links
- PETSc Manual:
PC/PCFieldSplitGetSchurPre
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 splitssubksp- the array ofKSPcontexts
Level: advanced
See also: PC, PCFIELDSPLIT, PCFieldSplitSetFields(), PCFieldSplitSetIS(), PCFieldSplitSchurGetSubKSP()
External Links
- PETSc Manual:
PC/PCFieldSplitGetSubKSP
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
- PETSc Manual:
PC/PCFieldSplitGetType
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 contextisy- the index set that defines the indices to which the fieldsplit is to be restricted
Level: advanced
See also: PCFIELDSPLIT, PCFieldSplitSetFields(), PCFieldSplitSetIS()
External Links
- PETSc Manual:
PC/PCFieldSplitRestrictIS
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
- PETSc Manual:
PC/PCFieldSplitSchurGetS
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 splitssubksp- the array ofKSPcontexts
Level: advanced
See also: PC, PCFIELDSPLIT, PCFieldSplitSetFields(), PCFieldSplitSetIS(), PCFieldSplitGetSubKSP()
External Links
- PETSc Manual:
PC/PCFieldSplitSchurGetSubKSP
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 contextS- the Schur complement matrix
Level: advanced
See also: PC, PCFieldSplitGetSubKSP(), PCFIELDSPLIT, PCFieldSplitSchurPreType, PCFieldSplitSetSchurPre(), MatSchurComplement, PCFieldSplitSchurGetS()
External Links
- PETSc Manual:
PC/PCFieldSplitSchurRestoreS
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 contextbs- the block size
Level: intermediate
See also: PC, PCFieldSplitGetSubKSP(), PCFIELDSPLIT, PCFieldSplitSetFields(), PCFieldSplitSetIS()
External Links
- PETSc Manual:
PC/PCFieldSplitSetBlockSize
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 contextflg- boolean indicating whether to use field splits defined by theDM
Options Database Key:
-pc_fieldsplit_dm_splits (true|false)- use the field splits defined by theDM
Level: intermediate
See also: PC, PCFIELDSPLIT, PCFieldSplitGetDMSplits(), DMCreateFieldDecomposition(), PCFieldSplitSetFields(), PCFieldSplitSetIS()
External Links
- PETSc Manual:
PC/PCFieldSplitSetDMSplits
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
- PETSc Manual:
PC/PCFieldSplitSetDetectSaddlePoint
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 objectflg- 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
- PETSc Manual:
PC/PCFieldSplitSetDiagUseAmat
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 contextsplitname- name of this split, ifNULLthe number of the split is usedn- the number of fields in this splitfields- the fields in this splitfields_col- generally the same asfields, if it does not matchfieldsthen 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
- PETSc Manual:
PC/PCFieldSplitSetFields
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 contextdelay- 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
- PETSc Manual:
PC/PCFieldSplitSetGKBDelay
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 contextmaxit- 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
- PETSc Manual:
PC/PCFieldSplitSetGKBMaxit
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 contextnu- 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
- PETSc Manual:
PC/PCFieldSplitSetGKBNu
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 contexttolerance- 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
- PETSc Manual:
PC/PCFieldSplitSetGKBTol
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 contextsplitname- name of this split, ifNULLthe number of the split is usedis- the index set that defines the elements in this split
Level: intermediate
See also: PC, PCFieldSplitGetSubKSP(), PCFIELDSPLIT, PCFieldSplitSetBlockSize(), PCFieldSplitSetFields()
External Links
- PETSc Manual:
PC/PCFieldSplitSetIS
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 objectflg- 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
- PETSc Manual:
PC/PCFieldSplitSetOffDiagUseAmat
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 contextftype- which blocks of factorization to retain,PC_FIELDSPLIT_SCHUR_FACT_FULLis default
Options Database Key:
-pc_fieldsplit_schur_fact_type (diag|lower|upper|full)- default isfull
Level: intermediate
See also: PC, PCFieldSplitGetSubKSP(), PCFIELDSPLIT, PCFieldSplitSetFields(), PCFieldSplitSchurPreType, PCFieldSplitSetSchurScale(), PCFieldSplitSetSchurPre()
External Links
- PETSc Manual:
PC/PCFieldSplitSetSchurFactType
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 contextptype- 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, orNULL
Options Database Keys:
-pc_fieldsplit_schur_precondition (self|selfp|user|a11|full)- default isa11. 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
- PETSc Manual:
PC/PCFieldSplitSetSchurPre
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 contextscale- 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
- PETSc Manual:
PC/PCFieldSplitSetSchurScale
PETSc.LibPETSc.PCFieldSplitSetType — Method
PCFieldSplitSetType(petsclib::PetscLibType, pc::AbstractPC, type::PCCompositeType)Sets the type, PCCompositeType, of a PCFIELDSPLIT
Collective
Input Parameters:
pc- the preconditioner contexttype-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
- PETSc Manual:
PC/PCFieldSplitSetType
PETSc.LibPETSc.PCFinalizePackage — Method
PCFinalizePackage(petsclib::PetscLibType)This function destroys everything in the PC package. It is called from PetscFinalize().
Level: developer
See also: PetscFinalize(), PCInitializePackage()
External Links
- PETSc Manual:
KSP/PCFinalizePackage
PETSc.LibPETSc.PCGAMGASMSetHEM — Method
PCGAMGASMSetHEM(petsclib::PetscLibType, pc::AbstractPC, n::PetscInt)Sets the number of HEM matching passed
Collective
Input Parameters:
pc- the preconditionern- 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
- PETSc Manual:
PC/PCGAMGASMSetHEM
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 contextflg-PETSC_TRUEto use aggregates,PETSC_FALSEto 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
- PETSc Manual:
PC/PCGAMGASMSetUseAggs
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, seePCGAMGClassicalType()
Level: intermediate
See also: PCGAMG, PCGAMGClassicalType, PCGAMGClassicalSetType()
External Links
- PETSc Manual:
PC/PCGAMGClassicalGetType
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 contexttype- the interpolation to use, seePCGAMGClassicalType()
Options Database Key:
-pc_gamg_classical_type (direct|standard)- set type of classical AMG prolongation
Level: intermediate
See also: PCGAMG, PCGAMGClassicalType, PCGAMGClassicalGetType()
External Links
- PETSc Manual:
PC/PCGAMGClassicalSetType
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- thePCGAMGA- the matrix, for any level
Output Parameter:
G- the graph
Level: advanced
See also: PCGAMGType, PCGAMG, PCGAMGSetType()
External Links
- PETSc Manual:
PC/PCGAMGCreateGraph
PETSc.LibPETSc.PCGAMGFinalizePackage — Method
PCGAMGFinalizePackage(petsclib::PetscLibType)This function frees everything from the PCGAMG package. It is called from PetscFinalize() automatically.
Level: developer
See also: PetscFinalize()
External Links
- PETSc Manual:
PC/PCGAMGFinalizePackage
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
- PETSc Manual:
PC/PCGAMGGetType
PETSc.LibPETSc.PCGAMGInitializePackage — Method
PCGAMGInitializePackage(petsclib::PetscLibType)This function initializes everything in the PCGAMG package. It is called from PCInitializePackage().
Level: developer
See also: PetscInitialize()
External Links
- PETSc Manual:
PC/PCGAMGInitializePackage
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 contextn- 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
- PETSc Manual:
PC/PCGAMGMISkSetAggressive
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 contextb- 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
- PETSc Manual:
PC/PCGAMGMISkSetMinDegreeOrdering
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 thePCGAMGtype.create- function for creating the gamg context.
Level: developer
See also: PCGAMGType, PCGAMG, PCGAMGSetType()
External Links
- PETSc Manual:
PC/PCGAMGRegister
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 contextn- 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
- PETSc Manual:
PC/PCGAMGSetAggressiveLevels
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 contextb- 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
- PETSc Manual:
PC/PCGAMGSetAggressiveSquareGraph
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 contextn- 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
- PETSc Manual:
PC/PCGAMGSetCoarseEqLim
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 contextflg-PCGAMGLayoutTypetype, eitherPCGAMG_LAYOUT_COMPACTorPCGAMG_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
- PETSc Manual:
PC/PCGAMGSetCoarseGridLayoutType
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 contextflg-PETSC_TRUEto 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
- PETSc Manual:
PC/PCGAMGSetCpuPinCoarseGrids
PETSc.LibPETSc.PCGAMGSetEigenvalues — Method
PCGAMGSetEigenvalues(petsclib::PetscLibType, pc::AbstractPC, emax::PetscReal, emin::PetscReal)Set WHAT eigenvalues WHY?
Collective
Input Parameters:
pc- the preconditioner contextemax- max eigenvalueemin- 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
- PETSc Manual:
PC/PCGAMGSetEigenvalues
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 contextb- 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
- PETSc Manual:
PC/PCGAMGSetGraphSymmetrize
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 contextn- number of indicesidx- 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
- PETSc Manual:
PC/PCGAMGSetInjectionIndex
PETSc.LibPETSc.PCGAMGSetLowMemoryFilter — Method
PCGAMGSetLowMemoryFilter(petsclib::PetscLibType, pc::AbstractPC, b::PetscBool)Use low memory graph/matrix filter
Logically Collective
Input Parameters:
pc- the preconditioner contextb- 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
- PETSc Manual:
PC/PCGAMGSetLowMemoryFilter
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 contextn- 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
- PETSc Manual:
PC/PCGAMGSetNSmooths
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 preconditionern- 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
- PETSc Manual:
PC/PCGAMGSetNlevels
PETSc.LibPETSc.PCGAMGSetParallelCoarseGridSolve — Method
PCGAMGSetParallelCoarseGridSolve(petsclib::PetscLibType, pc::AbstractPC, flg::PetscBool)allow a parallel coarse grid solver
Collective
Input Parameters:
pc- the preconditioner contextflg-PETSC_TRUEto 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
- PETSc Manual:
PC/PCGAMGSetParallelCoarseGridSolve
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 contextn- 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
- PETSc Manual:
PC/PCGAMGSetProcEqLim
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 contextv- array of reduction factors. 0 for first value forces a reduction to one process/device on first level in CUDAn- 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
- PETSc Manual:
PC/PCGAMGSetRankReductionFactors
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 contextb- flag, default isPETSC_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
- PETSc Manual:
PC/PCGAMGSetRecomputeEstEig
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 contextn-PETSC_TRUEorPETSC_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
- PETSc Manual:
PC/PCGAMGSetRepartition
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 contextn-PETSC_TRUEorPETSC_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
- PETSc Manual:
PC/PCGAMGSetReuseInterpolation
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 contextv- array of threshold values for finestnlevels; 0.0 means keep all nonzero entries in the graph; negative means keep even zero entries in the graphn- 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
- PETSc Manual:
PC/PCGAMGSetThreshold
PETSc.LibPETSc.PCGAMGSetThresholdScale — Method
PCGAMGSetThresholdScale(petsclib::PetscLibType, pc::AbstractPC, v::PetscReal)Relative threshold reduction at each level
Not Collective
Input Parameters:
pc- the preconditioner contextv- 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
- PETSc Manual:
PC/PCGAMGSetThresholdScale
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 contexttype-PCGAMGAGG,PCGAMGGEO, orPCGAMGCLASSICAL
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
- PETSc Manual:
PC/PCGAMGSetType
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 contextb- 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
- PETSc Manual:
PC/PCGAMGSetUseSAEstEig
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 operatorN- the number of global subdomains requested
Output Parameters:
n- the number of subdomains created on this MPI processiis- 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
- PETSc Manual:
PC/PCGASMCreateSubdomains
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 contextM- the global number of grid points in the x directionN- the global number of grid points in the y directionMdomains- the global number of subdomains in the x directionNdomains- the global number of subdomains in the y directiondof- degrees of freedom per nodeoverlap- overlap in mesh lines
Output Parameters:
nsub- the number of local subdomains creatediis- array of index sets defining inner (nonoverlapping) subdomainsois- array of index sets defining outer (overlapping, if overlap > 0) subdomains
Level: advanced
See also: PCGASM, PCGASMSetSubdomains(), PCGASMGetSubKSP(), PCGASMSetOverlap(), PCASMCreateSubdomains2D(), PCGASMDestroySubdomains()
External Links
- PETSc Manual:
PC/PCGASMCreateSubdomains2D
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 setsiis- the vector of inner subdomains, or the raw pointer to a PETSc array of themois- the vector of outer subdomains, or the raw pointer to a PETSc array of them, can benothing
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
- PETSc Manual:
PC/PCGASMDestroySubdomains
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 orNULLfirst_local- the global number of the first block on this process orNULL, all processes must request or all must passNULLksp- the array ofKSPcontexts
Level: advanced
See also: PCGASM, PCGASMSetSubdomains(), PCGASMSetOverlap(), PCGASMCreateSubdomains2D()
External Links
- PETSc Manual:
PC/PCGASMGetSubKSP
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 beNULL)ois- the index sets that define the outer subdomains (with overlap) supported on this process (can beNULL)
Level: advanced
See also: PCGASM, PCGASMSetOverlap(), PCGASMGetSubKSP(), PCGASMCreateSubdomains2D(), PCGASMSetSubdomains(), PCGASMGetSubmatrices(), PCGASMDestroySubdomains()
External Links
- PETSc Manual:
PC/PCGASMGetSubdomains
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
- PETSc Manual:
PC/PCGASMGetSubmatrices
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 theDM
Level: intermediate
See also: PCGASM, PCGASMSetUseDMSubdomains(), PCGASMSetOverlap(), PCGASMCreateSubdomains2D()
External Links
- PETSc Manual:
PC/PCGASMGetUseDMSubdomains
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 contextovl- 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
- PETSc Manual:
PC/PCGASMSetOverlap
PETSc.LibPETSc.PCGASMSetSortIndices — Method
PCGASMSetSortIndices(petsclib::PetscLibType, pc::AbstractPC, doSort::PetscBool)Determines whether subdomain indices are sorted.
Logically Collective
Input Parameters:
pc- the preconditioner contextdoSort- sort the subdomain indices
Level: intermediate
See also: PCGASM, PCGASMSetSubdomains(), PCGASMGetSubKSP(), PCGASMCreateSubdomains2D()
External Links
- PETSc Manual:
PC/PCGASMSetSortIndices
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 objectn- the number of subdomains for this MPI processiis- the index sets that define the inner subdomains (orNULLfor PETSc to determine subdomains), theiisarray is
copied so may be freed after this call.
ois- the index sets that define the outer subdomains (orNULLto use the same asiis, or to construct by expandingiisby
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
- PETSc Manual:
PC/PCGASMSetSubdomains
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 preconditionerN- total number of subdomains
Level: beginner
See also: PCGASM, PCGASMSetSubdomains(), PCGASMSetOverlap(), PCGASMCreateSubdomains2D()
External Links
- PETSc Manual:
PC/PCGASMSetTotalSubdomains
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 contexttype- variant ofPCGASM, 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]- SetsPCGASMtype
Level: intermediate
See also: PCGASM, PCGASMSetSubdomains(), PCGASMGetSubKSP(), PCGASMCreateSubdomains2D(), PCASM, PCASMSetType()
External Links
- PETSc Manual:
PC/PCGASMSetType
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 preconditionerflg- boolean indicating whether to use subdomains defined by theDM
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
- PETSc Manual:
PC/PCGASMSetUseDMSubdomains
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- theKSPobject
Level: intermediate
See also: PC, PCCreate(), PCSetType(), PCType, PCGALERKIN, PCGalerkinSetRestriction(), PCGalerkinSetInterpolation(), PCGalerkinSetComputeSubmatrix()
External Links
- PETSc Manual:
PC/PCGalerkinGetKSP
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 contextcomputeAsub- routine that computes the submatrix from the global matrixctx- context used by the routine, orNULL
Calling sequence of computeAsub:
pc- thePCGALERKINpreconditionerA- the matrix in thePCGALERKINAp- the computed submatrix from any previous computation, ifNULLit has not previously been computedcAp- the submatrix computed by this routinectx- optional user-defined function context
Level: intermediate
See also: PC, PCCreate(), PCSetType(), PCType, PCGALERKIN, PCGalerkinSetRestriction(), PCGalerkinSetInterpolation(), PCGalerkinGetKSP()
External Links
- PETSc Manual:
PC/PCGalerkinSetComputeSubmatrix
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 contextP- the interpolation operator
Level: intermediate
See also: PC, PCCreate(), PCSetType(), PCType, PCGALERKIN, PCGalerkinSetRestriction(), PCGalerkinGetKSP()
External Links
- PETSc Manual:
PC/PCGalerkinSetInterpolation
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 contextR- the restriction operator
Level: intermediate
See also: PC, PCCreate(), PCSetType(), PCType, PCGALERKIN, PCGalerkinSetInterpolation(), PCGalerkinGetKSP()
External Links
- PETSc Manual:
PC/PCGalerkinSetRestriction
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-PCcontext
Output Parameter:
ctx- application context
Level: intermediate
See also: PC, PCSetApplicationContext(), KSPSetApplicationContext(), KSPGetApplicationContext()
External Links
- PETSc Manual:
PC/PCGetApplicationContext
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 levelscoarseOperators- the coarse operator matrices (size ofnum_levels-1)
Level: advanced
See also: PC, PCMG, PCMGGetRestriction(), PCMGSetInterpolation(), PCMGGetRScale(), PCMGGetInterpolation(), PCGetInterpolations()
External Links
- PETSc Manual:
PC/PCGetCoarseOperators
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- theDM
Level: intermediate
See also: PC, DM, PCSetDM(), KSPSetDM(), KSPGetDM()
External Links
- PETSc Manual:
PC/PCGetDM
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- thePCpreconditioner context
Output Parameter:
flag-PETSC_TRUEif it applies the scaling
Level: developer
See also: PC, PCCreate(), PCSetUp(), PCDiagonalScaleLeft(), PCDiagonalScaleRight(), PCSetDiagonalScale()
External Links
- PETSc Manual:
PC/PCGetDiagonalScale
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- thePCpreconditioner context
Output Parameter:
reason- the reason it failed
Level: advanced
See also: PC, PCCreate(), PCApply(), PCDestroy(), PCSetFailedReason(), PCFailedReason
External Links
- PETSc Manual:
PC/PCGetFailedReason
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 levelsinterpolations- the interpolation matrices (size ofnum_levels-1)
Level: advanced
See also: PC, PCMG, PCMGGetRestriction(), PCMGSetInterpolation(), PCMGGetInterpolation(), PCGetCoarseOperators()
External Links
- PETSc Manual:
PC/PCGetInterpolations
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- thePC
Output Parameter:
level- the nest level
Level: developer
See also: KSPSetUp(), KSPSolve(), KSPDestroy(), KSP, KSPGMRES, KSPType, KSPSetNestLevel(), PCSetKSPNestLevel(), KSPGetNestLevel()
External Links
- PETSc Manual:
PC/PCGetKSPNestLevel
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- thePCpreconditioner context
Output Parameters:
Amat- the matrix defining the linear systemPmat- the matrix from which the preconditioner is constructed, usually the same as Amat.
Level: intermediate
See also: PC, PCSetOperators(), KSPGetOperators(), KSPSetOperators(), PCGetOperatorsSet()
External Links
- PETSc Manual:
PC/PCGetOperators
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- thePCpreconditioner context
Output Parameters:
mat- the matrix associated with the linear system was setpmat- matrix associated with the preconditioner was set, usually the same
Level: intermediate
See also: PC, PCSetOperators(), KSPGetOperators(), KSPSetOperators(), PCGetOperators()
External Links
- PETSc Manual:
PC/PCGetOperatorsSet
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- thePCpreconditioner context
Output Parameter:
prefix- pointer to the prefix string used, is returned
Level: advanced
See also: PC, PCSetFromOptions(), PCSetOptionsPrefix(), PCAppendOptionsPrefix()
External Links
- PETSc Manual:
PC/PCGetOptionsPrefix
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- thePCpreconditioner context
Output Parameter:
flag-PETSC_TRUEdo not compute a new preconditioner,PETSC_FALSEdo compute a new preconditioner
Level: intermediate
See also: PC, PCGetOperators(), MatZeroEntries(), PCSetReusePreconditioner()
External Links
- PETSc Manual:
PC/PCGetReusePreconditioner
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
- PETSc Manual:
PC/PCGetType
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- thePCpreconditioner context
Output Parameter:
flg-PETSC_TRUEto use theAmat,PETSC_FALSEto use thePmat
Level: intermediate
See also: PC, PCSetUseAmat(), PCBJACOBI, PCMG, PCFIELDSPLIT, PCCOMPOSITE
External Links
- PETSc Manual:
PC/PCGetUseAmat
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- thePCHMGcontextcomponent- which componentPCwill 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
- PETSc Manual:
PC/PCHMGSetCoarseningComponent
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- thePCHMGcontexttype-PCHYPREorPCGAMGcoarsening 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
- PETSc Manual:
PC/PCHMGSetInnerPCType
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- thePCHMGcontextreuse-PETSC_TRUEindicates thatPCHMGwill 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
- PETSc Manual:
PC/PCHMGSetReuseInterpolation
PETSc.LibPETSc.PCHMGSetUseSubspaceCoarsening — Method
PCHMGSetUseSubspaceCoarsening(petsclib::PetscLibType, pc::AbstractPC, subspace::PetscBool)Use subspace coarsening in PCHMG
Logically Collective
Input Parameters:
pc- thePCHMGcontextsubspace-PETSC_TRUEindicates thatPCHMGwill 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
- PETSc Manual:
PC/PCHMGSetUseSubspaceCoarsening
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- thePCHMGcontextusematmaij-PETSC_TRUE(default) to useMATMAIJfor interpolations.
Options Database Key:
-pc_hmg_use_matmaij (true|false)- useMATMAIJfor interpolations
Level: beginner
See also: PCHMG, PCType, PCGAMG
External Links
- PETSc Manual:
PC/PCHMGUseMatMAIJ
PETSc.LibPETSc.PCHPDDMFinalizePackage — Method
PCHPDDMFinalizePackage(petsclib::PetscLibType)External Links
- PETSc Manual:
KSP/PCHPDDMFinalizePackage
PETSc.LibPETSc.PCHPDDMGetCoarseCorrectionType — Method
type::PCHPDDMCoarseCorrectionType = PCHPDDMGetCoarseCorrectionType(petsclib::PetscLibType, pc::AbstractPC)External Links
- PETSc Manual:
KSP/PCHPDDMGetCoarseCorrectionType
PETSc.LibPETSc.PCHPDDMGetComplexities — Method
gc::PetscReal,oc::PetscReal = PCHPDDMGetComplexities(petsclib::PetscLibType, pc::AbstractPC)External Links
- PETSc Manual:
KSP/PCHPDDMGetComplexities
PETSc.LibPETSc.PCHPDDMGetSTShareSubKSP — Method
share::PetscBool = PCHPDDMGetSTShareSubKSP(petsclib::PetscLibType, pc::AbstractPC)External Links
- PETSc Manual:
KSP/PCHPDDMGetSTShareSubKSP
PETSc.LibPETSc.PCHPDDMHasNeumannMat — Method
PCHPDDMHasNeumannMat(petsclib::PetscLibType, pc::AbstractPC, has::PetscBool)External Links
- PETSc Manual:
KSP/PCHPDDMHasNeumannMat
PETSc.LibPETSc.PCHPDDMInitializePackage — Method
PCHPDDMInitializePackage(petsclib::PetscLibType)External Links
- PETSc Manual:
KSP/PCHPDDMInitializePackage
PETSc.LibPETSc.PCHPDDMSetAuxiliaryMat — Method
PCHPDDMSetAuxiliaryMat(petsclib::PetscLibType, pc::AbstractPC, is::AbstractIS, A::AbstractPetscMat, setup::external, ctx::Ptr{Cvoid})External Links
- PETSc Manual:
KSP/PCHPDDMSetAuxiliaryMat
PETSc.LibPETSc.PCHPDDMSetCoarseCorrectionType — Method
PCHPDDMSetCoarseCorrectionType(petsclib::PetscLibType, pc::AbstractPC, type::PCHPDDMCoarseCorrectionType)External Links
- PETSc Manual:
KSP/PCHPDDMSetCoarseCorrectionType
PETSc.LibPETSc.PCHPDDMSetDeflationMat — Method
PCHPDDMSetDeflationMat(petsclib::PetscLibType, pc::AbstractPC, is::AbstractIS, U::AbstractPetscMat)External Links
- PETSc Manual:
KSP/PCHPDDMSetDeflationMat
PETSc.LibPETSc.PCHPDDMSetRHSMat — Method
PCHPDDMSetRHSMat(petsclib::PetscLibType, pc::AbstractPC, B::AbstractPetscMat)External Links
- PETSc Manual:
KSP/PCHPDDMSetRHSMat
PETSc.LibPETSc.PCHPDDMSetSTShareSubKSP — Method
PCHPDDMSetSTShareSubKSP(petsclib::PetscLibType, pc::AbstractPC, share::PetscBool)External Links
- PETSc Manual:
KSP/PCHPDDMSetSTShareSubKSP
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 contextinterior- vector. node is interior if its entry in the array is 1.0.
Level: intermediate
See also: PCHYPRE, PCHYPRESetDiscreteGradient(), PCHYPRESetDiscreteCurl(), PCHYPRESetAlphaPoissonMatrix()
External Links
- PETSc Manual:
PC/PCHYPREAMSSetInteriorNodes
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 ofnum_levels)CFMarkers- the Coarse/Fine Boolean arrays (size ofnum_levels- 1)
Level: advanced
See also: PC, PCMG, PCMGGetRestriction(), PCMGSetInterpolation(), PCMGGetRScale(), PCMGGetInterpolation(), PCGetInterpolations()
External Links
- PETSc Manual:
PC/PCHYPREGetCFMarkers
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
- PETSc Manual:
PC/PCHYPREGetType
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 contextA- the matrix
Level: intermediate
See also: PCHYPRE, PCHYPRESetDiscreteGradient(), PCHYPRESetDiscreteCurl(), PCHYPRESetBetaPoissonMatrix()
External Links
- PETSc Manual:
PC/PCHYPRESetAlphaPoissonMatrix
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 contextA- the matrix, orNULLto turn it off
Level: intermediate
See also: PCHYPRE, PCHYPRESetDiscreteGradient(), PCHYPRESetDiscreteCurl(), PCHYPRESetAlphaPoissonMatrix()
External Links
- PETSc Manual:
PC/PCHYPRESetBetaPoissonMatrix
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 contextC- the discrete curl
Level: intermediate
See also: PCHYPRE, PCHYPRESetDiscreteGradient()
External Links
- PETSc Manual:
PC/PCHYPRESetDiscreteCurl
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 contextG- the discrete gradient
Level: intermediate
See also: PCHYPRE, PCHYPRESetDiscreteCurl()
External Links
- PETSc Manual:
PC/PCHYPRESetDiscreteGradient
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 contextozz- 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
- PETSc Manual:
PC/PCHYPRESetEdgeConstantVectors
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 contextdim- the dimension of the problem, only used in AMSRT_PiFull- Raviart-Thomas interpolation matrixRT_Pi- x/y/z component of Raviart-Thomas interpolation matrixND_PiFull- Nedelec interpolation matrixND_Pi- x/y/z component of Nedelec interpolation matrix
Level: intermediate
See also: PCHYPRE
External Links
- PETSc Manual:
PC/PCHYPRESetInterpolations
PETSc.LibPETSc.PCHYPRESetType — Method
PCHYPRESetType(petsclib::PetscLibType, pc::AbstractPC, name::String)Sets which hypre preconditioner you wish to use
Input Parameters:
pc- the preconditioner contextname- 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
- PETSc Manual:
PC/PCHYPRESetType
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 contextb- 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 tobvec1_N- vector of local nodes (interior and interface, including ghosts); used as work spacevec2_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
- PETSc Manual:
PC/PCISApplyInvSchur
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 contextv- 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 chunkvec2_B- workspace orNULL,vis used as workspace in that casevec1_D- work spacevec2_D- work space
Level: advanced
See also: PCBDDC, PCNN, PCISSetUseStiffnessScaling(), PCISSetSubdomainDiagonalScaling(), PCISScatterArrayNToVecB(), PCISSetSubdomainScalingFactor(), PCISApplyInvSchur(), PCISReset(), PCISInitialize()
External Links
- PETSc Manual:
PC/PCISApplySchur
PETSc.LibPETSc.PCISInitialize — Method
PCISInitialize(petsclib::PetscLibType, pc::AbstractPC)initializes the PC_IS portion of PCNN and PCBDDC preconditioner context
Input Parameter:
pc- thePCobject, must be of typePCNNorPCBDDC
Level: advanced
See also: PCBDDC, PCNN, PCISSetUseStiffnessScaling(), PCISSetSubdomainDiagonalScaling(), PCISScatterArrayNToVecB(), PCISSetSubdomainScalingFactor(), PCISReset(), PCISApplySchur(), PCISApplyInvSchur()
External Links
- PETSc Manual:
PC/PCISInitialize
PETSc.LibPETSc.PCISReset — Method
PCISReset(petsclib::PetscLibType, pc::AbstractPC)Removes all the PC_IS parts of the PC implementation data structure
Input Parameter:
pc- thePCobject, must be of typePCNNorPCBDDC
Level: advanced
See also: PCISSetUseStiffnessScaling(), PCISSetSubdomainDiagonalScaling(), PCISScatterArrayNToVecB(), PCISSetSubdomainScalingFactor(), PCISInitialize(), PCISApplySchur(), PCISApplyInvSchur()
External Links
- PETSc Manual:
PC/PCISReset
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 contextarray_N- [when inSCATTER_FORWARDmode] Array to be scattered into the vector otherwise output arrayimode- insert mode,ADD_VALUESorINSERT_VALUESsmode- scatter mode,SCATTER_FORWARDorSCATTER_REVERSEmode]v_B- [when inSCATTER_REVERSEmode] 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
- PETSc Manual:
PC/PCISScatterArrayNToVecB
PETSc.LibPETSc.PCISSetSubdomainDiagonalScaling — Method
PCISSetSubdomainDiagonalScaling(petsclib::PetscLibType, pc::AbstractPC, scaling_factors::AbstractPetscVec)Set diagonal scaling for PCIS.
Logically Collective
Input Parameters:
pc- the preconditioning contextscaling_factors- scaling factors for the subdomain
Level: intermediate
See also: PCBDDC, PCNN, PCISScatterArrayNToVecB(), PCISSetSubdomainScalingFactor(), PCISSetUseStiffnessScaling(), PCISReset(), PCISInitialize(), PCISApplyInvSchur(), PCISApplySchur()
External Links
- PETSc Manual:
PC/PCISSetSubdomainDiagonalScaling
PETSc.LibPETSc.PCISSetSubdomainScalingFactor — Method
PCISSetSubdomainScalingFactor(petsclib::PetscLibType, pc::AbstractPC, scal::PetscScalar)Set scaling factor for PCIS.
Not Collective
Input Parameters:
pc- the preconditioning contextscal- scaling factor for the subdomain
Level: intermediate
See also: PCBDDC, PCNN, PCISScatterArrayNToVecB(), PCISSetSubdomainDiagonalScaling(), PCISSetUseStiffnessScaling(), PCISReset(), PCISInitialize(), PCISApplyInvSchur(), PCISApplySchur()
External Links
- PETSc Manual:
PC/PCISSetSubdomainScalingFactor
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- thePCobject, must be of typePCNNorPCBDDCcomputematrices- Extract the blocksA_II,A_BI,A_IBandA_BBfrom the matrixcomputesolvers- Create theKSPfor the local Dirichlet and Neumann problems
Level: advanced
See also: PCBDDC, PCNN, PCISSetUseStiffnessScaling(), PCISSetSubdomainDiagonalScaling(), PCISScatterArrayNToVecB(), PCISSetSubdomainScalingFactor(), PCISReset(), PCISApplySchur(), PCISApplyInvSchur()
External Links
- PETSc Manual:
PC/PCISSetUp
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 contextuse- 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
- PETSc Manual:
PC/PCISSetUseStiffnessScaling
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
- PETSc Manual:
KSP/PCInitializePackage
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 ofVecof the inverted diagonaldiagonal_sqrt- Copy ofVecof the inverted square root diagonal
Level: developer
See also: PCJACOBI, PCJacobiSetType()
External Links
- PETSc Manual:
PC/PCJacobiGetDiagonal
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
- PETSc Manual:
PC/PCJacobiGetFixDiagonal
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
- PETSc Manual:
PC/PCJacobiGetRowl1Scale
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
- PETSc Manual:
PC/PCJacobiGetType
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
- PETSc Manual:
PC/PCJacobiGetUseAbs
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 contextflg- 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
- PETSc Manual:
PC/PCJacobiSetFixDiagonal
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 contextscale- scaling
Options Database Key:
-pc_jacobi_rowl1_scale scale- scaling of off diagonal values
Level: intermediate
See also: PCJACOBI, PCJacobiSetType(), PCJacobiGetRowl1Scale()
External Links
- PETSc Manual:
PC/PCJacobiSetRowl1Scale
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 contexttype-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
- PETSc Manual:
PC/PCJacobiSetType
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 contextflg- 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
- PETSc Manual:
PC/PCJacobiSetUseAbs
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- theKSPsolver
See also: PCKSP, PCKSPSetKSP()
External Links
- PETSc Manual:
PC/PCKSPGetKSP
PETSc.LibPETSc.PCKSPSetKSP — Method
PCKSPSetKSP(petsclib::PetscLibType, pc::AbstractPC, ksp::AbstractKSP)Sets the KSP context for a PCKSP.
Collective
Input Parameters:
pc- the preconditioner contextksp- theKSPsolver
Level: advanced
See also: PCKSP, PCKSPGetKSP()
External Links
- PETSc Manual:
PC/PCKSPSetKSP
PETSc.LibPETSc.PCLMVMClearIS — Method
PCLMVMClearIS(petsclib::PetscLibType, pc::AbstractPC)Removes the inactive variable index set from a PCLMVM
Input Parameter:
pc- AnPCLMVMpreconditioner
Level: intermediate
See also: PCLMVMSetIS()
External Links
- PETSc Manual:
PC/PCLMVMClearIS
PETSc.LibPETSc.PCLMVMGetMatLMVM — Method
B::PetscMat = PCLMVMGetMatLMVM(petsclib::PetscLibType, pc::AbstractPC)Returns a pointer to the underlying MATLMVM matrix.
Input Parameter:
pc- AnPCLMVMpreconditioner
Output Parameter:
B-MATLMVMmatrix used by the preconditioner
Level: intermediate
See also: PCLMVMSetMatLMVM()
External Links
- PETSc Manual:
PC/PCLMVMGetMatLMVM
PETSc.LibPETSc.PCLMVMSetIS — Method
PCLMVMSetIS(petsclib::PetscLibType, pc::AbstractPC, inactive::AbstractIS)Sets the index sets that reduce the PC application.
Input Parameters:
pc- AnPCLMVMpreconditionerinactive- Index set defining the variables removed from the problem
Level: intermediate
See also: PCLMVMClearIS()
External Links
- PETSc Manual:
PC/PCLMVMSetIS
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- AnPCLMVMpreconditionerB- AnMATLMVMtype matrix
Level: intermediate
See also: PCLMVMGetMatLMVM()
External Links
- PETSc Manual:
PC/PCLMVMSetMatLMVM
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 preconditionerX- Solution vector
Level: intermediate
See also: MatLMVMUpdate(), PCLMVMSetMatLMVM()
External Links
- PETSc Manual:
PC/PCLMVMSetUpdateVec
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 loadedPC, this needs to have been created withPCCreate()or
some related function before a call to PCLoad().
viewer- binary file viewerPETSCVIEWERBINARY, obtained fromPetscViewerBinaryOpen()
Level: intermediate
See also: PC, PetscViewerBinaryOpen(), PCView(), MatLoad(), VecLoad(), PETSCVIEWERBINARY
External Links
- PETSc Manual:
PC/PCLoad
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 ofcusparse,hypre
Level: intermediate
See also: PCHYPRE, PCMGGalerkinSetMatProductAlgorithm()
External Links
- PETSc Manual:
PC/PCMGGalerkinGetMatProductAlgorithm
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 contextname- one ofcusparse,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
- PETSc Manual:
PC/PCMGGalerkinSetMatProductAlgorithm
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
- PETSc Manual:
PC/PCMGGetAdaptCR
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
- PETSc Manual:
PC/PCMGGetAdaptCoarseSpaceType
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
- PETSc Manual:
PC/PCMGGetAdaptInterpolation
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
- PETSc Manual:
PC/PCMGGetCoarseSolve
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
- PETSc Manual:
PC/PCMGGetCoarseSpaceConstructor
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 ofPC_MG_GALERKIN_BOTH,PC_MG_GALERKIN_PMAT,PC_MG_GALERKIN_MAT,PC_MG_GALERKIN_NONE, orPC_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
- PETSc Manual:
PC/PCMGGetGalerkin
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 gridoc- 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
- PETSc Manual:
PC/PCMGGetGridComplexity
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 contextl- the level (0 is coarsest) to supply [Do not supply 0]
Output Parameter:
mat- the restriction matrix (may beNULLif no injection is available).
Level: advanced
See also: PCMG, PCMGSetInjection(), PCMGetGetRestriction()
External Links
- PETSc Manual:
PC/PCMGGetInjection
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 contextl- the level (0 is coarsest) to supply [Do not supply 0]
Output Parameter:
mat- the interpolation matrix, can beNULL
Level: advanced
See also: PCMG, PCMGGetRestriction(), PCMGSetInterpolation(), PCMGGetRScale()
External Links
- PETSc Manual:
PC/PCMGGetInterpolation
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
- PETSc Manual:
PC/PCMGGetLevels
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 contextrscale- the scalingl- the level (0 is coarsest) to supply [Do not supply 0]
Level: advanced
See also: PCMG, PCMGSetInterpolation(), PCMGGetRestriction(), PCMGGetInjection()
External Links
- PETSc Manual:
PC/PCMGGetRScale
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 contextl- 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
- PETSc Manual:
PC/PCMGGetRestriction
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 contextl- the level (0 is coarsest) to supply
Output Parameter:
ksp- the smoother
See also: PCMG, PCMGGetSmootherUp(), PCMGGetSmootherDown(), PCMGGetCoarseSolve()
External Links
- PETSc Manual:
PC/PCMGGetSmoother
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 contextl- the level (0 is coarsest) to supply
Output Parameter:
ksp- the smoother
Level: advanced
See also: PCMG, PCMGGetSmootherUp(), PCMGGetSmoother()
External Links
- PETSc Manual:
PC/PCMGGetSmootherDown
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 contextl- the level (0 is coarsest) to supply
Output Parameter:
ksp- the smoother
Level: advanced
See also: PCMG, PCMGGetSmootherDown()
External Links
- PETSc Manual:
PC/PCMGGetSmootherUp
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 ofPC_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
- PETSc Manual:
PC/PCMGGetType
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 matrixb- the right-hand sidex- the approximate solution
Output Parameter:
r- location to store the residual
Level: developer
See also: PCMG, PCMGSetMatResidual(), PCMGResidualDefault()
External Links
- PETSc Manual:
PC/PCMGMatResidualDefault
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 matrixb- the right-hand sidex- the approximate solution
Output Parameter:
r- location to store the residual
Level: developer
See also: PCMG, PCMGSetMatResidualTranspose()
External Links
- PETSc Manual:
PC/PCMGMatResidualTransposeDefault
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 contextn- 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
- PETSc Manual:
PC/PCMGMultiplicativeSetCycles
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 constructorfunction- constructor routine, seePCMGCoarseSpaceConstructorFn
Level: advanced
See also: PCMGCoarseSpaceConstructorFn, PCMG, PCMGGetCoarseSpaceConstructor(), PCRegister(), PCMGSetAdaptCoarseSpaceType(), PCMG_ADAPT_EIGENVECTOR, PCMG_ADAPT_GENERALIZED_EIGENVECTOR
External Links
- PETSc Manual:
PC/PCMGRegisterCoarseSpaceConstructor
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 matrixb- the right-hand sidex- the approximate solution
Output Parameter:
r- location to store the residual
Level: developer
See also: PCMG, PCMGSetResidual(), PCMGSetMatResidual()
External Links
- PETSc Manual:
PC/PCMGResidualDefault
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 matrixb- the right-hand sidex- the approximate solution
Output Parameter:
r- location to store the residual
Level: developer
See also: PCMG, PCMGSetResidualTranspose(), PCMGMatResidualTransposeDefault()
External Links
- PETSc Manual:
PC/PCMGResidualTransposeDefault
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 contextcr- 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
- PETSc Manual:
PC/PCMGSetAdaptCR
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 contextctype- 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
- PETSc Manual:
PC/PCMGSetAdaptCoarseSpaceType
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 contextadapt- flag for adaptation of the interpolator
Level: intermediate
See also: PCMG, PCMGGetAdaptInterpolation(), PCMGSetGalerkin(), PCMGGetAdaptCoarseSpaceType(), PCMGSetAdaptCoarseSpaceType()
External Links
- PETSc Manual:
PC/PCMGSetAdaptInterpolation
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 contextn- eitherPC_MG_CYCLE_VorPC_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
- PETSc Manual:
PC/PCMGSetCycleType
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 contextl- the level (0 is coarsest)c- eitherPC_MG_CYCLE_VorPC_MG_CYCLE_W
Level: advanced
See also: PCMG, PCMGCycleType, PCMGSetCycleType()
External Links
- PETSc Manual:
PC/PCMGSetCycleTypeOnLevel
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
- PETSc Manual:
PC/PCMGSetDistinctSmoothUp
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 contextuse- one ofPC_MG_GALERKIN_BOTH,PC_MG_GALERKIN_PMAT,PC_MG_GALERKIN_MAT, orPC_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
- PETSc Manual:
PC/PCMGSetGalerkin
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 contextl- the level (0 is coarsest) to supply [Do not supply 0]mat- the injection matrix
Level: advanced
See also: PCMG, PCMGSetRestriction()
External Links
- PETSc Manual:
PC/PCMGSetInjection
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 contextmat- the interpolation operatorl- the level (0 is coarsest) to supply [do not supply 0]
Level: advanced
See also: PCMG, PCMGSetRestriction()
External Links
- PETSc Manual:
PC/PCMGSetInterpolation
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 contextlevels- the number of levelscomms- 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
- PETSc Manual:
PC/PCMGSetLevels
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 contextn- 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
- PETSc Manual:
PC/PCMGSetNumberSmooth
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 contextAmat- the operatorPmat- the preconditioning operatorl- the level (0 is the coarsest) to supply
Level: advanced
See also: PCMG, PCMGSetGalerkin(), PCMGSetRestriction(), PCMGSetInterpolation()
External Links
- PETSc Manual:
PC/PCMGSetOperators
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 contextl- the level (0 is coarsest) this is to be used forc- the Vec
Level: advanced
See also: PCMG, PCMGSetRhs(), PCMGSetX()
External Links
- PETSc Manual:
PC/PCMGSetR
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 contextl- 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
- PETSc Manual:
PC/PCMGSetRScale
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 contextl- the level (0 is coarsest) to supplyresidual- 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
- PETSc Manual:
PC/PCMGSetResidual
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 contextl- the level (0 is coarsest) to supplyresidualt- 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
- PETSc Manual:
PC/PCMGSetResidualTranspose
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 contextl- the level (0 is coarsest) to supply [Do not supply 0]mat- the restriction matrix
Level: advanced
See also: PCMG, PCMGSetInterpolation()
External Links
- PETSc Manual:
PC/PCMGSetRestriction
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 contextl- the level (0 is coarsest) this is to be used forc- the Vec
Level: advanced
See also: PCMG, PCMGSetX(), PCMGSetR()
External Links
- PETSc Manual:
PC/PCMGSetRhs
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 contextform- multigrid form, one ofPC_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
- PETSc Manual:
PC/PCMGSetType
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 contextl- 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
- PETSc Manual:
PC/PCMGSetX
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 innerKSP
Level: advanced
See also: KSP, PCMPI, PCREDISTRIBUTE
External Links
- PETSc Manual:
PC/PCMPIGetKSP
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 thePCMPIServerAddressesstructure to free
Level: developer
See also: PCMPI, PetscShmgetMapAddresses(), PetscShmgetUnmapAddresses(), PetscObjectContainerCompose()
External Links
- PETSc Manual:
Sys/PCMPIServerAddressesDestroy
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
- PETSc Manual:
PC/PCMPIServerBegin
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
- PETSc Manual:
PC/PCMPIServerEnd
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- thePCpreconditioner contextX- block of input vectors
Output Parameter:
Y- block of output vectors
Level: developer
See also: PC, PCApply(), KSPMatSolve()
External Links
- PETSc Manual:
PC/PCMatApply
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- thePCpreconditioner contextX- block of input vectors
Output Parameter:
Y- block of output vectors
Level: developer
See also: PC, PCApplyTranspose(), KSPMatSolveTranspose()
External Links
- PETSc Manual:
PC/PCMatApplyTranspose
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 ofPCMAT
Output Parameter:
matop- TheMatOperation
Level: intermediate
See also: PCMAT, PCMatSetApplyOperation(), PCApply(), MatOperation
External Links
- PETSc Manual:
PC/PCMatGetApplyOperation
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 ofPCMATmatop- The selectedMatOperation
Level: intermediate
See also: PCMAT, PCMatGetApplyOperation(), PCApply(), MatOperation
External Links
- PETSc Manual:
PC/PCMatSetApplyOperation
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- thePCpreconditioner contextnsub- the number of local submatricesrow- 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 submatricesctx- 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
- PETSc Manual:
PC/PCModifySubMatrices
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 contextlfil0- the level of fill-in kept in LB, UB, E/UB and LB\Flfil1- the level of fill-in kept in Slfil2- 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
- PETSc Manual:
PC/PCPARMSSetFill
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 contexttype- 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
- PETSc Manual:
PC/PCPARMSSetGlobal
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 contexttype- 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
- PETSc Manual:
PC/PCPARMSSetLocal
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 contextnonsym-PETSC_TRUEindicates 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
- PETSc Manual:
PC/PCPARMSSetNonsymPerm
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 contextrestart- 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
- PETSc Manual:
PC/PCPARMSSetSolveRestart
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 contexttol- the convergence tolerancemaxits- 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
- PETSc Manual:
PC/PCPARMSSetSolveTolerances
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- thePCPATCHpreconditioner
Output Parameter:
cellNumbering- thePetscSectiongiving the cell numbering
Level: advanced
See also: PCPATCH, PCPatchSetCellNumbering(), PetscSection
External Links
- PETSc Manual:
PC/PCPatchGetCellNumbering
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- thePCPATCHpreconditioner
Output Parameters:
ctype- thePCPatchConstructTypefunc- the callback that builds the patches whenctypeisPC_PATCH_USERorPC_PATCH_PYTHON; otherwise unchangedctx- the application context associated withfunc; otherwise unchanged
Calling sequence of func:
pc- thePCPATCHpreconditionernpatch- number of patchespatches- theISthat define each patchpatchIterationSet- how the patches are iterated overctx- optional application context
Level: advanced
See also: PCPATCH, PCPatchSetConstructType(), PCPatchConstructType
External Links
- PETSc Manual:
PC/PCPatchGetConstructType
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- thePCPATCHpreconditioner
Output Parameter:
flg-PETSC_TRUEif local patch updates are weighted by a partition of unity,PETSC_FALSEif they are summed directly
Level: intermediate
See also: PCPATCH, PCPatchSetPartitionOfUnity()
External Links
- PETSc Manual:
PC/PCPatchGetPartitionOfUnity
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- thePCPATCHpreconditioner
Output Parameter:
flg-PETSC_TRUEif the element tensors are precomputed,PETSC_FALSEif they are recomputed for each patch
Level: intermediate
See also: PCPATCH, PCPatchSetPrecomputeElementTensors(), PCPatchSetSaveOperators()
External Links
- PETSc Manual:
PC/PCPatchGetPrecomputeElementTensors
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- thePCPATCHpreconditioner
Output Parameter:
flg-PETSC_TRUEif the assembled sub-matrices are stored,PETSC_FALSEif they are rebuilt on demand
Level: intermediate
See also: PCPATCH, PCPatchSetSaveOperators(), PCPatchSetPrecomputeElementTensors()
External Links
- PETSc Manual:
PC/PCPatchGetSaveOperators
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- thePCPATCHpreconditioner
Output Parameters:
npatch- number of local patches (may beNULL)ksp- newly allocated array of lengthnpatchholding the per-patchKSPobjects; the caller must free the array withPetscFree()
Level: advanced
See also: PCPATCH, KSP, PCASMGetSubKSP()
External Links
- PETSc Manual:
PC/PCPatchGetSubKSP
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- thePCPATCHpreconditioner
Output Parameter:
sub_mat_type- theMatTypeused for the per-patch sub-matrices
Level: advanced
See also: PCPATCH, PCPatchSetSubMatType(), MatType
External Links
- PETSc Manual:
PC/PCPatchGetSubMatType
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- thePCPATCHpreconditionercellNumbering- thePetscSectiongiving the cell numbering; its reference count is incremented
Level: advanced
See also: PCPATCH, PCPatchGetCellNumbering(), PetscSection
External Links
- PETSc Manual:
PC/PCPatchSetCellNumbering
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- ThePCfunc- The callback functionctx- The application context
Calling sequence of func:
pc- ThePCpoint- The pointx- The input solution (not used in linear problems)f- The patch residual vectorcellIS- An array of the cell numbersn- The size ofdofsArraydofsArray- The dofmap for the dofs to be solved fordofsArrayWithAll- The dofmap for all dofs on the patchctx- The application context
Level: advanced
See also: PCPatchSetComputeOperator(), PCPatchGetComputeOperator(), PCPatchSetDiscretisationInfo(), PCPatchSetComputeFunctionInteriorFacets()
External Links
- PETSc Manual:
PC/PCPatchSetComputeFunction
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- ThePCfunc- The callback functionctx- The application context
Calling sequence of func:
pc- ThePCpoint- The pointx- The input solution (not used in linear problems)f- The patch residual vectorfacetIS- An array of the facet numbersn- The size ofdofsArraydofsArray- The dofmap for the dofs to be solved fordofsArrayWithAll- The dofmap for all dofs on the patchctx- The application context
Level: advanced
See also: PCPatchSetComputeFunction(), PCPatchSetComputeFunctionInteriorFacets(), PCPatchSetComputeOperatorExteriorFacets(), PCPatchSetDiscretisationInfo()
External Links
- PETSc Manual:
PC/PCPatchSetComputeFunctionExteriorFacets
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- ThePCfunc- The callback functionctx- The application context
Calling sequence of func:
pc- ThePCpoint- The pointx- The input solution (not used in linear problems)f- The patch residual vectorfacetIS- An array of the facet numbersn- The size ofdofsArraydofsArray- The dofmap for the dofs to be solved fordofsArrayWithAll- The dofmap for all dofs on the patchctx- The application context
Level: advanced
See also: PCPatchSetComputeOperator(), PCPatchGetComputeOperator(), PCPatchSetDiscretisationInfo(), PCPatchSetComputeFunction()
External Links
- PETSc Manual:
PC/PCPatchSetComputeFunctionInteriorFacets
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- ThePCfunc- The callback functionctx- The application context
Calling sequence of func:
pc- ThePCpoint- The pointx- The input solution (not used in linear problems)mat- The patch matrixfacetIS- An array of the cell numbersn- The size ofdofsArraydofsArray- The dofmap for the dofs to be solved fordofsArrayWithAll- The dofmap for all dofs on the patchctx- The application context
Level: advanced
See also: PCPatchGetComputeOperator(), PCPatchSetComputeFunction(), PCPatchSetDiscretisationInfo()
External Links
- PETSc Manual:
PC/PCPatchSetComputeOperator
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- ThePCfunc- The callback functionctx- The application context
Calling sequence of func:
pc- ThePCpoint- The pointx- The input solution (not used in linear problems)mat- The patch matrixfacetIS- An array of the facet numbersn- The size ofdofsArraydofsArray- The dofmap for the dofs to be solved fordofsArrayWithAll- The dofmap for all dofs on the patchctx- The application context
Level: advanced
See also: PCPatchSetComputeOperator(), PCPatchSetComputeOperatorInteriorFacets(), PCPatchSetComputeFunctionExteriorFacets(), PCPatchSetDiscretisationInfo()
External Links
- PETSc Manual:
PC/PCPatchSetComputeOperatorExteriorFacets
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- ThePCfunc- The callback functionctx- The application context
Calling sequence of func:
pc- ThePCpoint- The pointx- The input solution (not used in linear problems)mat- The patch matrixfacetIS- An array of the facet numbersn- The size ofdofsArraydofsArray- The dofmap for the dofs to be solved fordofsArrayWithAll- The dofmap for all dofs on the patchctx- The application context
Level: advanced
See also: PCPatchGetComputeOperator(), PCPatchSetComputeFunction(), PCPatchSetDiscretisationInfo()
External Links
- PETSc Manual:
PC/PCPatchSetComputeOperatorInteriorFacets
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- thePCPATCHpreconditionerctype- thePCPatchConstructTypeselecting 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 whenctypeisPC_PATCH_USERorPC_PATCH_PYTHON; may beNULLotherwisectx- optional application context passed tofunc
Calling sequence of func:
pc- thePCPATCHpreconditionernpatch- number of patchespatches- theISthat define each patchpatchIterationSet- how the patches are iterated overctx- optional application context
Level: advanced
See also: PCPATCH, PCPatchGetConstructType(), PCPatchConstructType
External Links
- PETSc Manual:
PC/PCPatchSetConstructType
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- thePCPATCHpreconditionernsubspaces- the number of discretisation subspaces (e.g. fields)dms- array of lengthnsubspacesofDMs, one per subspace, from which the local sections and sectionPetscSFs are obtainedbs- array of lengthnsubspacesgiving the block size of each subspacenodesPerCell- array of lengthnsubspacesgiving the number of nodes per cell for each subspacecellNodeMap- array of lengthnsubspaces; entryiis a cell-to-node map (array) of length(cEnd - cStart) * nodesPerCell[i]subspaceOffsets- array of lengthnsubspaces + 1giving the starting global dof offset of each subspacenumGhostBcs- number of ghost (off-process) boundary-condition dofsghostBcNodes- array of lengthnumGhostBcsof the ghost boundary-condition dof indicesnumGlobalBcs- number of global boundary-condition dofsglobalBcNodes- array of lengthnumGlobalBcsof the global boundary-condition dof indices
Level: advanced
See also: PCPATCH, PCPatchSetComputeOperator(), PCPatchSetComputeFunction()
External Links
- PETSc Manual:
PC/PCPatchSetDiscretisationInfo
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- thePCPATCHpreconditionerflg-PETSC_TRUEto weight local patch updates by a partition of unity,PETSC_FALSEto sum them directly
Level: intermediate
See also: PCPATCH, PCPatchGetPartitionOfUnity()
External Links
- PETSc Manual:
PC/PCPatchSetPartitionOfUnity
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- thePCPATCHpreconditionerflg-PETSC_TRUEto precompute the element tensors,PETSC_FALSEto recompute them for each patch
Level: intermediate
See also: PCPATCH, PCPatchGetPrecomputeElementTensors(), PCPatchSetSaveOperators()
External Links
- PETSc Manual:
PC/PCPatchSetPrecomputeElementTensors
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- thePCPATCHpreconditionerflg-PETSC_TRUEto store the assembled sub-matrices for each patch,PETSC_FALSEto rebuild them on demand
Level: intermediate
See also: PCPATCH, PCPatchGetSaveOperators(), PCPatchSetPrecomputeElementTensors()
External Links
- PETSc Manual:
PC/PCPatchSetSaveOperators
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- thePCPATCHpreconditionersub_mat_type- theMatTypeto use for the per-patch sub-matrices (e.g.MATDENSE,MATSEQAIJ)
Level: advanced
See also: PCPATCH, PCPatchGetSubMatType(), MatType
External Links
- PETSc Manual:
PC/PCPatchSetSubMatType
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- thePCpreconditioner contextksp- theKSPKrylov subspace context
See also: PC, KSPSetPostSolve(), KSPSetPreSolve(), PCPreSolve(), KSPSolve()
External Links
- PETSc Manual:
PC/PCPostSolve
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- thePCpreconditioner contextksp- the Krylov subspace context
Level: developer
See also: PC, PCPostSolve(), KSP, PCSetPostSetUp(), KSPSetPreSolve(), KSPSetPostSolve()
External Links
- PETSc Manual:
PC/PCPreSolve
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
- PETSc Manual:
PC/PCPythonGetType
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
- PETSc Manual:
PC/PCPythonSetType
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 innerKSP
Level: advanced
See also: KSP, PCREDISTRIBUTE
External Links
- PETSc Manual:
PC/PCRedistributeGetKSP
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- thePCpreconditioner context
Level: advanced
See also: PC, PCCreate(), PCApply(), PCDestroy(), PCGetFailedReason(), PCSetFailedReason(), PCFailedReason
External Links
- PETSc Manual:
PC/PCReduceFailedReason
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- theKSPon the smaller set of processes
Level: advanced
See also: PCREDUNDANT
External Links
- PETSc Manual:
PC/PCRedundantGetKSP
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 matrixpmat- the (possibly different) matrix used to construct the preconditioner
Level: advanced
See also: PCREDUNDANT
External Links
- PETSc Manual:
PC/PCRedundantGetOperators
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 contextnredundant- 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
- PETSc Manual:
PC/PCRedundantSetNumber
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 contextin- the scatter to move the values inout- the scatter to move them out
Level: advanced
See also: PCREDUNDANT
External Links
- PETSc Manual:
PC/PCRedundantSetScatter
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 solverfunction- routine to create the method context which will be stored in aPCwhenPCSetType()is called
See also: PC, PCType, PCRegisterAll(), PCSetType(), PCShellSetContext(), PCShellSetApply(), PCSHELL
External Links
- PETSc Manual:
PC/PCRegister
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- thePCpreconditioner context
Level: developer
See also: PC, PCCreate(), PCSetUp()
External Links
- PETSc Manual:
PC/PCReset
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 processorits- 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
- PETSc Manual:
PC/PCSORGetIterations
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
- PETSc Manual:
PC/PCSORGetOmega
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
- PETSc Manual:
PC/PCSORGetSymmetric
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 contextlits- number of local iterations, smoothings over just variables on processorits- 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
- PETSc Manual:
PC/PCSORSetIterations
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 contextomega- 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
- PETSc Manual:
PC/PCSORSetOmega
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 contextflag- 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
- PETSc Manual:
PC/PCSORSetSymmetric
PETSc.LibPETSc.PCSPAISetBlockSize — Method
PCSPAISetBlockSize(petsclib::PetscLibType, pc::AbstractPC, block_size1::PetscInt)set the block size for the PCSPAI preconditioner
Input Parameters:
pc- the preconditionerblock_size1- block size (default 1)
Level: intermediate
See also: PCSPAI, PCSetType()
External Links
- PETSc Manual:
PC/PCSPAISetBlockSize
PETSc.LibPETSc.PCSPAISetCacheSize — Method
PCSPAISetCacheSize(petsclib::PetscLibType, pc::AbstractPC, cache_size::PetscInt)specify cache size in the PCSPAI preconditioner
Input Parameters:
pc- the preconditionercache_size- cache size {0,1,2,3,4,5} (default 5)
Level: intermediate
See also: PCSPAI, PCSetType()
External Links
- PETSc Manual:
PC/PCSPAISetCacheSize
PETSc.LibPETSc.PCSPAISetEpsilon — Method
PCSPAISetEpsilon(petsclib::PetscLibType, pc::AbstractPC, epsilon1::PetscReal)- Set the tolerance for the
PCSPAIpreconditioner
Input Parameters:
pc- the preconditionerepsilon1- the tolerance (default .4)
Level: intermediate
See also: PCSPAI, PCSetType()
External Links
- PETSc Manual:
PC/PCSPAISetEpsilon
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 preconditionermax1- size (default is 5000)
Level: intermediate
See also: PCSPAI, PCSetType()
External Links
- PETSc Manual:
PC/PCSPAISetMax
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 preconditionermaxnew1- maximum number (default 5)
Level: intermediate
See also: PCSPAI, PCSetType(), PCSPAISetNBSteps()
External Links
- PETSc Manual:
PC/PCSPAISetMaxNew
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 preconditionernbsteps1- number of steps (default 5)
See also: PCSPAI, PCSetType(), PCSPAISetMaxNew()
External Links
- PETSc Manual:
PC/PCSPAISetNBSteps
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 preconditionersp- 0 or 1
Level: intermediate
See also: PCSPAI, PCSetType()
External Links
- PETSc Manual:
PC/PCSPAISetSp
PETSc.LibPETSc.PCSPAISetVerbose — Method
PCSPAISetVerbose(petsclib::PetscLibType, pc::AbstractPC, verbose::PetscInt)verbosity level for the PCSPAI preconditioner
Input Parameters:
pc- the preconditionerverbose- level (default 1)
Level: intermediate
See also: PCSPAI, PCSetType()
External Links
- PETSc Manual:
PC/PCSPAISetVerbose
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- thePCcontextctx- optional application context
Level: advanced
See also: PC, PCGetApplicationContext(), KSPSetApplicationContext(), KSPGetApplicationContext(), PetscObjectCompose()
External Links
- PETSc Manual:
PC/PCSetApplicationContext
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- thePCpreconditioner contextdim- the dimension of the coordinates 1, 2, or 3nloc- the blocked size of the coordinates arraycoords- the coordinates array
Level: intermediate
See also: PC, MatSetNearNullSpace()
External Links
- PETSc Manual:
PC/PCSetCoordinates
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 contextdm- theDM, can beNULLto remove any currentDM
Level: intermediate
See also: PC, DM, PCGetDM(), KSPSetDM(), KSPGetDM(), SNESSetDM(), TSSetDM()
External Links
- PETSc Manual:
PC/PCSetDM
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- thePCpreconditioner contexts- scaling vector
Level: intermediate
See also: PCCreate(), PCSetUp(), PCDiagonalScaleLeft(), PCDiagonalScaleRight(), PCGetDiagonalScale()
External Links
- PETSc Manual:
PC/PCSetDiagonalScale
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 fromPCCreate()flg-PETSC_TRUEindicates you want the error generated
Level: advanced
See also: PC, KSPSetErrorIfNotConverged(), PCGetInitialGuessNonzero(), PCSetInitialGuessKnoll(), PCGetInitialGuessKnoll()
External Links
- PETSc Manual:
PC/PCSetErrorIfFailure
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- thePCpreconditioner contextreason- the reason it failed
Level: advanced
See also: PC, PCCreate(), PCApply(), PCDestroy(), PCFailedReason
External Links
- PETSc Manual:
PC/PCSetFailedReason
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 examplebjacobi
Level: advanced
See also: PC, PCSetType(), PCType, KSPSetFromOptions()
External Links
- PETSc Manual:
PC/PCSetFromOptions
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- thePClevel- the nest level
Level: developer
See also: KSPSetUp(), KSPSolve(), KSPDestroy(), KSP, KSPGMRES, KSPType, KSPGetNestLevel(), PCGetKSPNestLevel(), KSPSetNestLevel()
External Links
- PETSc Manual:
PC/PCSetKSPNestLevel
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- thePCpreconditioner contextfunc- routine for modifying the submatrices, seePCModifySubMatricesFnctx- optional user-defined context (may beNULL)
Level: advanced
See also: PC, PCModifySubMatricesFn, PCBJACOBI, PCASM, PCModifySubMatrices()
External Links
- PETSc Manual:
PC/PCSetModifySubMatrices
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- thePCpreconditioner contextAmat- the matrix that defines the linear systemPmat- the matrix to be used in constructing the preconditioner, usually the same as Amat.
Level: advanced
See also: PC, PCGetOperators(), MatZeroEntries()
External Links
- PETSc Manual:
PC/PCSetOperators
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- thePCpreconditioner contextprefix- the prefix string to prepend to allPCoption requests
Level: advanced
See also: PC, PCSetFromOptions(), PCAppendOptionsPrefix(), PCGetOptionsPrefix()
External Links
- PETSc Manual:
PC/PCSetOptionsPrefix
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 objectpostsetup- the function to call afterPCSetUp()
Calling sequence of postsetup:
pc- thePCcontext
Level: developer
See also: PC, PCSetUp()
External Links
- PETSc Manual:
PC/PCSetPostSetUp
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- thePCpreconditioner contextflag-PETSC_TRUEdo not compute a new preconditioner,PETSC_FALSEdo compute a new preconditioner
Level: intermediate
See also: PC, PCGetOperators(), MatZeroEntries(), PCGetReusePreconditioner(), KSPSetReusePreconditioner()
External Links
- PETSc Manual:
PC/PCSetReusePreconditioner
PETSc.LibPETSc.PCSetType — Method
PCSetType(petsclib::PetscLibType, pc::AbstractPC, type::String)Builds PC for a particular preconditioner type
Collective
Input Parameters:
pc- the preconditioner contexttype- a known method, seePCTypefor possible values
Options Database Key:
-pc_type type- SetsPCtype
See also: KSPSetType(), PCType, PCRegister(), PCCreate(), KSPGetPC()
External Links
- PETSc Manual:
PC/PCSetType
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- thePCpreconditioner context
Level: developer
See also: PC, PCCreate(), PCApply(), PCDestroy(), KSPSetUp(), PCSetUpOnBlocks()
External Links
- PETSc Manual:
PC/PCSetUp
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- thePCpreconditioner context
Level: developer
See also: PC, PCSetUp(), PCCreate(), PCApply(), PCDestroy()
External Links
- PETSc Manual:
PC/PCSetUpOnBlocks
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- thePCpreconditioner contextflg-PETSC_TRUEto use theAmat,PETSC_FALSEto use thePmat(default isPETSC_FALSE)
Options Database Key:
-pc_use_amat (true|false)- use theAmatargument toKSPSetOperators()orPCSetOperators()to apply the operator
Level: intermediate
See also: PC, PCGetUseAmat(), PCBJACOBI, PCMG, PCFIELDSPLIT, PCCOMPOSITE, KSPSetOperators(), PCSetOperators()
External Links
- PETSc Manual:
PC/PCSetUseAmat
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 typePCSHELL
Output Parameter:
ctx- the user provided context
Level: advanced
See also: PC, PCSHELL, PCShellSetContext(), PCShellSetApply(), PCShellSetDestroy()
External Links
- PETSc Manual:
PC/PCShellGetContext
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
- PETSc Manual:
PC/PCShellGetName
PETSc.LibPETSc.PCShellSetApply — Method
PCShellSetApply(petsclib::PetscLibType, pc::AbstractPC, apply::external)Sets routine to use as preconditioner.
Logically Collective
Input Parameters:
pc- the preconditioner contextapply- the application-provided preconditioning routine
Calling sequence of apply:
pc- the preconditioner, get the application context withPCShellGetContext()xin- input vectorxout- output vector
Level: intermediate
See also: PCSHELL, PCShellSetApplyRichardson(), PCShellSetSetUp(), PCShellSetApplyTranspose(), PCShellSetContext(), PCShellSetApplyBA(), PCShellSetApplySymmetricRight(), PCShellSetApplySymmetricLeft(), PCShellGetContext()
External Links
- PETSc Manual:
PC/PCShellSetApply
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 contextapplyBA- the application-provided BA routine
Calling sequence of applyBA:
pc- the preconditionerside-PC_LEFT,PC_RIGHT, orPC_SYMMETRICxin- input vectorxout- output vectorw- work vector
Level: intermediate
See also: PCSHELL, PCShellSetApplyRichardson(), PCShellSetSetUp(), PCShellSetApplyTranspose(), PCShellSetContext(), PCShellSetApply(), PCShellGetContext(), PCSide
External Links
- PETSc Manual:
PC/PCShellSetApplyBA
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 contextapply- the application-provided preconditioning routine
Calling sequence of apply:
pc- the preconditionerb- right-hand sidex- current iterater- work spacertol- relative tolerance of residual norm to stop atabstol- absolute tolerance of residual norm to stop atdtol- if residual norm increases by this factor than returnmaxits- number of iterations to runzeroinitialguess-PETSC_TRUEifxis known to be initially zeroits- returns the number of iterations usedreason- returns the reason the iteration has converged
Level: advanced
See also: PCSHELL, PCShellSetApply(), PCShellSetContext(), PCRichardsonConvergedReason(), PCShellGetContext(), KSPRICHARDSON
External Links
- PETSc Manual:
PC/PCShellSetApplyRichardson
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 contextapply- the application-provided left preconditioning routine
Calling sequence of apply:
pc- the preconditionerxin- input vectorxout- output vector
Level: advanced
See also: PCSHELL, PCShellSetApply(), PCShellSetSetUp(), PCShellSetApplyTranspose(), PCShellSetContext()
External Links
- PETSc Manual:
PC/PCShellSetApplySymmetricLeft
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 contextapply- the application-provided right preconditioning routine
Calling sequence of apply:
pc- the preconditionerxin- input vectorxout- output vector
Level: advanced
See also: PCSHELL, PCShellSetApply(), PCShellSetApplySymmetricLeft(), PCShellSetSetUp(), PCShellSetApplyTranspose(), PCShellSetContext(), PCShellGetContext()
External Links
- PETSc Manual:
PC/PCShellSetApplySymmetricRight
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 contextapplytranspose- the application-provided preconditioning transpose routine
Calling sequence of applytranspose:
pc- the preconditionerxin- input vectorxout- output vector
Level: intermediate
See also: PCSHELL, PCShellSetApplyRichardson(), PCShellSetSetUp(), PCShellSetApply(), PCShellSetContext(), PCShellSetApplyBA(), PCShellGetContext()
External Links
- PETSc Manual:
PC/PCShellSetApplyTranspose
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- thePCof typePCSHELLctx- the context
Level: advanced
See also: PC, PCShellGetContext(), PCSHELL, PCShellSetApply(), PCShellSetDestroy()
External Links
- PETSc Manual:
PC/PCShellSetContext
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 contextdestroy- the application-provided destroy routine
Calling sequence of destroy:
pc- the preconditioner
Level: intermediate
See also: PCSHELL, PCShellSetApply(), PCShellSetContext(), PCShellGetContext()
External Links
- PETSc Manual:
PC/PCShellSetDestroy
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 contextmatapply- the application-provided preconditioning routine
Calling sequence of matapply:
pc- the preconditionerXin- input block of vectors represented as a denseMatXout- output block of vectors represented as a denseMat
Level: advanced
See also: PCSHELL, PCShellSetApply(), PCShellSetContext(), PCShellGetContext()
External Links
- PETSc Manual:
PC/PCShellSetMatApply
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 contextmatapplytranspose- the application-provided preconditioning transpose routine
Calling sequence of matapplytranspose:
pc- the preconditionerxin- input matrixxout- output matrix
Level: intermediate
See also: PCSHELL, PCShellSetApplyRichardson(), PCShellSetSetUp(), PCShellSetApply(), PCShellSetContext(), PCShellSetApplyBA(), PCShellGetContext()
External Links
- PETSc Manual:
PC/PCShellSetMatApplyTranspose
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 contextname- character string describing shell preconditioner
Level: intermediate
See also: PCSHELL, PCShellGetName(), PetscObjectSetName(), PetscObjectGetName()
External Links
- PETSc Manual:
PC/PCShellSetName
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 contextpostsolve- the application-provided postsolve routine, seePCShellPSolveFn
Level: advanced
See also: PCSHELL, PCShellPSolveFn, PCShellSetApplyRichardson(), PCShellSetSetUp(), PCShellSetApplyTranspose(), PCShellSetPreSolve(), PCShellSetContext(), PCShellGetContext()
External Links
- PETSc Manual:
PC/PCShellSetPostSolve
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 contextpresolve- the application-provided presolve routine, seePCShellPSolveFn
Level: advanced
See also: PCSHELL, PCShellPSolveFn, PCShellSetApplyRichardson(), PCShellSetSetUp(), PCShellSetApplyTranspose(), PCShellSetPostSolve(), PCShellSetContext(), PCShellGetContext()
External Links
- PETSc Manual:
PC/PCShellSetPreSolve
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 contextsetup- the application-provided setup routine
Calling sequence of setup:
pc- the preconditioner
Level: intermediate
See also: PCSHELL, PCShellSetApplyRichardson(), PCShellSetApply(), PCShellSetContext(), PCShellGetContext()
External Links
- PETSc Manual:
PC/PCShellSetSetUp
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 contextview- the application-provided view routine
Calling sequence of view:
pc- the preconditionerv- viewer
Level: advanced
See also: PC, PCSHELL, PCShellSetApplyRichardson(), PCShellSetSetUp(), PCShellSetApplyTranspose(), PCShellSetContext(), PCShellGetContext()
External Links
- PETSc Manual:
PC/PCShellSetView
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-partitionedDM
Level: advanced
See also: DM, PCTELESCOPE, PCTelescopeSetIgnoreDM(), PCTelescopeSetUseCoarseDM(), PCTelescopeGetIgnoreKSPComputeOperators()
External Links
- PETSc Manual:
PC/PCTelescopeGetDM
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
- PETSc Manual:
PC/PCTelescopeGetIgnoreDM
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
- PETSc Manual:
PC/PCTelescopeGetIgnoreKSPComputeOperators
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- theKSPdefined on the smaller set of processes
Level: advanced
See also: PC, KSP, PCTELESCOPE
External Links
- PETSc Manual:
PC/PCTelescopeGetKSP
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
- PETSc Manual:
PC/PCTelescopeGetReductionFactor
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 (seePetscSubcommType)
Level: advanced
See also: PetscSubcomm, PetscSubcommType, PCTELESCOPE, PCTelescopeSetSubcommType()
External Links
- PETSc Manual:
PC/PCTelescopeGetSubcommType
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
- PETSc Manual:
PC/PCTelescopeGetUseCoarseDM
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- UsePETSC_TRUEto ignore anyDM
Level: advanced
See also: DM, PCTELESCOPE, PCTelescopeGetIgnoreDM()
External Links
- PETSc Manual:
PC/PCTelescopeSetIgnoreDM
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- UsePETSC_TRUEto ignore the function (if defined) set viaKSPSetComputeOperators()onpc
Level: advanced
See also: PCTELESCOPE, PCTelescopeSetIgnoreDM(), PCTelescopeSetUseCoarseDM(), PCTelescopeGetIgnoreKSPComputeOperators()
External Links
- PETSc Manual:
PC/PCTelescopeSetIgnoreKSPComputeOperators
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
- PETSc Manual:
PC/PCTelescopeSetReductionFactor
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 contextsubcommtype- the subcommunicator type (seePetscSubcommType)
Level: advanced
See also: PetscSubcommType, PetscSubcomm, PCTELESCOPE, PCTelescopeGetSubcommType()
External Links
- PETSc Manual:
PC/PCTelescopeSetSubcommType
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- UsePETSC_FALSEto ignore any coarseDM
Level: advanced
See also: DM, PCTELESCOPE, PCTelescopeSetIgnoreDM()
External Links
- PETSc Manual:
PC/PCTelescopeSetUseCoarseDM
PETSc.LibPETSc.PCView — Method
PCView(petsclib::PetscLibType, pc::AbstractPC, viewer::PetscViewer)Prints information about the PC
Collective
Input Parameters:
pc- thePCpreconditioner contextviewer- optionalPetscViewervisualization context
Level: intermediate
See also: PC, PetscViewer, PetscViewerType, KSPView(), PetscViewerASCIIOpen()
External Links
- PETSc Manual:
PC/PCView
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- thePCcontextobj- Optional object that provides the options prefixname- command line option name
Options Database Key:
-name [viewertype][:...]- option name and values. SeePetscObjectViewFromOptions()for the possible arguments
Level: developer
See also: PC, PCView, PetscObjectViewFromOptions(), PCCreate()
External Links
- PETSc Manual:
PC/PCViewFromOptions