Mat - Low-level Interface
This page documents the low-level, automatically wrapped PETSc Mat (matrix) functions available through LibPETSc. These functions provide direct access to the PETSc C API.
For the high-level Julia interface, see Mat.
Overview
The Mat interface includes:
- Core Mat operations: Creation, manipulation, and mathematical operations on matrices (~632 functions in
Mat_wrappers.jl) - Mat utilities: Additional matrix operations and conversions (~124 functions in
Mataddons_wrappers.jl)
Usage
All low-level Mat functions require a petsclib parameter as the first argument:
using PETSc
# Get the library instance
petsclib = PETSc.petsclibs[1]
PETSc.initialize(petsclib)
# Get PETSc types
PetscInt = petsclib.PetscInt
PetscScalar = petsclib.PetscScalar
# Create a sparse matrix
mat = LibPETSc.MatCreate(petsclib, LibPETSc.PETSC_COMM_SELF)
LibPETSc.MatSetSizes(petsclib, mat, PetscInt(10), PetscInt(10), PetscInt(10), PetscInt(10))
LibPETSc.MatSetType(petsclib, mat, "seqaij")
LibPETSc.MatSetUp(petsclib, mat)
# Set values (0-based indexing!)
row = PetscInt[0]
cols = PetscInt[0, 1]
vals = PetscScalar[2.0, -1.0]
LibPETSc.MatSetValues(petsclib, mat, PetscInt(1), row, PetscInt(2), cols, vals, LibPETSc.INSERT_VALUES)
# Assemble
LibPETSc.MatAssemblyBegin(petsclib, mat, LibPETSc.MAT_FINAL_ASSEMBLY)
LibPETSc.MatAssemblyEnd(petsclib, mat, LibPETSc.MAT_FINAL_ASSEMBLY)
# Clean up
LibPETSc.MatDestroy(petsclib, mat)
PETSc.finalize(petsclib)Function Reference
PETSc.LibPETSc.MatAIJGetLocalMat — Method
MatAIJGetLocalMat(petsclib::PetscLibType,A::PetscMat, A_loc::PetscMat)Creates a MATSEQAIJ from a MATAIJ matrix.
Not Collective
Input Parameter:
A- the matrix
Output Parameter:
A_loc- the local sequential matrix generated
Level: developer
-seealso: , Mat, MatMPIAIJGetLocalMat()
External Links
- PETSc Manual:
Mat/MatAIJGetLocalMat
PETSc.LibPETSc.MatAXPY — Method
MatAXPY(petsclib::PetscLibType,Y::PetscMat, a::PetscScalar, X::PetscMat, str::MatStructure)Computes Y = a*X + Y.
Logically Collective
Input Parameters:
a- the scalar multiplierX- the first matrixY- the second matrixstr- eitherSAME_NONZERO_PATTERN,DIFFERENT_NONZERO_PATTERN,UNKNOWN_NONZERO_PATTERN, orSUBSET_NONZERO_PATTERN(nonzeros ofXis a subset ofY's)
Level: intermediate
External Links
- PETSc Manual:
Mat/MatAXPY
PETSc.LibPETSc.MatAYPX — Method
MatAYPX(petsclib::PetscLibType,Y::PetscMat, a::PetscScalar, X::PetscMat, str::MatStructure)Computes Y = a*Y + X.
Logically Collective
Input Parameters:
a- thePetscScalarmultiplierY- the first matrixX- the second matrixstr- eitherSAME_NONZERO_PATTERN,DIFFERENT_NONZERO_PATTERN,UNKNOWN_NONZERO_PATTERN, orSUBSET_NONZERO_PATTERN(nonzeros ofXis a subset ofY's)
Level: intermediate
External Links
- PETSc Manual:
Mat/MatAYPX
PETSc.LibPETSc.MatAppendOptionsPrefix — Method
MatAppendOptionsPrefix(petsclib::PetscLibType,A::PetscMat, prefix::Vector{Cchar})Appends to the prefix used for searching for all matrix options in the database.
Logically Collective
Input Parameters:
A- the matrixprefix- the prefix to prepend to all option names
Level: advanced
-seealso: , Mat, MatGetOptionsPrefix(), MatAppendOptionsPrefixFactor(), MatSetOptionsPrefix()
External Links
- PETSc Manual:
Mat/MatAppendOptionsPrefix
PETSc.LibPETSc.MatAppendOptionsPrefixFactor — Method
MatAppendOptionsPrefixFactor(petsclib::PetscLibType,A::PetscMat, prefix::Vector{Cchar})Appends to the prefix used for searching for all matrix factor options in the database for for matrices created with MatGetFactor()
Logically Collective
Input Parameters:
A- the matrixprefix- the prefix to prepend to all option names for the factored matrix
Level: developer
-seealso: , Mat, Matrix Factorization, MatGetFactor(), PetscOptionsCreate(), PetscOptionsDestroy(), PetscObjectSetOptionsPrefix(), PetscObjectPrependOptionsPrefix(), PetscObjectGetOptionsPrefix(), TSAppendOptionsPrefix(), SNESAppendOptionsPrefix(), KSPAppendOptionsPrefix(), MatSetOptionsPrefixFactor(), MatSetOptionsPrefix()
External Links
- PETSc Manual:
Mat/MatAppendOptionsPrefixFactor
PETSc.LibPETSc.MatAssembled — Method
assembled::PetscBool = MatAssembled(petsclib::PetscLibType,mat::PetscMat)Indicates if a matrix has been assembled and is ready for use; for example, in matrix-vector product.
Not Collective
Input Parameter:
mat- the matrix
Output Parameter:
assembled-PETSC_TRUEorPETSC_FALSE
Level: advanced
-seealso: , Mat, MatAssemblyEnd(), MatSetValues(), MatAssemblyBegin()
External Links
- PETSc Manual:
Mat/MatAssembled
PETSc.LibPETSc.MatAssemblyBegin — Method
MatAssemblyBegin(petsclib::PetscLibType,mat::PetscMat, type::MatAssemblyType)Begins assembling the matrix. This routine should be called after completing all calls to MatSetValues().
Collective
Input Parameters:
mat- the matrixtype- type of assembly, eitherMAT_FLUSH_ASSEMBLYorMAT_FINAL_ASSEMBLY
Level: beginner
-seealso: , Mat, MatAssemblyEnd(), MatSetValues(), MatAssembled()
External Links
- PETSc Manual:
Mat/MatAssemblyBegin
PETSc.LibPETSc.MatAssemblyEnd — Method
MatAssemblyEnd(petsclib::PetscLibType,mat::PetscMat, type::MatAssemblyType)Completes assembling the matrix. This routine should be called after MatAssemblyBegin().
Collective
Input Parameters:
mat- the matrixtype- type of assembly, eitherMAT_FLUSH_ASSEMBLYorMAT_FINAL_ASSEMBLY
Options Database Keys:
-mat_view ::ascii_info- Prints info on matrix at conclusion ofMatAssemblyEnd()-mat_view ::ascii_info_detail- Prints more detailed info-mat_view- Prints matrix in ASCII format-mat_view ::ascii_matlab- Prints matrix in MATLAB format-mat_view draw- draws nonzero structure of matrix, usingMatView()andPetscDrawOpenX().-display <name>- Sets display name (default is host)-draw_pause <sec>- Sets number of seconds to pause after display-mat_view socket- Sends matrix to socket, can be accessed from MATLAB (See Using MATLAB with PETSc)-viewer_socket_machine <machine>- Machine to use for socket-viewer_socket_port <port>- Port number to use for socket-mat_view binary:filename[:append]- Save matrix to file in binary format
Level: beginner
-seealso: , Mat, MatAssemblyBegin(), MatSetValues(), PetscDrawOpenX(), PetscDrawCreate(), MatView(), MatAssembled(), PetscViewerSocketOpen()
External Links
- PETSc Manual:
Mat/MatAssemblyEnd
PETSc.LibPETSc.MatBackwardSolve — Method
MatBackwardSolve(petsclib::PetscLibType,mat::PetscMat, b::PetscVec, x::PetscVec)Solves U x = b, given a factored matrix, A = LU. D^(1/2) U x = b, given a factored symmetric matrix, A = U^TDU,
Neighbor-wise Collective
Input Parameters:
mat- the factored matrixb- the right-hand-side vector
Output Parameter:
x- the result vector
Level: developer
-seealso: , Mat, MatForwardSolve(), MatGetFactor(), MatSolve()
External Links
- PETSc Manual:
Mat/MatBackwardSolve
PETSc.LibPETSc.MatBindToCPU — Method
MatBindToCPU(petsclib::PetscLibType,A::PetscMat, flg::PetscBool)marks a matrix to temporarily stay on the CPU and perform computations on the CPU
Logically Collective
Input Parameters:
A- the matrixflg- bind to the CPU if value ofPETSC_TRUE
Level: intermediate
-seealso: , Mat, MatBoundToCPU()
External Links
- PETSc Manual:
Mat/MatBindToCPU
PETSc.LibPETSc.MatBlockMatSetPreallocation — Method
MatBlockMatSetPreallocation(petsclib::PetscLibType,B::PetscMat, bs::PetscInt, nz::PetscInt, nnz::Vector{PetscInt})For good matrix assembly performance the user should preallocate the matrix storage by setting the parameter nz (or the array nnz). By setting these parameters accurately, performance during matrix assembly can be increased by more than a factor of 50.
Collective
Input Parameters:
B- The matrixbs- size of each block in matrixnz- number of nonzeros per block row (same for all rows)nnz- array containing the number of nonzeros in the various block rows
(possibly different for each row) or NULL
Level: intermediate
-seealso: , Mat, MatCreate(), MatCreateBlockMat(), MatSetValues()
External Links
- PETSc Manual:
Mat/MatBlockMatSetPreallocation
PETSc.LibPETSc.MatBoundToCPU — Method
flg::PetscBool = MatBoundToCPU(petsclib::PetscLibType,A::PetscMat)query if a matrix is bound to the CPU
Input Parameter:
A- the matrix
Output Parameter:
flg- the logical flag
Level: intermediate
-seealso: , Mat, MatBindToCPU()
External Links
- PETSc Manual:
Mat/MatBoundToCPU
PETSc.LibPETSc.MatCholeskyFactor — Method
MatCholeskyFactor(petsclib::PetscLibType,mat::PetscMat, perm::IS, info::MatFactorInfo)Performs in symmetric matrix.
Collective
Input Parameters:
mat- the matrixperm- row and column permutationsinfo- expected fill as ratio of original fill
Level: developer
-seealso: , Mat, Matrix Factorization, MatGetFactor(), MatFactorInfo, MatLUFactor(), MatCholeskyFactorSymbolic(), MatCholeskyFactorNumeric() MatGetOrdering()
External Links
- PETSc Manual:
Mat/MatCholeskyFactor
PETSc.LibPETSc.MatCholeskyFactorNumeric — Method
MatCholeskyFactorNumeric(petsclib::PetscLibType,fact::PetscMat, mat::PetscMat, info::MatFactorInfo)Performs numeric Cholesky factorization of a symmetric matrix. Call this routine after first calling MatGetFactor() and MatCholeskyFactorSymbolic().
Collective
Input Parameters:
fact- the factor matrix obtained withMatGetFactor(), where the factored values are storedmat- the initial matrix that is to be factoredinfo- options for factorization
Level: developer
-seealso: , Mat, Matrix Factorization, MatFactorInfo, MatGetFactor(), MatCholeskyFactorSymbolic(), MatCholeskyFactor(), MatLUFactorNumeric()
External Links
- PETSc Manual:
Mat/MatCholeskyFactorNumeric
PETSc.LibPETSc.MatCholeskyFactorSymbolic — Method
MatCholeskyFactorSymbolic(petsclib::PetscLibType,fact::PetscMat, mat::PetscMat, perm::IS, info::MatFactorInfo)Performs symbolic Cholesky factorization of a symmetric matrix.
Collective
Input Parameters:
fact- the factor matrix obtained withMatGetFactor()mat- the matrixperm- row and column permutationsinfo- options for factorization, includes
-seealso: , Mat, Matrix Factorization, MatFactorInfo, MatGetFactor(), MatLUFactorSymbolic(), MatCholeskyFactor(), MatCholeskyFactorNumeric() MatGetOrdering()
External Links
- PETSc Manual:
Mat/MatCholeskyFactorSymbolic
PETSc.LibPETSc.MatCompositeAddMat — Method
MatCompositeAddMat(petsclib::PetscLibType,mat::PetscMat, smat::PetscMat)Add another matrix to a composite matrix.
Collective
Input Parameters:
mat- the composite matrixsmat- the partial matrix
Level: advanced
-seealso: , Mat, MatCreateComposite(), MatCompositeGetMat(), MATCOMPOSITE
External Links
- PETSc Manual:
Mat/MatCompositeAddMat
PETSc.LibPETSc.MatCompositeGetMat — Method
MatCompositeGetMat(petsclib::PetscLibType,mat::PetscMat, i::PetscInt, Ai::PetscMat)Returns the ith matrix from the composite matrix.
Logically Collective
Input Parameters:
mat- the composite matrixi- the number of requested matrix
Output Parameter:
Ai- ith matrix in composite
Level: advanced
-seealso: , Mat, MatCreateComposite(), MatCompositeGetNumberMat(), MatCompositeAddMat(), MATCOMPOSITE
External Links
- PETSc Manual:
Mat/MatCompositeGetMat
PETSc.LibPETSc.MatCompositeGetMatStructure — Method
MatCompositeGetMatStructure(petsclib::PetscLibType,mat::PetscMat, str::MatStructure)Returns the structure of matrices in the composite matrix.
Not Collective
Input Parameter:
mat- the composite matrix
Output Parameter:
str- structure of the matrices
Level: advanced
-seealso: , Mat, MatCreateComposite(), MatCompositeSetMatStructure(), MATCOMPOSITE
External Links
- PETSc Manual:
Mat/MatCompositeGetMatStructure
PETSc.LibPETSc.MatCompositeGetNumberMat — Method
nmat::PetscInt = MatCompositeGetNumberMat(petsclib::PetscLibType,mat::PetscMat)Returns the number of matrices in the composite matrix.
Not Collective
Input Parameter:
mat- the composite matrix
Output Parameter:
nmat- number of matrices in the composite matrix
Level: advanced
-seealso: , Mat, MatCreateComposite(), MatCompositeGetMat(), MATCOMPOSITE
External Links
- PETSc Manual:
Mat/MatCompositeGetNumberMat
PETSc.LibPETSc.MatCompositeGetType — Method
type::MatCompositeType = MatCompositeGetType(petsclib::PetscLibType,mat::PetscMat)Returns type of composite.
Not Collective
Input Parameter:
mat- the composite matrix
Output Parameter:
type- type of composite
Level: advanced
-seealso: , Mat, MatCreateComposite(), MatCompositeSetType(), MATCOMPOSITE, MatCompositeType
External Links
- PETSc Manual:
Mat/MatCompositeGetType
PETSc.LibPETSc.MatCompositeMerge — Method
MatCompositeMerge(petsclib::PetscLibType,mat::PetscMat)Given a composite matrix, replaces it with a "regular" matrix by summing or computing the product of all the matrices inside the composite matrix.
Collective
Input Parameter:
mat- the composite matrix
Options Database Keys:
-mat_composite_merge- merge inMatAssemblyEnd()-mat_composite_merge_type- set merge direction
Level: advanced
-seealso: , Mat, MatDestroy(), MatMult(), MatCompositeAddMat(), MatCreateComposite(), MatCompositeSetMatStructure(), MatCompositeSetMergeType(), MATCOMPOSITE
External Links
- PETSc Manual:
Mat/MatCompositeMerge
PETSc.LibPETSc.MatCompositeSetMatStructure — Method
MatCompositeSetMatStructure(petsclib::PetscLibType,mat::PetscMat, str::MatStructure)Indicates structure of matrices in the composite matrix.
Not Collective
Input Parameters:
mat- the composite matrixstr- eitherSAME_NONZERO_PATTERN,DIFFERENT_NONZERO_PATTERN(default) orSUBSET_NONZERO_PATTERN
Level: advanced
-seealso: , Mat, MatAXPY(), MatCreateComposite(), MatCompositeMerge() MatCompositeGetMatStructure(), MATCOMPOSITE
External Links
- PETSc Manual:
Mat/MatCompositeSetMatStructure
PETSc.LibPETSc.MatCompositeSetMergeType — Method
MatCompositeSetMergeType(petsclib::PetscLibType,mat::PetscMat, type::MatCompositeMergeType)Sets order of MatCompositeMerge().
Logically Collective
Input Parameters:
mat- the composite matrixtype-MAT_COMPOSITE_MERGE RIGHT(default) to start merge from right with the first added matrix (mat[0]),
MAT_COMPOSITE_MERGE_LEFT to start merge from left with the last added matrix (mat[nmat-1])
Level: advanced
-seealso: , Mat, MatCreateComposite(), MatCompositeMerge(), MATCOMPOSITE
External Links
- PETSc Manual:
Mat/MatCompositeSetMergeType
PETSc.LibPETSc.MatCompositeSetScalings — Method
scalings::PetscScalar = MatCompositeSetScalings(petsclib::PetscLibType,mat::PetscMat)Sets separate scaling factors for component matrices.
Logically Collective
Input Parameters:
mat- the composite matrixscalings- array of scaling factors with scalings[i] being factor of i-th matrix, for i in [0, nmat)
Level: advanced
-seealso: , Mat, MatScale(), MatDiagonalScale(), MATCOMPOSITE
External Links
- PETSc Manual:
Mat/MatCompositeSetScalings
PETSc.LibPETSc.MatCompositeSetType — Method
MatCompositeSetType(petsclib::PetscLibType,mat::PetscMat, type::MatCompositeType)Indicates if the matrix is defined as the sum of a set of matrices or the product.
Logically Collective
Input Parameters:
mat- the composite matrixtype- theMatCompositeTypeto use for the matrix
Level: advanced
-seealso: , Mat, MatDestroy(), MatMult(), MatCompositeAddMat(), MatCreateComposite(), MatCompositeGetType(), MATCOMPOSITE, MatCompositeType
External Links
- PETSc Manual:
Mat/MatCompositeSetType
PETSc.LibPETSc.MatComputeBandwidth — Method
bw::PetscInt = MatComputeBandwidth(petsclib::PetscLibType,A::PetscMat, fraction::PetscReal)Calculate the full bandwidth of the matrix, meaning the width 2k+1 where k diagonals on either side are sufficient to contain all the matrix nonzeros.
Collective
Input Parameters:
A- TheMatfraction- An optional percentage of the Frobenius norm of the matrix that the bandwidth should enclose
Output Parameter:
bw- The matrix bandwidth
Level: beginner
-seealso: DMPlexCreate(), DMPlexSetConeSize(), DMPlexSetChart()
External Links
- PETSc Manual:
Mat/MatComputeBandwidth
PETSc.LibPETSc.MatComputeOperator — Method
MatComputeOperator(petsclib::PetscLibType,inmat::PetscMat, mattype::MatType, mat::PetscMat)Computes the explicit matrix
Collective
Input Parameters:
inmat- the matrixmattype- the matrix type for the explicit operator
Output Parameter:
mat- the explicit operator
Level: advanced
-seealso: , Mat, MatConvert(), MatMult(), MatComputeOperatorTranspose()
External Links
- PETSc Manual:
Mat/MatComputeOperator
PETSc.LibPETSc.MatComputeOperatorTranspose — Method
MatComputeOperatorTranspose(petsclib::PetscLibType,inmat::PetscMat, mattype::MatType, mat::PetscMat)Computes the explicit matrix representation of a give matrix that can apply MatMultTranspose()
Collective
Input Parameters:
inmat- the matrixmattype- the matrix type for the explicit operator
Output Parameter:
mat- the explicit operator transposed
Level: advanced
-seealso: , Mat, MatConvert(), MatMult(), MatComputeOperator()
External Links
- PETSc Manual:
Mat/MatComputeOperatorTranspose
PETSc.LibPETSc.MatComputeVariableBlockEnvelope — Method
MatComputeVariableBlockEnvelope(petsclib::PetscLibType,mat::PetscMat)Given a matrix whose nonzeros are in blocks along the diagonal this computes and stores the sizes of these blocks in the matrix. An individual block may lie over several processes.
Collective
Input Parameter:
mat- the matrix
Level: intermediate
-seealso: , Mat, MatInvertVariableBlockEnvelope(), MatSetVariableBlockSizes()
External Links
- PETSc Manual:
Mat/MatComputeVariableBlockEnvelope
PETSc.LibPETSc.MatConjugate — Method
MatConjugate(petsclib::PetscLibType,mat::PetscMat)replaces the matrix values with their complex conjugates
Logically Collective
Input Parameter:
mat- the matrix
Level: advanced
-seealso: , Mat, MatRealPart(), MatImaginaryPart(), VecConjugate(), MatTranspose()
External Links
- PETSc Manual:
Mat/MatConjugate
PETSc.LibPETSc.MatConstantDiagonalGetConstant — Method
value::PetscScalar = MatConstantDiagonalGetConstant(petsclib::PetscLibType,mat::PetscMat)Get the scalar constant of a constant diagonal matrix
Not collective
Input Parameter:
mat- aMATCONSTANTDIAGONAL
Output Parameter:
value- the scalar value
Level: developer
-seealso: , Mat, MatDestroy(), MATCONSTANTDIAGONAL
External Links
- PETSc Manual:
Mat/MatConstantDiagonalGetConstant
PETSc.LibPETSc.MatConvert — Method
MatConvert(petsclib::PetscLibType,mat::PetscMat, newtype::MatType, reuse::MatReuse, M::PetscMat)Converts a matrix to another matrix, either of the same or different type.
Collective
Input Parameters:
mat- the matrixnewtype- new matrix type. UseMATSAMEto create a new matrix of the
same type as the original matrix.
reuse- denotes if the destination matrix is to be created or reused.
Use MAT_INPLACE_MATRIX for inplace conversion (that is when you want the input Mat to be changed to contain the matrix in the new format), otherwise use MAT_INITIAL_MATRIX or MAT_REUSE_MATRIX (can only be used after the first call was made with MAT_INITIAL_MATRIX, causes the matrix space in M to be reused).
Output Parameter:
M- pointer to place new matrix
Level: intermediate
-seealso: , Mat, MatCopy(), MatDuplicate(), MAT_INITIAL_MATRIX, MAT_REUSE_MATRIX, MAT_INPLACE_MATRIX
External Links
- PETSc Manual:
Mat/MatConvert
PETSc.LibPETSc.MatCopy — Method
MatCopy(petsclib::PetscLibType,A::PetscMat, B::PetscMat, str::MatStructure)Copies a matrix to another matrix.
Collective
Input Parameters:
A- the matrixstr-SAME_NONZERO_PATTERNorDIFFERENT_NONZERO_PATTERN
Output Parameter:
B- where the copy is put
Level: intermediate
-seealso: , Mat, MatConvert(), MatDuplicate()
External Links
- PETSc Manual:
Mat/MatCopy
PETSc.LibPETSc.MatCopyHashToXAIJ — Method
MatCopyHashToXAIJ(petsclib::PetscLibType,A::PetscMat, B::PetscMat)copy hash table entries into an XAIJ matrix type
Logically Collective
Input Parameter:
A- A matrix in unassembled, hash table form
Output Parameter:
B- The XAIJ matrix. This can either beAor some matrix of equivalent size, e.g. obtained fromAviaMatDuplicate()
Example: -seealso: , Mat, MAT_USE_HASH_TABLE
External Links
- PETSc Manual:
Mat/MatCopyHashToXAIJ
PETSc.LibPETSc.MatCreate — Method
A::PetscMat = MatCreate(petsclib::PetscLibType,comm::MPI_Comm)Creates a matrix where the type is determined from either a call to MatSetType() or from the options database with a call to MatSetFromOptions().
Collective
Input Parameter:
comm- MPI communicator
Output Parameter:
A- the matrix
Options Database Keys:
-mat_type seqaij-MATSEQAIJtype, usesMatCreateSeqAIJ()-mat_type mpiaij-MATMPIAIJtype, usesMatCreateAIJ()-mat_type seqdense-MATSEQDENSE, usesMatCreateSeqDense()-mat_type mpidense-MATMPIDENSEtype, usesMatCreateDense()-mat_type seqbaij-MATSEQBAIJtype, usesMatCreateSeqBAIJ()-mat_type mpibaij-MATMPIBAIJtype, usesMatCreateBAIJ()
See the manpages for particular formats (e.g., MATSEQAIJ) for additional format-specific options.
Level: beginner
-seealso: , Mat, MatCreateSeqAIJ(), MatCreateAIJ(), MatCreateSeqDense(), MatCreateDense(), MatCreateSeqBAIJ(), MatCreateBAIJ(), MatCreateSeqSBAIJ(), MatCreateSBAIJ(), MatConvert()
External Links
- PETSc Manual:
Mat/MatCreate
PETSc.LibPETSc.MatCreateAIJ — Method
A::PetscMat = MatCreateAIJ(petsclib::PetscLibType,comm::MPI_Comm, m::PetscInt, n::PetscInt, M::PetscInt, N::PetscInt, d_nz::PetscInt, d_nnz::Vector{PetscInt}, o_nz::PetscInt, o_nnz::Vector{PetscInt})Creates a sparse parallel matrix in MATAIJ format (the default parallel PETSc format). For good matrix assembly performance the user should preallocate the matrix storage by setting the parameters d_nz (or d_nnz) and o_nz (or o_nnz).
Collective
Input Parameters:
comm- MPI communicatorm- number of local rows (orPETSC_DECIDEto have calculated if M is given). This value should be the same as the local size used in creating the y vector for the matrix-vector product y = Ax.n- This value should be the same as the local size used in creating the x vector for the matrix-vector product y = Ax. (orPETSC_DECIDEto have calculated if N is given) For square matrices n is almost always m.M- number of global rows (orPETSC_DETERMINEto have calculated if m is given)N- number of global columns (orPETSC_DETERMINEto have calculated if n is given)d_nz- number of nonzeros per row in DIAGONAL portion of local submatrix (same value is used for all local rows)d_nnz- array containing the number of nonzeros in the various rows of the DIAGONAL portion of the local submatrix (possibly different for each row) orNULL, ifd_nzis used to specify the nonzero structure. The size of this array is equal to the number of local rows, i.e 'm'.o_nz- number of nonzeros per row in the OFF-DIAGONAL portion of local submatrix (same value is used for all local rows).o_nnz- array containing the number of nonzeros in the various rows of the OFF-DIAGONAL portion of the local submatrix (possibly different for each row) orNULL, ifo_nzis used to specify the nonzero structure. The size of this array is equal to the number of local rows, i.e 'm'.
Output Parameter:
A- the matrix
Options Database Keys:
-mat_no_inode- Do not use inodes-mat_inode_limit <limit>- Sets inode limit (max limit=5)-matmult_vecscatter_view <viewer>- View the vecscatter (i.e., communication pattern) used inMatMult()of sparse parallel matrices.
See viewer types in manual of MatView(). Of them, ascii_matlab, draw or binary cause the VecScatter to be viewed as a matrix. Entry (i,j) is the size of message (in bytes) rank i sends to rank j in one MatMult() call.
Level: intermediate
-seealso: , Mat, Sparse Matrix Creation, MatCreate(), MatCreateSeqAIJ(), MatSetValues(), MatMPIAIJSetPreallocation(), MatMPIAIJSetPreallocationCSR(), MATMPIAIJ, MatCreateMPIAIJWithArrays(), MatGetOwnershipRange(), MatGetOwnershipRanges(), MatGetOwnershipRangeColumn(), MatGetOwnershipRangesColumn(), PetscLayout
External Links
- PETSc Manual:
Mat/MatCreateAIJ
PETSc.LibPETSc.MatCreateAIJKokkos — Method
A::PetscMat = MatCreateAIJKokkos(petsclib::PetscLibType,comm::MPI_Comm, m::PetscInt, n::PetscInt, M::PetscInt, N::PetscInt, d_nz::PetscInt, d_nnz::Vector{PetscInt}, o_nz::PetscInt, o_nnz::Vector{PetscInt})External Links
- PETSc Manual:
Mat/MatCreateAIJKokkos
PETSc.LibPETSc.MatCreateAIJViennaCL — Method
A::PetscMat = MatCreateAIJViennaCL(petsclib::PetscLibType,comm::MPI_Comm, m::PetscInt, n::PetscInt, M::PetscInt, N::PetscInt, d_nz::PetscInt, d_nnz::Vector{PetscInt}, o_nz::PetscInt, o_nnz::Vector{PetscInt})External Links
- PETSc Manual:
Mat/MatCreateAIJViennaCL
PETSc.LibPETSc.MatCreateBAIJ — Method
A::PetscMat = MatCreateBAIJ(petsclib::PetscLibType,comm::MPI_Comm, bs::PetscInt, m::PetscInt, n::PetscInt, M::PetscInt, N::PetscInt, d_nz::PetscInt, d_nnz::Union{Ptr,Vector{PetscInt}}, o_nz::PetscInt, o_nnz::Union{Ptr,Vector{PetscInt}})Creates a sparse parallel matrix in MATBAIJ format (block compressed row).
Collective
Input Parameters:
comm- MPI communicatorbs- size of block, the blocks are ALWAYS square. One can useMatSetBlockSizes()to set a different row and column blocksize but the row blocksize always defines the size of the blocks. The column blocksize sets the blocksize of the vectors obtained withMatCreateVecs()m- number of local rows (orPETSC_DECIDEto have calculated if M is given). This value should be the same as the local size used in creating the y vector for the matrix-vector product y = Ax.n- number of local columns (orPETSC_DECIDEto have calculated if N is given). This value should be the same as the local size used in creating the x vector for the matrix-vector product y = Ax.M- number of global rows (orPETSC_DETERMINEto have calculated if m is given)N- number of global columns (orPETSC_DETERMINEto have calculated if n is given)d_nz- number of nonzero blocks per block row in diagonal portion of local submatrix (same for all local rows)d_nnz- array containing the number of nonzero blocks in the various block rows of the in diagonal portion of the local (possibly different for each block row) or NULL. If you plan to factor the matrix you must leave room for the diagonal entry and set it even if it is zero.o_nz- number of nonzero blocks per block row in the off-diagonal portion of local submatrix (same for all local rows).o_nnz- array containing the number of nonzero blocks in the various block rows of the off-diagonal portion of the local submatrix (possibly different for each block row) or NULL.
Output Parameter:
A- the matrix
Options Database Keys:
-mat_block_size- size of the blocks to use-mat_use_hash_table <fact>- set hash table factor
Level: intermediate
-seealso: Mat, MatCreate(), MatCreateSeqBAIJ(), MatSetValues(), MatMPIBAIJSetPreallocation(), MatMPIBAIJSetPreallocationCSR(), MatGetOwnershipRange(), MatGetOwnershipRanges(), MatGetOwnershipRangeColumn(), MatGetOwnershipRangesColumn(), PetscLayout
External Links
- PETSc Manual:
Mat/MatCreateBAIJ
PETSc.LibPETSc.MatCreateBAIJMKL — Method
A::PetscMat = MatCreateBAIJMKL(petsclib::PetscLibType,comm::MPI_Comm, bs::PetscInt, m::PetscInt, n::PetscInt, M::PetscInt, N::PetscInt, d_nz::PetscInt, d_nnz::Vector{PetscInt}, o_nz::PetscInt, o_nnz::Vector{PetscInt})Creates a sparse parallel matrix in MATBAIJMKL format (block compressed row).
Collective
Input Parameters:
comm- MPI communicatorbs- size of block, the blocks are ALWAYS square. One can useMatSetBlockSizes()to set a different row and column blocksize but the row blocksize always defines the size of the blocks. The column blocksize sets the blocksize of the vectors obtained withMatCreateVecs()m- number of local rows (orPETSC_DECIDEto have calculated ifMis given) This value should be the same as the local size used in creating the y vector for the matrix-vector product y = Ax.n- number of local columns (orPETSC_DECIDEto have calculated ifNis given) This value should be the same as the local size used in creating the x vector for the matrix-vector product y = Ax.M- number of global rows (orPETSC_DETERMINEto have calculated ifmis given)N- number of global columns (orPETSC_DETERMINEto have calculated ifnis given)d_nz- number of nonzero blocks per block row in diagonal portion of local submatrix (same for all local rows)d_nnz- array containing the number of nonzero blocks in the various block rows of the in diagonal portion of the local (possibly different for each block row) orNULL. If you plan to factor the matrix you must leave room for the diagonal entry and set it even if it is zero.o_nz- number of nonzero blocks per block row in the off-diagonal portion of local submatrix (same for all local rows).o_nnz- array containing the number of nonzero blocks in the various block rows of the off-diagonal portion of the local submatrix (possibly different for each block row) orNULL.
Output Parameter:
A- the matrix
Options Database Keys:
-mat_block_size- size of the blocks to use-mat_use_hash_table <fact>- set hash table factor
Level: intermediate
-seealso: , Mat, MATBAIJMKL, MATBAIJ, MatCreate(), MatCreateSeqBAIJMKL(), MatSetValues(), MatMPIBAIJSetPreallocation(), MatMPIBAIJSetPreallocationCSR()
External Links
- PETSc Manual:
Mat/MatCreateBAIJMKL
PETSc.LibPETSc.MatCreateBlockMat — Method
A::PetscMat = MatCreateBlockMat(petsclib::PetscLibType,comm::MPI_Comm, m::PetscInt, n::PetscInt, bs::PetscInt, nz::PetscInt, nnz::Union{Ptr,Vector{PetscInt}})Creates a new matrix in which each block contains a uniform
Collective
Input Parameters:
comm- MPI communicatorm- number of rowsn- number of columnsbs- size of each submatrixnz- expected maximum number of nonzero blocks in row (usePETSC_DEFAULTif not known)nnz- expected number of nonzers per block row if known (useNULLotherwise)
Output Parameter:
A- the matrix
Level: intermediate
-seealso: , Mat, MATBLOCKMAT, MatCreateNest()
External Links
- PETSc Manual:
Mat/MatCreateBlockMat
PETSc.LibPETSc.MatCreateCentering — Method
C::PetscMat = MatCreateCentering(petsclib::PetscLibType,comm::MPI_Comm, n::PetscInt, N::PetscInt)Creates a new matrix object that implements the (symmetric and idempotent) centering matrix, I
Collective
Input Parameters:
comm- MPI communicatorn- number of local rows (orPETSC_DECIDEto have calculated ifNis given) This value should be the same as the local size used in creating theyvector for the matrix-vector product y = Ax.N- number of global rows (orPETSC_DETERMINEto have calculated ifnis given)
Output Parameter:
C- the matrix
-seealso: , Mat, MatCreateLRC(), MatCreateComposite()
External Links
- PETSc Manual:
Mat/MatCreateCentering
PETSc.LibPETSc.MatCreateComposite — Method
mats::PetscMat,mat::PetscMat = MatCreateComposite(petsclib::PetscLibType,comm::MPI_Comm, nmat::PetscInt)Creates a matrix as the sum or product of one or more matrices
Collective
Input Parameters:
comm- MPI communicatornmat- number of matrices to put inmats- the matrices
Output Parameter:
mat- the matrix
Options Database Keys:
-mat_composite_merge- merge inMatAssemblyEnd()-mat_composite_merge_mvctx- merge Mvctx of component matrices to optimize communication inMatMult()for ADDITIVE matrices-mat_composite_merge_type- set merge direction
Level: advanced
-seealso: , Mat, MatDestroy(), MatMult(), MatCompositeAddMat(), MatCompositeGetMat(), MatCompositeMerge(), MatCompositeSetType(), MATCOMPOSITE, MatCompositeType
External Links
- PETSc Manual:
Mat/MatCreateComposite
PETSc.LibPETSc.MatCreateConstantDiagonal — Method
J::PetscMat = MatCreateConstantDiagonal(petsclib::PetscLibType,comm::MPI_Comm, m::PetscInt, n::PetscInt, M::PetscInt, N::PetscInt, diag::PetscScalar)Creates a matrix with a uniform value along the diagonal
Collective
Input Parameters:
comm- MPI communicatorm- number of local rows (orPETSC_DECIDEto have calculated ifMis given). This value should be the same as the local size used in creating the y vector for the matrix-vector product y = Ax.n- This value should be the same as the local size used in creating the x vector for the matrix-vector product y = Ax. (orPETSC_DECIDEto have calculated ifNis given) For square matrices n is almost alwaysm.M- number of global rows (orPETSC_DETERMINEto have calculated if m is given)N- number of global columns (orPETSC_DETERMINEto have calculated if n is given)diag- the diagonal value
Output Parameter:
J- the diagonal matrix
Level: advanced
-seealso: , Mat, MatDestroy(), MATCONSTANTDIAGONAL, MatScale(), MatShift(), MatMult(), MatGetDiagonal(), MatGetFactor(), MatSolve()
External Links
- PETSc Manual:
Mat/MatCreateConstantDiagonal
PETSc.LibPETSc.MatCreateDense — Method
A::PetscMat = MatCreateDense(petsclib::PetscLibType,comm::MPI_Comm, m::PetscInt, n::PetscInt, M::PetscInt, N::PetscInt, data::Union{Ptr,Vector{PetscScalar}})Creates a matrix in MATDENSE format.
Collective
Input Parameters:
comm- MPI communicatorm- number of local rows (orPETSC_DECIDEto have calculated ifMis given)n- number of local columns (orPETSC_DECIDEto have calculated ifNis given)M- number of global rows (orPETSC_DECIDEto have calculated ifmis given)N- number of global columns (orPETSC_DECIDEto have calculated ifnis given)data- optional location of matrix data. Set data toNULL(PETSC_NULL_SCALAR_ARRAYfor Fortran users) for PETSc to control all matrix memory allocation.
Output Parameter:
A- the matrix
Level: intermediate
-seealso: , Mat, MATDENSE, MatCreate(), MatCreateSeqDense(), MatSetValues()
External Links
- PETSc Manual:
Mat/MatCreateDense
PETSc.LibPETSc.MatCreateDenseFromVecType — Method
data::PetscScalar,A::PetscMat = MatCreateDenseFromVecType(petsclib::PetscLibType,comm::MPI_Comm, vtype::VecType, m::PetscInt, n::PetscInt, M::PetscInt, N::PetscInt, lda::PetscInt)Create a matrix that matches the type of a Vec.
Collective
Input Parameters:
comm- the communicatorvtype- the vector typem- number of local rows (orPETSC_DECIDEto have calculated ifMis given)n- number of local columns (orPETSC_DECIDEto have calculated ifNis given)M- number of global rows (orPETSC_DECIDEto have calculated ifmis given)N- number of global columns (orPETSC_DECIDEto have calculated ifnis given)lda- optional leading dimension. Pass any non-positive number to use the default.data- optional location of matrix data, which should have the same memory type as the vector. PassNULLto have PETSc take care of matrix memory allocation.
Output Parameter:
A- the dense matrix
Level: advanced
-seealso: , Mat, MatCreateDense(), MatCreateDenseCUDA(), MatCreateDenseHIP(), PetscMemType
External Links
- PETSc Manual:
Mat/MatCreateDenseFromVecType
PETSc.LibPETSc.MatCreateDiagonal — Method
J::PetscMat = MatCreateDiagonal(petsclib::PetscLibType,diag::PetscVec)Creates a matrix defined by a given vector along its diagonal.
Collective
Input Parameter:
diag- vector for the diagonal
Output Parameter:
J- the diagonal matrix
Level: advanced
-seealso: , Mat, MatDestroy(), MATCONSTANTDIAGONAL, MatScale(), MatShift(), MatMult(), MatGetDiagonal(), MatSolve() MatDiagonalRestoreInverseDiagonal(), MatDiagonalGetDiagonal(), MatDiagonalRestoreDiagonal(), MatDiagonalGetInverseDiagonal()
External Links
- PETSc Manual:
Mat/MatCreateDiagonal
PETSc.LibPETSc.MatCreateFFT — Method
A::PetscMat = MatCreateFFT(petsclib::PetscLibType,comm::MPI_Comm, ndim::PetscInt, dim::Vector{PetscInt}, mattype::MatType)Creates a matrix object that provides FFT via an external package
Collective
Input Parameters:
comm- MPI communicatorndim- the ndim-dimensional transformdim- array of size ndim, dim[i] contains the vector length in the i-dimensionmattype- package type, e.g.,MATFFTWorMATSEQCUFFT
Output Parameter:
A- the matrix
Options Database Key:
-mat_fft_type- set FFT type fft or seqcufft
Level: intermediate
-seealso: , Mat, MATFFTW, MATSEQCUFFT, MatCreateVecsFFTW()
External Links
- PETSc Manual:
Mat/MatCreateFFT
PETSc.LibPETSc.MatCreateFromOptions — Method
A::PetscMat = MatCreateFromOptions(petsclib::PetscLibType,comm::MPI_Comm, prefix::Vector{Cchar}, bs::PetscInt, m::PetscInt, n::PetscInt, M::PetscInt, N::PetscInt)Creates a matrix whose type is set from the options database
Collective
Input Parameters:
comm- MPI communicatorprefix- [optional] prefix for the options databasebs- the blocksize (commonly 1)m- the local number of rows (orPETSC_DECIDE)n- the local number of columns (orPETSC_DECIDEorPETSC_DETERMINE)M- the global number of rows (orPETSC_DETERMINE)N- the global number of columns (orPETSC_DETERMINE)
Output Parameter:
A- the matrix
Options Database Key:
-mat_type- seeMatType, for exampleaij,aijcusparse,baij,sbaij,dense, defaults toaij
Level: beginner
-seealso: , Mat, MatCreateSeqAIJ(), MatCreateAIJ(), MatCreateSeqDense(), MatCreateDense(), MatCreateSeqBAIJ(), MatCreateBAIJ(), MatCreateSeqSBAIJ(), MatCreateSBAIJ(), MatConvert(), MatCreate()
External Links
- PETSc Manual:
Mat/MatCreateFromOptions
PETSc.LibPETSc.MatCreateGraph — Method
graph::PetscMat = MatCreateGraph(petsclib::PetscLibType,A::PetscMat, sym::PetscBool, scale::PetscBool, filter::PetscReal, num_idx::PetscInt, index::Vector{PetscInt})create a scalar matrix (that is a matrix with one vertex for each block vertex in the original matrix), for use in graph algorithms and possibly removes small values from the graph structure.
Collective
Input Parameters:
A- the matrixsym-PETSC_TRUEindicates that the graph should be symmetrizedscale-PETSC_TRUEindicates that the graph edge weights should be symmetrically scaled with the diagonal entryfilter- filter value - < 0: does nothing; == 0: removes only 0.0 entries; otherwise: removes entries with abs(entries) <= valuenum_idx- size of 'index' arrayindex- array of block indices to use for graph strength of connection weight
Output Parameter:
graph- the resulting graph
Level: advanced
-seealso: , Mat, MatCreate(), PCGAMG
External Links
- PETSc Manual:
Mat/MatCreateGraph
PETSc.LibPETSc.MatCreateHermitianTranspose — Method
N::PetscMat = MatCreateHermitianTranspose(petsclib::PetscLibType,A::PetscMat)Creates a new matrix object of MatType MATHERMITIANTRANSPOSEVIRTUAL that behaves like A'*
Collective
Input Parameter:
A- the (possibly rectangular) matrix
Output Parameter:
N- the matrix that represents A'*
Level: intermediate
-seealso: , Mat, MatCreateNormal(), MatMult(), MatMultHermitianTranspose(), MatCreate(), MATTRANSPOSEVIRTUAL, MatCreateTranspose(), MatHermitianTransposeGetMat(), MATNORMAL, MATNORMALHERMITIAN
External Links
- PETSc Manual:
Mat/MatCreateHermitianTranspose
PETSc.LibPETSc.MatCreateHtoolFromKernel — Method
kernel::MatHtoolKernelFn,kernelctx::Cvoid,B::PetscMat = MatCreateHtoolFromKernel(petsclib::PetscLibType,comm::MPI_Comm, m::PetscInt, n::PetscInt, M::PetscInt, N::PetscInt, spacedim::PetscInt, coords_target::Vector{PetscReal}, coords_source::Vector{PetscReal})External Links
- PETSc Manual:
Mat/MatCreateHtoolFromKernel
PETSc.LibPETSc.MatCreateIS — Method
A::PetscMat = MatCreateIS(petsclib::PetscLibType,comm::MPI_Comm, bs::PetscInt, m::PetscInt, n::PetscInt, M::PetscInt, N::PetscInt, rmap::ISLocalToGlobalMapping, cmap::ISLocalToGlobalMapping)Creates a "process" unassembled matrix.
Collective.
Input Parameters:
comm- MPI communicator that will share the matrixbs- block size of the matrixm- local size of left vector used in matrix vector productsn- local size of right vector used in matrix vector productsM- global size of left vector used in matrix vector productsN- global size of right vector used in matrix vector productsrmap- local to global map for rowscmap- local to global map for cols
Output Parameter:
A- the resulting matrix
Level: intermediate
-seealso: , Mat, MATIS, MatSetLocalToGlobalMapping()
External Links
- PETSc Manual:
Mat/MatCreateIS
PETSc.LibPETSc.MatCreateKAIJ — Method
kaij::PetscMat = MatCreateKAIJ(petsclib::PetscLibType,A::PetscMat, p::PetscInt, q::PetscInt, S::Vector{PetscScalar}, T::Vector{PetscScalar})Creates a matrix of type MATKAIJ.
Collective
Input Parameters:
A- theMATAIJmatrixp- number of rows inSandTq- number of columns inSandTS- theSmatrix (can beNULL), stored as aPetscScalararray (column-major)T- theTmatrix (can beNULL), stored as aPetscScalararray (column-major)
Output Parameter:
kaij- the newMATKAIJmatrix
Level: advanced
-seealso: , Mat, MatKAIJSetAIJ(), MatKAIJSetS(), MatKAIJSetT(), MatKAIJGetAIJ(), MatKAIJGetS(), MatKAIJGetT(), MATKAIJ
External Links
- PETSc Manual:
Mat/MatCreateKAIJ
PETSc.LibPETSc.MatCreateLMVMBFGS — Method
B::PetscMat = MatCreateLMVMBFGS(petsclib::PetscLibType,comm::MPI_Comm, n::PetscInt, N::PetscInt)Creates a limited matrix used for approximating Jacobians. L-BFGS is symmetric positive-definite by construction, and is commonly used to approximate Hessians in optimization problems.
To use the L-BFGS matrix with other vector types, the matrix must be created using MatCreate() and MatSetType(), followed by MatLMVMAllocate(). This ensures that the internal storage and work vectors are duplicated from the correct type of vector.
Collective
Input Parameters:
comm- MPI communicatorn- number of local rows for storage vectorsN- global size of the storage vectors
Output Parameter:
B- the matrix
Options Database Keys:
-mat_lmvm_scale_type- (developer) type of scaling applied to J0 (none, scalar, diagonal)-mat_lmvm_theta- (developer) convex ratio between BFGS and DFP components of the diagonal J0 scaling-mat_lmvm_rho- (developer) update limiter for the J0 scaling-mat_lmvm_alpha- (developer) coefficient factor for the quadratic subproblem in J0 scaling-mat_lmvm_beta- (developer) exponential factor for the diagonal J0 scaling-mat_lmvm_sigma_hist- (developer) number of past updates to use in J0 scaling
Level: intermediate
-seealso: , MatCreate(), MATLMVM, MATLMVMBFGS, MatCreateLMVMDFP(), MatCreateLMVMSR1(), MatCreateLMVMBroyden(), MatCreateLMVMBadBroyden(), MatCreateLMVMSymBroyden()
External Links
- PETSc Manual:
Ksp/MatCreateLMVMBFGS
PETSc.LibPETSc.MatCreateLMVMBadBroyden — Method
B::PetscMat = MatCreateLMVMBadBroyden(petsclib::PetscLibType,comm::MPI_Comm, n::PetscInt, N::PetscInt)Creates a limited approximation matrix used for a Jacobian. L-BadBrdn is not guaranteed to be symmetric or positive-definite.
To use the L-BadBrdn matrix with other vector types, the matrix must be created using MatCreate() and MatSetType(), followed by MatLMVMAllocate(). This ensures that the internal storage and work vectors are duplicated from the correct type of vector.
Collective
Input Parameters:
comm- MPI communicatorn- number of local rows for storage vectorsN- global size of the storage vectors
Output Parameter:
B- the matrix
Options Database Keys:
-mat_lmvm_hist_size- the number of history vectors to keep-mat_lmvm_mult_algorithm- the algorithm to use for multiplication (recursive, dense, compact_dense)-mat_lmvm_cache_J0_products- whether products between the base Jacobian J0 and history vectors should be cached or recomputed-mat_lmvm_debug- (developer) perform internal debugging checks
Level: intermediate
-seealso: , MatCreate(), MATLMVM, MATLMVMBADBRDN, MatCreateLMVMDFP(), MatCreateLMVMSR1(), MatCreateLMVMBFGS(), MatCreateLMVMBroyden(), MatCreateLMVMSymBroyden()
External Links
- PETSc Manual:
Ksp/MatCreateLMVMBadBroyden
PETSc.LibPETSc.MatCreateLMVMBroyden — Method
B::PetscMat = MatCreateLMVMBroyden(petsclib::PetscLibType,comm::MPI_Comm, n::PetscInt, N::PetscInt)Creates a limited matrix used for a Jacobian. L-Brdn is not guaranteed to be symmetric or positive-definite.
To use the L-Brdn matrix with other vector types, the matrix must be created using MatCreate() and MatSetType(), followed by MatLMVMAllocate(). This ensures that the internal storage and work vectors are duplicated from the correct type of vector.
Collective
Input Parameters:
comm- MPI communicatorn- number of local rows for storage vectorsN- global size of the storage vectors
Output Parameter:
B- the matrix
Options Database Keys:
-mat_lmvm_hist_size- the number of history vectors to keep-mat_lmvm_mult_algorithm- the algorithm to use for multiplication (recursive, dense, compact_dense)-mat_lmvm_cache_J0_products- whether products between the base Jacobian J0 and history vectors should be cached or recomputed-mat_lmvm_debug- (developer) perform internal debugging checks
Level: intermediate
-seealso: , MatCreate(), MATLMVM, MATLMVMBRDN, MatCreateLMVMDFP(), MatCreateLMVMSR1(), MatCreateLMVMBFGS(), MatCreateLMVMBadBroyden(), MatCreateLMVMSymBroyden()
External Links
- PETSc Manual:
Ksp/MatCreateLMVMBroyden
PETSc.LibPETSc.MatCreateLMVMDBFGS — Method
B::PetscMat = MatCreateLMVMDBFGS(petsclib::PetscLibType,comm::MPI_Comm, n::PetscInt, N::PetscInt)Creates a dense representation of the limited Broyden-Fletcher-Goldfarb-Shanno (BFGS) approximation to a Hessian.
Collective
Input Parameters:
comm- MPI communicatorn- number of local rows for storage vectorsN- global size of the storage vectors
Output Parameter:
B- the matrix
Level: advanced
-seealso: MatCreate(), MATLMVM, MATLMVMDBFGS, MatCreateLMVMBFGS()
External Links
- PETSc Manual:
Ksp/MatCreateLMVMDBFGS
PETSc.LibPETSc.MatCreateLMVMDDFP — Method
B::PetscMat = MatCreateLMVMDDFP(petsclib::PetscLibType,comm::MPI_Comm, n::PetscInt, N::PetscInt)Creates a dense representation of the limited Davidon-Fletcher-Powell (DFP) approximation to a Hessian.
Collective
Input Parameters:
comm- MPI communicatorn- number of local rows for storage vectorsN- global size of the storage vectors
Output Parameter:
B- the matrix
Level: advanced
-seealso: MatCreate(), MATLMVM, MATLMVMDDFP, MatCreateLMVMDFP()
External Links
- PETSc Manual:
Ksp/MatCreateLMVMDDFP
PETSc.LibPETSc.MatCreateLMVMDFP — Method
B::PetscMat = MatCreateLMVMDFP(petsclib::PetscLibType,comm::MPI_Comm, n::PetscInt, N::PetscInt)Creates a limited used for approximating Jacobians. L-DFP is symmetric positive-definite by construction, and is the dual of L-BFGS where Y and S vectors swap roles.
To use the L-DFP matrix with other vector types, the matrix must be created using MatCreate() and MatSetType(), followed by MatLMVMAllocate(). This ensures that the internal storage and work vectors are duplicated from the correct type of vector.
Collective
Input Parameters:
comm- MPI communicatorn- number of local rows for storage vectorsN- global size of the storage vectors
Output Parameter:
B- the matrix
Options Database Keys:
-mat_lmvm_scale_type- (developer) type of scaling applied to J0 (none, scalar, diagonal)-mat_lmvm_theta- (developer) convex ratio between BFGS and DFP components of the diagonal J0 scaling-mat_lmvm_rho- (developer) update limiter for the J0 scaling-mat_lmvm_alpha- (developer) coefficient factor for the quadratic subproblem in J0 scaling-mat_lmvm_beta- (developer) exponential factor for the diagonal J0 scaling-mat_lmvm_sigma_hist- (developer) number of past updates to use in J0 scaling
Level: intermediate
-seealso: , MatCreate(), MATLMVM, MATLMVMDFP, MatCreateLMVMBFGS(), MatCreateLMVMSR1(), MatCreateLMVMBroyden(), MatCreateLMVMBadBroyden(), MatCreateLMVMSymBroyden()
External Links
- PETSc Manual:
Ksp/MatCreateLMVMDFP
PETSc.LibPETSc.MatCreateLMVMDQN — Method
B::PetscMat = MatCreateLMVMDQN(petsclib::PetscLibType,comm::MPI_Comm, n::PetscInt, N::PetscInt)Creates a dense representation of the limited Quasi-Newton approximation to a Hessian.
Collective
Input Parameters:
comm- MPI communicatorn- number of local rows for storage vectorsN- global size of the storage vectors
Output Parameter:
B- the matrix
Level: advanced
-seealso: MatCreate(), MATLMVM, MATLMVMDBFGS, MATLMVMDDFP, MatCreateLMVMDDFP(), MatCreateLMVMDBFGS()
External Links
- PETSc Manual:
Ksp/MatCreateLMVMDQN
PETSc.LibPETSc.MatCreateLMVMDiagBroyden — Method
B::PetscMat = MatCreateLMVMDiagBroyden(petsclib::PetscLibType,comm::MPI_Comm, n::PetscInt, N::PetscInt)DiagBrdn creates a symmetric Broyden for approximating Hessians.
Collective
Input Parameters:
comm- MPI communicatorn- number of local rows for storage vectorsN- global size of the storage vectors
Output Parameter:
B- the matrix
Options Database Keys:
-mat_lmvm_theta- (developer) convex ratio between BFGS and DFP components of the diagonal J0 scaling-mat_lmvm_rho- (developer) update limiter for the J0 scaling-mat_lmvm_alpha- (developer) coefficient factor for the quadratic subproblem in J0 scaling-mat_lmvm_beta- (developer) exponential factor for the diagonal J0 scaling-mat_lmvm_sigma_hist- (developer) number of past updates to use in J0 scaling.-mat_lmvm_tol- (developer) tolerance for bounding the denominator of the rescaling away from 0.-mat_lmvm_forward- (developer) whether or not to use the forward or backward Broyden update to the diagonal
Level: intermediate
-seealso: , MatCreate(), MATLMVM, MATLMVMDIAGBRDN, MatCreateLMVMDFP(), MatCreateLMVMSR1(), MatCreateLMVMBFGS(), MatCreateLMVMBroyden(), MatCreateLMVMSymBroyden()
External Links
- PETSc Manual:
Ksp/MatCreateLMVMDiagBroyden
PETSc.LibPETSc.MatCreateLMVMSR1 — Method
B::PetscMat = MatCreateLMVMSR1(petsclib::PetscLibType,comm::MPI_Comm, n::PetscInt, N::PetscInt)Creates a limited matrix used for a Jacobian. L-SR1 is symmetric by construction, but is not guaranteed to be positive-definite.
To use the L-SR1 matrix with other vector types, the matrix must be created using MatCreate() and MatSetType(), followed by MatLMVMAllocate(). This ensures that the internal storage and work vectors are duplicated from the correct type of vector.
Collective
Input Parameters:
comm- MPI communicatorn- number of local rows for storage vectorsN- global size of the storage vectors
Output Parameter:
B- the matrix
Options Database Keys:
-mat_lmvm_hist_size- the number of history vectors to keep-mat_lmvm_mult_algorithm- the algorithm to use for multiplication (recursive, dense, compact_dense)-mat_lmvm_cache_J0_products- whether products between the base Jacobian J0 and history vectors should be cached or recomputed-mat_lmvm_eps- (developer) numerical zero tolerance for testing when an update should be skipped-mat_lmvm_debug- (developer) perform internal debugging checks
Level: intermediate
-seealso: , MatCreate(), MATLMVM, MATLMVMSR1, MatCreateLMVMBFGS(), MatCreateLMVMDFP(), MatCreateLMVMBroyden(), MatCreateLMVMBadBroyden(), MatCreateLMVMSymBroyden()
External Links
- PETSc Manual:
Ksp/MatCreateLMVMSR1
PETSc.LibPETSc.MatCreateLMVMSymBadBroyden — Method
B::PetscMat = MatCreateLMVMSymBadBroyden(petsclib::PetscLibType,comm::MPI_Comm, n::PetscInt, N::PetscInt)Creates a limited for approximating Jacobians.
Collective
Input Parameters:
comm- MPI communicatorn- number of local rows for storage vectorsN- global size of the storage vectors
Output Parameter:
B- the matrix
Options Database Keys:
-mat_lmvm_hist_size- the number of history vectors to keep-mat_lmvm_psi- convex ratio between BFGS and DFP components of the update-mat_lmvm_scale_type- type of scaling applied to J0 (none, scalar, diagonal)-mat_lmvm_mult_algorithm- the algorithm to use for multiplication (recursive, dense, compact_dense)-mat_lmvm_cache_J0_products- whether products between the base Jacobian J0 and history vectors should be cached or recomputed-mat_lmvm_eps- (developer) numerical zero tolerance for testing when an update should be skipped-mat_lmvm_debug- (developer) perform internal debugging checks-mat_lmvm_theta- (developer) convex ratio between BFGS and DFP components of the diagonal J0 scaling-mat_lmvm_rho- (developer) update limiter for the J0 scaling-mat_lmvm_alpha- (developer) coefficient factor for the quadratic subproblem in J0 scaling-mat_lmvm_beta- (developer) exponential factor for the diagonal J0 scaling-mat_lmvm_sigma_hist- (developer) number of past updates to use in J0 scaling
Level: intermediate
-seealso: , LMVM Matrices, MatCreate(), MATLMVM, MATLMVMSYMBROYDEN, MatCreateLMVMDFP(), MatCreateLMVMSR1(), MatCreateLMVMBFGS(), MatCreateLMVMBroyden(), MatCreateLMVMBadBroyden()
External Links
- PETSc Manual:
Ksp/MatCreateLMVMSymBadBroyden
PETSc.LibPETSc.MatCreateLMVMSymBroyden — Method
B::PetscMat = MatCreateLMVMSymBroyden(petsclib::PetscLibType,comm::MPI_Comm, n::PetscInt, N::PetscInt)Creates a limited for approximating Jacobians.
Collective
Input Parameters:
comm- MPI communicator, set toPETSC_COMM_SELFn- number of local rows for storage vectorsN- global size of the storage vectors
Output Parameter:
B- the matrix
Options Database Keys:
-mat_lmvm_hist_size- the number of history vectors to keep-mat_lmvm_phi- convex ratio between BFGS and DFP components of the update-mat_lmvm_scale_type- type of scaling applied to J0 (none, scalar, diagonal)-mat_lmvm_mult_algorithm- the algorithm to use for multiplication (recursive, dense, compact_dense)-mat_lmvm_cache_J0_products- whether products between the base Jacobian J0 and history vectors should be cached or recomputed-mat_lmvm_eps- (developer) numerical zero tolerance for testing when an update should be skipped-mat_lmvm_debug- (developer) perform internal debugging checks-mat_lmvm_theta- (developer) convex ratio between BFGS and DFP components of the diagonal J0 scaling-mat_lmvm_rho- (developer) update limiter for the J0 scaling-mat_lmvm_alpha- (developer) coefficient factor for the quadratic subproblem in J0 scaling-mat_lmvm_beta- (developer) exponential factor for the diagonal J0 scaling-mat_lmvm_sigma_hist- (developer) number of past updates to use in J0 scaling
Level: intermediate
-seealso: , MatCreate(), MATLMVM, MATLMVMSYMBROYDEN, MatCreateLMVMDFP(), MatCreateLMVMSR1(), MatCreateLMVMBFGS(), MatCreateLMVMBroyden(), MatCreateLMVMBadBroyden()
External Links
- PETSc Manual:
Ksp/MatCreateLMVMSymBroyden
PETSc.LibPETSc.MatCreateLRC — Method
N::PetscMat = MatCreateLRC(petsclib::PetscLibType,A::PetscMat, U::PetscMat, c::PetscVec, V::PetscMat)Creates a new matrix object that behaves like A + UCV' of type MATLRC
Collective
Input Parameters:
A- the (sparse) matrix (can beNULL)U- dense rectangular (tall and skinny) matrixV- dense rectangular (tall and skinny) matrixc- a vector containing the diagonal of C (can beNULL)
Output Parameter:
N- the matrix that represents A + UCV'
Level: intermediate
-seealso: , Mat, MATLRC, MatLRCGetMats()
External Links
- PETSc Manual:
Mat/MatCreateLRC
PETSc.LibPETSc.MatCreateLaplacian — Method
L::PetscMat = MatCreateLaplacian(petsclib::PetscLibType,A::PetscMat, tol::PetscReal, weighted::PetscBool)Create the matrix Laplacian, with all values in the matrix less than the tolerance set to zero
Input Parameters:
A- The matrixtol- The zero toleranceweighted- Flag for using edge weights
Output Parameter:
L- The graph Laplacian matrix
Level: intermediate
-seealso: MatFilter(), MatGetGraph()
External Links
- PETSc Manual:
Mat/MatCreateLaplacian
PETSc.LibPETSc.MatCreateLocalRef — Method
newmat::PetscMat = MatCreateLocalRef(petsclib::PetscLibType,A::PetscMat, isrow::IS, iscol::IS)Gets a logical reference to a local submatrix, for use in assembly, that is to set values into the matrix
Not Collective
Input Parameters:
A- full matrix, generally parallelisrow- Local index set for the rowsiscol- Local index set for the columns
Output Parameter:
newmat- new serialMat
Level: developer
-seealso: , Mat, MATSUBMATRIX, MatCreateSubMatrixVirtual(), MatSetValuesLocal(), MatSetValuesBlockedLocal(), MatGetLocalSubMatrix(), MatCreateSubMatrix()
External Links
- PETSc Manual:
Mat/MatCreateLocalRef
PETSc.LibPETSc.MatCreateMAIJ — Method
maij::PetscMat = MatCreateMAIJ(petsclib::PetscLibType,A::PetscMat, dof::PetscInt)Creates a matrix type providing restriction and interpolation operations for multicomponent problems. It interpolates each component the same way independently. The matrix type is based on MATSEQAIJ for sequential matrices, and MATMPIAIJ for distributed matrices.
Collective
Input Parameters:
A- theMATAIJmatrix describing the action on blocksdof- the block size (number of components per node)
Output Parameter:
maij- the newMATMAIJmatrix
Level: advanced
-seealso: , Mat, MATAIJ, MATMAIJ, MatMAIJGetAIJ(), MatMAIJRedimension()
External Links
- PETSc Manual:
Mat/MatCreateMAIJ
PETSc.LibPETSc.MatCreateMFFD — Method
J::PetscMat = MatCreateMFFD(petsclib::PetscLibType,comm::MPI_Comm, m::PetscInt, n::PetscInt, M::PetscInt, N::PetscInt)Creates a matrix approximately multiply a vector by the matrix (Jacobian) . See also MatCreateSNESMF()
Collective
Input Parameters:
comm- MPI communicatorm- number of local rows (orPETSC_DECIDEto have calculated ifMis given). This value should be the same as the local size used in creating the y vector for the matrix-vector product y = Ax.n- This value should be the same as the local size used in creating the x vector for the matrix-vector product y = Ax. (orPETSC_DECIDEto have calculated ifNis given) For square matricesnis almost alwaysm.M- number of global rows (orPETSC_DETERMINEto have calculated ifmis given)N- number of global columns (orPETSC_DETERMINEto have calculated ifnis given)
Output Parameter:
J- the matrix-free matrix
Options Database Keys:
-mat_mffd_type- wp or ds (seeMATMFFD_WPorMATMFFD_DS)-mat_mffd_err- square root of estimated relative error in function evaluation-mat_mffd_period- how often h is recomputed, defaults to 1, every time-mat_mffd_check_positivity- possibly decreasehuntil U + h*a has only positive values-mat_mffd_umin <umin>- Sets umin (for default PETSc routine that computes h only)-mat_mffd_complex- use the Lyness trick with complex numbers to compute the matrix-vector product instead of differencing (requires real valued functions but that PETSc be configured for complex numbers)-snes_mf- use the finite difference based matrix-free matrix withSNESSolve()and no preconditioner-snes_mf_operator- use the finite difference based matrix-free matrix withSNESSolve()but construct a preconditioner
using the matrix passed as pmat to SNESSetJacobian().
Level: advanced
-seealso: , Mat, MATMFFD, MatDestroy(), MatMFFDSetFunctionError(), MatMFFDDSSetUmin(), MatMFFDSetFunction() MatMFFDSetHHistory(), MatMFFDResetHHistory(), MatCreateSNESMF(), MatCreateShell(), MATSHELL, MatMFFDGetH(), MatMFFDRegister(), MatMFFDComputeJacobian()
External Links
- PETSc Manual:
Mat/MatCreateMFFD
PETSc.LibPETSc.MatCreateMPIAIJCRL — Method
A::PetscMat = MatCreateMPIAIJCRL(petsclib::PetscLibType,comm::MPI_Comm, m::PetscInt, n::PetscInt, nz::PetscInt, nnz::Vector{PetscInt}, onz::PetscInt, onnz::Vector{PetscInt})Creates a sparse matrix of type MATMPIAIJCRL.
Collective
Input Parameters:
comm- MPI communicator, set toPETSC_COMM_SELFm- number of rowsn- number of columnsnz- number of nonzeros per row (same for all rows), for the "diagonal" submatrixnnz- array containing the number of nonzeros in the various rows (possibly different for each row) orNULL, for the "diagonal" submatrixonz- number of nonzeros per row (same for all rows), for the "off-diagonal" submatrixonnz- array containing the number of nonzeros in the various rows (possibly different for each row) orNULL, for the "off-diagonal" submatrix
Output Parameter:
A- the matrix
Level: intermediate
-seealso: , Mat, Sparse Matrix Creation, MATAIJ, MATAIJSELL, MATAIJPERM, MATAIJMKL, MatCreate(), MatCreateMPIAIJPERM(), MatSetValues()
External Links
- PETSc Manual:
Mat/MatCreateMPIAIJCRL
PETSc.LibPETSc.MatCreateMPIAIJMKL — Method
A::PetscMat = MatCreateMPIAIJMKL(petsclib::PetscLibType,comm::MPI_Comm, m::PetscInt, n::PetscInt, M::PetscInt, N::PetscInt, d_nz::PetscInt, d_nnz::Vector{PetscInt}, o_nz::PetscInt, o_nnz::Vector{PetscInt})Creates a sparse parallel matrix whose local portions are stored as MATSEQAIJMKL matrices (a matrix class that inherits from MATSEQAIJ but uses some operations provided by Intel MKL).
Collective
Input Parameters:
comm- MPI communicatorm- number of local rows (orPETSC_DECIDEto have calculated ifMis given)
This value should be the same as the local size used in creating the y vector for the matrix-vector product y = Ax.
n- This value should be the same as the local size used in creating the
x vector for the matrix-vector product y = Ax. (or PETSC_DECIDE to have calculated if N is given) For square matrices n is almost always m.
M- number of global rows (orPETSC_DETERMINEto have calculated ifmis given)N- number of global columns (orPETSC_DETERMINEto have calculated ifnis given)d_nz- number of nonzeros per row in DIAGONAL portion of local submatrix
(same value is used for all local rows)
d_nnz- array containing the number of nonzeros in the various rows of the
DIAGONAL portion of the local submatrix (possibly different for each row) or NULL, if d_nz is used to specify the nonzero structure. The size of this array is equal to the number of local rows, i.e m. For matrices you plan to factor you must leave room for the diagonal entry and put in the entry even if it is zero.
o_nz- number of nonzeros per row in the OFF-DIAGONAL portion of local
submatrix (same value is used for all local rows).
o_nnz- array containing the number of nonzeros in the various rows of the
OFF-DIAGONAL portion of the local submatrix (possibly different for each row) or NULL, if o_nz is used to specify the nonzero structure. The size of this array is equal to the number of local rows, i.e m.
Output Parameter:
A- the matrix
Options Database Key:
-mat_aijmkl_no_spmv2- disables use of the SpMV2 inspector-executor routines
Level: intermediate
-seealso: , Mat, Sparse Matrix Creation, MATMPIAIJMKL, MatCreate(), MatCreateSeqAIJMKL(), MatSetValues(), MatGetOwnershipRange(), MatGetOwnershipRanges(), MatGetOwnershipRangeColumn(), MatGetOwnershipRangesColumn(), PetscLayout
External Links
- PETSc Manual:
Mat/MatCreateMPIAIJMKL
PETSc.LibPETSc.MatCreateMPIAIJPERM — Method
A::PetscMat = MatCreateMPIAIJPERM(petsclib::PetscLibType,comm::MPI_Comm, m::PetscInt, n::PetscInt, M::PetscInt, N::PetscInt, d_nz::PetscInt, d_nnz::Vector{PetscInt}, o_nz::PetscInt, o_nnz::Vector{PetscInt})Creates a sparse parallel matrix whose local portions are stored as MATSEQAIJPERM matrices (a matrix class that inherits from SEQAIJ but includes some optimizations to allow more effective vectorization).
Collective
Input Parameters:
comm- MPI communicatorm- number of local rows (orPETSC_DECIDEto have calculated ifMis given)
This value should be the same as the local size used in creating the y vector for the matrix-vector product y = Ax.
n- This value should be the same as the local size used in creating the
x vector for the matrix-vector product y = Ax. (or PETSC_DECIDE to have calculated if N is given) For square matrices n is almost always m.
M- number of global rows (orPETSC_DETERMINEto have calculated ifmis given)N- number of global columns (orPETSC_DETERMINEto have calculated ifnis given)d_nz- number of nonzeros per row in DIAGONAL portion of local submatrix
(same value is used for all local rows)
d_nnz- array containing the number of nonzeros in the various rows of the
DIAGONAL portion of the local submatrix (possibly different for each row) or NULL, if d_nz is used to specify the nonzero structure. The size of this array is equal to the number of local rows, i.e m. For matrices you plan to factor you must leave room for the diagonal entry and put in the entry even if it is zero.
o_nz- number of nonzeros per row in the OFF-DIAGONAL portion of local
submatrix (same value is used for all local rows).
o_nnz- array containing the number of nonzeros in the various rows of the
OFF-DIAGONAL portion of the local submatrix (possibly different for each row) or NULL, if o_nz is used to specify the nonzero structure. The size of this array is equal to the number of local rows, i.e m.
Output Parameter:
A- the matrix
Options Database Keys:
-mat_no_inode- Do not use inodes-mat_inode_limit <limit>- Sets inode limit (max limit=5)
Level: intermediate
-seealso: , Mat, Sparse Matrix Creation, MATMPIAIJPERM, MatCreate(), MatCreateSeqAIJPERM(), MatSetValues()
External Links
- PETSc Manual:
Mat/MatCreateMPIAIJPERM
PETSc.LibPETSc.MatCreateMPIAIJSELL — Method
A::PetscMat = MatCreateMPIAIJSELL(petsclib::PetscLibType,comm::MPI_Comm, m::PetscInt, n::PetscInt, M::PetscInt, N::PetscInt, d_nz::PetscInt, d_nnz::Vector{PetscInt}, o_nz::PetscInt, o_nnz::Vector{PetscInt})Creates a sparse parallel matrix whose local portions are stored as MATSEQAIJSELL matrices (a matrix class that inherits from SEQAIJ but performs some operations in SELL format).
Collective
Input Parameters:
comm- MPI communicatorm- number of local rows (orPETSC_DECIDEto have calculated ifMis given)
This value should be the same as the local size used in creating the y vector for the matrix-vector product y = Ax.
n- This value should be the same as the local size used in creating the
x vector for the matrix-vector product y = Ax. (or PETSC_DECIDE to have calculated if N is given) For square matrices n is almost always m.
M- number of global rows (orPETSC_DETERMINEto have calculated ifmis given)N- number of global columns (orPETSC_DETERMINEto have calculated ifnis given)d_nz- number of nonzeros per row in DIAGONAL portion of local submatrix
(same value is used for all local rows)
d_nnz- array containing the number of nonzeros in the various rows of the
DIAGONAL portion of the local submatrix (possibly different for each row) or NULL, if d_nz is used to specify the nonzero structure. The size of this array is equal to the number of local rows, i.e m. For matrices you plan to factor you must leave room for the diagonal entry and put in the entry even if it is zero.
o_nz- number of nonzeros per row in the OFF-DIAGONAL portion of local
submatrix (same value is used for all local rows).
o_nnz- array containing the number of nonzeros in the various rows of the
OFF-DIAGONAL portion of the local submatrix (possibly different for each row) or NULL, if o_nz is used to specify the nonzero structure. The size of this array is equal to the number of local rows, i.e m.
Output Parameter:
A- the matrix
Options Database Key:
-mat_aijsell_eager_shadow- Construct shadow matrix upon matrix assembly; default is to take a "lazy" approach, performing this step the first
time the matrix is applied
Level: intermediate
-seealso: , Mat, Sparse Matrix Creation, MATSEQAIJSELL, MATMPIAIJSELL, MATAIJSELL, MatCreate(), MatCreateSeqAIJSELL(), MatSetValues()
External Links
- PETSc Manual:
Mat/MatCreateMPIAIJSELL
PETSc.LibPETSc.MatCreateMPIAIJSumSeqAIJ — Method
mpimat::PetscMat = MatCreateMPIAIJSumSeqAIJ(petsclib::PetscLibType,comm::MPI_Comm, seqmat::PetscMat, m::PetscInt, n::PetscInt, scall::MatReuse)Creates a MATMPIAIJ matrix by adding sequential matrices from each processor
Collective
Input Parameters:
comm- the communicators the parallel matrix will live onseqmat- the input sequential matricesm- number of local rows (orPETSC_DECIDE)n- number of local columns (orPETSC_DECIDE)scall- eitherMAT_INITIAL_MATRIXorMAT_REUSE_MATRIX
Output Parameter:
mpimat- the parallel matrix generated
Level: advanced
-seealso: , Mat, MatCreateAIJ()
External Links
- PETSc Manual:
Mat/MatCreateMPIAIJSumSeqAIJ
PETSc.LibPETSc.MatCreateMPIAIJSumSeqAIJNumeric — Method
MatCreateMPIAIJSumSeqAIJNumeric(petsclib::PetscLibType,seqmat::PetscMat, mpimat::PetscMat)External Links
- PETSc Manual:
Mat/MatCreateMPIAIJSumSeqAIJNumeric
PETSc.LibPETSc.MatCreateMPIAIJSumSeqAIJSymbolic — Method
mpimat::PetscMat = MatCreateMPIAIJSumSeqAIJSymbolic(petsclib::PetscLibType,comm::MPI_Comm, seqmat::PetscMat, m::PetscInt, n::PetscInt)External Links
- PETSc Manual:
Mat/MatCreateMPIAIJSumSeqAIJSymbolic
PETSc.LibPETSc.MatCreateMPIAIJWithArrays — Method
mat::PetscMat = MatCreateMPIAIJWithArrays(petsclib::PetscLibType,comm::MPI_Comm, m::PetscInt, n::PetscInt, M::PetscInt, N::PetscInt, i::Vector{PetscInt}, j::Vector{PetscInt}, a::Vector{PetscScalar})creates a MATMPIAIJ matrix using arrays that contain in standard CSR format for the local rows.
Collective
Input Parameters:
comm- MPI communicatorm- number of local rows (Cannot bePETSC_DECIDE)n- This value should be the same as the local size used in creating the
x vector for the matrix-vector product y = Ax. (or PETSC_DECIDE to have calculated if N is given) For square matrices n is almost always m.
M- number of global rows (orPETSC_DETERMINEto have calculated ifmis given)N- number of global columns (orPETSC_DETERMINEto have calculated ifnis given)i- row indices (of length m+1); that is i[0] = 0, i[row] = i[row-1] + number of elements in that row of the matrixj- global column indicesa- optional matrix values
Output Parameter:
mat- the matrix
Level: intermediate
-seealso: , Mat, MatCreate(), MatCreateSeqAIJ(), MatSetValues(), MatMPIAIJSetPreallocation(), MatMPIAIJSetPreallocationCSR(), MATMPIAIJ, MatCreateAIJ(), MatCreateMPIAIJWithSplitArrays(), MatUpdateMPIAIJWithArray(), MatSetPreallocationCOO(), MatSetValuesCOO()
External Links
- PETSc Manual:
Mat/MatCreateMPIAIJWithArrays
PETSc.LibPETSc.MatCreateMPIAIJWithSeqAIJ — Method
garray::PetscInt,mat::PetscMat = MatCreateMPIAIJWithSeqAIJ(petsclib::PetscLibType,comm::MPI_Comm, M::PetscInt, N::PetscInt, A::PetscMat, B::PetscMat)creates a MATMPIAIJ matrix using MATSEQAIJ matrices that contain the "diagonal" and "off-diagonal" part of the matrix in CSR format.
Collective
Input Parameters:
comm- MPI communicatorM- the global row sizeN- the global column sizeA- "diagonal" portion of matrixB- if garray isNULL, B should be the offdiag matrix using global col ids and of size N - if garray is notNULL, B should be the offdiag matrix using local col ids and of size garraygarray- eitherNULLor the global index ofBcolumns. If notNULL, it should be allocated byPetscMalloc1()and will be owned bymatthereafter.
Output Parameter:
mat- the matrix, with inputAas its local diagonal matrix
Level: advanced
-seealso: , Mat, MATMPIAIJ, MATSEQAIJ, MatCreateMPIAIJWithSplitArrays()
External Links
- PETSc Manual:
Mat/MatCreateMPIAIJWithSeqAIJ
PETSc.LibPETSc.MatCreateMPIAIJWithSplitArrays — Method
mat::PetscMat = MatCreateMPIAIJWithSplitArrays(petsclib::PetscLibType,comm::MPI_Comm, m::PetscInt, n::PetscInt, M::PetscInt, N::PetscInt, i::Vector{PetscInt}, j::Vector{PetscInt}, a::Vector{PetscScalar}, oi::Vector{PetscInt}, oj::Vector{PetscInt}, oa::Vector{PetscScalar})creates a MATMPIAIJ matrix using arrays that contain the "diagonal" and "off-diagonal" part of the matrix in CSR format.
Collective
Input Parameters:
comm- MPI communicatorm- number of local rows (Cannot bePETSC_DECIDE)n- This value should be the same as the local size used in creating the
x vector for the matrix-vector product y = Ax. (or PETSC_DECIDE to have calculated if N is given) For square matrices n is almost always m.
M- number of global rows (orPETSC_DETERMINEto have calculated ifmis given)N- number of global columns (orPETSC_DETERMINEto have calculated ifnis given)i- row indices for "diagonal" portion of matrix; that is i[0] = 0, i[row] = i[row-1] + number of elements in that row of the matrixj- column indices, which must be local, i.e., based off the start column of the diagonal portiona- matrix valuesoi- row indices for "off-diagonal" portion of matrix; that is oi[0] = 0, oi[row] = oi[row-1] + number of elements in that row of the matrixoj- column indices, which must be global, representing global columns in theMATMPIAIJmatrixoa- matrix values
Output Parameter:
mat- the matrix
Level: advanced
-seealso: , Mat, MatCreate(), MatCreateSeqAIJ(), MatSetValues(), MatMPIAIJSetPreallocation(), MatMPIAIJSetPreallocationCSR(), MATMPIAIJ, MatCreateAIJ(), MatCreateMPIAIJWithArrays()
External Links
- PETSc Manual:
Mat/MatCreateMPIAIJWithSplitArrays
PETSc.LibPETSc.MatCreateMPIAdj — Method
A::PetscMat = MatCreateMPIAdj(petsclib::PetscLibType,comm::MPI_Comm, m::PetscInt, N::PetscInt, i::Vector{PetscInt}, j::Vector{PetscInt}, values::Vector{PetscInt})Creates a sparse matrix representing an adjacency list. The matrix need not have numerical values associated with it, it is intended for ordering (to reduce bandwidth etc) and partitioning.
Collective
Input Parameters:
comm- MPI communicatorm- number of local rowsN- number of global columnsi- the indices intojfor the start of each rowj- the column indices for each row (sorted for each row).values- the values, optional, useNULLif not provided
Output Parameter:
A- the matrix
Level: intermediate
-seealso: , Mat, MatCreate(), MatConvert(), MatGetOrdering(), MATMPIADJ, MatMPIAdjSetPreallocation()
External Links
- PETSc Manual:
Mat/MatCreateMPIAdj
PETSc.LibPETSc.MatCreateMPIBAIJWithArrays — Method
mat::PetscMat = MatCreateMPIBAIJWithArrays(petsclib::PetscLibType,comm::MPI_Comm, bs::PetscInt, m::PetscInt, n::PetscInt, M::PetscInt, N::PetscInt, i::Vector{PetscInt}, j::Vector{PetscInt}, a::Vector{PetscScalar})creates a MATMPIBAIJ matrix using arrays that contain in standard block CSR format for the local rows.
Collective
Input Parameters:
comm- MPI communicatorbs- the block size, only a block size of 1 is supportedm- number of local rows (Cannot bePETSC_DECIDE)n- This value should be the same as the local size used in creating the x vector for the matrix-vector product y = Ax . (orPETSC_DECIDEto have calculated ifNis given) For square matricesnis almost alwaysm.M- number of global rows (orPETSC_DETERMINEto have calculated ifmis given)N- number of global columns (orPETSC_DETERMINEto have calculated ifnis given)i- row indices; that is i[0] = 0, i[row] = i[row-1] + number of block elements in that rowth block row of the matrixj- column indicesa- matrix values
Output Parameter:
mat- the matrix
Level: intermediate
-seealso: Mat, MatCreate(), MatCreateSeqAIJ(), MatSetValues(), MatMPIAIJSetPreallocation(), MatMPIAIJSetPreallocationCSR(), MATMPIAIJ, MatCreateAIJ(), MatCreateMPIAIJWithSplitArrays()
External Links
- PETSc Manual:
Mat/MatCreateMPIBAIJWithArrays
PETSc.LibPETSc.MatCreateMPIMatConcatenateSeqMat — Method
mpimat::PetscMat = MatCreateMPIMatConcatenateSeqMat(petsclib::PetscLibType,comm::MPI_Comm, seqmat::PetscMat, n::PetscInt, reuse::MatReuse)Creates a single large PETSc matrix by concatenating sequential matrices from each processor
Collective
Input Parameters:
comm- the communicators the parallel matrix will live onseqmat- the input sequential matricesn- number of local columns (orPETSC_DECIDE)reuse- eitherMAT_INITIAL_MATRIXorMAT_REUSE_MATRIX
Output Parameter:
mpimat- the parallel matrix generated
Level: developer
External Links
- PETSc Manual:
Mat/MatCreateMPIMatConcatenateSeqMat
PETSc.LibPETSc.MatCreateMPISBAIJWithArrays — Method
mat::PetscMat = MatCreateMPISBAIJWithArrays(petsclib::PetscLibType,comm::MPI_Comm, bs::PetscInt, m::PetscInt, n::PetscInt, M::PetscInt, N::PetscInt, i::Vector{PetscInt}, j::Vector{PetscInt}, a::Vector{PetscScalar})creates a MATMPISBAIJ matrix using arrays that contain in standard CSR format for the local rows.
Collective
Input Parameters:
comm- MPI communicatorbs- the block size, only a block size of 1 is supportedm- number of local rows (Cannot bePETSC_DECIDE)n- This value should be the same as the local size used in creating the x vector for the matrix-vector product y = Ax . (orPETSC_DECIDEto have calculated ifNis given) For square matricesnis almost alwaysm.M- number of global rows (orPETSC_DETERMINEto have calculated ifmis given)N- number of global columns (orPETSC_DETERMINEto have calculated ifnis given)i- row indices; that is i[0] = 0, i[row] = i[row-1] + number of block elements in that row block row of the matrixj- column indicesa- matrix values
Output Parameter:
mat- the matrix
Level: intermediate
-seealso: , Mat, MATMPISBAIJ, MatCreate(), MatCreateSeqAIJ(), MatSetValues(), MatMPIAIJSetPreallocation(), MatMPIAIJSetPreallocationCSR(), MATMPIAIJ, MatCreateAIJ(), MatCreateMPIAIJWithSplitArrays(), MatMPISBAIJSetPreallocationCSR()
External Links
- PETSc Manual:
Mat/MatCreateMPISBAIJWithArrays
PETSc.LibPETSc.MatCreateNest — Method
B::PetscMat = MatCreateNest(petsclib::PetscLibType,comm::MPI_Comm, nr::PetscInt, is_row::Vector{IS}, nc::PetscInt, is_col::Vector{IS}, a::Vector{PetscMat})Creates a new MATNEST matrix containing several nested submatrices, each stored separately
Collective
Input Parameters:
comm- Communicator for the newMATNESTnr- number of nested row blocksis_row- index sets for each nested row block, orNULLto make contiguousnc- number of nested column blocksis_col- index sets for each nested column block, orNULLto make contiguousa- array of nr imes nc submatrices, empty submatrices can be passed usingNULL
Output Parameter:
B- new matrix
Level: advanced
-seealso: , Mat, MATNEST, MatCreate(), VecCreateNest(), DMCreateMatrix(), MatNestSetSubMat(), MatNestGetSubMat(), MatNestGetLocalISs(), MatNestGetSize(), MatNestGetISs(), MatNestSetSubMats(), MatNestGetSubMats()
External Links
- PETSc Manual:
Mat/MatCreateNest
PETSc.LibPETSc.MatCreateNormal — Method
N::PetscMat = MatCreateNormal(petsclib::PetscLibType,A::PetscMat)Creates a new MATNORMAL matrix object that behaves like A^T A.
Collective
Input Parameter:
A- the (possibly rectangular) matrix
Output Parameter:
N- the matrix that represents A^T A
Level: intermediate
-seealso: , Mat, MATNORMAL, MatMult(), MatNormalGetMat(), MATNORMALHERMITIAN, MatCreateNormalHermitian()
External Links
- PETSc Manual:
Mat/MatCreateNormal
PETSc.LibPETSc.MatCreateNormalHermitian — Method
N::PetscMat = MatCreateNormalHermitian(petsclib::PetscLibType,A::PetscMat)Creates a new matrix object MATNORMALHERMITIAN that behaves like A^* A.
Collective
Input Parameter:
A- the (possibly rectangular complex) matrix
Output Parameter:
N- the matrix that represents A^* A
Level: intermediate
-seealso: , Mat, MATNORMAL, MATNORMALHERMITIAN, MatNormalHermitianGetMat()
External Links
- PETSc Manual:
Mat/MatCreateNormalHermitian
PETSc.LibPETSc.MatCreateRedundantMatrix — Method
matredundant::PetscMat = MatCreateRedundantMatrix(petsclib::PetscLibType,mat::PetscMat, nsubcomm::PetscInt, subcomm::MPI_Comm, reuse::MatReuse)Create redundant matrices and put them into processors of subcommunicators.
Collective
Input Parameters:
mat- the matrixnsubcomm- the number of subcommunicators (= number of redundant parallel or sequential matrices)subcomm- MPI communicator split from the communicator where mat resides in (orMPI_COMM_NULLif nsubcomm is used)reuse- eitherMAT_INITIAL_MATRIXorMAT_REUSE_MATRIX
Output Parameter:
matredundant- redundant matrix
Level: advanced
-seealso: , Mat, MatDestroy(), PetscSubcommCreate(), PetscSubcomm
External Links
- PETSc Manual:
Mat/MatCreateRedundantMatrix
PETSc.LibPETSc.MatCreateSBAIJ — Method
A::PetscMat = MatCreateSBAIJ(petsclib::PetscLibType,comm::MPI_Comm, bs::PetscInt, m::PetscInt, n::PetscInt, M::PetscInt, N::PetscInt, d_nz::PetscInt, d_nnz::Vector{PetscInt}, o_nz::PetscInt, o_nnz::Vector{PetscInt})Creates a sparse parallel matrix in symmetric block AIJ format, MATSBAIJ, (block compressed row). For good matrix assembly performance the user should preallocate the matrix storage by setting the parameters d_nz (or d_nnz) and o_nz (or o_nnz).
Collective
Input Parameters:
comm- MPI communicatorbs- size of block, the blocks are ALWAYS square. One can useMatSetBlockSizes()to set a different row and column blocksize but the row blocksize always defines the size of the blocks. The column blocksize sets the blocksize of the vectors obtained withMatCreateVecs()m- number of local rows (orPETSC_DECIDEto have calculated ifMis given) This value should be the same as the local size used in creating the y vector for the matrix-vector product y = Ax.n- number of local columns (orPETSC_DECIDEto have calculated ifNis given) This value should be the same as the local size used in creating the x vector for the matrix-vector product y = Ax.M- number of global rows (orPETSC_DETERMINEto have calculated ifmis given)N- number of global columns (orPETSC_DETERMINEto have calculated ifnis given)d_nz- number of block nonzeros per block row in diagonal portion of local submatrix (same for all local rows)d_nnz- array containing the number of block nonzeros in the various block rows in the upper triangular portion of the in diagonal portion of the local (possibly different for each block block row) orNULL. If you plan to factor the matrix you must leave room for the diagonal entry and set its value even if it is zero.o_nz- number of block nonzeros per block row in the off-diagonal portion of local submatrix (same for all local rows).o_nnz- array containing the number of nonzeros in the various block rows of the off-diagonal portion of the local submatrix (possibly different for each block row) orNULL.
Output Parameter:
A- the matrix
Options Database Keys:
-mat_no_unroll- uses code that does not unroll the loops in the block calculations (much slower)-mat_block_size- size of the blocks to use-mat_mpi- use the parallel matrix data structures even on one processor (defaults to using SeqBAIJ format on one processor)
Level: intermediate
-seealso: , Mat, MATSBAIJ, MatCreate(), MatCreateSeqSBAIJ(), MatSetValues(), MatCreateBAIJ(), MatGetOwnershipRange(), MatGetOwnershipRanges(), MatGetOwnershipRangeColumn(), MatGetOwnershipRangesColumn(), PetscLayout
External Links
- PETSc Manual:
Mat/MatCreateSBAIJ
PETSc.LibPETSc.MatCreateSELL — Method
A::PetscMat = MatCreateSELL(petsclib::PetscLibType,comm::MPI_Comm, m::PetscInt, n::PetscInt, M::PetscInt, N::PetscInt, d_rlenmax::PetscInt, d_rlen::Vector{PetscInt}, o_rlenmax::PetscInt, o_rlen::Vector{PetscInt})Creates a sparse parallel matrix in MATSELL format.
Collective
Input Parameters:
comm- MPI communicatorm- number of local rows (orPETSC_DECIDEto have calculated if M is given). This value should be the same as the local size used in creating the y vector for the matrix-vector product y = Ax.n- This value should be the same as the local size used in creating the x vector for the matrix-vector product y = Ax. (orPETSC_DECIDEto have calculated ifNis given) For square matrices n is almost alwaysm.M- number of global rows (orPETSC_DETERMINEto have calculated ifmis given)N- number of global columns (orPETSC_DETERMINEto have calculated ifnis given)d_rlenmax- max number of nonzeros per row in DIAGONAL portion of local submatrix (same value is used for all local rows)d_rlen- array containing the number of nonzeros in the various rows of the DIAGONAL portion of the local submatrix (possibly different for each row) orNULL, if d_rlenmax is used to specify the nonzero structure. The size of this array is equal to the number of local rows, i.em.o_rlenmax- max number of nonzeros per row in the OFF-DIAGONAL portion of local submatrix (same value is used for all local rows).o_rlen- array containing the number of nonzeros in the various rows of the OFF-DIAGONAL portion of the local submatrix (possibly different for each row) orNULL, ifo_rlenmaxis used to specify the nonzero structure. The size of this array is equal to the number of local rows, i.em.
Output Parameter:
A- the matrix
Options Database Key:
-mat_sell_oneindex- Internally use indexing starting at 1
rather than 0. When calling MatSetValues(), the user still MUST index entries starting at 0!
Example: Consider the following 8x8 matrix with 34 non-zero values, that is assembled across 3 processors. Lets assume that proc0 owns 3 rows, proc1 owns 3 rows, proc2 owns 2 rows. This division can be shown as follows
-seealso: Mat, MATSELL, MatCreate(), MatCreateSeqSELL(), MatSetValues(), MatMPISELLSetPreallocation(), MATMPISELL
External Links
- PETSc Manual:
Mat/MatCreateSELL
PETSc.LibPETSc.MatCreateSNESMF — Method
J::PetscMat = MatCreateSNESMF(petsclib::PetscLibType,snes::PetscSNES)Creates a finite differencing based matrix a SNES solver. This matrix can be used as the Jacobian argument for the routine SNESSetJacobian(). See MatCreateMFFD() for details on how the finite difference computation is done.
Collective
Input Parameters:
snes- theSNEScontext
Output Parameter:
J- the matrix-free matrix which is of typeMATMFFD
Level: advanced
-seealso: , SNES, MATMFFD, MatDestroy(), MatMFFDSetFunction(), MatMFFDSetFunctionError(), MatMFFDDSSetUmin() MatMFFDSetHHistory(), MatMFFDResetHHistory(), MatCreateMFFD(), MatCreateShell(), MatMFFDGetH(), MatMFFDRegister(), MatMFFDComputeJacobian(), MatSNESMFSetReuseBase(), MatSNESMFGetReuseBase()
External Links
- PETSc Manual:
Snes/MatCreateSNESMF
PETSc.LibPETSc.MatCreateSNESMFMore — Method
J::PetscMat = MatCreateSNESMFMore(petsclib::PetscLibType,snes::PetscSNES, x::PetscVec)Creates a matrix context for use with a SNES solver that uses the More method to compute an optimal h based on the noise of the function. This matrix can be used as the Jacobian argument for the routine SNESSetJacobian().
Input Parameters:
snes- theSNEScontextx- vector whereSNESsolution is to be stored.
Output Parameter:
J- the matrix-free matrix
Options Database Keys:
-snes_mf_err <error_rel>- seeMatCreateSNESMF()-snes_mf_umin <umin>- seeMatCreateSNESMF()-snes_mf_compute_err- compute the square root or relative error in function-snes_mf_freq_err <freq>- set the frequency to recompute the parameters-snes_mf_jorge- use the method of Jorge More
Level: advanced
-seealso: , SNESCreateMF(), MatCreateMFFD(), MatDestroy(), MatMFFDSetFunctionError()
External Links
- PETSc Manual:
Snes/MatCreateSNESMFMore
PETSc.LibPETSc.MatCreateScaLAPACK — Method
A::PetscMat = MatCreateScaLAPACK(petsclib::PetscLibType,comm::MPI_Comm, mb::PetscInt, nb::PetscInt, M::PetscInt, N::PetscInt, rsrc::PetscInt, csrc::PetscInt)Creates a dense parallel matrix in ScaLAPACK format (2D block cyclic distribution) for a MATSCALAPACK matrix
Collective
Input Parameters:
comm- MPI communicatormb- row block size (orPETSC_DECIDEto have it set)nb- column block size (orPETSC_DECIDEto have it set)M- number of global rowsN- number of global columnsrsrc- coordinate of process that owns the first row of the distributed matrixcsrc- coordinate of process that owns the first column of the distributed matrix
Output Parameter:
A- the matrix
Options Database Key:
-mat_scalapack_block_sizes- size of the blocks to use (one or two integers separated by comma)
Level: intermediate
-seealso: , Mat, MATSCALAPACK, MATDENSE, MATELEMENTAL, MatCreate(), MatCreateDense(), MatSetValues()
External Links
- PETSc Manual:
Mat/MatCreateScaLAPACK
PETSc.LibPETSc.MatCreateScatter — Method
A::PetscMat = MatCreateScatter(petsclib::PetscLibType,comm::MPI_Comm, scatter::VecScatter)Creates a new matrix of MatType MATSCATTER, based on a VecScatter
Collective
Input Parameters:
comm- MPI communicatorscatter- aVecScatter
Output Parameter:
A- the matrix
Level: intermediate
-seealso: , Mat, MatScatterSetVecScatter(), MatScatterGetVecScatter(), MATSCATTER
External Links
- PETSc Manual:
Mat/MatCreateScatter
PETSc.LibPETSc.MatCreateSchurComplement — Method
S::PetscMat = MatCreateSchurComplement(petsclib::PetscLibType,A00::PetscMat, Ap00::PetscMat, A01::PetscMat, A10::PetscMat, A11::PetscMat)Creates a new Mat that behaves like the Schur complement of a matrix
Collective
Input Parameters:
A00- the upper-left block of the original matrix A = [A00 A01; A10 A11]Ap00- matrix from which the preconditioner is constructed for use in ksp(A00,Ap00) to approximate the action of A00^{-1}A01- the upper-right block of the original matrix A = [A00 A01; A10 A11]A10- the lower-left block of the original matrix A = [A00 A01; A10 A11]A11- (optional) the lower-right block of the original matrix A = [A00 A01; A10 A11]
Output Parameter:
S- the matrix that behaves as the Schur complement S = A11 - A10 ksp(A00,Ap00) A01
Level: intermediate
-seealso: , MatCreateNormal(), MatMult(), MatCreate(), MatSchurComplementGetKSP(), MatSchurComplementUpdateSubMatrices(), MatCreateTranspose(), MatGetSchurComplement(), MatSchurComplementGetPmat(), MatSchurComplementSetSubMatrices()
External Links
- PETSc Manual:
Ksp/MatCreateSchurComplement
PETSc.LibPETSc.MatCreateSchurComplementPmat — Method
Sp::PetscMat = MatCreateSchurComplementPmat(petsclib::PetscLibType,A00::PetscMat, A01::PetscMat, A10::PetscMat, A11::PetscMat, ainvtype::MatSchurComplementAinvType, preuse::MatReuse)create a matrix for preconditioning the Schur complement by explicitly assembling the sparse matrix Sp = A11 - A10 inv(DIAGFORM(A00)) A01
Collective
Input Parameters:
A00- the upper-left part of the original matrix A = [A00 A01; A10 A11]A01- (optional) the upper-right part of the original matrix A = [A00 A01; A10 A11]A10- (optional) the lower-left part of the original matrix A = [A00 A01; A10 A11]A11- (optional) the lower-right part of the original matrix A = [A00 A01; A10 A11]ainvtype- type of approximation for DIAGFORM(A00) used when forming Sp = A11 - A10 inv(DIAGFORM(A00)) A01. SeeMatSchurComplementAinvType.preuse-MAT_INITIAL_MATRIXfor a newSp, orMAT_REUSE_MATRIXto reuse an existingSp, orMAT_IGNORE_MATRIXto put nothing inSp
Output Parameter:
Sp- approximate Schur complement suitable for constructing a preconditioner for the true Schur complement S = A11 - A10 inv(A00) A01
Level: advanced
-seealso: , MatCreateSchurComplement(), MatGetSchurComplement(), MatSchurComplementGetPmat(), MatSchurComplementAinvType
External Links
- PETSc Manual:
Ksp/MatCreateSchurComplementPmat
PETSc.LibPETSc.MatCreateSeqAIJ — Method
A::PetscMat = MatCreateSeqAIJ(petsclib::PetscLibType,comm::MPI_Comm, m::PetscInt, n::PetscInt, nz::PetscInt, nnz::Vector{PetscInt})Creates a sparse matrix in MATSEQAIJ (compressed row) format (the default parallel PETSc format). For good matrix assembly performance the user should preallocate the matrix storage by setting the parameter nz (or the array nnz).
Collective
Input Parameters:
comm- MPI communicator, set toPETSC_COMM_SELFm- number of rowsn- number of columnsnz- number of nonzeros per row (same for all rows)nnz- array containing the number of nonzeros in the various rows
(possibly different for each row) or NULL
Output Parameter:
A- the matrix
Options Database Keys:
-mat_no_inode- Do not use inodes-mat_inode_limit <limit>- Sets inode limit (max limit=5)
Level: intermediate
-seealso: , Mat, Sparse Matrix Creation, MatCreate(), MatCreateAIJ(), MatSetValues(), MatSeqAIJSetColumnIndices(), MatCreateSeqAIJWithArrays()
External Links
- PETSc Manual:
Mat/MatCreateSeqAIJ
PETSc.LibPETSc.MatCreateSeqAIJCRL — Method
A::PetscMat = MatCreateSeqAIJCRL(petsclib::PetscLibType,comm::MPI_Comm, m::PetscInt, n::PetscInt, nz::PetscInt, nnz::Vector{PetscInt})Creates a sparse matrix of type MATSEQAIJCRL.
Collective
Input Parameters:
comm- MPI communicator, set toPETSC_COMM_SELFm- number of rowsn- number of columnsnz- number of nonzeros per row (same for all rows), ignored ifnnzis givennnz- array containing the number of nonzeros in the various rows
(possibly different for each row) or NULL
Output Parameter:
A- the matrix
Level: intermediate
-seealso: , Mat, MatCreate(), MatCreateMPIAIJPERM(), MatSetValues()
External Links
- PETSc Manual:
Mat/MatCreateSeqAIJCRL
PETSc.LibPETSc.MatCreateSeqAIJFromTriple — Method
mat::PetscMat = MatCreateSeqAIJFromTriple(petsclib::PetscLibType,comm::MPI_Comm, m::PetscInt, n::PetscInt, i::Vector{PetscInt}, j::Vector{PetscInt}, a::Vector{PetscScalar}, nz::PetscCount, idx::PetscBool)Creates an sequential MATSEQAIJ matrix using matrix elements (in COO format) provided by the user.
Collective
Input Parameters:
comm- must be an MPI communicator of size 1m- number of rowsn- number of columnsi- row indicesj- column indicesa- matrix valuesnz- number of nonzerosidx- if theiandjindices start with 1 usePETSC_TRUEotherwise usePETSC_FALSE
Output Parameter:
mat- the matrix
Level: intermediate
Example: For the following matrix, the input data expected is as shown (using 0 based indexing) -seealso: , Mat, MatCreate(), MatCreateAIJ(), MatCreateSeqAIJ(), MatCreateSeqAIJWithArrays(), MatMPIAIJSetPreallocationCSR(), MatSetValuesCOO(), MatSetPreallocationCOO()
External Links
- PETSc Manual:
Mat/MatCreateSeqAIJFromTriple
PETSc.LibPETSc.MatCreateSeqAIJKokkos — Method
A::PetscMat = MatCreateSeqAIJKokkos(petsclib::PetscLibType,comm::MPI_Comm, m::PetscInt, n::PetscInt, nz::PetscInt, nnz::Vector{PetscInt})External Links
- PETSc Manual:
Mat/MatCreateSeqAIJKokkos
PETSc.LibPETSc.MatCreateSeqAIJMKL — Method
A::PetscMat = MatCreateSeqAIJMKL(petsclib::PetscLibType,comm::MPI_Comm, m::PetscInt, n::PetscInt, nz::PetscInt, nnz::Vector{PetscInt})Creates a sparse matrix of type MATSEQAIJMKL.
Collective
Input Parameters:
comm- MPI communicator, set toPETSC_COMM_SELFm- number of rowsn- number of columnsnz- number of nonzeros per row (same for all rows)nnz- array containing the number of nonzeros in the various rows
(possibly different for each row) or NULL
Output Parameter:
A- the matrix
Options Database Keys:
-mat_aijmkl_no_spmv2- disable use of the SpMV2 inspector-executor routines-mat_aijmkl_eager_inspection- perform MKL "inspection" phase upon matrix assembly; default is to do "lazy" inspection,
performing this step the first time the matrix is applied
Level: intermediate
-seealso: , Mat, MatCreate(), MatCreateMPIAIJMKL(), MatSetValues()
External Links
- PETSc Manual:
Mat/MatCreateSeqAIJMKL
PETSc.LibPETSc.MatCreateSeqAIJPERM — Method
A::PetscMat = MatCreateSeqAIJPERM(petsclib::PetscLibType,comm::MPI_Comm, m::PetscInt, n::PetscInt, nz::PetscInt, nnz::Vector{PetscInt})Creates a sparse matrix of type MATSEQAIJPERM.
Collective
Input Parameters:
comm- MPI communicator, set toPETSC_COMM_SELFm- number of rowsn- number of columnsnz- number of nonzeros per row (same for all rows), ignored ifnnzis givennnz- array containing the number of nonzeros in the various rows (possibly different for each row) orNULL
Output Parameter:
A- the matrix
Level: intermediate
-seealso: , Mat, MatCreate(), MatCreateMPIAIJPERM(), MatSetValues()
External Links
- PETSc Manual:
Mat/MatCreateSeqAIJPERM
PETSc.LibPETSc.MatCreateSeqAIJSELL — Method
A::PetscMat = MatCreateSeqAIJSELL(petsclib::PetscLibType,comm::MPI_Comm, m::PetscInt, n::PetscInt, nz::PetscInt, nnz::Vector{PetscInt})Creates a sparse matrix of type MATSEQAIJSELL.
Collective
Input Parameters:
comm- MPI communicator, set toPETSC_COMM_SELFm- number of rowsn- number of columnsnz- number of nonzeros per row (same for all rows)nnz- array containing the number of nonzeros in the various rows
(possibly different for each row) or NULL
Output Parameter:
A- the matrix
Options Database Keys:
-mat_aijsell_eager_shadow- Construct shadow matrix upon matrix assembly; default is to take a "lazy" approach,
performing this step the first time the matrix is applied
Level: intermediate
-seealso: , Mat, MatCreate(), MatCreateMPIAIJSELL(), MatSetValues()
External Links
- PETSc Manual:
Mat/MatCreateSeqAIJSELL
PETSc.LibPETSc.MatCreateSeqAIJViennaCL — Method
A::PetscMat = MatCreateSeqAIJViennaCL(petsclib::PetscLibType,comm::MPI_Comm, m::PetscInt, n::PetscInt, nz::PetscInt, nnz::Vector{PetscInt})External Links
- PETSc Manual:
Mat/MatCreateSeqAIJViennaCL
PETSc.LibPETSc.MatCreateSeqAIJWithArrays — Method
mat::PetscMat = MatCreateSeqAIJWithArrays(petsclib::PetscLibType,comm::MPI_Comm, m::PetscInt, n::PetscInt, i::Vector{PetscInt}, j::Vector{PetscInt}, a::Vector{PetscScalar})Creates an sequential MATSEQAIJ matrix using matrix elements (in CSR format) provided by the user.
Collective
Input Parameters:
comm- must be an MPI communicator of size 1m- number of rowsn- number of columnsi- row indices; that is i[0] = 0, i[row] = i[row-1] + number of elements in that row of the matrixj- column indicesa- matrix values
Output Parameter:
mat- the matrix
Level: intermediate
-seealso: , Mat, MatCreate(), MatCreateAIJ(), MatCreateSeqAIJ(), MatCreateMPIAIJWithArrays(), MatMPIAIJSetPreallocationCSR()
External Links
- PETSc Manual:
Mat/MatCreateSeqAIJWithArrays
PETSc.LibPETSc.MatCreateSeqBAIJ — Method
A::PetscMat = MatCreateSeqBAIJ(petsclib::PetscLibType,comm::MPI_Comm, bs::PetscInt, m::PetscInt, n::PetscInt, nz::PetscInt, nnz::Vector{PetscInt})Creates a sparse matrix in MATSEQAIJ (block compressed row) format. For good matrix assembly performance the user should preallocate the matrix storage by setting the parameter nz (or the array nnz).
Collective
Input Parameters:
comm- MPI communicator, set toPETSC_COMM_SELFbs- size of block, the blocks are ALWAYS square. One can useMatSetBlockSizes()to set a different row and column blocksize but the row
blocksize always defines the size of the blocks. The column blocksize sets the blocksize of the vectors obtained with MatCreateVecs()
m- number of rowsn- number of columnsnz- number of nonzero blocks per block row (same for all rows)nnz- array containing the number of nonzero blocks in the various block rows
(possibly different for each block row) or NULL
Output Parameter:
A- the matrix
Options Database Keys:
-mat_no_unroll- uses code that does not unroll the loops in the block calculations (much slower)-mat_block_size- size of the blocks to use
Level: intermediate
-seealso: , Mat, Sparse Matrices, MatCreate(), MatCreateSeqAIJ(), MatSetValues(), MatCreateBAIJ()
External Links
- PETSc Manual:
Mat/MatCreateSeqBAIJ
PETSc.LibPETSc.MatCreateSeqBAIJMKL — Method
A::PetscMat = MatCreateSeqBAIJMKL(petsclib::PetscLibType,comm::MPI_Comm, bs::PetscInt, m::PetscInt, n::PetscInt, nz::PetscInt, nnz::Vector{PetscInt})Creates a sparse matrix of type MATSEQBAIJMKL. This type inherits from MATSEQBAIJ and is largely identical, but uses sparse BLAS routines from Intel MKL whenever possible.
Input Parameters:
comm- MPI communicator, set toPETSC_COMM_SELFbs- size of block, the blocks are ALWAYS square. One can useMatSetBlockSizes()to set a different row and column blocksize but the row blocksize always defines the size of the blocks. The column blocksize sets the blocksize of the vectors obtained withMatCreateVecs()m- number of rowsn- number of columnsnz- number of nonzero blocks per block row (same for all rows)nnz- array containing the number of nonzero blocks in the various block rows (possibly different for each block row) orNULL
Output Parameter:
A- the matrix
It is recommended that one use the MatCreate(), MatSetType() and/or MatSetFromOptions(), MatXXXXSetPreallocation() paradigm instead of this routine directly. [MatXXXXSetPreallocation() is, for example, MatSeqBAIJSetPreallocation()]
Options Database Keys:
-mat_no_unroll- uses code that does not unroll the loops in the block calculations (much slower)-mat_block_size- size of the blocks to use
Level: intermediate
-seealso: Sparse Matrices, MatCreate(), MatCreateSeqAIJ(), MatSetValues(), MatCreateBAIJ()
External Links
- PETSc Manual:
Mat/MatCreateSeqBAIJMKL
PETSc.LibPETSc.MatCreateSeqBAIJWithArrays — Method
mat::PetscMat = MatCreateSeqBAIJWithArrays(petsclib::PetscLibType,comm::MPI_Comm, bs::PetscInt, m::PetscInt, n::PetscInt, i::Vector{PetscInt}, j::Vector{PetscInt}, a::Vector{PetscScalar})Creates a MATSEQBAIJ matrix using matrix elements provided by the user.
Collective
Input Parameters:
comm- must be an MPI communicator of size 1bs- size of blockm- number of rowsn- number of columnsi- row indices; that is i[0] = 0, i[row] = i[row-1] + number of elements in that row block row of the matrixj- column indicesa- matrix values
Output Parameter:
mat- the matrix
Level: advanced
-seealso: , Mat, MatCreate(), MatCreateBAIJ(), MatCreateSeqBAIJ()
External Links
- PETSc Manual:
Mat/MatCreateSeqBAIJWithArrays
PETSc.LibPETSc.MatCreateSeqDense — Method
A::PetscMat = MatCreateSeqDense(petsclib::PetscLibType,comm::MPI_Comm, m::PetscInt, n::PetscInt, data::Vector{PetscScalar})Creates a MATSEQDENSE that is stored in column major order (the usual Fortran format).
Collective
Input Parameters:
comm- MPI communicator, set toPETSC_COMM_SELFm- number of rowsn- number of columnsdata- optional location of matrix data in column major order. UseNULLfor PETSc to control all matrix memory allocation.
Output Parameter:
A- the matrix
Level: intermediate
-seealso: , Mat, MATSEQDENSE, MatCreate(), MatCreateDense(), MatSetValues()
External Links
- PETSc Manual:
Mat/MatCreateSeqDense
PETSc.LibPETSc.MatCreateSeqSBAIJ — Method
A::PetscMat = MatCreateSeqSBAIJ(petsclib::PetscLibType,comm::MPI_Comm, bs::PetscInt, m::PetscInt, n::PetscInt, nz::PetscInt, nnz::Vector{PetscInt})Creates a sparse symmetric matrix in (block compressed row) MATSEQSBAIJ format. For good matrix assembly performance the user should preallocate the matrix storage by setting the parameter nz (or the array nnz).
Collective
Input Parameters:
comm- MPI communicator, set toPETSC_COMM_SELFbs- size of block, the blocks are ALWAYS square. One can useMatSetBlockSizes()to set a different row and column blocksize but the row blocksize always defines the size of the blocks. The column blocksize sets the blocksize of the vectors obtained with MatCreateVecs()m- number of rowsn- number of columnsnz- number of block nonzeros per block row (same for all rows)nnz- array containing the number of block nonzeros in the upper triangular plus diagonal portion of each block (possibly different for each block row) orNULL
Output Parameter:
A- the symmetric matrix
Options Database Keys:
-mat_no_unroll- uses code that does not unroll the loops in the block calculations (much slower)-mat_block_size- size of the blocks to use
Level: intermediate
-seealso: , Mat, Sparse Matrices, MATSEQSBAIJ, MatCreate(), MatCreateSeqAIJ(), MatSetValues(), MatCreateSBAIJ()
External Links
- PETSc Manual:
Mat/MatCreateSeqSBAIJ
PETSc.LibPETSc.MatCreateSeqSBAIJWithArrays — Method
mat::PetscMat = MatCreateSeqSBAIJWithArrays(petsclib::PetscLibType,comm::MPI_Comm, bs::PetscInt, m::PetscInt, n::PetscInt, i::Vector{PetscInt}, j::Vector{PetscInt}, a::Vector{PetscScalar})Creates an sequential MATSEQSBAIJ matrix using matrix elements (upper triangular entries in CSR format) provided by the user.
Collective
Input Parameters:
comm- must be an MPI communicator of size 1bs- size of blockm- number of rowsn- number of columnsi- row indices; that is i[0] = 0, i[row] = i[row-1] + number of block elements in that row block row of the matrixj- column indicesa- matrix values
Output Parameter:
mat- the matrix
Level: advanced
-seealso: , Mat, MATSEQSBAIJ, MatCreate(), MatCreateSBAIJ(), MatCreateSeqSBAIJ()
External Links
- PETSc Manual:
Mat/MatCreateSeqSBAIJWithArrays
PETSc.LibPETSc.MatCreateSeqSELL — Method
A::PetscMat = MatCreateSeqSELL(petsclib::PetscLibType,comm::MPI_Comm, m::PetscInt, n::PetscInt, rlenmax::PetscInt, rlen::Union{Ptr,Vector{PetscInt}})Creates a sparse matrix in MATSEQSELL format.
Collective
Input Parameters:
comm- MPI communicator, set toPETSC_COMM_SELFm- number of rowsn- number of columnsrlenmax- maximum number of nonzeros in a row, ignored ifrlenis providedrlen- array containing the number of nonzeros in the various rows (possibly different for each row) or NULL
Output Parameter:
A- the matrix
Level: intermediate
-seealso: Mat, MATSEQSELL, MatCreate(), MatCreateSELL(), MatSetValues(), MatSeqSELLSetPreallocation(), MATSELL, MATMPISELL
External Links
- PETSc Manual:
Mat/MatCreateSeqSELL
PETSc.LibPETSc.MatCreateShell — Method
A::PetscMat = MatCreateShell(petsclib::PetscLibType,comm::MPI_Comm, m::PetscInt, n::PetscInt, M::PetscInt, N::PetscInt, ctx::Ptr)Creates a new matrix of MatType MATSHELL for use with a user private matrix data storage format.
Collective
Input Parameters:
comm- MPI communicatorm- number of local rows (orPETSC_DECIDEto have calculated ifMis given)n- number of local columns (orPETSC_DECIDEto have calculated ifNis given)M- number of global rows (may bePETSC_DETERMINEto have calculated ifmis given)N- number of global columns (may bePETSC_DETERMINEto have calculated ifnis given)ctx- pointer to data needed by the shell matrix routines
Output Parameter:
A- the matrix
Level: advanced
-seealso: , Mat, MATSHELL, MatShellSetOperation(), MatHasOperation(), MatShellGetContext(), MatShellSetContext(), MatShellSetManageScalingShifts(), MatShellSetMatProductOperation()
External Links
- PETSc Manual:
Mat/MatCreateShell
PETSc.LibPETSc.MatCreateSubMatrices — Method
submat::Vector{PetscMat} = MatCreateSubMatrices(petsclib::PetscLibType,mat::PetscMat, n::PetscInt, irow::Vector{IS}, icol::Vector{IS}, scall::MatReuse)Extracts several submatrices from a matrix. If submat points to an array of valid matrices, they may be reused to store the new submatrices.
Collective
Input Parameters:
mat- the matrixn- the number of submatrixes to be extracted (on this processor, may be zero)irow- index set of rows to extracticol- index set of columns to extractscall- eitherMAT_INITIAL_MATRIXorMAT_REUSE_MATRIX
Output Parameter:
submat- the array of submatrices
Level: advanced
-seealso: , Mat, MatDestroySubMatrices(), MatCreateSubMatrix(), MatGetRow(), MatGetDiagonal(), MatReuse
External Links
- PETSc Manual:
Mat/MatCreateSubMatrices
PETSc.LibPETSc.MatCreateSubMatricesMPI — Method
submat::Vector{PetscMat} = MatCreateSubMatricesMPI(petsclib::PetscLibType,mat::PetscMat, n::PetscInt, irow::Vector{IS}, icol::Vector{IS}, scall::MatReuse)Extracts MPI submatrices across a sub communicator of mat (by pairs of IS that may live on subcomms).
Collective
Input Parameters:
mat- the matrixn- the number of submatrixes to be extractedirow- index set of rows to extracticol- index set of columns to extractscall- eitherMAT_INITIAL_MATRIXorMAT_REUSE_MATRIX
Output Parameter:
submat- the array of submatrices
Level: advanced
-seealso: , Mat, PCGASM, MatCreateSubMatrices(), MatCreateSubMatrix(), MatGetRow(), MatGetDiagonal(), MatReuse
External Links
- PETSc Manual:
Mat/MatCreateSubMatricesMPI
PETSc.LibPETSc.MatCreateSubMatrix — Method
newmat::PetscMat = MatCreateSubMatrix(petsclib::PetscLibType,mat::PetscMat, isrow::IS, iscol::IS, cll::MatReuse)Gets a single submatrix on the same number of processors as the original matrix.
Collective
Input Parameters:
mat- the original matrixisrow- parallelIScontaining the rows this processor should obtainiscol- parallelIScontaining all columns you wish to keep. Each process should list the columns that will be in IT's "diagonal part" in the new matrix.cll- eitherMAT_INITIAL_MATRIXorMAT_REUSE_MATRIX
Output Parameter:
newmat- the new submatrix, of the same type as the original matrix
Level: advanced
-seealso: , Mat, MatCreateSubMatrices(), MatCreateSubMatricesMPI(), MatCreateSubMatrixVirtual(), MatSubMatrixVirtualUpdate()
External Links
- PETSc Manual:
Mat/MatCreateSubMatrix
PETSc.LibPETSc.MatCreateSubMatrixFree — Method
J::PetscMat = MatCreateSubMatrixFree(petsclib::PetscLibType,mat::PetscMat, Rows::IS, Cols::IS)Creates a reduced matrix by masking a full matrix.
Collective
Input Parameters:
mat- matrix of arbitrary typeRows- the rows that will be in the submatrixCols- the columns that will be in the submatrix
Output Parameter:
J- New matrix
Level: developer
-seealso: MatCreate()
External Links
- PETSc Manual:
Tao/MatCreateSubMatrixFree
PETSc.LibPETSc.MatCreateSubMatrixVirtual — Method
newmat::PetscMat = MatCreateSubMatrixVirtual(petsclib::PetscLibType,A::PetscMat, isrow::IS, iscol::IS)Creates a virtual matrix MATSUBMATRIX that acts as a submatrix
Collective
Input Parameters:
A- matrix that we will extract a submatrix ofisrow- rows to be present in the submatrixiscol- columns to be present in the submatrix
Output Parameter:
newmat- new matrix
Level: developer
-seealso: , Mat, MATSUBMATRIX, MATLOCALREF, MatCreateLocalRef(), MatCreateSubMatrix(), MatSubMatrixVirtualUpdate()
External Links
- PETSc Manual:
Mat/MatCreateSubMatrixVirtual
PETSc.LibPETSc.MatCreateTranspose — Method
N::PetscMat = MatCreateTranspose(petsclib::PetscLibType,A::PetscMat)Creates a new matrix MATTRANSPOSEVIRTUAL object that behaves like A'
Collective
Input Parameter:
A- the (possibly rectangular) matrix
Output Parameter:
N- the matrix that represents A'
Level: intermediate
-seealso: , Mat, MATTRANSPOSEVIRTUAL, MatCreateNormal(), MatMult(), MatMultTranspose(), MatCreate(), MATNORMALHERMITIAN
External Links
- PETSc Manual:
Mat/MatCreateTranspose
PETSc.LibPETSc.MatCreateVecs — Method
right::PetscVec,left::PetscVec = MatCreateVecs(petsclib::PetscLibType,mat::PetscMat)Get vector(s) compatible with the matrix, i.e. with the same parallel layout, PetscLayout for rows and columns
Collective
Input Parameter:
mat- the matrix
Output Parameters:
right- (optional) vector that the matrix can be multiplied againstleft- (optional) vector that the matrix vector product can be stored in
Level: advanced
-seealso: , Mat, Vec, VecCreate(), VecDestroy(), DMCreateGlobalVector()
External Links
- PETSc Manual:
Mat/MatCreateVecs
PETSc.LibPETSc.MatCreateVecsFFTW — Method
x::PetscVec,y::PetscVec,z::PetscVec = MatCreateVecsFFTW(petsclib::PetscLibType,A::PetscMat)Get vector(s) compatible with the matrix, i.e. with the parallel layout determined by MATFFTW
Collective
Input Parameter:
A- the matrix
Output Parameters:
x- (optional) input vector of forward FFTWy- (optional) output vector of forward FFTWz- (optional) output vector of backward FFTW
Options Database Key:
-mat_fftw_plannerflags- set FFTW planner flags
Level: advanced
-seealso: , Mat, MATFFTW, MatCreateFFT(), MatCreateVecs()
External Links
- PETSc Manual:
Mat/MatCreateVecsFFTW
PETSc.LibPETSc.MatDFischer — Method
MatDFischer(petsclib::PetscLibType,jac::PetscMat, X::PetscVec, Con::PetscVec, XL::PetscVec, XU::PetscVec, T1::PetscVec, T2::PetscVec, Da::PetscVec, Db::PetscVec)Calculates an element of the B Fischer-Burmeister function for complementarity problems.
Collective
Input Parameters:
jac- the jacobian offatXX- current pointCon- constraints function evaluated atXXL- lower boundsXU- upper boundsT1- work vectorT2- work vector
Output Parameters:
Da- diagonal perturbation component of the resultDb- row scaling component of the result
Level: developer
-seealso: Mat, VecFischer(), VecSFischer(), MatDSFischer()
External Links
- PETSc Manual:
Tao/MatDFischer
PETSc.LibPETSc.MatDSFischer — Method
MatDSFischer(petsclib::PetscLibType,jac::PetscMat, X::PetscVec, Con::PetscVec, XL::PetscVec, XU::PetscVec, mu::PetscReal, T1::PetscVec, T2::PetscVec, Da::PetscVec, Db::PetscVec, Dm::PetscVec)Calculates an element of the B smoothed Fischer-Burmeister function for complementarity problems.
Collective
Input Parameters:
jac- the jacobian of f at XX- current pointCon- constraint function evaluated at XXL- lower boundsXU- upper boundsmu- smoothing parameterT1- work vectorT2- work vector
Output Parameters:
Da- diagonal perturbation component of the resultDb- row scaling component of the resultDm- derivative with respect to scaling parameter
Level: developer
-seealso: Mat, VecFischer(), VecDFischer(), MatDFischer()
External Links
- PETSc Manual:
Tao/MatDSFischer
PETSc.LibPETSc.MatDenseGetArray — Method
array::Vector{PetscScalar} = MatDenseGetArray(petsclib::PetscLibType,A::PetscMat)gives read
Logically Collective
Input Parameter:
A- a dense matrix
Output Parameter:
array- pointer to the data
Level: intermediate
-seealso: , Mat, MATDENSE, MatDenseRestoreArray(), MatDenseGetArrayRead(), MatDenseRestoreArrayRead(), MatDenseGetArrayWrite(), MatDenseRestoreArrayWrite()
External Links
- PETSc Manual:
Mat/MatDenseGetArray
PETSc.LibPETSc.MatDenseGetArrayAndMemType — Method
array::Vector{PetscScalar},mtype::PetscMemType = MatDenseGetArrayAndMemType(petsclib::PetscLibType,A::PetscMat)gives read
Logically Collective
Input Parameter:
A- a dense matrix
Output Parameters:
array- pointer to the datamtype- memory type of the returned pointer
Level: intermediate
-seealso: , Mat, MATDENSE, MatDenseRestoreArrayAndMemType(), MatDenseGetArrayReadAndMemType(), MatDenseGetArrayWriteAndMemType(), MatDenseGetArrayRead(), MatDenseRestoreArrayRead(), MatDenseGetArrayWrite(), MatDenseRestoreArrayWrite(), MatSeqAIJGetCSRAndMemType()
External Links
- PETSc Manual:
Mat/MatDenseGetArrayAndMemType
PETSc.LibPETSc.MatDenseGetArrayRead — Method
array::Vector{PetscScalar} = MatDenseGetArrayRead(petsclib::PetscLibType,A::PetscMat)gives read
Not Collective
Input Parameter:
A- a dense matrix
Output Parameter:
array- pointer to the data
Level: intermediate
-seealso: , Mat, MATDENSE, MatDenseRestoreArrayRead(), MatDenseGetArray(), MatDenseRestoreArray(), MatDenseGetArrayWrite(), MatDenseRestoreArrayWrite()
External Links
- PETSc Manual:
Mat/MatDenseGetArrayRead
PETSc.LibPETSc.MatDenseGetArrayReadAndMemType — Method
array::Vector{PetscScalar},mtype::PetscMemType = MatDenseGetArrayReadAndMemType(petsclib::PetscLibType,A::PetscMat)gives read
Logically Collective
Input Parameter:
A- a dense matrix
Output Parameters:
array- pointer to the datamtype- memory type of the returned pointer
Level: intermediate
-seealso: , Mat, MATDENSE, MatDenseRestoreArrayReadAndMemType(), MatDenseGetArrayWriteAndMemType(), MatDenseGetArrayRead(), MatDenseRestoreArrayRead(), MatDenseGetArrayWrite(), MatDenseRestoreArrayWrite(), MatSeqAIJGetCSRAndMemType()
External Links
- PETSc Manual:
Mat/MatDenseGetArrayReadAndMemType
PETSc.LibPETSc.MatDenseGetArrayWrite — Method
array::Vector{PetscScalar} = MatDenseGetArrayWrite(petsclib::PetscLibType,A::PetscMat)gives write
Not Collective
Input Parameter:
A- a dense matrix
Output Parameter:
array- pointer to the data
Level: intermediate
-seealso: , Mat, MATDENSE, MatDenseRestoreArrayWrite(), MatDenseGetArray(), MatDenseRestoreArray(), MatDenseGetArrayRead(), MatDenseRestoreArrayRead()
External Links
- PETSc Manual:
Mat/MatDenseGetArrayWrite
PETSc.LibPETSc.MatDenseGetArrayWriteAndMemType — Method
array::Vector{PetscScalar},mtype::PetscMemType = MatDenseGetArrayWriteAndMemType(petsclib::PetscLibType,A::PetscMat)gives write
Logically Collective
Input Parameter:
A- a dense matrix
Output Parameters:
array- pointer to the datamtype- memory type of the returned pointer
Level: intermediate
-seealso: , Mat, MATDENSE, MatDenseRestoreArrayWriteAndMemType(), MatDenseGetArrayReadAndMemType(), MatDenseGetArrayRead(), MatDenseRestoreArrayRead(), MatDenseGetArrayWrite(), MatDenseRestoreArrayWrite(), MatSeqAIJGetCSRAndMemType()
External Links
- PETSc Manual:
Mat/MatDenseGetArrayWriteAndMemType
PETSc.LibPETSc.MatDenseGetColumn — Method
vals::Vector{PetscScalar} = MatDenseGetColumn(petsclib::PetscLibType,A::PetscMat, col::PetscInt)gives access to a column of a dense matrix. This is only the local part of the column. You MUST call MatDenseRestoreColumn() to avoid memory bleeding.
Not Collective
Input Parameters:
A- aMATSEQDENSEorMATMPIDENSEmatrixcol- column index
Output Parameter:
vals- pointer to the data
Level: intermediate
-seealso: , Mat, MATDENSE, MatDenseRestoreColumn(), MatDenseGetColumnVec()
External Links
- PETSc Manual:
Mat/MatDenseGetColumn
PETSc.LibPETSc.MatDenseGetColumnVec — Method
MatDenseGetColumnVec(petsclib::PetscLibType,A::PetscMat, col::PetscInt, v::PetscVec)Gives read
Collective
Input Parameters:
A- theMatobjectcol- the column index
Output Parameter:
v- the vector
Level: intermediate
-seealso: , Mat, MATDENSE, MATDENSECUDA, MATDENSEHIP, MatDenseGetColumnVecRead(), MatDenseGetColumnVecWrite(), MatDenseRestoreColumnVec(), MatDenseRestoreColumnVecRead(), MatDenseRestoreColumnVecWrite(), MatDenseGetColumn()
External Links
- PETSc Manual:
Mat/MatDenseGetColumnVec
PETSc.LibPETSc.MatDenseGetColumnVecRead — Method
MatDenseGetColumnVecRead(petsclib::PetscLibType,A::PetscMat, col::PetscInt, v::PetscVec)Gives read
Collective
Input Parameters:
A- theMatobjectcol- the column index
Output Parameter:
v- the vector
Level: intermediate
-seealso: , Mat, MATDENSE, MATDENSECUDA, MATDENSEHIP, MatDenseGetColumnVec(), MatDenseGetColumnVecWrite(), MatDenseRestoreColumnVec(), MatDenseRestoreColumnVecRead(), MatDenseRestoreColumnVecWrite()
External Links
- PETSc Manual:
Mat/MatDenseGetColumnVecRead
PETSc.LibPETSc.MatDenseGetColumnVecWrite — Method
MatDenseGetColumnVecWrite(petsclib::PetscLibType,A::PetscMat, col::PetscInt, v::PetscVec)Gives write
Collective
Input Parameters:
A- theMatobjectcol- the column index
Output Parameter:
v- the vector
Level: intermediate
-seealso: , Mat, MATDENSE, MATDENSECUDA, MATDENSEHIP, MatDenseGetColumnVec(), MatDenseGetColumnVecRead(), MatDenseRestoreColumnVec(), MatDenseRestoreColumnVecRead(), MatDenseRestoreColumnVecWrite()
External Links
- PETSc Manual:
Mat/MatDenseGetColumnVecWrite
PETSc.LibPETSc.MatDenseGetLDA — Method
lda::PetscInt = MatDenseGetLDA(petsclib::PetscLibType,A::PetscMat)gets the leading dimension of the array returned from MatDenseGetArray()
Not Collective
Input Parameter:
A- aMATDENSEorMATDENSECUDAmatrix
Output Parameter:
lda- the leading dimension
Level: intermediate
-seealso: , Mat, MATDENSE, MATDENSECUDA, MatDenseGetArray(), MatDenseRestoreArray(), MatDenseGetArrayRead(), MatDenseRestoreArrayRead(), MatDenseSetLDA()
External Links
- PETSc Manual:
Mat/MatDenseGetLDA
PETSc.LibPETSc.MatDenseGetLocalMatrix — Method
MatDenseGetLocalMatrix(petsclib::PetscLibType,A::PetscMat, B::PetscMat)For a MATMPIDENSE or MATSEQDENSE matrix returns the sequential matrix that represents the operator. For sequential matrices it returns itself.
Input Parameter:
A- the sequential or MPIMATDENSEmatrix
Output Parameter:
B- the inner matrix
Level: intermediate
-seealso: , Mat, MATDENSE, MATMPIDENSE, MATSEQDENSE
External Links
- PETSc Manual:
Mat/MatDenseGetLocalMatrix
PETSc.LibPETSc.MatDenseGetSubMatrix — Method
MatDenseGetSubMatrix(petsclib::PetscLibType,A::PetscMat, rbegin::PetscInt, rend::PetscInt, cbegin::PetscInt, cend::PetscInt, v::PetscMat)Gives access to a block of rows and columns of a dense matrix, represented as a Mat.
Collective
Input Parameters:
A- theMatobjectrbegin- the first global row index in the block (ifPETSC_DECIDE, is 0)rend- the global row index past the last one in the block (ifPETSC_DECIDE, isM)cbegin- the first global column index in the block (ifPETSC_DECIDE, is 0)cend- the global column index past the last one in the block (ifPETSC_DECIDE, isN)
Output Parameter:
v- the matrix
Level: intermediate
-seealso: , Mat, MATDENSE, MATDENSECUDA, MATDENSEHIP, MatDenseGetColumnVec(), MatDenseRestoreColumnVec(), MatDenseRestoreSubMatrix()
External Links
- PETSc Manual:
Mat/MatDenseGetSubMatrix
PETSc.LibPETSc.MatDensePlaceArray — Method
array::PetscScalar = MatDensePlaceArray(petsclib::PetscLibType,mat::PetscMat)Allows one to replace the array in a MATDENSE matrix with an array provided by the user. This is useful to avoid copying an array into a matrix
Not Collective
Input Parameters:
mat- the matrixarray- the array in column major order
Level: developer
-seealso: , Mat, MATDENSE, MatDenseGetArray(), MatDenseResetArray(), VecPlaceArray(), VecGetArray(), VecRestoreArray(), VecReplaceArray(), VecResetArray(), MatDenseReplaceArray()
External Links
- PETSc Manual:
Mat/MatDensePlaceArray
PETSc.LibPETSc.MatDenseReplaceArray — Method
array::PetscScalar = MatDenseReplaceArray(petsclib::PetscLibType,mat::PetscMat)Allows one to replace the array in a dense matrix with an array provided by the user. This is useful to avoid copying an array into a matrix
Not Collective
Input Parameters:
mat- the matrixarray- the array in column major order
Level: developer
-seealso: , Mat, MatDensePlaceArray(), MatDenseGetArray(), VecReplaceArray()
External Links
- PETSc Manual:
Mat/MatDenseReplaceArray
PETSc.LibPETSc.MatDenseResetArray — Method
MatDenseResetArray(petsclib::PetscLibType,mat::PetscMat)Resets the matrix array to that it previously had before the call to MatDensePlaceArray()
Not Collective
Input Parameter:
mat- the matrix
Level: developer
-seealso: , Mat, MATDENSE, MatDenseGetArray(), MatDensePlaceArray(), VecPlaceArray(), VecGetArray(), VecRestoreArray(), VecReplaceArray(), VecResetArray()
External Links
- PETSc Manual:
Mat/MatDenseResetArray
PETSc.LibPETSc.MatDenseRestoreArray — Method
array::Vector{PetscScalar} = MatDenseRestoreArray(petsclib::PetscLibType,A::PetscMat)returns access to the array where the data for a MATDENSE matrix is stored obtained by MatDenseGetArray()
Logically Collective
Input Parameters:
A- a dense matrixarray- pointer to the data (may beNULL)
Level: intermediate
-seealso: , Mat, MATDENSE, MatDenseGetArray(), MatDenseGetArrayRead(), MatDenseRestoreArrayRead(), MatDenseGetArrayWrite(), MatDenseRestoreArrayWrite()
External Links
- PETSc Manual:
Mat/MatDenseRestoreArray
PETSc.LibPETSc.MatDenseRestoreArrayAndMemType — Method
array::Vector{PetscScalar} = MatDenseRestoreArrayAndMemType(petsclib::PetscLibType,A::PetscMat)returns access to the array that is obtained by MatDenseGetArrayAndMemType()
Logically Collective
Input Parameters:
A- a dense matrixarray- pointer to the data
Level: intermediate
-seealso: , Mat, MATDENSE, MatDenseGetArrayAndMemType(), MatDenseGetArray(), MatDenseGetArrayRead(), MatDenseRestoreArrayRead(), MatDenseGetArrayWrite(), MatDenseRestoreArrayWrite()
External Links
- PETSc Manual:
Mat/MatDenseRestoreArrayAndMemType
PETSc.LibPETSc.MatDenseRestoreArrayRead — Method
array::Vector{PetscScalar} = MatDenseRestoreArrayRead(petsclib::PetscLibType,A::PetscMat)returns access to the array where the data for a MATDENSE matrix is stored obtained by MatDenseGetArrayRead()
Not Collective
Input Parameters:
A- a dense matrixarray- pointer to the data (may beNULL)
Level: intermediate
-seealso: , Mat, MATDENSE, MatDenseGetArrayRead(), MatDenseGetArray(), MatDenseRestoreArray(), MatDenseGetArrayWrite(), MatDenseRestoreArrayWrite()
External Links
- PETSc Manual:
Mat/MatDenseRestoreArrayRead
PETSc.LibPETSc.MatDenseRestoreArrayReadAndMemType — Method
array::Vector{PetscScalar} = MatDenseRestoreArrayReadAndMemType(petsclib::PetscLibType,A::PetscMat)returns access to the array that is obtained by MatDenseGetArrayReadAndMemType()
Logically Collective
Input Parameters:
A- a dense matrixarray- pointer to the data
Level: intermediate
-seealso: , Mat, MATDENSE, MatDenseGetArrayReadAndMemType(), MatDenseGetArray(), MatDenseGetArrayRead(), MatDenseRestoreArrayRead(), MatDenseGetArrayWrite(), MatDenseRestoreArrayWrite()
External Links
- PETSc Manual:
Mat/MatDenseRestoreArrayReadAndMemType
PETSc.LibPETSc.MatDenseRestoreArrayWrite — Method
array::Vector{PetscScalar} = MatDenseRestoreArrayWrite(petsclib::PetscLibType,A::PetscMat)returns access to the array where the data for a MATDENSE matrix is stored obtained by MatDenseGetArrayWrite()
Not Collective
Input Parameters:
A- a dense matrixarray- pointer to the data (may beNULL)
Level: intermediate
-seealso: , Mat, MATDENSE, MatDenseGetArrayWrite(), MatDenseGetArray(), MatDenseRestoreArray(), MatDenseGetArrayRead(), MatDenseRestoreArrayRead()
External Links
- PETSc Manual:
Mat/MatDenseRestoreArrayWrite
PETSc.LibPETSc.MatDenseRestoreArrayWriteAndMemType — Method
array::Vector{PetscScalar} = MatDenseRestoreArrayWriteAndMemType(petsclib::PetscLibType,A::PetscMat)returns access to the array that is obtained by MatDenseGetArrayReadAndMemType()
Logically Collective
Input Parameters:
A- a dense matrixarray- pointer to the data
Level: intermediate
-seealso: , Mat, MATDENSE, MatDenseGetArrayWriteAndMemType(), MatDenseGetArray(), MatDenseGetArrayRead(), MatDenseRestoreArrayRead(), MatDenseGetArrayWrite(), MatDenseRestoreArrayWrite()
External Links
- PETSc Manual:
Mat/MatDenseRestoreArrayWriteAndMemType
PETSc.LibPETSc.MatDenseRestoreColumn — Method
vals::Vector{PetscScalar} = MatDenseRestoreColumn(petsclib::PetscLibType,A::PetscMat)returns access to a column of a MATDENSE matrix which is returned by MatDenseGetColumn().
Not Collective
Input Parameters:
A- aMATSEQDENSEorMATMPIDENSEmatrixvals- pointer to the data (may beNULL)
Level: intermediate
-seealso: , Mat, MATDENSE, MatDenseGetColumn()
External Links
- PETSc Manual:
Mat/MatDenseRestoreColumn
PETSc.LibPETSc.MatDenseRestoreColumnVec — Method
MatDenseRestoreColumnVec(petsclib::PetscLibType,A::PetscMat, col::PetscInt, v::PetscVec)Returns access to a column of a dense matrix obtained from MatDenseGetColumnVec().
Collective
Input Parameters:
A- theMatobjectcol- the column indexv- theVecobject (may beNULL)
Level: intermediate
-seealso: , Mat, MATDENSE, MATDENSECUDA, MATDENSEHIP, MatDenseGetColumnVec(), MatDenseGetColumnVecRead(), MatDenseGetColumnVecWrite(), MatDenseRestoreColumnVecRead(), MatDenseRestoreColumnVecWrite()
External Links
- PETSc Manual:
Mat/MatDenseRestoreColumnVec
PETSc.LibPETSc.MatDenseRestoreColumnVecRead — Method
MatDenseRestoreColumnVecRead(petsclib::PetscLibType,A::PetscMat, col::PetscInt, v::PetscVec)Returns access to a column of a dense matrix obtained from MatDenseGetColumnVecRead().
Collective
Input Parameters:
A- theMatobjectcol- the column indexv- theVecobject (may beNULL)
Level: intermediate
-seealso: , Mat, MATDENSE, MATDENSECUDA, MATDENSEHIP, MatDenseGetColumnVec(), MatDenseGetColumnVecRead(), MatDenseGetColumnVecWrite(), MatDenseRestoreColumnVec(), MatDenseRestoreColumnVecWrite()
External Links
- PETSc Manual:
Mat/MatDenseRestoreColumnVecRead
PETSc.LibPETSc.MatDenseRestoreColumnVecWrite — Method
MatDenseRestoreColumnVecWrite(petsclib::PetscLibType,A::PetscMat, col::PetscInt, v::PetscVec)Returns access to a column of a dense matrix obtained from MatDenseGetColumnVecWrite().
Collective
Input Parameters:
A- theMatobjectcol- the column indexv- theVecobject (may beNULL)
Level: intermediate
-seealso: , Mat, MATDENSE, MATDENSECUDA, MATDENSEHIP, MatDenseGetColumnVec(), MatDenseGetColumnVecRead(), MatDenseGetColumnVecWrite(), MatDenseRestoreColumnVec(), MatDenseRestoreColumnVecRead()
External Links
- PETSc Manual:
Mat/MatDenseRestoreColumnVecWrite
PETSc.LibPETSc.MatDenseRestoreSubMatrix — Method
MatDenseRestoreSubMatrix(petsclib::PetscLibType,A::PetscMat, v::PetscMat)Returns access to a block of columns of a dense matrix obtained from MatDenseGetSubMatrix().
Collective
Input Parameters:
A- theMatobjectv- theMatobject (may beNULL)
Level: intermediate
-seealso: , Mat, MATDENSE, MATDENSECUDA, MATDENSEHIP, MatDenseGetColumnVec(), MatDenseRestoreColumnVec(), MatDenseGetSubMatrix()
External Links
- PETSc Manual:
Mat/MatDenseRestoreSubMatrix
PETSc.LibPETSc.MatDenseSetLDA — Method
MatDenseSetLDA(petsclib::PetscLibType,A::PetscMat, lda::PetscInt)Sets the leading dimension of the array used by the MATDENSE matrix
Collective if the matrix layouts have not yet been setup
Input Parameters:
A- aMATDENSEorMATDENSECUDAmatrixlda- the leading dimension
Level: intermediate
-seealso: , Mat, MATDENSE, MATDENSECUDA, MatDenseGetArray(), MatDenseRestoreArray(), MatDenseGetArrayRead(), MatDenseRestoreArrayRead(), MatDenseGetLDA()
External Links
- PETSc Manual:
Mat/MatDenseSetLDA
PETSc.LibPETSc.MatDestroy — Method
MatDestroy(petsclib::PetscLibType,A::AbstractPetscMat)Frees space taken by a matrix.
Collective
Input Parameter:
A- the matrix
Level: beginner
External Links
- PETSc Manual:
Mat/MatDestroy
PETSc.LibPETSc.MatDestroyMatrices — Method
MatDestroyMatrices(petsclib::PetscLibType,n::PetscInt, mat::Vector{PetscMat})Destroys an array of matrices
Collective
Input Parameters:
n- the number of local matricesmat- the matrices (this is a pointer to the array of matrices)
Level: advanced
-seealso: , Mat, MatCreateSubMatrices(), MatDestroySubMatrices()
External Links
- PETSc Manual:
Mat/MatDestroyMatrices
PETSc.LibPETSc.MatDestroySeqNonzeroStructure — Method
MatDestroySeqNonzeroStructure(petsclib::PetscLibType,mat::PetscMat)Destroys matrix obtained with MatGetSeqNonzeroStructure().
Collective
Input Parameter:
mat- the matrix
Level: advanced
-seealso: , Mat, MatGetSeqNonzeroStructure()
External Links
- PETSc Manual:
Mat/MatDestroySeqNonzeroStructure
PETSc.LibPETSc.MatDestroySubMatrices — Method
MatDestroySubMatrices(petsclib::PetscLibType,n::PetscInt, mat::Vector{PetscMat})Destroys a set of matrices obtained with MatCreateSubMatrices().
Collective
Input Parameters:
n- the number of local matricesmat- the matrices (this is a pointer to the array of matrices, to match the calling sequence ofMatCreateSubMatrices())
Level: advanced
-seealso: , Mat, MatCreateSubMatrices(), MatDestroyMatrices()
External Links
- PETSc Manual:
Mat/MatDestroySubMatrices
PETSc.LibPETSc.MatDiagonalGetDiagonal — Method
MatDiagonalGetDiagonal(petsclib::PetscLibType,A::PetscMat, diag::PetscVec)Get the diagonal of a MATDIAGONAL
Input Parameter:
A- theMATDIAGONAL
Output Parameter:
diag- theVecthat defines the diagonal
Level: developer
-seealso: , MATDIAGONAL, MatCreateDiagonal(), MatDiagonalRestoreDiagonal(), MatDiagonalGetInverseDiagonal(), MatGetDiagonal()
External Links
- PETSc Manual:
Mat/MatDiagonalGetDiagonal
PETSc.LibPETSc.MatDiagonalGetInverseDiagonal — Method
MatDiagonalGetInverseDiagonal(petsclib::PetscLibType,A::PetscMat, inv_diag::PetscVec)Get the inverse diagonal of a MATDIAGONAL
Input Parameter:
A- theMATDIAGONAL
Output Parameter:
inv_diag- theVecthat defines the inverse diagonal
Level: developer
-seealso: , MATDIAGONAL, MatCreateDiagonal(), MatDiagonalRestoreInverseDiagonal(), MatDiagonalGetDiagonal(), MATLMVMBROYDEN, MatSolve()
External Links
- PETSc Manual:
Mat/MatDiagonalGetInverseDiagonal
PETSc.LibPETSc.MatDiagonalRestoreDiagonal — Method
MatDiagonalRestoreDiagonal(petsclib::PetscLibType,A::PetscMat, diag::PetscVec)Restore the diagonal of a MATDIAGONAL
Input Parameters:
A- theMATDIAGONALdiag- theVecobtained fromMatDiagonalGetDiagonal()
Level: developer
-seealso: , MATDIAGONAL, MatCreateDiagonal(), MatDiagonalGetDiagonal()
External Links
- PETSc Manual:
Mat/MatDiagonalRestoreDiagonal
PETSc.LibPETSc.MatDiagonalRestoreInverseDiagonal — Method
MatDiagonalRestoreInverseDiagonal(petsclib::PetscLibType,A::PetscMat, inv_diag::PetscVec)Restore the inverse diagonal of a MATDIAGONAL
Input Parameters:
A- theMATDIAGONALinv_diag- theVecobtained fromMatDiagonalGetInverseDiagonal()
Level: developer
-seealso: , MATDIAGONAL, MatCreateDiagonal(), MatDiagonalGetInverseDiagonal()
External Links
- PETSc Manual:
Mat/MatDiagonalRestoreInverseDiagonal
PETSc.LibPETSc.MatDiagonalScale — Method
MatDiagonalScale(petsclib::PetscLibType,mat::PetscMat, l::PetscVec, r::PetscVec)Scales a matrix on the left and right by diagonal matrices that are stored as vectors. Either of the two scaling matrices can be NULL.
Collective
Input Parameters:
mat- the matrix to be scaledl- the left scaling vector (orNULL)r- the right scaling vector (orNULL)
Level: intermediate
-seealso: , Mat, MatScale(), MatShift(), MatDiagonalSet()
External Links
- PETSc Manual:
Mat/MatDiagonalScale
PETSc.LibPETSc.MatDiagonalScaleLocal — Method
MatDiagonalScaleLocal(petsclib::PetscLibType,mat::PetscMat, diag::PetscVec)Scales columns of a matrix given the scaling values including the ghosted ones.
Not Collective
Input Parameters:
mat- the matrixdiag- the diagonal values, including ghost ones
Level: developer
-seealso: , Mat, MatDiagonalScale()
External Links
- PETSc Manual:
Mat/MatDiagonalScaleLocal
PETSc.LibPETSc.MatDiagonalSet — Method
MatDiagonalSet(petsclib::PetscLibType,Y::PetscMat, D::PetscVec, is::InsertMode)Computes Y = Y + D, where D is a diagonal matrix that is represented as a vector. Or Y[i,i] = D[i] if InsertMode is INSERT_VALUES.
Neighbor-wise Collective
Input Parameters:
Y- the input matrixD- the diagonal matrix, represented as a vectoris-INSERT_VALUESorADD_VALUES
Level: intermediate
-seealso: , Mat, MatShift(), MatScale(), MatDiagonalScale()
External Links
- PETSc Manual:
Mat/MatDiagonalSet
PETSc.LibPETSc.MatDuplicate — Method
MatDuplicate(petsclib::PetscLibType,mat::PetscMat, op::MatDuplicateOption, M::PetscMat)Duplicates a matrix including the non
Collective
Input Parameters:
mat- the matrixop- One ofMAT_DO_NOT_COPY_VALUES,MAT_COPY_VALUES, orMAT_SHARE_NONZERO_PATTERN.
See the manual page for MatDuplicateOption() for an explanation of these options.
Output Parameter:
M- pointer to place new matrix
Level: intermediate
-seealso: , Mat, MatCopy(), MatConvert(), MatDuplicateOption
External Links
- PETSc Manual:
Mat/MatDuplicate
PETSc.LibPETSc.MatEliminateZeros — Method
MatEliminateZeros(petsclib::PetscLibType,A::PetscMat, keep::PetscBool)eliminate the nondiagonal zero entries in place from the nonzero structure of a sparse Mat in place, meaning the same memory is used for the matrix, and no new memory is allocated.
Collective
Input Parameters:
A- the matrixkeep- if for a given row ofA, the diagonal coefficient is zero, indicates whether it should be left in the structure or eliminated as well
Level: intermediate
-seealso: , Mat, MatCreate(), MatCreateGraph(), MatFilter()
External Links
- PETSc Manual:
Mat/MatEliminateZeros
PETSc.LibPETSc.MatEqual — Method
flg::PetscBool = MatEqual(petsclib::PetscLibType,A::PetscMat, B::PetscMat)Compares two matrices.
Collective
Input Parameters:
A- the first matrixB- the second matrix
Output Parameter:
flg-PETSC_TRUEif the matrices are equal;PETSC_FALSEotherwise.
Level: intermediate
-seealso: , Mat, MatMultEqual()
External Links
- PETSc Manual:
Mat/MatEqual
PETSc.LibPETSc.MatFactorClearError — Method
MatFactorClearError(petsclib::PetscLibType,mat::PetscMat)clears the error code in a factorization
Logically Collective
Input Parameter:
mat- the factored matrix
Level: developer
-seealso: , Mat, MatZeroEntries(), MatFactor(), MatGetFactor(), MatLUFactorSymbolic(), MatCholeskyFactorSymbolic(), MatFactorGetError(), MatFactorGetErrorZeroPivot(), MatGetErrorCode(), MatFactorError
External Links
- PETSc Manual:
Mat/MatFactorClearError
PETSc.LibPETSc.MatFactorCreateSchurComplement — Method
S::PetscMat,status::MatFactorSchurStatus = MatFactorCreateSchurComplement(petsclib::PetscLibType,F::PetscMat)Create a Schur complement matrix object using Schur data computed during the factorization step
Logically Collective
Input Parameters:
F- the factored matrix obtained by callingMatGetFactor()S- location where to return the Schur complement, can beNULLstatus- the status of the Schur complement matrix, can beNULL
Level: advanced
-seealso: , Mat, MatGetFactor(), MatFactorSetSchurIS(), MatFactorGetSchurComplement(), MatFactorSchurStatus, MATSOLVERMUMPS, MATSOLVERMKL_PARDISO
External Links
- PETSc Manual:
Mat/MatFactorCreateSchurComplement
PETSc.LibPETSc.MatFactorFactorizeSchurComplement — Method
MatFactorFactorizeSchurComplement(petsclib::PetscLibType,F::PetscMat)Factorize the Schur complement matrix computed during the factorization step
Logically Collective
Input Parameter:
F- the factored matrix obtained by callingMatGetFactor()
Level: advanced
-seealso: , Mat, MatGetFactor(), MatFactorSetSchurIS(), MatFactorInvertSchurComplement()
External Links
- PETSc Manual:
Mat/MatFactorFactorizeSchurComplement
PETSc.LibPETSc.MatFactorGetCanUseOrdering — Method
flg::PetscBool = MatFactorGetCanUseOrdering(petsclib::PetscLibType,mat::PetscMat)Indicates if the factorization can use the ordering provided in MatLUFactorSymbolic(), MatCholeskyFactorSymbolic()
Logically Collective
Input Parameter:
mat- the matrix
Output Parameter:
flg-PETSC_TRUEif uses the ordering
Level: developer
-seealso: , Mat, Matrix Factorization, MatCopy(), MatDuplicate(), MatGetFactorAvailable(), MatGetFactor(), MatLUFactorSymbolic(), MatCholeskyFactorSymbolic()
External Links
- PETSc Manual:
Mat/MatFactorGetCanUseOrdering
PETSc.LibPETSc.MatFactorGetError — Method
MatFactorGetError(petsclib::PetscLibType,mat::PetscMat, err::MatFactorError)gets the error code from a factorization
Logically Collective
Input Parameter:
mat- the factored matrix
Output Parameter:
err- the error code
Level: advanced
-seealso: , Mat, MatZeroEntries(), MatFactor(), MatGetFactor(), MatLUFactorSymbolic(), MatCholeskyFactorSymbolic(), MatFactorClearError(), MatFactorGetErrorZeroPivot(), MatFactorError
External Links
- PETSc Manual:
Mat/MatFactorGetError
PETSc.LibPETSc.MatFactorGetErrorZeroPivot — Method
pivot::PetscReal,row::PetscInt = MatFactorGetErrorZeroPivot(petsclib::PetscLibType,mat::PetscMat)returns the pivot value that was determined to be zero and the row it occurred in
Logically Collective
Input Parameter:
mat- the factored matrix
Output Parameters:
pivot- the pivot value computedrow- the row that the zero pivot occurred. This row value must be interpreted carefully due to row reorderings and which processes
the share the matrix
Level: advanced
-seealso: , Mat, MatZeroEntries(), MatFactor(), MatGetFactor(), MatLUFactorSymbolic(), MatCholeskyFactorSymbolic(), MatFactorClearError(), MAT_FACTOR_NUMERIC_ZEROPIVOT
External Links
- PETSc Manual:
Mat/MatFactorGetErrorZeroPivot
PETSc.LibPETSc.MatFactorGetPreferredOrdering — Method
MatFactorGetPreferredOrdering(petsclib::PetscLibType,mat::PetscMat, ftype::MatFactorType, otype::MatOrderingType)The preferred ordering for a particular matrix factor object
Logically Collective
Input Parameters:
mat- the matrix obtained withMatGetFactor()ftype- the factorization type to be used
Output Parameter:
otype- the preferred ordering type
Level: developer
-seealso: , Mat, Matrix Factorization, MatFactorType, MatOrderingType, MatCopy(), MatDuplicate(), MatGetFactorAvailable(), MatGetFactor(), MatLUFactorSymbolic(), MatCholeskyFactorSymbolic()
External Links
- PETSc Manual:
Mat/MatFactorGetPreferredOrdering
PETSc.LibPETSc.MatFactorGetSchurComplement — Method
MatFactorGetSchurComplement(petsclib::PetscLibType,F::PetscMat, S::PetscMat, status::MatFactorSchurStatus)Gets access to a Schur complement matrix using the current Schur data within a factored matrix
Logically Collective
Input Parameters:
F- the factored matrix obtained by callingMatGetFactor()S- location where to return the Schur complement, can beNULLstatus- the status of the Schur complement matrix, can beNULL
Level: advanced
-seealso: , Mat, MatGetFactor(), MatFactorSetSchurIS(), MatFactorRestoreSchurComplement(), MatFactorCreateSchurComplement(), MatFactorSchurStatus
External Links
- PETSc Manual:
Mat/MatFactorGetSchurComplement
PETSc.LibPETSc.MatFactorGetSolverType — Method
type::MatSolverType = MatFactorGetSolverType(petsclib::PetscLibType,mat::PetscMat)Returns name of the package providing the factorization routines
Not Collective
Input Parameter:
mat- the matrix, must be a factored matrix
Output Parameter:
type- the string name of the package (do not free this string)
Level: intermediate
-seealso: , Mat, Matrix Factorization, MatGetFactor(), MatSolverType, MatCopy(), MatDuplicate(), MatGetFactorAvailable()
External Links
- PETSc Manual:
Mat/MatFactorGetSolverType
PETSc.LibPETSc.MatFactorInfoInitialize — Method
MatFactorInfoInitialize(petsclib::PetscLibType,info::MatFactorInfo)Initializes a MatFactorInfo data structure with default values.
Not Collective
Input Parameter:
info- theMatFactorInfodata structure
Level: developer
-seealso: , Mat, MatGetFactor(), MatFactorInfo
External Links
- PETSc Manual:
Mat/MatFactorInfoInitialize
PETSc.LibPETSc.MatFactorInvertSchurComplement — Method
MatFactorInvertSchurComplement(petsclib::PetscLibType,F::PetscMat)Invert the Schur complement matrix computed during the factorization step
Logically Collective
Input Parameter:
F- the factored matrix obtained by callingMatGetFactor()
Level: advanced
-seealso: , Mat, MatGetFactor(), MatFactorSetSchurIS(), MatFactorGetSchurComplement(), MatFactorCreateSchurComplement()
External Links
- PETSc Manual:
Mat/MatFactorInvertSchurComplement
PETSc.LibPETSc.MatFactorRestoreSchurComplement — Method
MatFactorRestoreSchurComplement(petsclib::PetscLibType,F::PetscMat, S::PetscMat, status::MatFactorSchurStatus)Restore the Schur complement matrix object obtained from a call to MatFactorGetSchurComplement()
Logically Collective
Input Parameters:
F- the factored matrix obtained by callingMatGetFactor()S- location where the Schur complement is storedstatus- the status of the Schur complement matrix (seeMatFactorSchurStatus)
Level: advanced
-seealso: , Mat, MatGetFactor(), MatFactorSetSchurIS(), MatFactorCreateSchurComplement(), MatFactorSchurStatus
External Links
- PETSc Manual:
Mat/MatFactorRestoreSchurComplement
PETSc.LibPETSc.MatFactorSetSchurIS — Method
MatFactorSetSchurIS(petsclib::PetscLibType,mat::PetscMat, is::IS)Set indices corresponding to the Schur complement you wish to have computed
Collective
Input Parameters:
mat- the factored matrixis- the index set defining the Schur indices (0-based)
Level: advanced
-seealso: , Mat, MatGetFactor(), MatFactorGetSchurComplement(), MatFactorRestoreSchurComplement(), MatFactorCreateSchurComplement(), MatFactorSolveSchurComplement(), MatFactorSolveSchurComplementTranspose(), MATSOLVERMUMPS, MATSOLVERMKL_PARDISO
External Links
- PETSc Manual:
Mat/MatFactorSetSchurIS
PETSc.LibPETSc.MatFactorSolveSchurComplement — Method
MatFactorSolveSchurComplement(petsclib::PetscLibType,F::PetscMat, rhs::PetscVec, sol::PetscVec)Solve the Schur complement system computed during the factorization step
Logically Collective
Input Parameters:
F- the factored matrix obtained by callingMatGetFactor()rhs- location where the right-hand side of the Schur complement system is storedsol- location where the solution of the Schur complement system has to be returned
Level: advanced
-seealso: , Mat, MatGetFactor(), MatFactorSetSchurIS(), MatFactorSolveSchurComplementTranspose()
External Links
- PETSc Manual:
Mat/MatFactorSolveSchurComplement
PETSc.LibPETSc.MatFactorSolveSchurComplementTranspose — Method
MatFactorSolveSchurComplementTranspose(petsclib::PetscLibType,F::PetscMat, rhs::PetscVec, sol::PetscVec)Solve the transpose of the Schur complement system computed during the factorization step
Logically Collective
Input Parameters:
F- the factored matrix obtained by callingMatGetFactor()rhs- location where the right-hand side of the Schur complement system is storedsol- location where the solution of the Schur complement system has to be returned
Level: advanced
-seealso: , Mat, MatGetFactor(), MatFactorSetSchurIS(), MatFactorSolveSchurComplement()
External Links
- PETSc Manual:
Mat/MatFactorSolveSchurComplementTranspose
PETSc.LibPETSc.MatFilter — Method
MatFilter(petsclib::PetscLibType,A::PetscMat, tol::PetscReal, compress::PetscBool, keep::PetscBool)Set all values in the matrix with an absolute value less than or equal to the tolerance to zero, and optionally compress the underlying storage
Input Parameters:
A- The matrixtol- The zero tolerancecompress- Whether the storage from the input matrixAshould be compressed once values less than or equal totolare set to zerokeep- Ifcompressis true and for a given row ofA, the diagonal coefficient is less than or equal totol, indicates whether it should be left in the structure or eliminated as well
Level: intermediate
-seealso: , Mat, MatCreate(), MatZeroEntries(), MatEliminateZeros(), VecFilter()
External Links
- PETSc Manual:
Mat/MatFilter
PETSc.LibPETSc.MatFinalizePackage — Method
MatFinalizePackage(petsclib::PetscLibType)This function destroys everything in the PETSc interface to the Mat package. It is called from PetscFinalize().
Level: developer
-seealso: Mat, PetscFinalize(), MatInitializePackage()
External Links
- PETSc Manual:
Mat/MatFinalizePackage
PETSc.LibPETSc.MatFindNonzeroRows — Method
MatFindNonzeroRows(petsclib::PetscLibType,mat::PetscMat, keptrows::IS)Locate all rows that are not completely zero in the matrix
Input Parameter:
mat- the matrix
Output Parameter:
keptrows- the rows that are not completely zero
Level: intermediate
-seealso: , Mat, MatFindZeroRows()
External Links
- PETSc Manual:
Mat/MatFindNonzeroRows
PETSc.LibPETSc.MatFindOffBlockDiagonalEntries — Method
MatFindOffBlockDiagonalEntries(petsclib::PetscLibType,mat::PetscMat, is::IS)Finds all the rows of a matrix that have entries outside of the main diagonal block (defined by the matrix block size)
Collective
Input Parameter:
mat- the matrix
Output Parameter:
is- contains the list of rows with off block diagonal entries
Level: developer
-seealso: , Mat, MatMultTranspose(), MatMultAdd(), MatMultTransposeAdd()
External Links
- PETSc Manual:
Mat/MatFindOffBlockDiagonalEntries
PETSc.LibPETSc.MatFindZeroDiagonals — Method
MatFindZeroDiagonals(petsclib::PetscLibType,mat::PetscMat, is::IS)Finds all the rows of a matrix that have zero or no diagonal entry in the matrix
Collective
Input Parameter:
mat- the matrix
Output Parameter:
is- if any rows have zero diagonals this contains the list of them
Level: developer
-seealso: , Mat, MatMultTranspose(), MatMultAdd(), MatMultTransposeAdd()
External Links
- PETSc Manual:
Mat/MatFindZeroDiagonals
PETSc.LibPETSc.MatFindZeroRows — Method
MatFindZeroRows(petsclib::PetscLibType,mat::PetscMat, zerorows::IS)Locate all rows that are completely zero in the matrix
Input Parameter:
mat- the matrix
Output Parameter:
zerorows- the rows that are completely zero
Level: intermediate
-seealso: , Mat, MatFindNonzeroRows()
External Links
- PETSc Manual:
Mat/MatFindZeroRows
PETSc.LibPETSc.MatForwardSolve — Method
MatForwardSolve(petsclib::PetscLibType,mat::PetscMat, b::PetscVec, x::PetscVec)Solves L x = b , given a factored matrix, A = LU , or U^TD^(1/2) x = b, given a factored symmetric matrix, A = U^TD*U,
Neighbor-wise Collective
Input Parameters:
mat- the factored matrixb- the right-hand-side vector
Output Parameter:
x- the result vector
Level: developer
-seealso: , Mat, MatBackwardSolve(), MatGetFactor(), MatSolve()
External Links
- PETSc Manual:
Mat/MatForwardSolve
PETSc.LibPETSc.MatGalerkin — Method
MatGalerkin(petsclib::PetscLibType,restrct::PetscMat, dA::PetscMat, interpolate::PetscMat, reuse::MatReuse, fill::PetscReal, A::PetscMat)Constructs the coarse grid problem matrix via Galerkin projection.
If the interpolation and restriction operators are the same, uses MatPtAP(). If they are not the same, uses MatMatMatMult().
Once the coarse grid problem is constructed, correct for interpolation operators that are not of full rank, which can legitimately happen in the case of non-nested geometric multigrid.
Input Parameters:
restrct- restriction operatordA- fine grid matrixinterpolate- interpolation operatorreuse- eitherMAT_INITIAL_MATRIXorMAT_REUSE_MATRIXfill- expected fill, usePETSC_DETERMINEorPETSC_DETERMINEif you do not have a good estimate
Output Parameter:
A- the Galerkin coarse matrix
Options Database Key:
-pc_mg_galerkin <both,pmat,mat,none>- for what matrices the Galerkin process should be used
Level: developer
-seealso: , Mat, MatPtAP(), MatMatMatMult()
External Links
- PETSc Manual:
Mat/MatGalerkin
PETSc.LibPETSc.MatGetBindingPropagates — Method
flg::PetscBool = MatGetBindingPropagates(petsclib::PetscLibType,A::PetscMat)Gets whether the state of being bound to the CPU for a GPU matrix type propagates to child and some other associated objects
Input Parameter:
A- the matrix
Output Parameter:
flg- flag indicating whether the boundtocpu flag will be propagated
Level: developer
-seealso: , Mat, MatSetBindingPropagates()
External Links
- PETSc Manual:
Mat/MatGetBindingPropagates
PETSc.LibPETSc.MatGetBlockSize — Method
bs::PetscInt = MatGetBlockSize(petsclib::PetscLibType,mat::PetscMat)Returns the matrix block size.
Not Collective
Input Parameter:
mat- the matrix
Output Parameter:
bs- block size
Level: intermediate
-seealso: , Mat, MATBAIJ, MATSBAIJ, MatCreateSeqBAIJ(), MatCreateBAIJ(), MatGetBlockSizes()
External Links
- PETSc Manual:
Mat/MatGetBlockSize
PETSc.LibPETSc.MatGetBlockSizes — Method
rbs::PetscInt,cbs::PetscInt = MatGetBlockSizes(petsclib::PetscLibType,mat::PetscMat)Returns the matrix block row and column sizes.
Not Collective
Input Parameter:
mat- the matrix
Output Parameters:
rbs- row block sizecbs- column block size
Level: intermediate
-seealso: , Mat, MATBAIJ, MATSBAIJ, MatCreateSeqBAIJ(), MatCreateBAIJ(), MatGetBlockSize(), MatSetBlockSize(), MatSetBlockSizes()
External Links
- PETSc Manual:
Mat/MatGetBlockSizes
PETSc.LibPETSc.MatGetBrowsOfAcols — Method
MatGetBrowsOfAcols(petsclib::PetscLibType,A::PetscMat, B::PetscMat, scall::MatReuse, rowb::IS, colb::IS, B_seq::PetscMat)Returns IS that contain rows of B that equal to nonzero columns of local A
Collective
Input Parameters:
A- the first matrix inMATMPIAIJformatB- the second matrix inMATMPIAIJformatscall- eitherMAT_INITIAL_MATRIXorMAT_REUSE_MATRIX
Output Parameters:
rowb- On input index sets of rows of B to extract (orNULL), modified on outputcolb- On input index sets of columns of B to extract (orNULL), modified on outputB_seq- the sequential matrix generated
Level: developer
-seealso: Mat, MATMPIAIJ, IS, MatReuse
External Links
- PETSc Manual:
Mat/MatGetBrowsOfAcols
PETSc.LibPETSc.MatGetColumnIJ — Method
n::PetscInt,ia::Vector{PetscInt},ja::Vector{PetscInt},done::PetscBool = MatGetColumnIJ(petsclib::PetscLibType,mat::PetscMat, shift::PetscInt, symmetric::PetscBool, inodecompressed::PetscBool)Returns the compressed column storage i and j indices for sequential matrices.
Collective
Input Parameters:
mat- the matrixshift- 1 or zero indicating we want the indices starting at 0 or 1symmetric-PETSC_TRUEorPETSC_FALSEindicating the matrix data structure should be
symmetrized
inodecompressed-PETSC_TRUEorPETSC_FALSEindicating if the nonzero structure of the
inodes or the nonzero elements is wanted. For MATBAIJ matrices the compressed version is always used.
Output Parameters:
n- number of columns in the (possibly compressed) matrixia- the column pointers; that is ia[0] = 0, ia[col] = i[col-1] + number of elements in that col of the matrixja- the row indicesdone-PETSC_TRUEorPETSC_FALSE, indicating whether the values have been returned
Level: developer
-seealso: , Mat, MatGetRowIJ(), MatRestoreColumnIJ()
External Links
- PETSc Manual:
Mat/MatGetColumnIJ
PETSc.LibPETSc.MatGetColumnMeans — Method
MatGetColumnMeans(petsclib::PetscLibType,A::PetscMat, means::Vector{PetscScalar})Gets the arithmetic means of each column of a sparse or dense matrix.
Input Parameter:
A- the matrix
Output Parameter:
means- an array as large as the TOTAL number of columns in the matrix
Level: intermediate
-seealso: , Mat, VecSum(), MatGetColumnSums(), MatGetColumnNorms(), MatGetColumnReductions()
External Links
- PETSc Manual:
Mat/MatGetColumnMeans
PETSc.LibPETSc.MatGetColumnMeansImaginaryPart — Method
MatGetColumnMeansImaginaryPart(petsclib::PetscLibType,A::PetscMat, means::Vector{PetscReal})Gets the arithmetic means of the imaginary part of each column of a sparse or dense matrix.
Input Parameter:
A- the matrix
Output Parameter:
means- an array as large as the TOTAL number of columns in the matrix
Level: intermediate
-seealso: , Mat, MatGetColumnMeansRealPart(), VecSum(), MatGetColumnSums(), MatGetColumnNorms(), MatGetColumnReductions()
External Links
- PETSc Manual:
Mat/MatGetColumnMeansImaginaryPart
PETSc.LibPETSc.MatGetColumnMeansRealPart — Method
MatGetColumnMeansRealPart(petsclib::PetscLibType,A::PetscMat, means::Vector{PetscReal})Gets the arithmetic means of the real part of each column of a sparse or dense matrix.
Input Parameter:
A- the matrix
Output Parameter:
means- an array as large as the TOTAL number of columns in the matrix
Level: intermediate
-seealso: , Mat, MatGetColumnMeansImaginaryPart(), VecSum(), MatGetColumnSums(), MatGetColumnNorms(), MatGetColumnReductions()
External Links
- PETSc Manual:
Mat/MatGetColumnMeansRealPart
PETSc.LibPETSc.MatGetColumnNorms — Method
MatGetColumnNorms(petsclib::PetscLibType,A::PetscMat, type::NormType, norms::Vector{PetscReal})Gets the norms of each column of a sparse or dense matrix.
Input Parameters:
A- the matrixtype-NORM_2,NORM_1orNORM_INFINITY
Output Parameter:
norms- an array as large as the TOTAL number of columns in the matrix
Level: intermediate
-seealso: , Mat, NormType, MatNorm()
External Links
- PETSc Manual:
Mat/MatGetColumnNorms
PETSc.LibPETSc.MatGetColumnReductions — Method
MatGetColumnReductions(petsclib::PetscLibType,A::PetscMat, type::PetscInt, reductions::Vector{PetscReal})Gets the reductions of each column of a sparse or dense matrix.
Input Parameters:
A- the matrixtype- A constant defined inNormTypeorReductionType:NORM_2,NORM_1,NORM_INFINITY,REDUCTION_SUM_REALPART,
REDUCTION_SUM_IMAGINARYPART, REDUCTION_MEAN_REALPART, REDUCTION_MEAN_IMAGINARYPART
Output Parameter:
reductions- an array as large as the TOTAL number of columns in the matrix
Level: developer
-seealso: , Mat, ReductionType, NormType, MatGetColumnNorms(), MatGetColumnSums(), MatGetColumnMeans()
External Links
- PETSc Manual:
Mat/MatGetColumnReductions
PETSc.LibPETSc.MatGetColumnSums — Method
MatGetColumnSums(petsclib::PetscLibType,A::PetscMat, sums::Vector{PetscScalar})Gets the sums of each column of a sparse or dense matrix.
Input Parameter:
A- the matrix
Output Parameter:
sums- an array as large as the TOTAL number of columns in the matrix
Level: intermediate
-seealso: , Mat, VecSum(), MatGetColumnMeans(), MatGetColumnNorms(), MatGetColumnReductions()
External Links
- PETSc Manual:
Mat/MatGetColumnSums
PETSc.LibPETSc.MatGetColumnSumsImaginaryPart — Method
MatGetColumnSumsImaginaryPart(petsclib::PetscLibType,A::PetscMat, sums::Vector{PetscReal})Gets the sums of the imaginary part of each column of a sparse or dense matrix.
Input Parameter:
A- the matrix
Output Parameter:
sums- an array as large as the TOTAL number of columns in the matrix
Level: intermediate
-seealso: , Mat, MatGetColumnSumsRealPart(), VecSum(), MatGetColumnMeans(), MatGetColumnNorms(), MatGetColumnReductions()
External Links
- PETSc Manual:
Mat/MatGetColumnSumsImaginaryPart
PETSc.LibPETSc.MatGetColumnSumsRealPart — Method
MatGetColumnSumsRealPart(petsclib::PetscLibType,A::PetscMat, sums::Vector{PetscReal})Gets the sums of the real part of each column of a sparse or dense matrix.
Input Parameter:
A- the matrix
Output Parameter:
sums- an array as large as the TOTAL number of columns in the matrix
Level: intermediate
-seealso: , Mat, MatGetColumnSumsImaginaryPart(), VecSum(), MatGetColumnMeans(), MatGetColumnNorms(), MatGetColumnReductions()
External Links
- PETSc Manual:
Mat/MatGetColumnSumsRealPart
PETSc.LibPETSc.MatGetColumnVector — Method
MatGetColumnVector(petsclib::PetscLibType,A::PetscMat, yy::PetscVec, col::PetscInt)Gets the values from a given column of a matrix.
Not Collective
Input Parameters:
A- the matrixyy- the vectorcol- the column requested (in global numbering)
Level: advanced
-seealso: , Mat, MatGetRow(), MatGetDiagonal(), MatMult()
External Links
- PETSc Manual:
Mat/MatGetColumnVector
PETSc.LibPETSc.MatGetCurrentMemType — Method
m::PetscMemType = MatGetCurrentMemType(petsclib::PetscLibType,A::PetscMat)Get the memory location of the matrix
Not Collective, but the result will be the same on all MPI processes
Input Parameter:
A- the matrix whose memory type we are checking
Output Parameter:
m- the memory type
Level: intermediate
-seealso: , Mat, MatBoundToCPU(), PetscMemType
External Links
- PETSc Manual:
Mat/MatGetCurrentMemType
PETSc.LibPETSc.MatGetDM — Method
dm::PetscDM = MatGetDM(petsclib::PetscLibType,A::PetscMat)Gets the DM defining the data layout of the matrix
Not Collective
Input Parameter:
A- TheMat
Output Parameter:
dm- TheDM
Level: intermediate
Note: A matrix may not have a DM associated with it
Developer Note: Since the Mat class doesn't know about the DM class the DM object is associated with the Mat through a PetscObjectCompose() operation
See also:
DM, MatSetDM(), DMCreateMatrix(), DMSetMatType()
External Links
- PETSc Manual:
DM/MatGetDM
PETSc.LibPETSc.MatGetDiagonal — Method
MatGetDiagonal(petsclib::PetscLibType,mat::PetscMat, v::PetscVec)Gets the diagonal of a matrix as a Vec
Logically Collective
Input Parameter:
mat- the matrix
Output Parameter:
v- the diagonal of the matrix
Level: intermediate
-seealso: , Mat, Vec, MatGetRow(), MatCreateSubMatrices(), MatCreateSubMatrix(), MatGetRowMaxAbs()
External Links
- PETSc Manual:
Mat/MatGetDiagonal
PETSc.LibPETSc.MatGetDiagonalBlock — Method
MatGetDiagonalBlock(petsclib::PetscLibType,A::PetscMat, a::PetscMat)Returns the part of the matrix associated with the on
Not Collective
Input Parameter:
A- the matrix
Output Parameter:
a- the diagonal part (which is a SEQUENTIAL matrix)
Level: advanced
-seealso: , Mat, MatCreateAIJ(), MATAIJ, MATBAIJ, MATSBAIJ
External Links
- PETSc Manual:
Mat/MatGetDiagonalBlock
PETSc.LibPETSc.MatGetFactor — Method
MatGetFactor(petsclib::PetscLibType,mat::PetscMat, type::MatSolverType, ftype::MatFactorType, f::PetscMat)Returns a matrix suitable to calls to MatXXFactorSymbolic,Numeric()
Collective
Input Parameters:
mat- the matrixtype- name of solver type, for example,superlu,petsc(to use PETSc's solver if it is available), if this is 'NULL', then the first result that satisfies
the other criteria is returned
ftype- factor type,MAT_FACTOR_LU,MAT_FACTOR_CHOLESKY,MAT_FACTOR_ICC,MAT_FACTOR_ILU,MAT_FACTOR_QR
Output Parameter:
f- the factor matrix used with MatXXFactorSymbolic,Numeric() calls. Can beNULLin some cases, see notes below.
Options Database Keys:
-pc_factor_mat_solver_type <type>- choose the type at run time. When usingKSPsolvers-pc_factor_mat_factor_on_host <bool>- do mat factorization on host (with device matrices). Default is doing it on device-pc_factor_mat_solve_on_host <bool>- do mat solve on host (with device matrices). Default is doing it on device
Level: intermediate
-seealso: , Mat, Matrix Factorization, KSP, MatSolverType, MatFactorType, MatCopy(), MatDuplicate(), MatGetFactorAvailable(), MatFactorGetCanUseOrdering(), MatSolverTypeRegister(), MatSolverTypeGet() MAT_FACTOR_LU, MAT_FACTOR_CHOLESKY, MAT_FACTOR_ICC, MAT_FACTOR_ILU, MAT_FACTOR_QR, MatInitializePackage()
External Links
- PETSc Manual:
Mat/MatGetFactor
PETSc.LibPETSc.MatGetFactorAvailable — Method
flg::PetscBool = MatGetFactorAvailable(petsclib::PetscLibType,mat::PetscMat, type::MatSolverType, ftype::MatFactorType)Returns a flag if matrix supports particular type and factor type
Not Collective
Input Parameters:
mat- the matrixtype- name of solver type, for example,superlu,petsc(to use PETSc's default)ftype- factor type,MAT_FACTOR_LU,MAT_FACTOR_CHOLESKY,MAT_FACTOR_ICC,MAT_FACTOR_ILU,MAT_FACTOR_QR
Output Parameter:
flg- PETSC_TRUE if the factorization is available
Level: intermediate
-seealso: , Mat, Matrix Factorization, MatSolverType, MatFactorType, MatGetFactor(), MatCopy(), MatDuplicate(), MatSolverTypeRegister(), MAT_FACTOR_LU, MAT_FACTOR_CHOLESKY, MAT_FACTOR_ICC, MAT_FACTOR_ILU, MAT_FACTOR_QR, MatSolverTypeGet()
External Links
- PETSc Manual:
Mat/MatGetFactorAvailable
PETSc.LibPETSc.MatGetFactorType — Method
t::MatFactorType = MatGetFactorType(petsclib::PetscLibType,mat::PetscMat)gets the type of factorization a matrix is
Not Collective
Input Parameter:
mat- the matrix
Output Parameter:
t- the type, one ofMAT_FACTOR_NONE,MAT_FACTOR_LU,MAT_FACTOR_CHOLESKY,MAT_FACTOR_ILU,MAT_FACTOR_ICC,MAT_FACTOR_ILUDT,MAT_FACTOR_QR
Level: intermediate
-seealso: , Mat, Matrix Factorization, MatFactorType, MatGetFactor(), MatSetFactorType(), MAT_FACTOR_NONE, MAT_FACTOR_LU, MAT_FACTOR_CHOLESKY, MAT_FACTOR_ILU, MAT_FACTOR_ICC,MAT_FACTOR_ILUDT, MAT_FACTOR_QR
External Links
- PETSc Manual:
Mat/MatGetFactorType
PETSc.LibPETSc.MatGetGhosts — Method
nghosts::PetscInt,ghosts::Vector{PetscInt} = MatGetGhosts(petsclib::PetscLibType,mat::PetscMat)Get the global indices of all ghost nodes defined by the sparse matrix
Collective
Input Parameter:
mat- the matrix
Output Parameters:
nghosts- number of ghosts (forMATBAIJandMATSBAIJmatrices there is one ghost for each matrix block)ghosts- the global indices of the ghost points
Level: advanced
-seealso: , Mat, VecCreateGhost(), VecCreateGhostBlock()
External Links
- PETSc Manual:
Mat/MatGetGhosts
PETSc.LibPETSc.MatGetInertia — Method
nneg::PetscInt,nzero::PetscInt,npos::PetscInt = MatGetInertia(petsclib::PetscLibType,mat::PetscMat)Gets the inertia from a factored matrix
Collective
Input Parameter:
mat- the matrix
Output Parameters:
nneg- number of negative eigenvaluesnzero- number of zero eigenvaluesnpos- number of positive eigenvalues
Level: advanced
-seealso: , Mat, MatGetFactor(), MatCholeskyFactor()
External Links
- PETSc Manual:
Mat/MatGetInertia
PETSc.LibPETSc.MatGetInfo — Method
MatGetInfo(petsclib::PetscLibType,mat::PetscMat, flag::MatInfoType, info::MatInfo)Returns information about matrix storage (number of nonzeros, memory, etc.).
Collective if MAT_GLOBAL_MAX or MAT_GLOBAL_SUM is used as the flag
Input Parameters:
mat- the matrixflag- flag indicating the type of parameters to be returned (MAT_LOCAL- local matrix,MAT_GLOBAL_MAX- maximum over all processors,MAT_GLOBAL_SUM- sum over all processors)
Output Parameter:
info- matrix information context
Options Database Key:
-mat_view ::ascii_info- print matrix info toPETSC_STDOUT
Level: intermediate
-seealso: , Mat, MatInfo, MatStashGetInfo()
External Links
- PETSc Manual:
Mat/MatGetInfo
PETSc.LibPETSc.MatGetLayouts — Method
MatGetLayouts(petsclib::PetscLibType,A::PetscMat, rmap::PetscLayout, cmap::PetscLayout)Gets the PetscLayout objects for rows and columns
Not Collective
Input Parameter:
A- the matrix
Output Parameters:
rmap- row layoutcmap- column layout
Level: advanced
-seealso: , Mat, Matrix Layouts, PetscLayout, MatCreateVecs(), MatGetLocalToGlobalMapping(), MatSetLayouts()
External Links
- PETSc Manual:
Mat/MatGetLayouts
PETSc.LibPETSc.MatGetLocalSize — Method
m::PetscInt,n::PetscInt = MatGetLocalSize(petsclib::PetscLibType,mat::PetscMat)For most matrix formats, excluding MATELEMENTAL and MATSCALAPACK, Returns the number of local rows and local columns of a matrix. For all matrices this is the local size of the left and right vectors as returned by MatCreateVecs().
Not Collective
Input Parameter:
mat- the matrix
Output Parameters:
m- the number of local rows, useNULLto not obtain this valuen- the number of local columns, useNULLto not obtain this value
Level: beginner
-seealso: , Mat, MatSetSizes(), MatGetSize()
External Links
- PETSc Manual:
Mat/MatGetLocalSize
PETSc.LibPETSc.MatGetLocalSubMatrix — Method
MatGetLocalSubMatrix(petsclib::PetscLibType,mat::PetscMat, isrow::IS, iscol::IS, submat::PetscMat)Gets a reference to a submatrix specified in local numbering
Not Collective
Input Parameters:
mat- matrix to extract local submatrix fromisrow- local row indices for submatrixiscol- local column indices for submatrix
Output Parameter:
submat- the submatrix
Level: intermediate
-seealso: , Mat, MatRestoreLocalSubMatrix(), MatCreateLocalRef(), MatSetLocalToGlobalMapping()
External Links
- PETSc Manual:
Mat/MatGetLocalSubMatrix
PETSc.LibPETSc.MatGetLocalToGlobalMapping — Method
MatGetLocalToGlobalMapping(petsclib::PetscLibType,A::PetscMat, rmapping::ISLocalToGlobalMapping, cmapping::ISLocalToGlobalMapping)Gets the local
Not Collective
Input Parameter:
A- the matrix
Output Parameters:
rmapping- row mappingcmapping- column mapping
Level: advanced
-seealso: , Mat, MatSetLocalToGlobalMapping(), MatSetValuesLocal()
External Links
- PETSc Manual:
Mat/MatGetLocalToGlobalMapping
PETSc.LibPETSc.MatGetMultiProcBlock — Method
MatGetMultiProcBlock(petsclib::PetscLibType,mat::PetscMat, subComm::MPI_Comm, scall::MatReuse, subMat::PetscMat)Create multiple 'parallel submatrices' from a given Mat. Each submatrix can span multiple procs.
Collective
Input Parameters:
mat- the matrixsubComm- the sub communicator obtained as if byMPI_Comm_split(PetscObjectComm((PetscObject)mat))scall- eitherMAT_INITIAL_MATRIXorMAT_REUSE_MATRIX
Output Parameter:
subMat- parallel sub-matrices each spanning a givensubcomm
Level: advanced
-seealso: , Mat, MatCreateRedundantMatrix(), MatCreateSubMatrices(), PCBJACOBI
External Links
- PETSc Manual:
Mat/MatGetMultiProcBlock
PETSc.LibPETSc.MatGetNearNullSpace — Method
MatGetNearNullSpace(petsclib::PetscLibType,mat::PetscMat, nullsp::MatNullSpace)Get null space attached with MatSetNearNullSpace()
Not Collective
Input Parameter:
mat- the matrix
Output Parameter:
nullsp- the null space object,NULLif not set
Level: advanced
-seealso: , Mat, MatNullSpace, MatSetNearNullSpace(), MatGetNullSpace(), MatNullSpaceCreate()
External Links
- PETSc Manual:
Mat/MatGetNearNullSpace
PETSc.LibPETSc.MatGetNonzeroState — Method
MatGetNonzeroState(petsclib::PetscLibType,mat::PetscMat, state::PetscObjectState)Returns a 64 matrix has had new nonzero locations added to (or removed from) the matrix since the previous call, the value will be larger.
Not Collective
Input Parameter:
mat- the matrix
Output Parameter:
state- the current state
Level: intermediate
-seealso: , Mat, PetscObjectStateGet(), PetscObjectGetId()
External Links
- PETSc Manual:
Mat/MatGetNonzeroState
PETSc.LibPETSc.MatGetNullSpace — Method
MatGetNullSpace(petsclib::PetscLibType,mat::PetscMat, nullsp::MatNullSpace)retrieves the null space of a matrix.
Logically Collective
Input Parameters:
mat- the matrixnullsp- the null space object
Level: developer
-seealso: , Mat, MatCreate(), MatNullSpaceCreate(), MatSetNearNullSpace(), MatSetNullSpace(), MatNullSpace
External Links
- PETSc Manual:
Mat/MatGetNullSpace
PETSc.LibPETSc.MatGetNullSpaces — Method
MatGetNullSpaces(petsclib::PetscLibType,n::PetscInt, mat::Vector{PetscMat}, nullsp::Vector{MatNullSpace})gets the null spaces, transpose null spaces, and near null spaces from an array of matrices
Logically Collective
Input Parameters:
n- the number of matricesmat- the array of matrices
Output Parameters:
nullsp- an array of null spaces,NULLfor each matrix that does not have a null space, length 3 *n
Level: developer
-seealso: , Mat, MatCreate(), MatNullSpaceCreate(), MatSetNearNullSpace(), MatGetNullSpace(), MatSetTransposeNullSpace(), MatGetTransposeNullSpace(), MatNullSpaceRemove(), MatRestoreNullSpaces()
External Links
- PETSc Manual:
Mat/MatGetNullSpaces
PETSc.LibPETSc.MatGetOption — Method
flg::PetscBool = MatGetOption(petsclib::PetscLibType,mat::PetscMat, op::MatOption)Gets a parameter option that has been set for a matrix.
Logically Collective
Input Parameters:
mat- the matrixop- the option, this only responds to certain options, check the code for which ones
Output Parameter:
flg- turn the option on (PETSC_TRUE) or off (PETSC_FALSE)
Level: intermediate
-seealso: , Mat, MatOption, MatSetOption(), MatIsSymmetric(), MatIsHermitian(), MatIsStructurallySymmetric(), MatIsSymmetricKnown(), MatIsHermitianKnown(), MatIsStructurallySymmetricKnown()
External Links
- PETSc Manual:
Mat/MatGetOption
PETSc.LibPETSc.MatGetOptionsPrefix — Method
MatGetOptionsPrefix(petsclib::PetscLibType,A::PetscMat, prefix::Vector{Cchar})Gets the prefix used for searching for all matrix options in the database.
Not Collective
Input Parameter:
A- the matrix
Output Parameter:
prefix- pointer to the prefix string used
Level: advanced
-seealso: , Mat, MatAppendOptionsPrefix(), MatSetOptionsPrefix(), MatAppendOptionsPrefixFactor(), MatSetOptionsPrefixFactor()
External Links
- PETSc Manual:
Mat/MatGetOptionsPrefix
PETSc.LibPETSc.MatGetOrdering — Method
MatGetOrdering(petsclib::PetscLibType,mat::PetscMat, type::MatOrderingType, rperm::IS, cperm::IS)Gets a reordering for a matrix to reduce fill or to improve numerical stability of LU factorization.
Collective
Input Parameters:
mat- the matrixtype- type of reordering, one of the following
-seealso: MatOrderingRegister(), PCFactorSetMatOrderingType(), MatColoring, MatColoringCreate(), MatOrderingType, Mat
External Links
- PETSc Manual:
Mat/MatGetOrdering
PETSc.LibPETSc.MatGetOrderingList — Method
MatGetOrderingList(petsclib::PetscLibType,list::PetscFunctionList)External Links
- PETSc Manual:
Mat/MatGetOrderingList
PETSc.LibPETSc.MatGetOwnershipIS — Method
MatGetOwnershipIS(petsclib::PetscLibType,A::PetscMat, rows::IS, cols::IS)Get row and column ownership of a matrices' values as index sets.
Not Collective
Input Parameter:
A- matrix
Output Parameters:
rows- rows in which this process owns elements, , useNULLto not obtain this valuecols- columns in which this process owns elements, useNULLto not obtain this value
Level: intermediate
-seealso: , IS, Mat, MatGetOwnershipRanges(), MatSetValues(), MATELEMENTAL, MATSCALAPACK
External Links
- PETSc Manual:
Mat/MatGetOwnershipIS
PETSc.LibPETSc.MatGetOwnershipRange — Method
m::PetscInt,n::PetscInt = MatGetOwnershipRange(petsclib::PetscLibType,mat::PetscMat)For matrices that own values by row, excludes MATELEMENTAL and MATSCALAPACK, returns the range of matrix rows owned by this MPI process.
Not Collective
Input Parameter:
mat- the matrix
Output Parameters:
m- the global index of the first local row, useNULLto not obtain this valuen- one more than the global index of the last local row, useNULLto not obtain this value
Level: beginner
-seealso: , Mat, MatGetOwnershipRanges(), MatGetOwnershipRangeColumn(), MatGetOwnershipRangesColumn(), PetscSplitOwnership(), PetscSplitOwnershipBlock(), PetscLayout, MatSetSizes(), MatCreateAIJ(), DMDAGetGhostCorners(), DM
External Links
- PETSc Manual:
Mat/MatGetOwnershipRange
PETSc.LibPETSc.MatGetOwnershipRangeColumn — Method
m::PetscInt,n::PetscInt = MatGetOwnershipRangeColumn(petsclib::PetscLibType,mat::PetscMat)Returns the range of matrix columns associated with rows of a vector one multiplies this matrix by that are owned by this processor.
Not Collective, unless matrix has not been allocated, then collective
Input Parameter:
mat- the matrix
Output Parameters:
m- the global index of the first local column, useNULLto not obtain this valuen- one more than the global index of the last local column, useNULLto not obtain this value
Level: developer
-seealso: , Mat, MatGetOwnershipRange(), MatGetOwnershipRanges(), MatGetOwnershipRangesColumn(), PetscLayout, MatSetSizes(), MatCreateAIJ(), DMDAGetGhostCorners(), DM
External Links
- PETSc Manual:
Mat/MatGetOwnershipRangeColumn
PETSc.LibPETSc.MatGetOwnershipRanges — Method
ranges::Vector{PetscInt} = MatGetOwnershipRanges(petsclib::PetscLibType,mat::PetscMat)For matrices that own values by row, excludes MATELEMENTAL and MATSCALAPACK, returns the range of matrix rows owned by each process.
Not Collective, unless matrix has not been allocated
Input Parameter:
mat- the matrix
Output Parameter:
ranges- start of each processors portion plus one more than the total length at the end, of lengthsize+ 1
where size is the number of MPI processes used by mat
Level: beginner
-seealso: , Mat, MatGetOwnershipRange(), MatGetOwnershipRangeColumn(), MatGetOwnershipRangesColumn(), PetscLayout, PetscSplitOwnership(), PetscSplitOwnershipBlock(), MatSetSizes(), MatCreateAIJ(), DMDAGetGhostCorners(), DM
External Links
- PETSc Manual:
Mat/MatGetOwnershipRanges
PETSc.LibPETSc.MatGetOwnershipRangesColumn — Method
ranges::Vector{PetscInt} = MatGetOwnershipRangesColumn(petsclib::PetscLibType,mat::PetscMat)Returns the ranges of matrix columns associated with rows of a vector one multiplies this vector by that are owned by each processor.
Not Collective, unless matrix has not been allocated
Input Parameter:
mat- the matrix
Output Parameter:
ranges- start of each processors portion plus one more than the total length at the end
Level: beginner
-seealso: , Mat, MatGetOwnershipRange(), MatGetOwnershipRangeColumn(), MatGetOwnershipRanges(), PetscSplitOwnership(), PetscSplitOwnershipBlock(), PetscLayout, MatSetSizes(), MatCreateAIJ(), DMDAGetGhostCorners(), DM
External Links
- PETSc Manual:
Mat/MatGetOwnershipRangesColumn
PETSc.LibPETSc.MatGetRow — Method
ncols::PetscInt,cols::Vector{PetscInt},vals::Vector{PetscScalar} = MatGetRow(petsclib::PetscLibType,mat::PetscMat, row::PetscInt)Gets a row of a matrix. You MUST call MatRestoreRow() for each row that you get to ensure that your application does not bleed memory.
Not Collective
Input Parameters:
mat- the matrixrow- the row to get
Output Parameters:
ncols- if notNULL, the number of nonzeros inrowcols- if notNULL, the column numbersvals- if notNULL, the numerical values
Level: advanced
-seealso: , Mat, MatRestoreRow(), MatSetValues(), MatGetValues(), MatCreateSubMatrices(), MatGetDiagonal(), MatGetRowIJ(), MatRestoreRowIJ()
External Links
- PETSc Manual:
Mat/MatGetRow
PETSc.LibPETSc.MatGetRowIJ — Method
n::PetscInt,ia::Vector{PetscInt},ja::Vector{PetscInt},done::PetscBool = MatGetRowIJ(petsclib::PetscLibType,mat::PetscMat, shift::PetscInt, symmetric::PetscBool, inodecompressed::PetscBool)Returns the compressed row storage i and j indices for the local rows of a sparse matrix
Collective
Input Parameters:
mat- the matrixshift- 0 or 1 indicating we want the indices starting at 0 or 1symmetric-PETSC_TRUEorPETSC_FALSEindicating the matrix data structure should be symmetrizedinodecompressed-PETSC_TRUEorPETSC_FALSEindicating if the nonzero structure of the
inodes or the nonzero elements is wanted. For MATBAIJ matrices the compressed version is always used.
Output Parameters:
n- number of local rows in the (possibly compressed) matrix, useNULLif not neededia- the row pointers; that is ia[0] = 0, ia[row] = ia[row-1] + number of elements in that row of the matrix, useNULLif not neededja- the column indices, useNULLif not neededdone- indicates if the routine actually worked and returned appropriate ia[] and ja[] arrays; callers
are responsible for handling the case when done == PETSC_FALSE and ia and ja are not set
Level: developer
-seealso: , Mat, MATAIJ, MatGetColumnIJ(), MatRestoreRowIJ(), MatSeqAIJGetArray()
External Links
- PETSc Manual:
Mat/MatGetRowIJ
PETSc.LibPETSc.MatGetRowMax — Method
MatGetRowMax(petsclib::PetscLibType,mat::PetscMat, v::PetscVec, idx::Vector{PetscInt})Gets the maximum value (of the real part) of each row of the matrix
Logically Collective
Input Parameter:
mat- the matrix
Output Parameters:
v- the vector for storing the maximumsidx- the indices of the column found for each row (optional, otherwise passNULL)
Level: intermediate
-seealso: , Mat, MatGetDiagonal(), MatCreateSubMatrices(), MatCreateSubMatrix(), MatGetRowMaxAbs(), MatGetRowMin(), MatGetRowMinAbs()
External Links
- PETSc Manual:
Mat/MatGetRowMax
PETSc.LibPETSc.MatGetRowMaxAbs — Method
MatGetRowMaxAbs(petsclib::PetscLibType,mat::PetscMat, v::PetscVec, idx::Vector{PetscInt})Gets the maximum value (in absolute value) of each row of the matrix
Logically Collective
Input Parameter:
mat- the matrix
Output Parameters:
v- the vector for storing the maximumsidx- the indices of the column found for each row (orNULLif not needed)
Level: intermediate
-seealso: , Mat, MatGetDiagonal(), MatCreateSubMatrices(), MatCreateSubMatrix(), MatGetRowSum(), MatGetRowMin(), MatGetRowMinAbs()
External Links
- PETSc Manual:
Mat/MatGetRowMaxAbs
PETSc.LibPETSc.MatGetRowMin — Method
MatGetRowMin(petsclib::PetscLibType,mat::PetscMat, v::PetscVec, idx::Vector{PetscInt})Gets the minimum value (of the real part) of each row of the matrix
Logically Collective
Input Parameter:
mat- the matrix
Output Parameters:
v- the vector for storing the maximumsidx- the indices of the column found for each row (optional, passNULLif not needed)
Level: intermediate
-seealso: , Mat, MatGetDiagonal(), MatCreateSubMatrices(), MatCreateSubMatrix(), MatGetRowMaxAbs(), MatGetRowMinAbs(), MatGetRowMax()
External Links
- PETSc Manual:
Mat/MatGetRowMin
PETSc.LibPETSc.MatGetRowMinAbs — Method
MatGetRowMinAbs(petsclib::PetscLibType,mat::PetscMat, v::PetscVec, idx::Vector{PetscInt})Gets the minimum value (in absolute value) of each row of the matrix
Logically Collective
Input Parameter:
mat- the matrix
Output Parameters:
v- the vector for storing the minimumsidx- the indices of the column found for each row (orNULLif not needed)
Level: intermediate
-seealso: , Mat, MatGetDiagonal(), MatCreateSubMatrices(), MatCreateSubMatrix(), MatGetRowMax(), MatGetRowMaxAbs(), MatGetRowMin()
External Links
- PETSc Manual:
Mat/MatGetRowMinAbs
PETSc.LibPETSc.MatGetRowSum — Method
MatGetRowSum(petsclib::PetscLibType,mat::PetscMat, v::PetscVec)Gets the sum of each row of the matrix
Logically or Neighborhood Collective
Input Parameter:
mat- the matrix
Output Parameter:
v- the vector for storing the sum of rows
Level: intermediate
-seealso: , Mat, MatGetDiagonal(), MatCreateSubMatrices(), MatCreateSubMatrix(), MatGetRowMax(), MatGetRowMin(), MatGetRowMaxAbs(), MatGetRowMinAbs(), MatGetRowSumAbs()
External Links
- PETSc Manual:
Mat/MatGetRowSum
PETSc.LibPETSc.MatGetRowSumAbs — Method
MatGetRowSumAbs(petsclib::PetscLibType,mat::PetscMat, v::PetscVec)Gets the sum value (in absolute value) of each row of the matrix
Logically Collective
Input Parameter:
mat- the matrix
Output Parameter:
v- the vector for storing the sum
Level: intermediate
This code is only implemented for a couple of matrix formats.
-seealso: , Mat, MatGetDiagonal(), MatCreateSubMatrices(), MatCreateSubMatrix(), MatGetRowMax(), MatGetRowMin(), MatGetRowMinAbs()
External Links
- PETSc Manual:
Mat/MatGetRowSumAbs
PETSc.LibPETSc.MatGetRowUpperTriangular — Method
MatGetRowUpperTriangular(petsclib::PetscLibType,mat::PetscMat)Sets a flag to enable calls to MatGetRow() for matrix in MATSBAIJ format. You should call MatRestoreRowUpperTriangular() after callingMatGetRow() and MatRestoreRow() to disable the flag.
Not Collective
Input Parameter:
mat- the matrix
Level: advanced
-seealso: , Mat, MATSBAIJ, MatRestoreRowUpperTriangular()
External Links
- PETSc Manual:
Mat/MatGetRowUpperTriangular
PETSc.LibPETSc.MatGetSchurComplement — Method
MatGetSchurComplement(petsclib::PetscLibType,A::PetscMat, isrow0::IS, iscol0::IS, isrow1::IS, iscol1::IS, mreuse::MatReuse, S::PetscMat, ainvtype::MatSchurComplementAinvType, preuse::MatReuse, Sp::PetscMat)Obtain the Schur complement from eliminating part of the matrix in another part.
Collective
Input Parameters:
A- matrix in which the complement is to be takenisrow0- rows to eliminateiscol0- columns to eliminate, (isrow0,iscol0) should be square and nonsingularisrow1- rows in which the Schur complement is formediscol1- columns in which the Schur complement is formedmreuse-MAT_INITIAL_MATRIXorMAT_REUSE_MATRIX, useMAT_IGNORE_MATRIXto put nothing inSainvtype- the type of approximation used for the inverse of the (0,0) block used in formingSp:
MAT_SCHUR_COMPLEMENT_AINV_DIAG, MAT_SCHUR_COMPLEMENT_AINV_LUMP, MAT_SCHUR_COMPLEMENT_AINV_BLOCK_DIAG, or MAT_SCHUR_COMPLEMENT_AINV_FULL
preuse-MAT_INITIAL_MATRIXorMAT_REUSE_MATRIX, useMAT_IGNORE_MATRIXto put nothing inSp
Output Parameters:
S- exact Schur complement, often of typeMATSCHURCOMPLEMENTwhich is difficult to use for preconditioningSp- approximate Schur complement from which a preconditioner can be built A11 - A10 inv(DIAGFORM(A00)) A01
Level: advanced
-seealso: , MatCreateSubMatrix(), PCFIELDSPLIT, MatCreateSchurComplement(), MatSchurComplementAinvType
External Links
- PETSc Manual:
Ksp/MatGetSchurComplement
PETSc.LibPETSc.MatGetSeqNonzeroStructure — Method
MatGetSeqNonzeroStructure(petsclib::PetscLibType,mat::PetscMat, matstruct::PetscMat)Extracts the nonzero structure from a matrix and stores it, in its entirety, on each process
Collective
Input Parameter:
mat- the matrix
Output Parameter:
matstruct- the sequential matrix with the nonzero structure ofmat
Level: developer
-seealso: , Mat, MatDestroySeqNonzeroStructure(), MatCreateSubMatrices(), MatDestroyMatrices()
External Links
- PETSc Manual:
Mat/MatGetSeqNonzeroStructure
PETSc.LibPETSc.MatGetSize — Method
m::PetscInt,n::PetscInt = MatGetSize(petsclib::PetscLibType,mat::PetscMat)Returns the numbers of rows and columns in a matrix.
Not Collective
Input Parameter:
mat- the matrix
Output Parameters:
m- the number of global rowsn- the number of global columns
Level: beginner
-seealso: , Mat, MatSetSizes(), MatGetLocalSize()
External Links
- PETSc Manual:
Mat/MatGetSize
PETSc.LibPETSc.MatGetState — Method
MatGetState(petsclib::PetscLibType,A::PetscMat, state::PetscObjectState)Gets the state of a Mat. Same value as returned by PetscObjectStateGet()
Not Collective
Input Parameter:
A- the matrix
Output Parameter:
state- the object state
Level: advanced
-seealso: , Mat, MatCreate(), PetscObjectStateGet(), MatGetNonzeroState()
External Links
- PETSc Manual:
Mat/MatGetState
PETSc.LibPETSc.MatGetTrace — Method
trace::PetscScalar = MatGetTrace(petsclib::PetscLibType,mat::PetscMat)Gets the trace of a matrix. The sum of the diagonal entries.
Collective
Input Parameter:
mat- the matrix
Output Parameter:
trace- the sum of the diagonal entries
Level: advanced
External Links
- PETSc Manual:
Mat/MatGetTrace
PETSc.LibPETSc.MatGetTransposeNullSpace — Method
MatGetTransposeNullSpace(petsclib::PetscLibType,mat::PetscMat, nullsp::MatNullSpace)retrieves the null space of the transpose of a matrix.
Logically Collective
Input Parameters:
mat- the matrixnullsp- the null space object
Level: developer
-seealso: , Mat, MatNullSpace, MatCreate(), MatNullSpaceCreate(), MatSetNearNullSpace(), MatSetTransposeNullSpace(), MatSetNullSpace(), MatGetNullSpace()
External Links
- PETSc Manual:
Mat/MatGetTransposeNullSpace
PETSc.LibPETSc.MatGetType — Method
type::MatType = MatGetType(petsclib::PetscLibType,mat::PetscMat)Gets the matrix type as a string from the matrix object.
Not Collective
Input Parameter:
mat- the matrix
Output Parameter:
type- name of matrix type
Level: intermediate
-seealso: , Mat, MatType, MatSetType()
External Links
- PETSc Manual:
Mat/MatGetType
PETSc.LibPETSc.MatGetValue — Method
va::PetscScalar = MatGetValue(petsclib::PetscLibType,mat::PetscMat, row::PetscInt, col::PetscInt)External Links
- PETSc Manual:
Mat/MatGetValue
PETSc.LibPETSc.MatGetValues — Method
MatGetValues(petsclib::PetscLibType,mat::PetscMat, m::PetscInt, idxm::Vector{PetscInt}, n::PetscInt, idxn::Vector{PetscInt}, v::Vector{PetscScalar})Gets a block of local values from a matrix.
Not Collective; can only return values that are owned by the give process
Input Parameters:
mat- the matrixv- a logically two-dimensional array for storing the valuesm- the number of rowsidxm- the global indices of the rowsn- the number of columnsidxn- the global indices of the columns
Level: advanced
-seealso: , Mat, MatGetRow(), MatCreateSubMatrices(), MatSetValues(), MatGetOwnershipRange(), MatGetValuesLocal(), MatGetValue()
External Links
- PETSc Manual:
Mat/MatGetValues
PETSc.LibPETSc.MatGetValuesLocal — Method
MatGetValuesLocal(petsclib::PetscLibType,mat::PetscMat, nrow::PetscInt, irow::Vector{PetscInt}, ncol::PetscInt, icol::Vector{PetscInt}, y::Vector{PetscScalar})retrieves values from certain locations in a matrix using the local numbering of the indices defined previously by MatSetLocalToGlobalMapping()
Not Collective
Input Parameters:
mat- the matrixnrow- number of rowsirow- the row local indicesncol- number of columnsicol- the column local indices
Output Parameter:
y- a one-dimensional array that contains the values implicitly stored as a two-dimensional array, by default in row-major order.
See MAT_ROW_ORIENTED in MatSetOption() for how to use column-major order.
Level: advanced
-seealso: , Mat, MatAssemblyBegin(), MatAssemblyEnd(), MatSetValues(), MatSetLocalToGlobalMapping(), MatSetValuesLocal(), MatGetValues()
External Links
- PETSc Manual:
Mat/MatGetValuesLocal
PETSc.LibPETSc.MatGetVariableBlockSizes — Method
nblocks::PetscInt,bsizes::Vector{PetscInt} = MatGetVariableBlockSizes(petsclib::PetscLibType,mat::PetscMat)Gets a diagonal blocks of the matrix that need not be of the same size
Not Collective; No Fortran Support
Input Parameter:
mat- the matrix
Output Parameters:
nblocks- the number of blocks on this processbsizes- the block sizes
Level: intermediate
-seealso: , Mat, MatCreateSeqBAIJ(), MatCreateBAIJ(), MatGetBlockSize(), MatSetBlockSizes(), MatGetBlockSizes(), MatSetVariableBlockSizes(), MatComputeVariableBlockEnvelope()
External Links
- PETSc Manual:
Mat/MatGetVariableBlockSizes
PETSc.LibPETSc.MatGetVecType — Method
vtype::VecType = MatGetVecType(petsclib::PetscLibType,mat::PetscMat)Gets the vector type the matrix will return with MatCreateVecs()
Not Collective
Input Parameter:
mat- the matrix
Output Parameter:
vtype- name of vector type
Level: intermediate
-seealso: , Mat, MatType, MatSetVecType(), VecType
External Links
- PETSc Manual:
Mat/MatGetVecType
PETSc.LibPETSc.MatHYPREGetParCSR — Method
MatHYPREGetParCSR(petsclib::PetscLibType,A::PetscMat, parcsr::hypre_ParCSRMatrix)Gets the pointer to the ParCSR matrix
Not Collective, No Fortran Support
Input Parameter:
A- theMATHYPREobject
Output Parameter:
parcsr- the pointer to thehypre_ParCSRMatrix
Level: intermediate
-seealso: , Mat, MATHYPRE, PetscCopyMode
External Links
- PETSc Manual:
Mat/MatHYPREGetParCSR
PETSc.LibPETSc.MatHYPRESetPreallocation — Method
MatHYPRESetPreallocation(petsclib::PetscLibType,A::PetscMat, dnz::PetscInt, dnnz::Vector{PetscInt}, onz::PetscInt, onnz::Vector{PetscInt})Preallocates memory for a sparse parallel matrix in HYPRE IJ format
Collective
Input Parameters:
A- the matrixdnz- number of nonzeros per row in DIAGONAL portion of local submatrix
(same value is used for all local rows)
dnnz- array containing the number of nonzeros in the various rows of the
DIAGONAL portion of the local submatrix (possibly different for each row) or NULL (PETSC_NULL_INTEGER in Fortran), if d_nz is used to specify the nonzero structure. The size of this array is equal to the number of local rows, i.e m. For matrices that will be factored, you must leave room for (and set) the diagonal entry even if it is zero.
onz- number of nonzeros per row in the OFF-DIAGONAL portion of local
submatrix (same value is used for all local rows).
onnz- array containing the number of nonzeros in the various rows of the
OFF-DIAGONAL portion of the local submatrix (possibly different for each row) or NULL (PETSC_NULL_INTEGER in Fortran), if o_nz is used to specify the nonzero structure. The size of this array is equal to the number of local rows, i.e m.
Level: intermediate
-seealso: , Mat, MatCreate(), MatMPIAIJSetPreallocation(), MATHYPRE, MATAIJ
External Links
- PETSc Manual:
Mat/MatHYPRESetPreallocation
PETSc.LibPETSc.MatHasCongruentLayouts — Method
cong::PetscBool = MatHasCongruentLayouts(petsclib::PetscLibType,mat::PetscMat)Determines whether the rows and columns layouts of the matrix are congruent
Collective
Input Parameter:
mat- the matrix
Output Parameter:
cong- eitherPETSC_TRUEorPETSC_FALSE
Level: beginner
-seealso: , Mat, MatCreate(), MatSetSizes(), PetscLayout
External Links
- PETSc Manual:
Mat/MatHasCongruentLayouts
PETSc.LibPETSc.MatHasOperation — Method
has::PetscBool = MatHasOperation(petsclib::PetscLibType,mat::PetscMat, op::MatOperation)Determines whether the given matrix supports the particular operation.
Not Collective
Input Parameters:
mat- the matrixop- the operation, for example,MATOP_GET_DIAGONAL
Output Parameter:
has- eitherPETSC_TRUEorPETSC_FALSE
Level: advanced
-seealso: , Mat, MatCreateShell(), MatGetOperation(), MatSetOperation()
External Links
- PETSc Manual:
Mat/MatHasOperation
PETSc.LibPETSc.MatHeaderMerge — Method
MatHeaderMerge(petsclib::PetscLibType,A::PetscMat, C::PetscMat)Merges some information from the header of C to A; the C object is then destroyed
Collective, No Fortran Support
Input Parameters:
A- aMatbeing merged intoC- theMatproviding the merge information
Level: developer
-seealso: Mat, MatHeaderReplace()
External Links
- PETSc Manual:
Mat/MatHeaderMerge
PETSc.LibPETSc.MatHeaderReplace — Method
MatHeaderReplace(petsclib::PetscLibType,A::PetscMat, C::PetscMat)Replaces the internal data of matrix A by the internal data of matrix C while deleting the outer wrapper of C
Input Parameters:
A- aMatwhose internal data is to be replacedC- theMatproviding new internal data forA
Level: advanced
-seealso: Mat, MatHeaderMerge()
External Links
- PETSc Manual:
Mat/MatHeaderReplace
PETSc.LibPETSc.MatHermitianTranspose — Method
MatHermitianTranspose(petsclib::PetscLibType,mat::PetscMat, reuse::MatReuse, B::PetscMat)Computes an in
Collective
Input Parameters:
mat- the matrix to transpose and complex conjugatereuse- eitherMAT_INITIAL_MATRIX,MAT_REUSE_MATRIX, orMAT_INPLACE_MATRIX
Output Parameter:
B- the Hermitian transpose
Level: intermediate
-seealso: , Mat, MatTranspose(), MatMultTranspose(), MatMultTransposeAdd(), MatIsTranspose(), MatReuse
External Links
- PETSc Manual:
Mat/MatHermitianTranspose
PETSc.LibPETSc.MatHermitianTransposeGetMat — Method
MatHermitianTransposeGetMat(petsclib::PetscLibType,A::PetscMat, M::PetscMat)Gets the Mat object stored inside a MATHERMITIANTRANSPOSEVIRTUAL
Logically Collective
Input Parameter:
A- theMATHERMITIANTRANSPOSEVIRTUALmatrix
Output Parameter:
M- the matrix object stored inside A
Level: intermediate
-seealso: , Mat, MATHERMITIANTRANSPOSEVIRTUAL, MatCreateHermitianTranspose()
External Links
- PETSc Manual:
Mat/MatHermitianTransposeGetMat
PETSc.LibPETSc.MatHtoolGetPermutationSource — Method
MatHtoolGetPermutationSource(petsclib::PetscLibType,A::PetscMat, is::IS)External Links
- PETSc Manual:
Mat/MatHtoolGetPermutationSource
PETSc.LibPETSc.MatHtoolGetPermutationTarget — Method
MatHtoolGetPermutationTarget(petsclib::PetscLibType,A::PetscMat, is::IS)External Links
- PETSc Manual:
Mat/MatHtoolGetPermutationTarget
PETSc.LibPETSc.MatHtoolSetKernel — Method
MatHtoolSetKernel(petsclib::PetscLibType,A::PetscMat, kernel::MatHtoolKernelFn, kernelctx::Cvoid)External Links
- PETSc Manual:
Mat/MatHtoolSetKernel
PETSc.LibPETSc.MatHtoolUsePermutation — Method
MatHtoolUsePermutation(petsclib::PetscLibType,A::PetscMat, use::PetscBool)External Links
- PETSc Manual:
Mat/MatHtoolUsePermutation
PETSc.LibPETSc.MatHtoolUseRecompression — Method
MatHtoolUseRecompression(petsclib::PetscLibType,A::PetscMat, use::PetscBool)External Links
- PETSc Manual:
Mat/MatHtoolUseRecompression
PETSc.LibPETSc.MatICCFactor — Method
MatICCFactor(petsclib::PetscLibType,mat::PetscMat, row::IS, info::MatFactorInfo)Performs in
Collective
Input Parameters:
mat- the matrixrow- row/column permutationinfo- information on desired factorization process
Level: developer
-seealso: , Mat, MatFactorInfo, MatGetFactor(), MatICCFactorSymbolic(), MatLUFactorNumeric(), MatCholeskyFactor()
External Links
- PETSc Manual:
Mat/MatICCFactor
PETSc.LibPETSc.MatICCFactorSymbolic — Method
MatICCFactorSymbolic(petsclib::PetscLibType,fact::PetscMat, mat::PetscMat, perm::IS, info::MatFactorInfo)Performs symbolic incomplete Cholesky factorization for a symmetric matrix. Use MatCholeskyFactorNumeric() to complete the factorization.
Collective
Input Parameters:
fact- the factorized matrix obtained withMatGetFactor()mat- the matrix to be factoredperm- row and column permutationinfo- structure containing
-seealso: , Mat, MatGetFactor(), MatCholeskyFactorNumeric(), MatCholeskyFactor(), MatFactorInfo
External Links
- PETSc Manual:
Mat/MatICCFactorSymbolic
PETSc.LibPETSc.MatILUFactor — Method
MatILUFactor(petsclib::PetscLibType,mat::PetscMat, row::IS, col::IS, info::MatFactorInfo)Performs in
Collective
Input Parameters:
mat- the matrixrow- row permutationcol- column permutationinfo- structure containing
-seealso: , Mat, Matrix Factorization, MatILUFactorSymbolic(), MatLUFactorNumeric(), MatCholeskyFactor(), MatFactorInfo
External Links
- PETSc Manual:
Mat/MatILUFactor
PETSc.LibPETSc.MatILUFactorSymbolic — Method
MatILUFactorSymbolic(petsclib::PetscLibType,fact::PetscMat, mat::PetscMat, row::IS, col::IS, info::MatFactorInfo)Performs symbolic ILU factorization of a matrix obtained with MatGetFactor() Uses levels of fill only, not drop tolerance. Use MatLUFactorNumeric() to complete the factorization.
Collective
Input Parameters:
fact- the factorized matrix obtained withMatGetFactor()mat- the matrixrow- row permutationcol- column permutationinfo- structure containing
-seealso: , Mat, Matrix Factorization, MatGetFactor(), MatLUFactorSymbolic(), MatLUFactorNumeric(), MatCholeskyFactor() MatGetOrdering(), MatFactorInfo
External Links
- PETSc Manual:
Mat/MatILUFactorSymbolic
PETSc.LibPETSc.MatISFixLocalEmpty — Method
MatISFixLocalEmpty(petsclib::PetscLibType,A::PetscMat, fix::PetscBool)Compress out zero local rows from the local matrices
Logically Collective
Input Parameters:
A- the matrixfix- the boolean flag
Level: advanced
-seealso: , Mat, MATIS, MatCreate(), MatCreateIS(), MatISSetPreallocation(), MatAssemblyEnd(), MAT_FINAL_ASSEMBLY
External Links
- PETSc Manual:
Mat/MatISFixLocalEmpty
PETSc.LibPETSc.MatISGetAllowRepeated — Method
flg::PetscBool = MatISGetAllowRepeated(petsclib::PetscLibType,A::PetscMat)Get the flag to allow repeated entries in the local to global map
Not Collective
Input Parameter:
A- the matrix
Output Parameter:
flg- the boolean flag
Level: intermediate
-seealso: , Mat, MatCreate(), MatCreateIS(), MatSetLocalToGlobalMapping(), MatISSetAllowRepeated()
External Links
- PETSc Manual:
Mat/MatISGetAllowRepeated
PETSc.LibPETSc.MatISGetLocalMat — Method
MatISGetLocalMat(petsclib::PetscLibType,mat::PetscMat, loc::PetscMat)Gets the local matrix stored inside a MATIS matrix.
Not Collective.
Input Parameter:
mat- the matrix
Output Parameter:
local- the local matrix
Level: intermediate
-seealso: , Mat, MATIS, MatISRestoreLocalMat()
External Links
- PETSc Manual:
Mat/MatISGetLocalMat
PETSc.LibPETSc.MatISGetLocalToGlobalMapping — Method
MatISGetLocalToGlobalMapping(petsclib::PetscLibType,A::PetscMat, rmapping::ISLocalToGlobalMapping, cmapping::ISLocalToGlobalMapping)Gets the local
Not Collective
Input Parameter:
A- the matrix
Output Parameters:
rmapping- row mappingcmapping- column mapping
Level: advanced
-seealso: , Mat, MATIS, MatSetLocalToGlobalMapping()
External Links
- PETSc Manual:
Mat/MatISGetLocalToGlobalMapping
PETSc.LibPETSc.MatISRestoreLocalMat — Method
MatISRestoreLocalMat(petsclib::PetscLibType,mat::PetscMat, loc::PetscMat)Restores the local matrix obtained with MatISGetLocalMat()
Not Collective.
Input Parameters:
mat- the matrixlocal- the local matrix
Level: intermediate
-seealso: , Mat, MATIS, MatISGetLocalMat()
External Links
- PETSc Manual:
Mat/MatISRestoreLocalMat
PETSc.LibPETSc.MatISSetAllowRepeated — Method
MatISSetAllowRepeated(petsclib::PetscLibType,A::PetscMat, flg::PetscBool)Set the flag to allow repeated entries in the local to global map
Logically Collective
Input Parameters:
A- the matrixflg- the boolean flag
Level: intermediate
-seealso: , Mat, MatCreate(), MatCreateIS(), MatSetLocalToGlobalMapping(), MatISGetAllowRepeated()
External Links
- PETSc Manual:
Mat/MatISSetAllowRepeated
PETSc.LibPETSc.MatISSetLocalMat — Method
MatISSetLocalMat(petsclib::PetscLibType,mat::PetscMat, loc::PetscMat)Replace the local matrix stored inside a MATIS object.
Not Collective
Input Parameters:
mat- the matrixlocal- the local matrix
Level: intermediate
-seealso: , Mat, MATIS, MatISSetLocalMatType, MatISGetLocalMat()
External Links
- PETSc Manual:
Mat/MatISSetLocalMat
PETSc.LibPETSc.MatISSetLocalMatType — Method
MatISSetLocalMatType(petsclib::PetscLibType,mat::PetscMat, mtype::MatType)Specifies the type of local matrix inside the MATIS
Logically Collective.
Input Parameters:
mat- the matrixmtype- the local matrix type
Level: intermediate
-seealso: , Mat, MATIS, MatSetType(), MatType
External Links
- PETSc Manual:
Mat/MatISSetLocalMatType
PETSc.LibPETSc.MatISSetPreallocation — Method
MatISSetPreallocation(petsclib::PetscLibType,B::PetscMat, d_nz::PetscInt, d_nnz::Vector{PetscInt}, o_nz::PetscInt, o_nnz::Vector{PetscInt})Preallocates memory for a MATIS parallel matrix.
Collective
Input Parameters:
B- the matrixd_nz- number of nonzeros per row in DIAGONAL portion of local submatrix
(same value is used for all local rows)
d_nnz- array containing the number of nonzeros in the various rows of the
DIAGONAL portion of the local submatrix (possibly different for each row) or NULL, if d_nz is used to specify the nonzero structure. The size of this array is equal to the number of local rows, i.e m. For matrices that will be factored, you must leave room for (and set) the diagonal entry even if it is zero.
o_nz- number of nonzeros per row in the OFF-DIAGONAL portion of local
submatrix (same value is used for all local rows).
o_nnz- array containing the number of nonzeros in the various rows of the
OFF-DIAGONAL portion of the local submatrix (possibly different for each row) or NULL, if o_nz is used to specify the nonzero structure. The size of this array is equal to the number of local rows, i.e m.
If the *nnz parameter is given then the *nz parameter is ignored
Level: intermediate
-seealso: , Mat, MatCreate(), MatCreateIS(), MatMPIAIJSetPreallocation(), MatISGetLocalMat(), MATIS
External Links
- PETSc Manual:
Mat/MatISSetPreallocation
PETSc.LibPETSc.MatISStoreL2L — Method
MatISStoreL2L(petsclib::PetscLibType,A::PetscMat, store::PetscBool)Store local
Logically Collective
Input Parameters:
A- the matrixstore- the boolean flag
Level: advanced
-seealso: , Mat, MatCreate(), MatCreateIS(), MatISSetPreallocation(), MatPtAP()
External Links
- PETSc Manual:
Mat/MatISStoreL2L
PETSc.LibPETSc.MatImaginaryPart — Method
MatImaginaryPart(petsclib::PetscLibType,mat::PetscMat)Moves the imaginary part of the matrix to the real part and zeros the imaginary part
Logically Collective
Input Parameter:
mat- the matrix
Level: advanced
-seealso: , Mat, MatRealPart()
External Links
- PETSc Manual:
Mat/MatImaginaryPart
PETSc.LibPETSc.MatIncreaseOverlap — Method
MatIncreaseOverlap(petsclib::PetscLibType,mat::PetscMat, n::PetscInt, is::Vector{IS}, ov::PetscInt)Given a set of submatrices indicated by index sets, replaces the index sets by larger ones that represent submatrices with additional overlap.
Collective
Input Parameters:
mat- the matrixn- the number of index setsis- the array of index sets (these index sets will changed during the call)ov- the additional overlap requested
Options Database Key:
-mat_increase_overlap_scalable- use a scalable algorithm to compute the overlap (supported by MPIAIJ matrix)
Level: developer
-seealso: , Mat, PCASM, MatSetBlockSize(), MatIncreaseOverlapSplit(), MatCreateSubMatrices()
External Links
- PETSc Manual:
Mat/MatIncreaseOverlap
PETSc.LibPETSc.MatIncreaseOverlapSplit — Method
MatIncreaseOverlapSplit(petsclib::PetscLibType,mat::PetscMat, n::PetscInt, is::Vector{IS}, ov::PetscInt)Given a set of submatrices indicated by index sets across a sub communicator, replaces the index sets by larger ones that represent submatrices with additional overlap.
Collective
Input Parameters:
mat- the matrixn- the number of index setsis- the array of index sets (these index sets will changed during the call)ov- the additional overlap requested
` Options Database Key:
-mat_increase_overlap_scalable- use a scalable algorithm to compute the overlap (supported by MPIAIJ matrix)
Level: developer
-seealso: , Mat, MatCreateSubMatrices(), MatIncreaseOverlap()
External Links
- PETSc Manual:
Mat/MatIncreaseOverlapSplit
PETSc.LibPETSc.MatInitializePackage — Method
MatInitializePackage(petsclib::PetscLibType)This function initializes everything in the Mat package. It is called from PetscDLLibraryRegister_petscmat() when using dynamic libraries, and on the first call to MatCreate() when using shared or static libraries.
Level: developer
-seealso: , Mat, PetscInitialize(), MatFinalizePackage()
External Links
- PETSc Manual:
Mat/MatInitializePackage
PETSc.LibPETSc.MatInodeAdjustForInodes — Method
MatInodeAdjustForInodes(petsclib::PetscLibType,A::PetscMat, rperm::IS, cperm::IS)External Links
- PETSc Manual:
Mat/MatInodeAdjustForInodes
PETSc.LibPETSc.MatInodeGetInodeSizes — Method
node_count::PetscInt,sizes::Vector{PetscInt},limit::PetscInt = MatInodeGetInodeSizes(petsclib::PetscLibType,A::PetscMat)Returns the inode information of a matrix with inodes
Not Collective
Input Parameter:
A- the Inode matrix or matrix derived from the Inode class – e.g.,MATSEQAIJ
Output Parameters:
node_count- no of inodes present in the matrix.sizes- an array of sizenode_count, with the sizes of each inode.limit- the max size used to generate the inodes.
Level: advanced
External Links
- PETSc Manual:
Mat/MatInodeGetInodeSizes
PETSc.LibPETSc.MatInterpolate — Method
MatInterpolate(petsclib::PetscLibType,A::PetscMat, x::PetscVec, y::PetscVec)y = Ax or A^Tx depending on the shape of the matrix
Neighbor-wise Collective
Input Parameters:
A- the matrixx- the vector to be interpolated
Output Parameter:
y- the resulting vector
Level: intermediate
-seealso: , Mat, MatMultAdd(), MatMultTransposeAdd(), MatRestrict(), PCMG
External Links
- PETSc Manual:
Mat/MatInterpolate
PETSc.LibPETSc.MatInterpolateAdd — Method
MatInterpolateAdd(petsclib::PetscLibType,A::PetscMat, x::PetscVec, y::PetscVec, w::PetscVec)w = y + Ax or A^Tx depending on the shape of the matrix
Neighbor-wise Collective
Input Parameters:
A- the matrixx- the vector to be multiplied by the interpolation operatory- the vector to be added to the result
Output Parameter:
w- the resulting vector
Level: intermediate
-seealso: , Mat, MatMultAdd(), MatMultTransposeAdd(), MatRestrict(), PCMG
External Links
- PETSc Manual:
Mat/MatInterpolateAdd
PETSc.LibPETSc.MatInvertBlockDiagonal — Method
values::Vector{PetscScalar} = MatInvertBlockDiagonal(petsclib::PetscLibType,mat::PetscMat)Inverts the block diagonal entries.
Collective; No Fortran Support
Input Parameter:
mat- the matrix
Output Parameter:
values- the block inverses in column major order (FORTRAN-like)
Level: advanced
-seealso: , Mat, MatInvertVariableBlockEnvelope(), MatInvertBlockDiagonalMat()
External Links
- PETSc Manual:
Mat/MatInvertBlockDiagonal
PETSc.LibPETSc.MatInvertBlockDiagonalMat — Method
MatInvertBlockDiagonalMat(petsclib::PetscLibType,A::PetscMat, C::PetscMat)set the values of matrix C to be the inverted block diagonal of matrix A
Collective
Input Parameters:
A- the matrixC- matrix with inverted block diagonal ofA. This matrix should be created and may have its type set.
Level: advanced
-seealso: , Mat, MatInvertBlockDiagonal()
External Links
- PETSc Manual:
Mat/MatInvertBlockDiagonalMat
PETSc.LibPETSc.MatInvertVariableBlockDiagonal — Method
MatInvertVariableBlockDiagonal(petsclib::PetscLibType,mat::PetscMat, nblocks::PetscInt, bsizes::Vector{PetscInt}, values::Vector{PetscScalar})Inverts the point block diagonal entries.
Collective; No Fortran Support
Input Parameters:
mat- the matrixnblocks- the number of blocks on the process, set withMatSetVariableBlockSizes()bsizes- the size of each block on the process, set withMatSetVariableBlockSizes()
Output Parameter:
values- the block inverses in column major order (FORTRAN-like)
Level: advanced
-seealso: , Mat, MatInvertBlockDiagonal(), MatSetVariableBlockSizes(), MatInvertVariableBlockEnvelope()
External Links
- PETSc Manual:
Mat/MatInvertVariableBlockDiagonal
PETSc.LibPETSc.MatInvertVariableBlockEnvelope — Method
MatInvertVariableBlockEnvelope(petsclib::PetscLibType,A::PetscMat, reuse::MatReuse, C::PetscMat)set matrix C to be the inverted block diagonal of matrix A
Collective
Input Parameters:
A- the matrixreuse- indicates if theCmatrix was obtained from a previous call to this routine
Output Parameter:
C- matrix with inverted block diagonal ofA
Level: advanced
-seealso: , Mat, MatInvertBlockDiagonal(), MatComputeBlockDiagonal()
External Links
- PETSc Manual:
Mat/MatInvertVariableBlockEnvelope
PETSc.LibPETSc.MatIsHermitian — Method
flg::PetscBool = MatIsHermitian(petsclib::PetscLibType,A::PetscMat, tol::PetscReal)Test whether a matrix is Hermitian
Collective
Input Parameters:
A- the matrix to testtol- difference between value and its transpose less than this amount counts as equal (use 0.0 for exact Hermitian)
Output Parameter:
flg- the result
Level: intermediate
-seealso: , Mat, MatTranspose(), MatIsTranspose(), MatIsHermitianKnown(), MatIsStructurallySymmetric(), MatSetOption(), MatIsSymmetricKnown(), MatIsSymmetric(), MAT_HERMITIAN, MAT_SYMMETRY_ETERNAL
External Links
- PETSc Manual:
Mat/MatIsHermitian
PETSc.LibPETSc.MatIsHermitianKnown — Method
set::PetscBool,flg::PetscBool = MatIsHermitianKnown(petsclib::PetscLibType,A::PetscMat)Checks if a matrix knows if it is Hermitian or not and its Hermitian state
Not Collective
Input Parameter:
A- the matrix to check
Output Parameters:
set-PETSC_TRUEif the matrix knows its Hermitian state (this tells you if the next flag is valid)flg- the result (only valid if set isPETSC_TRUE)
Level: advanced
-seealso: , Mat, MAT_SYMMETRY_ETERNAL, MAT_HERMITIAN, MatTranspose(), MatIsTranspose(), MatIsHermitian(), MatIsStructurallySymmetric(), MatSetOption(), MatIsSymmetric()
External Links
- PETSc Manual:
Mat/MatIsHermitianKnown
PETSc.LibPETSc.MatIsHermitianTranspose — Method
flg::PetscBool = MatIsHermitianTranspose(petsclib::PetscLibType,A::PetscMat, B::PetscMat, tol::PetscReal)Test whether a matrix is another one's Hermitian transpose,
Collective
Input Parameters:
A- the matrix to testB- the matrix to test against, this can equal the first parametertol- tolerance, differences between entries smaller than this are counted as zero
Output Parameter:
flg- the result
Level: intermediate
-seealso: , Mat, MatTranspose(), MatIsSymmetric(), MatIsHermitian(), MatIsTranspose()
External Links
- PETSc Manual:
Mat/MatIsHermitianTranspose
PETSc.LibPETSc.MatIsLinear — Method
flg::PetscBool = MatIsLinear(petsclib::PetscLibType,A::PetscMat, n::PetscInt)Check if a shell matrix A is a linear operator.
Collective
Input Parameters:
A- the shell matrixn- number of random vectors to be tested
Output Parameter:
flg-PETSC_TRUEif the shell matrix is linear;PETSC_FALSEotherwise.
Level: intermediate
-seealso: Mat, MatMatMultEqual(), MatMultEqual(), MatMultAddEqual(), MatMultTransposeEqual()
External Links
- PETSc Manual:
Mat/MatIsLinear
PETSc.LibPETSc.MatIsSPDKnown — Method
set::PetscBool,flg::PetscBool = MatIsSPDKnown(petsclib::PetscLibType,A::PetscMat)Checks if a matrix knows if it is symmetric positive definite or not and its symmetric positive definite state
Not Collective
Input Parameter:
A- the matrix to check
Output Parameters:
set-PETSC_TRUEif the matrix knows its symmetric positive definite state (this tells you if the next flag is valid)flg- the result (only valid if set isPETSC_TRUE)
Level: advanced
-seealso: , Mat, MAT_SPD_ETERNAL, MAT_SPD, MatTranspose(), MatIsTranspose(), MatIsHermitian(), MatIsStructurallySymmetric(), MatSetOption(), MatIsSymmetric(), MatIsHermitianKnown()
External Links
- PETSc Manual:
Mat/MatIsSPDKnown
PETSc.LibPETSc.MatIsShell — Method
flg::PetscBool = MatIsShell(petsclib::PetscLibType,mat::PetscMat)Inquires if a matrix is derived from MATSHELL
Input Parameter:
mat- the matrix
Output Parameter:
flg- the Boolean value
Level: developer
-seealso: , Mat, MATSHELL, MATMFFD, MatCreateShell(), MATTRANSPOSEVIRTUAL, MATSCHURCOMPLEMENT
External Links
- PETSc Manual:
Mat/MatIsShell
PETSc.LibPETSc.MatIsStructurallySymmetric — Method
flg::PetscBool = MatIsStructurallySymmetric(petsclib::PetscLibType,A::PetscMat)Test whether a matrix is structurally symmetric
Collective
Input Parameter:
A- the matrix to test
Output Parameter:
flg- the result
Level: intermediate
-seealso: , Mat, MAT_STRUCTURALLY_SYMMETRIC, MAT_STRUCTURAL_SYMMETRY_ETERNAL, MatTranspose(), MatIsTranspose(), MatIsHermitian(), MatIsSymmetric(), MatSetOption(), MatIsStructurallySymmetricKnown()
External Links
- PETSc Manual:
Mat/MatIsStructurallySymmetric
PETSc.LibPETSc.MatIsStructurallySymmetricKnown — Method
set::PetscBool,flg::PetscBool = MatIsStructurallySymmetricKnown(petsclib::PetscLibType,A::PetscMat)Checks if a matrix knows if it is structurally symmetric or not and its structurally symmetric state
Not Collective
Input Parameter:
A- the matrix to check
Output Parameters:
set- PETSC_TRUE if the matrix knows its structurally symmetric state (this tells you if the next flag is valid)flg- the result (only valid if set is PETSC_TRUE)
Level: advanced
-seealso: , Mat, MAT_STRUCTURALLY_SYMMETRIC, MatTranspose(), MatIsTranspose(), MatIsHermitian(), MatIsStructurallySymmetric(), MatSetOption(), MatIsSymmetric(), MatIsHermitianKnown()
External Links
- PETSc Manual:
Mat/MatIsStructurallySymmetricKnown
PETSc.LibPETSc.MatIsSymmetric — Method
flg::PetscBool = MatIsSymmetric(petsclib::PetscLibType,A::PetscMat, tol::PetscReal)Test whether a matrix is symmetric
Collective
Input Parameters:
A- the matrix to testtol- difference between value and its transpose less than this amount counts as equal (use 0.0 for exact transpose)
Output Parameter:
flg- the result
Level: intermediate
-seealso: , Mat, MatTranspose(), MatIsTranspose(), MatIsHermitian(), MatIsStructurallySymmetric(), MatSetOption(), MatIsSymmetricKnown(), MAT_SYMMETRIC, MAT_SYMMETRY_ETERNAL
External Links
- PETSc Manual:
Mat/MatIsSymmetric
PETSc.LibPETSc.MatIsSymmetricKnown — Method
set::PetscBool,flg::PetscBool = MatIsSymmetricKnown(petsclib::PetscLibType,A::PetscMat)Checks if a matrix knows if it is symmetric or not and its symmetric state
Not Collective
Input Parameter:
A- the matrix to check
Output Parameters:
set-PETSC_TRUEif the matrix knows its symmetry state (this tells you if the next flag is valid)flg- the result (only valid if set isPETSC_TRUE)
Level: advanced
-seealso: , Mat, MAT_SYMMETRY_ETERNAL, MatTranspose(), MatIsTranspose(), MatIsHermitian(), MatIsStructurallySymmetric(), MatSetOption(), MatIsSymmetric(), MatIsHermitianKnown()
External Links
- PETSc Manual:
Mat/MatIsSymmetricKnown
PETSc.LibPETSc.MatIsTranspose — Method
flg::PetscBool = MatIsTranspose(petsclib::PetscLibType,A::PetscMat, B::PetscMat, tol::PetscReal)Test whether a matrix is another one's transpose, or its own, in which case it tests symmetry.
Collective
Input Parameters:
A- the matrix to testB- the matrix to test against, this can equal the first parametertol- tolerance, differences between entries smaller than this are counted as zero
Output Parameter:
flg- the result
Level: intermediate
-seealso: , Mat, MatTranspose(), MatIsSymmetric(), MatIsHermitian()
External Links
- PETSc Manual:
Mat/MatIsTranspose
PETSc.LibPETSc.MatKAIJGetAIJ — Method
MatKAIJGetAIJ(petsclib::PetscLibType,A::PetscMat, B::PetscMat)Get the MATAIJ matrix describing the blockwise action of the MATKAIJ matrix
Not Collective, but if the MATKAIJ matrix is parallel, the MATAIJ matrix is also parallel
Input Parameter:
A- theMATKAIJmatrix
Output Parameter:
B- theMATAIJmatrix
Level: advanced
-seealso: , Mat, MatCreateKAIJ(), MATKAIJ, MATAIJ
External Links
- PETSc Manual:
Mat/MatKAIJGetAIJ
PETSc.LibPETSc.MatKAIJGetS — Method
m::PetscInt,n::PetscInt,S::Vector{PetscScalar} = MatKAIJGetS(petsclib::PetscLibType,A::PetscMat)Get the S matrix describing the shift action of the MATKAIJ matrix
Not Collective; the entire S is stored and returned independently on all processes.
Input Parameter:
A- theMATKAIJmatrix
Output Parameters:
m- the number of rows inSn- the number of columns inSS- the S matrix, in form of a scalar array in column-major format
Level: advanced
-seealso: , Mat, MATKAIJ, MatCreateKAIJ(), MatGetBlockSizes()
External Links
- PETSc Manual:
Mat/MatKAIJGetS
PETSc.LibPETSc.MatKAIJGetSRead — Method
m::PetscInt,n::PetscInt,S::Vector{PetscScalar} = MatKAIJGetSRead(petsclib::PetscLibType,A::PetscMat)Get a read
Not Collective; the entire S is stored and returned independently on all processes.
Input Parameter:
A- theMATKAIJmatrix
Output Parameters:
m- the number of rows inSn- the number of columns inSS- the S matrix, in form of a scalar array in column-major format
Level: advanced
-seealso: , Mat, MATKAIJ, MatCreateKAIJ(), MatGetBlockSizes()
External Links
- PETSc Manual:
Mat/MatKAIJGetSRead
PETSc.LibPETSc.MatKAIJGetScaledIdentity — Method
identity::PetscBool = MatKAIJGetScaledIdentity(petsclib::PetscLibType,A::PetscMat)Check if both S and T are scaled identities.
Logically Collective.
Input Parameter:
A- theMATKAIJmatrix
Output Parameter:
identity- the Boolean value
Level: advanced
-seealso: , Mat, MATKAIJ, MatKAIJGetS(), MatKAIJGetT()
External Links
- PETSc Manual:
Mat/MatKAIJGetScaledIdentity
PETSc.LibPETSc.MatKAIJGetT — Method
m::PetscInt,n::PetscInt,T::Vector{PetscScalar} = MatKAIJGetT(petsclib::PetscLibType,A::PetscMat)Get the transformation matrix T associated with the MATKAIJ matrix
Not Collective; the entire T is stored and returned independently on all processes
Input Parameter:
A- theMATKAIJmatrix
Output Parameters:
m- the number of rows inTn- the number of columns inTT- the T matrix, in form of a scalar array in column-major format
Level: advanced
-seealso: , Mat, MATKAIJ, MatCreateKAIJ(), MatGetBlockSizes()
External Links
- PETSc Manual:
Mat/MatKAIJGetT
PETSc.LibPETSc.MatKAIJGetTRead — Method
m::PetscInt,n::PetscInt,T::Vector{PetscScalar} = MatKAIJGetTRead(petsclib::PetscLibType,A::PetscMat)Get a read
Not Collective; the entire T is stored and returned independently on all processes
Input Parameter:
A- theMATKAIJmatrix
Output Parameters:
m- the number of rows inTn- the number of columns inTT- the T matrix, in form of a scalar array in column-major format
Level: advanced
-seealso: , Mat, MATKAIJ, MatCreateKAIJ(), MatGetBlockSizes()
External Links
- PETSc Manual:
Mat/MatKAIJGetTRead
PETSc.LibPETSc.MatKAIJRestoreS — Method
S::Vector{PetscScalar} = MatKAIJRestoreS(petsclib::PetscLibType,A::PetscMat)Restore array obtained with MatKAIJGetS()
Not Collective
Input Parameters:
A- theMATKAIJmatrixS- location of pointer to array obtained withMatKAIJGetS()
Level: advanced
-seealso: , Mat, MATKAIJ, MatKAIJGetS(), MatKAIJGetSRead(), MatKAIJRestoreSRead()
External Links
- PETSc Manual:
Mat/MatKAIJRestoreS
PETSc.LibPETSc.MatKAIJRestoreSRead — Method
S::Vector{PetscScalar} = MatKAIJRestoreSRead(petsclib::PetscLibType,A::PetscMat)Restore array obtained with MatKAIJGetSRead()
Not Collective
Input Parameters:
A- theMATKAIJmatrixS- location of pointer to array obtained withMatKAIJGetS()
Level: advanced
-seealso: , Mat, MATKAIJ, MatKAIJGetS(), MatKAIJGetSRead()
External Links
- PETSc Manual:
Mat/MatKAIJRestoreSRead
PETSc.LibPETSc.MatKAIJRestoreT — Method
T::Vector{PetscScalar} = MatKAIJRestoreT(petsclib::PetscLibType,A::PetscMat)Restore array obtained with MatKAIJGetT()
Not Collective
Input Parameters:
A- theMATKAIJmatrixT- location of pointer to array obtained withMatKAIJGetS()
Level: advanced
-seealso: , Mat, MATKAIJ, MatKAIJGetT(), MatKAIJGetTRead(), MatKAIJRestoreTRead()
External Links
- PETSc Manual:
Mat/MatKAIJRestoreT
PETSc.LibPETSc.MatKAIJRestoreTRead — Method
T::Vector{PetscScalar} = MatKAIJRestoreTRead(petsclib::PetscLibType,A::PetscMat)Restore array obtained with MatKAIJGetTRead()
Not Collective
Input Parameters:
A- theMATKAIJmatrixT- location of pointer to array obtained withMatKAIJGetS()
Level: advanced
-seealso: , Mat, MATKAIJ, MatKAIJGetT(), MatKAIJGetTRead()
External Links
- PETSc Manual:
Mat/MatKAIJRestoreTRead
PETSc.LibPETSc.MatKAIJSetAIJ — Method
MatKAIJSetAIJ(petsclib::PetscLibType,A::PetscMat, B::PetscMat)Set the MATAIJ matrix describing the blockwise action of the MATKAIJ matrix
Logically Collective; if the MATAIJ matrix is parallel, the MATKAIJ matrix is also parallel
Input Parameters:
A- theMATKAIJmatrixB- theMATAIJmatrix
Level: advanced
-seealso: , Mat, MATKAIJ, MatKAIJGetAIJ(), MatKAIJSetS(), MatKAIJSetT()
External Links
- PETSc Manual:
Mat/MatKAIJSetAIJ
PETSc.LibPETSc.MatKAIJSetS — Method
MatKAIJSetS(petsclib::PetscLibType,A::PetscMat, p::PetscInt, q::PetscInt, S::Vector{PetscScalar})Set the S matrix describing the shift action of the MATKAIJ matrix
Logically Collective; the entire S is stored independently on all processes.
Input Parameters:
A- theMATKAIJmatrixp- the number of rows inSq- the number of columns inSS- the S matrix, in form of a scalar array in column-major format
Level: advanced
-seealso: , Mat, MATKAIJ, MatKAIJGetS(), MatKAIJSetT(), MatKAIJSetAIJ()
External Links
- PETSc Manual:
Mat/MatKAIJSetS
PETSc.LibPETSc.MatKAIJSetT — Method
MatKAIJSetT(petsclib::PetscLibType,A::PetscMat, p::PetscInt, q::PetscInt, T::Vector{PetscScalar})Set the transformation matrix T associated with the MATKAIJ matrix
Logically Collective; the entire T is stored independently on all processes.
Input Parameters:
A- theMATKAIJmatrixp- the number of rows inSq- the number of columns inST- theTmatrix, in form of a scalar array in column-major format
Level: advanced
-seealso: , Mat, MATKAIJ, MatKAIJGetT(), MatKAIJSetS(), MatKAIJSetAIJ()
External Links
- PETSc Manual:
Mat/MatKAIJSetT
PETSc.LibPETSc.MatLMVMAllocate — Method
MatLMVMAllocate(petsclib::PetscLibType,B::PetscMat, X::PetscVec, F::PetscVec)Produces all necessary common memory for LMVM approximations based on the solution and function vectors provided.
Input Parameters:
B- AMATLMVMmatrixX- Solution vectorF- Function vector
Level: intermediate
-seealso: , LMVM Matrices, MATLMVM, MatLMVMReset(), MatLMVMUpdate()
External Links
- PETSc Manual:
Ksp/MatLMVMAllocate
PETSc.LibPETSc.MatLMVMApplyJ0Fwd — Method
MatLMVMApplyJ0Fwd(petsclib::PetscLibType,B::PetscMat, X::PetscVec, Y::PetscVec)Applies an approximation of the forward matrix-vector product with the initial Jacobian.
Input Parameters:
B- AMATLMVMmatrixX- vector to multiply with J0
Output Parameter:
Y- resulting vector for the operation
Level: advanced
-seealso: , LMVM Matrices, MATLMVM, MatLMVMSetJ0(), MatLMVMSetJ0Scale(), MatLMVMSetJ0ScaleDiag(), MatLMVMSetJ0PC(), MatLMVMSetJ0KSP(), MatLMVMApplyJ0Inv()
External Links
- PETSc Manual:
Ksp/MatLMVMApplyJ0Fwd
PETSc.LibPETSc.MatLMVMApplyJ0Inv — Method
MatLMVMApplyJ0Inv(petsclib::PetscLibType,B::PetscMat, X::PetscVec, Y::PetscVec)Applies some estimation of the initial Jacobian inverse to the given vector.
Input Parameters:
B- AMATLMVMmatrixX- vector to "multiply" with J0^{-1}
Output Parameter:
Y- resulting vector for the operation
Level: advanced
-seealso: , LMVM Matrices, MATLMVM, MatLMVMSetJ0(), MatLMVMSetJ0Scale(), MatLMVMSetJ0ScaleDiag(), MatLMVMSetJ0PC(), MatLMVMSetJ0KSP(), MatLMVMApplyJ0Fwd()
External Links
- PETSc Manual:
Ksp/MatLMVMApplyJ0Inv
PETSc.LibPETSc.MatLMVMClearJ0 — Method
MatLMVMClearJ0(petsclib::PetscLibType,B::PetscMat)Removes all definitions of J0 and reverts to an identity matrix (scale = 1.0).
Input Parameter:
B- AMATLMVMmatrix
Level: advanced
-seealso: , LMVM Matrices, MATLMVM, MatLMVMSetJ0()
External Links
- PETSc Manual:
Ksp/MatLMVMClearJ0
PETSc.LibPETSc.MatLMVMDenseSetType — Method
MatLMVMDenseSetType(petsclib::PetscLibType,B::PetscMat, type::MatLMVMDenseType)Sets the memory storage type for dense MATLMVM
Input Parameters:
B- theMATLMVMmatrixtype- scale type, seeMatLMVMDenseSetType
Options Database Keys:
-mat_lqn_type <reorder,inplace>- set the strategy-mat_lbfgs_type <reorder,inplace>- set the strategy-mat_ldfp_type <reorder,inplace>- set the strategy
Level: intermediate
MatLMVMDenseTypes:
MAT_LMVM_DENSE_REORDER- reorders memory to minimize kernel launchMAT_LMVM_DENSE_INPLACE- launches kernel inplace to minimize memory movement
-seealso: , MATLMVMDQN, MATLMVMDBFGS, MATLMVMDDFP, MatLMVMDenseType
External Links
- PETSc Manual:
Ksp/MatLMVMDenseSetType
PETSc.LibPETSc.MatLMVMGetHistorySize — Method
hist_size::PetscInt = MatLMVMGetHistorySize(petsclib::PetscLibType,B::PetscMat)External Links
- PETSc Manual:
Ksp/MatLMVMGetHistorySize
PETSc.LibPETSc.MatLMVMGetJ0 — Method
MatLMVMGetJ0(petsclib::PetscLibType,B::PetscMat, J0::PetscMat)Returns a pointer to the internal J0 matrix.
Input Parameter:
B- AMATLMVMmatrix
Output Parameter:
J0-Matobject for defining the initial Jacobian
Level: advanced
-seealso: , LMVM Matrices, MATLMVM, MatLMVMSetJ0()
External Links
- PETSc Manual:
Ksp/MatLMVMGetJ0
PETSc.LibPETSc.MatLMVMGetJ0KSP — Method
MatLMVMGetJ0KSP(petsclib::PetscLibType,B::PetscMat, J0ksp::PetscKSP)Returns a pointer to the internal KSP solver associated with the initial Jacobian.
Input Parameter:
B- AMATLMVMmatrix
Output Parameter:
J0ksp-KSPsolver for defining the initial inverse-Jacobian
Level: advanced
-seealso: , LMVM Matrices, MATLMVM, MatLMVMSetJ0KSP()
External Links
- PETSc Manual:
Ksp/MatLMVMGetJ0KSP
PETSc.LibPETSc.MatLMVMGetJ0PC — Method
MatLMVMGetJ0PC(petsclib::PetscLibType,B::PetscMat, J0pc::PC)Returns a pointer to the internal PC object associated with the initial Jacobian.
Input Parameter:
B- AMATLMVMmatrix
Output Parameter:
J0pc-PCobject for defining the initial inverse-Jacobian
Level: advanced
-seealso: , LMVM Matrices, MATLMVM, MatLMVMSetJ0PC()
External Links
- PETSc Manual:
Ksp/MatLMVMGetJ0PC
PETSc.LibPETSc.MatLMVMGetLastUpdate — Method
MatLMVMGetLastUpdate(petsclib::PetscLibType,B::PetscMat, x_prev::PetscVec, f_prev::PetscVec)Get the last vectors passed to MatLMVMUpdate()
Not collective
Input Parameter:
B- aMatLMVMmatrix
Output Parameters:
x_prev- the last solution vectorf_prev- the last function vector
Level: intermediate
-seealso: , MatLMVM, MatLMVMUpdate()
External Links
- PETSc Manual:
Ksp/MatLMVMGetLastUpdate
PETSc.LibPETSc.MatLMVMGetMultAlgorithm — Method
MatLMVMGetMultAlgorithm(petsclib::PetscLibType,B::PetscMat, alg::MatLMVMMultAlgorithm)Get the algorithm used by a MatLMVM for products
Not collective
Input Parameter:
B- aMatLMVMmatrix
Output Parameter:
alg- one of the algorithm classes (MAT_LMVM_MULT_RECURSIVE,MAT_LMVM_MULT_DENSE,MAT_LMVM_MULT_COMPACT_DENSE)
Level: advanced
-seealso: , MatLMVM, MatLMVMMultAlgorithm, MatLMVMSetMultAlgorithm()
External Links
- PETSc Manual:
Ksp/MatLMVMGetMultAlgorithm
PETSc.LibPETSc.MatLMVMGetRejectCount — Method
nrejects::PetscInt = MatLMVMGetRejectCount(petsclib::PetscLibType,B::PetscMat)Returns the number of rejected updates. The counters are reset when MatLMVMReset() is called.
Input Parameter:
B- AMATLMVMmatrix
Output Parameter:
nrejects- number of rejected updates
Level: intermediate
-seealso: , LMVM Matrices, MATLMVM, MatLMVMReset()
External Links
- PETSc Manual:
Ksp/MatLMVMGetRejectCount
PETSc.LibPETSc.MatLMVMGetUpdateCount — Method
nupdates::PetscInt = MatLMVMGetUpdateCount(petsclib::PetscLibType,B::PetscMat)Returns the number of accepted updates.
Input Parameter:
B- AMATLMVMmatrix
Output Parameter:
nupdates- number of accepted updates
Level: intermediate
-seealso: , LMVM Matrices, MATLMVM, MatLMVMGetRejectCount(), MatLMVMReset()
External Links
- PETSc Manual:
Ksp/MatLMVMGetUpdateCount
PETSc.LibPETSc.MatLMVMIsAllocated — Method
flg::PetscBool = MatLMVMIsAllocated(petsclib::PetscLibType,B::PetscMat)Returns a boolean flag that shows whether the necessary data structures for the underlying matrix is allocated.
Input Parameter:
B- AMATLMVMmatrix
Output Parameter:
flg-PETSC_TRUEif allocated,PETSC_FALSEotherwise
Level: intermediate
-seealso: , LMVM Matrices, MATLMVM, MatLMVMAllocate(), MatLMVMReset()
External Links
- PETSc Manual:
Ksp/MatLMVMIsAllocated
PETSc.LibPETSc.MatLMVMReset — Method
MatLMVMReset(petsclib::PetscLibType,B::PetscMat, destructive::PetscBool)Flushes all of the accumulated updates out of the MATLMVM approximation.
Input Parameters:
B- AMATLMVMmatrixdestructive- flag for enabling destruction of data structures
Level: intermediate
-seealso: , LMVM Matrices, MATLMVM, MatLMVMAllocate(), MatLMVMUpdate()
External Links
- PETSc Manual:
Ksp/MatLMVMReset
PETSc.LibPETSc.MatLMVMResetShift — Method
MatLMVMResetShift(petsclib::PetscLibType,B::PetscMat)Zero the shift factor for a MATLMVM.
Input Parameter:
B- AMATLMVMmatrix
Level: intermediate
-seealso: , LMVM Matrices, MATLMVM, MatLMVMAllocate(), MatLMVMUpdate()
External Links
- PETSc Manual:
Ksp/MatLMVMResetShift
PETSc.LibPETSc.MatLMVMSetHistorySize — Method
MatLMVMSetHistorySize(petsclib::PetscLibType,B::PetscMat, hist_size::PetscInt)Set the number of past iterates to be stored for the construction of the limited-memory quasi-Newton update.
Input Parameters:
B- AMATLMVMmatrixhist_size- number of past iterates (default 5)
Options Database Key:
-mat_lmvm_hist_size <m>- set number of past iterates
Level: beginner
-seealso: , LMVM Matrices, MATLMVM, MatLMVMGetUpdateCount()
External Links
- PETSc Manual:
Ksp/MatLMVMSetHistorySize
PETSc.LibPETSc.MatLMVMSetJ0 — Method
MatLMVMSetJ0(petsclib::PetscLibType,B::PetscMat, J0::PetscMat)Allows the user to define the initial Jacobian matrix from which the LMVM up.
Input Parameters:
B- An LMVM-type matrixJ0- The initial Jacobian matrix, will be referenced by B.
Level: advanced
-seealso: , LMVM Matrices, MATLMVM, MatLMVMSetJ0PC(), MatLMVMSetJ0KSP()
External Links
- PETSc Manual:
Ksp/MatLMVMSetJ0
PETSc.LibPETSc.MatLMVMSetJ0Diag — Method
MatLMVMSetJ0Diag(petsclib::PetscLibType,B::PetscMat, V::PetscVec)Allows the user to define a vector V such that J0 = diag(V).
Input Parameters:
B- An LMVM-type matrixV- Vector that defines the diagonal of the initial Jacobian: values are copied, V is not referenced
Level: advanced
-seealso: , LMVM Matrices, MATLMVM, MatLMVMSetScale(), MatLMVMSetJ0()
External Links
- PETSc Manual:
Ksp/MatLMVMSetJ0Diag
PETSc.LibPETSc.MatLMVMSetJ0KSP — Method
MatLMVMSetJ0KSP(petsclib::PetscLibType,B::PetscMat, J0ksp::PetscKSP)Allows the user to provide a pre approximation.
Input Parameters:
B- AMATLMVMmatrixJ0ksp-KSPsolver for the initial inverse-Jacobian application
Level: advanced
-seealso: , LMVM Matrices, MATLMVM, MatLMVMGetJ0KSP()
External Links
- PETSc Manual:
Ksp/MatLMVMSetJ0KSP
PETSc.LibPETSc.MatLMVMSetJ0PC — Method
MatLMVMSetJ0PC(petsclib::PetscLibType,B::PetscMat, J0pc::PC)Allows the user to define a PC object that acts as the initial inverse
Input Parameters:
B- AMATLMVMmatrixJ0pc-PCobject wherePCApply()defines an inverse application for J0
Level: advanced
-seealso: , LMVM Matrices, MATLMVM, MatLMVMGetJ0PC()
External Links
- PETSc Manual:
Ksp/MatLMVMSetJ0PC
PETSc.LibPETSc.MatLMVMSetJ0Scale — Method
MatLMVMSetJ0Scale(petsclib::PetscLibType,B::PetscMat, scale::PetscReal)Allows the user to define a scalar value mu such that J0 = mu*I.
Input Parameters:
B- AMATLMVMmatrixscale- Scalar value mu that defines the initial Jacobian
Level: advanced
-seealso: , LMVM Matrices, MATLMVM, MatLMVMSetDiagScale(), MatLMVMSetJ0()
External Links
- PETSc Manual:
Ksp/MatLMVMSetJ0Scale
PETSc.LibPETSc.MatLMVMSetMultAlgorithm — Method
MatLMVMSetMultAlgorithm(petsclib::PetscLibType,B::PetscMat, alg::MatLMVMMultAlgorithm)Set the algorithm used by a MatLMVM for products
Logically collective
Input Parameters:
B- aMatLMVMmatrixalg- one of the algorithm classes (MAT_LMVM_MULT_RECURSIVE,MAT_LMVM_MULT_DENSE,MAT_LMVM_MULT_COMPACT_DENSE)
Level: advanced
-seealso: , MatLMVM, MatLMVMMultAlgorithm, MatLMVMGetMultAlgorithm()
External Links
- PETSc Manual:
Ksp/MatLMVMSetMultAlgorithm
PETSc.LibPETSc.MatLMVMSymBadBroydenGetPsi — Method
psi::PetscReal = MatLMVMSymBadBroydenGetPsi(petsclib::PetscLibType,B::PetscMat)Get the psi parameter for a Broyden class quasi
Input Parameter:
B- The matrix
Output Parameter:
psi- a number defining an update that is an affine combination of the BFGS update (psi = 1) and DFP update (psi = 0)
Level: advanced
-seealso: , MATLMVMSYMBROYDEN, MATLMVMSYMBADBROYDEN, MATLMVMDFP, MATLMVMBFGS, MatLMVMSymBadBroydenSetPsi(), MatLMVMSymBroydenGetPhi(), MatLMVMSymBroydenSetPhi()
External Links
- PETSc Manual:
Ksp/MatLMVMSymBadBroydenGetPsi
PETSc.LibPETSc.MatLMVMSymBadBroydenSetPsi — Method
MatLMVMSymBadBroydenSetPsi(petsclib::PetscLibType,B::PetscMat, psi::PetscReal)Get the psi parameter for a Broyden class quasi
Input Parameters:
B- The matrixpsi- a number defining an update that is a convex combination of the BFGS update (psi = 1) and DFP update (psi = 0)
Level: developer
-seealso: , MATLMVMSYMBROYDEN, MATLMVMSYMBADBROYDEN, MATLMVMDFP, MATLMVMBFGS, MatLMVMSymBadBroydenGetPsi(), MatLMVMSymBroydenGetPhi(), MatLMVMSymBroydenSetPhi()
External Links
- PETSc Manual:
Ksp/MatLMVMSymBadBroydenSetPsi
PETSc.LibPETSc.MatLMVMSymBroydenGetPhi — Method
phi::PetscReal = MatLMVMSymBroydenGetPhi(petsclib::PetscLibType,B::PetscMat)Get the phi parameter for a Broyden class quasi
Input Parameter:
B- The matrix
Output Parameter:
phi- a number defining an update that is an affine combination of the BFGS update (phi = 0) and DFP update (phi = 1)
Level: advanced
-seealso: , MATLMVMSYMBROYDEN, MATLMVMSYMBADBROYDEN, MATLMVMDFP, MATLMVMBFGS, MatLMVMSymBroydenSetPhi(), MatLMVMSymBadBroydenGetPsi(), MatLMVMSymBadBroydenSetPsi()
External Links
- PETSc Manual:
Ksp/MatLMVMSymBroydenGetPhi
PETSc.LibPETSc.MatLMVMSymBroydenSetDelta — Method
MatLMVMSymBroydenSetDelta(petsclib::PetscLibType,B::PetscMat, delta::PetscScalar)Sets the starting value for the diagonal scaling vector computed in the SymBrdn approximations (also works for BFGS and DFP).
Input Parameters:
B-MATLMVMmatrixdelta- initial value for diagonal scaling
Level: intermediate
External Links
- PETSc Manual:
Ksp/MatLMVMSymBroydenSetDelta
PETSc.LibPETSc.MatLMVMSymBroydenSetPhi — Method
MatLMVMSymBroydenSetPhi(petsclib::PetscLibType,B::PetscMat, phi::PetscReal)Get the phi parameter for a Broyden class quasi
Input Parameters:
B- The matrixphi- a number defining an update that is a convex combination of the BFGS update (phi = 0) and DFP update (phi = 1)
Level: advanced
-seealso: , MATLMVMSYMBROYDEN, MATLMVMSYMBADBROYDEN, MATLMVMDFP, MATLMVMBFGS, MatLMVMSymBroydenGetPhi(), MatLMVMSymBadBroydenGetPsi(), MatLMVMSymBadBroydenSetPsi()
External Links
- PETSc Manual:
Ksp/MatLMVMSymBroydenSetPhi
PETSc.LibPETSc.MatLMVMSymBroydenSetScaleType — Method
MatLMVMSymBroydenSetScaleType(petsclib::PetscLibType,B::PetscMat, stype::MatLMVMSymBroydenScaleType)Sets the scale type for symmetric Broyden
Input Parameters:
B- theMATLMVMmatrixstype- scale type, seeMatLMVMSymBroydenScaleType
Options Database Key:
-mat_lmvm_scale_type <none,scalar,diagonal>- set the scaling type
Level: intermediate
MatLMVMSymBrdnScaleTypes:
MAT_LMVM_SYMBROYDEN_SCALE_NONE- use whatever initial Hessian is already there (will be the identity if the user does nothing)MAT_LMVM_SYMBROYDEN_SCALE_SCALAR- use the Shanno scalar as the initial HessianMAT_LMVM_SYMBROYDEN_SCALE_DIAGONAL- use a diagonalized BFGS update as the initial HessianMAT_LMVM_SYMBROYDEN_SCALE_USER- same asMAT_LMVM_SYMBROYDEN_NONEMAT_LMVM_SYMBROYDEN_SCALE_DECIDE- let PETSc decide
-seealso: , MATLMVMSYMBROYDEN, MatCreateLMVMSymBroyden(), MatLMVMSymBroydenScaleType
External Links
- PETSc Manual:
Ksp/MatLMVMSymBroydenSetScaleType
PETSc.LibPETSc.MatLMVMUpdate — Method
MatLMVMUpdate(petsclib::PetscLibType,B::PetscMat, X::PetscVec, F::PetscVec)Adds (X
Input Parameters:
B- AMATLMVMmatrixX- Solution vectorF- Function vector
Level: intermediate
-seealso: , LMVM Matrices, MATLMVM, MatLMVMReset(), MatLMVMAllocate()
External Links
- PETSc Manual:
Ksp/MatLMVMUpdate
PETSc.LibPETSc.MatLRCGetMats — Method
MatLRCGetMats(petsclib::PetscLibType,N::PetscMat, A::PetscMat, U::PetscMat, c::PetscVec, V::PetscMat)Returns the constituents of an LRC matrix
Not collective
Input Parameter:
N- matrix of typeMATLRC
Output Parameters:
A- the (sparse) matrixU- first dense rectangular (tall and skinny) matrixc- a sequential vector containing the diagonal of CV- second dense rectangular (tall and skinny) matrix
Level: intermediate
-seealso: , MatLRCSetMats(), Mat, MATLRC, MatCreateLRC()
External Links
- PETSc Manual:
Mat/MatLRCGetMats
PETSc.LibPETSc.MatLRCSetMats — Method
MatLRCSetMats(petsclib::PetscLibType,N::PetscMat, A::PetscMat, U::PetscMat, c::PetscVec, V::PetscMat)Sets the constituents of an LRC matrix
Logically collective
Input Parameters:
N- matrix of typeMATLRCA- the (sparse) matrixU- first dense rectangular (tall and skinny) matrixc- a sequential vector containing the diagonal of CV- second dense rectangular (tall and skinny) matrix
Level: intermediate
-seealso: , MatLRCGetMats(), Mat, MATLRC, MatCreateLRC()
External Links
- PETSc Manual:
Mat/MatLRCSetMats
PETSc.LibPETSc.MatLUFactor — Method
MatLUFactor(petsclib::PetscLibType,mat::PetscMat, row::IS, col::IS, info::MatFactorInfo)Performs in
Collective
Input Parameters:
mat- the matrixrow- row permutationcol- column permutationinfo- options for factorization, includes
-seealso: , Matrix Factorization, Mat, MatFactorType, MatLUFactorSymbolic(), MatLUFactorNumeric(), MatCholeskyFactor(), MatGetOrdering(), MatSetUnfactored(), MatFactorInfo, MatGetFactor()
External Links
- PETSc Manual:
Mat/MatLUFactor
PETSc.LibPETSc.MatLUFactorNumeric — Method
MatLUFactorNumeric(petsclib::PetscLibType,fact::PetscMat, mat::PetscMat, info::MatFactorInfo)Performs numeric LU factorization of a matrix. Call this routine after first calling MatLUFactorSymbolic() and MatGetFactor().
Collective
Input Parameters:
fact- the factor matrix obtained withMatGetFactor()mat- the matrixinfo- options for factorization
Level: developer
-seealso: , Mat, Matrix Factorization, MatGetFactor(), MatFactorInfo, MatLUFactorSymbolic(), MatLUFactor(), MatCholeskyFactor()
External Links
- PETSc Manual:
Mat/MatLUFactorNumeric
PETSc.LibPETSc.MatLUFactorSymbolic — Method
MatLUFactorSymbolic(petsclib::PetscLibType,fact::PetscMat, mat::PetscMat, row::IS, col::IS, info::MatFactorInfo)Performs symbolic LU factorization of matrix. Call this routine before calling MatLUFactorNumeric() and after MatGetFactor().
Collective
Input Parameters:
fact- the factor matrix obtained withMatGetFactor()mat- the matrixrow- the row permutationcol- the column permutationinfo- options for factorization, includes
-seealso: , Mat, Matrix Factorization, MatGetFactor(), MatLUFactor(), MatLUFactorNumeric(), MatCholeskyFactor(), MatFactorInfo, MatFactorInfoInitialize()
External Links
- PETSc Manual:
Mat/MatLUFactorSymbolic
PETSc.LibPETSc.MatLoad — Method
MatLoad(petsclib::PetscLibType,mat::PetscMat, viewer::PetscViewer)Loads a matrix that has been stored in binary/HDF5 format with MatView(). The matrix format is determined from the options database. Generates a parallel MPI matrix if the communicator has more than one processor. The default matrix type is MATAIJ.
Collective
Input Parameters:
mat- the newly loaded matrix, this needs to have been created withMatCreate()
or some related function before a call to MatLoad()
viewer-PETSCVIEWERBINARY/PETSCVIEWERHDF5file viewer
Options Database Key:
-matload_block_size <bs>- set block size
Level: beginner
-seealso: , Mat, PetscViewerBinaryOpen(), PetscViewerSetType(), MatView(), VecLoad()
External Links
- PETSc Manual:
Mat/MatLoad
PETSc.LibPETSc.MatMAIJGetAIJ — Method
MatMAIJGetAIJ(petsclib::PetscLibType,A::PetscMat, B::PetscMat)Get the MATAIJ matrix describing the blockwise action of the MATMAIJ matrix
Not Collective, but if the MATMAIJ matrix is parallel, the MATAIJ matrix is also parallel
Input Parameter:
A- theMATMAIJmatrix
Output Parameter:
B- theMATAIJmatrix
Level: advanced
-seealso: , Mat, MATMAIJ, MATAIJ, MatCreateMAIJ()
External Links
- PETSc Manual:
Mat/MatMAIJGetAIJ
PETSc.LibPETSc.MatMAIJRedimension — Method
MatMAIJRedimension(petsclib::PetscLibType,A::PetscMat, dof::PetscInt, B::PetscMat)Get a new MATMAIJ matrix with the same action, but for a different block size
Logically Collective
Input Parameters:
A- theMATMAIJmatrixdof- the block size for the new matrix
Output Parameter:
B- the newMATMAIJmatrix
Level: advanced
-seealso: , Mat, MATMAIJ, MatCreateMAIJ()
External Links
- PETSc Manual:
Mat/MatMAIJRedimension
PETSc.LibPETSc.MatMPIAIJGetLocalMat — Method
MatMPIAIJGetLocalMat(petsclib::PetscLibType,A::PetscMat, scall::MatReuse, A_loc::PetscMat)Creates a MATSEQAIJ from a MATMPIAIJ matrix.
Not Collective
Input Parameters:
A- the matrixscall- eitherMAT_INITIAL_MATRIXorMAT_REUSE_MATRIX
Output Parameter:
A_loc- the local sequential matrix generated
Level: developer
-seealso: , Mat, MATMPIAIJ, MatGetOwnershipRange(), MatMPIAIJGetLocalMatCondensed(), MatMPIAIJGetLocalMatMerge()
External Links
- PETSc Manual:
Mat/MatMPIAIJGetLocalMat
PETSc.LibPETSc.MatMPIAIJGetLocalMatCondensed — Method
MatMPIAIJGetLocalMatCondensed(petsclib::PetscLibType,A::PetscMat, scall::MatReuse, row::IS, col::IS, A_loc::PetscMat)Creates a MATSEQAIJ matrix from an MATMPIAIJ matrix by taking all its local rows and NON
Not Collective
Input Parameters:
A- the matrixscall- eitherMAT_INITIAL_MATRIXorMAT_REUSE_MATRIXrow- index set of rows to extract (orNULL)col- index set of columns to extract (orNULL)
Output Parameter:
A_loc- the local sequential matrix generated
Level: developer
-seealso: , Mat, MATMPIAIJ, MatGetOwnershipRange(), MatMPIAIJGetLocalMat()
External Links
- PETSc Manual:
Mat/MatMPIAIJGetLocalMatCondensed
PETSc.LibPETSc.MatMPIAIJGetLocalMatMerge — Method
MatMPIAIJGetLocalMatMerge(petsclib::PetscLibType,A::PetscMat, scall::MatReuse, glob::IS, A_loc::PetscMat)Creates a MATSEQAIJ from a MATMPIAIJ matrix by taking all its local rows and putting them into a sequential matrix with mlocal rows and n columns. Where n is the sum of the number of columns of the diagonal and off-diagonal part
Not Collective
Input Parameters:
A- the matrixscall- eitherMAT_INITIAL_MATRIXorMAT_REUSE_MATRIX
Output Parameters:
glob- sequentialISwith global indices associated with the columns of the local sequential matrix generated (can beNULL)A_loc- the local sequential matrix generated
Level: developer
-seealso: , Mat, MATMPIAIJ, MatGetOwnershipRange(), MatMPIAIJGetLocalMat(), MatMPIAIJGetLocalMatCondensed()
External Links
- PETSc Manual:
Mat/MatMPIAIJGetLocalMatMerge
PETSc.LibPETSc.MatMPIAIJGetNumberNonzeros — Method
MatMPIAIJGetNumberNonzeros(petsclib::PetscLibType,A::PetscMat, nz::PetscCount)gets the number of nonzeros in the matrix on this MPI rank
Not Collective
Input Parameter:
A- the matrix
Output Parameter:
nz- the number of nonzeros
Level: advanced
External Links
- PETSc Manual:
Mat/MatMPIAIJGetNumberNonzeros
PETSc.LibPETSc.MatMPIAIJGetSeqAIJ — Method
colmap::Vector{PetscInt} = MatMPIAIJGetSeqAIJ(petsclib::PetscLibType,A::PetscMat, Ad::PetscMat, Ao::PetscMat)Returns the local pieces of this distributed matrix
Not Collective
Input Parameter:
A- TheMATMPIAIJmatrix
Output Parameters:
Ad- The local diagonal block as aMATSEQAIJmatrixAo- The local off-diagonal block as aMATSEQAIJmatrixcolmap- An array mapping local column numbers ofAoto global column numbers of the parallel matrix
Level: intermediate
-seealso: , Mat, MATMPIAIJ, MatMPIAIJGetLocalMat(), MatMPIAIJGetLocalMatCondensed(), MatCreateAIJ(), MATSEQAIJ
External Links
- PETSc Manual:
Mat/MatMPIAIJGetSeqAIJ
PETSc.LibPETSc.MatMPIAIJSetPreallocation — Method
MatMPIAIJSetPreallocation(petsclib::PetscLibType,B::PetscMat, d_nz::PetscInt, d_nnz::Vector{PetscInt}, o_nz::PetscInt, o_nnz::Vector{PetscInt})Preallocates memory for a sparse parallel matrix in MATMPIAIJ format (the default parallel PETSc format). For good matrix assembly performance the user should preallocate the matrix storage by setting the parameters d_nz (or d_nnz) and o_nz (or o_nnz).
Collective
Input Parameters:
B- the matrixd_nz- number of nonzeros per row in DIAGONAL portion of local submatrix
(same value is used for all local rows)
d_nnz- array containing the number of nonzeros in the various rows of the
DIAGONAL portion of the local submatrix (possibly different for each row) or NULL (PETSC_NULL_INTEGER in Fortran), if d_nz is used to specify the nonzero structure. The size of this array is equal to the number of local rows, i.e 'm'. For matrices that will be factored, you must leave room for (and set) the diagonal entry even if it is zero.
o_nz- number of nonzeros per row in the OFF-DIAGONAL portion of local
submatrix (same value is used for all local rows).
o_nnz- array containing the number of nonzeros in the various rows of the
OFF-DIAGONAL portion of the local submatrix (possibly different for each row) or NULL (PETSC_NULL_INTEGER in Fortran), if o_nz is used to specify the nonzero structure. The size of this array is equal to the number of local rows, i.e 'm'.
-seealso: , Mat, Sparse Matrices, MATMPIAIJ, MATAIJ, MatCreate(), MatCreateSeqAIJ(), MatSetValues(), MatCreateAIJ(), MatMPIAIJSetPreallocationCSR(), MatGetInfo(), PetscSplitOwnership(), MatSetPreallocationCOO(), MatSetValuesCOO()
External Links
- PETSc Manual:
Mat/MatMPIAIJSetPreallocation
PETSc.LibPETSc.MatMPIAIJSetPreallocationCSR — Method
MatMPIAIJSetPreallocationCSR(petsclib::PetscLibType,B::PetscMat, i::Vector{PetscInt}, j::Vector{PetscInt}, v::Vector{PetscScalar})Allocates memory for a sparse parallel matrix in MATAIJ format (the default parallel PETSc format).
Collective
Input Parameters:
B- the matrixi- the indices intojfor the start of each local row (indices start with zero)j- the column indices for each local row (indices start with zero)v- optional values in the matrix
Level: developer
-seealso: , Mat, MATMPIAIJ, MatCreate(), MatCreateSeqAIJ(), MatSetValues(), MatMPIAIJSetPreallocation(), MatCreateAIJ(), MatCreateSeqAIJWithArrays(), MatCreateMPIAIJWithSplitArrays(), MatCreateMPIAIJWithArrays(), MatSetPreallocationCOO(), MatSetValuesCOO()
External Links
- PETSc Manual:
Mat/MatMPIAIJSetPreallocationCSR
PETSc.LibPETSc.MatMPIAIJSetUseScalableIncreaseOverlap — Method
MatMPIAIJSetUseScalableIncreaseOverlap(petsclib::PetscLibType,A::PetscMat, sc::PetscBool)Determine if the matrix uses a scalable algorithm to compute the overlap
Collective
Input Parameters:
A- the matrixsc-PETSC_TRUEindicates use the scalable algorithm (default is not to use the scalable algorithm)
Level: advanced
External Links
- PETSc Manual:
Mat/MatMPIAIJSetUseScalableIncreaseOverlap
PETSc.LibPETSc.MatMPIAdjCreateNonemptySubcommMat — Method
B::PetscMat = MatMPIAdjCreateNonemptySubcommMat(petsclib::PetscLibType,A::PetscMat)create the same MATMPIADJ matrix on a subcommunicator containing only processes owning a positive number of rows
Collective
Input Parameter:
A- originalMATMPIADJmatrix
Output Parameter:
B- matrix on subcommunicator,NULLon MPI processes that own zero rows ofA
Level: developer
-seealso: , Mat, MATMPIADJ, MatCreateMPIAdj()
External Links
- PETSc Manual:
Mat/MatMPIAdjCreateNonemptySubcommMat
PETSc.LibPETSc.MatMPIAdjSetPreallocation — Method
i::PetscInt,j::PetscInt,values::PetscInt = MatMPIAdjSetPreallocation(petsclib::PetscLibType,B::PetscMat)Sets the array used for storing the matrix elements
Logically Collective
Input Parameters:
B- the matrixi- the indices intojfor the start of each rowj- the column indices for each row (sorted for each row).
The indices in i and j start with zero (NOT with one).
values- [useNULLif not provided] edge weights
Level: intermediate
-seealso: , Mat, MatCreate(), MatCreateMPIAdj(), MatSetValues(), MATMPIADJ
External Links
- PETSc Manual:
Mat/MatMPIAdjSetPreallocation
PETSc.LibPETSc.MatMPIAdjToSeq — Method
MatMPIAdjToSeq(petsclib::PetscLibType,A::PetscMat, B::PetscMat)Converts an parallel MATMPIADJ matrix to complete MATMPIADJ on each process (needed by sequential partitioners)
Logically Collective
Input Parameter:
A- the matrix
Output Parameter:
B- the same matrix on all processes
Level: intermediate
-seealso: , Mat, MATMPIADJ, MatCreate(), MatCreateMPIAdj(), MatSetValues(), MatMPIAdjToSeqRankZero()
External Links
- PETSc Manual:
Mat/MatMPIAdjToSeq
PETSc.LibPETSc.MatMPIAdjToSeqRankZero — Method
MatMPIAdjToSeqRankZero(petsclib::PetscLibType,A::PetscMat, B::PetscMat)Converts an parallel MATMPIADJ matrix to complete MATMPIADJ on rank zero (needed by sequential partitioners)
Logically Collective
Input Parameter:
A- the matrix
Output Parameter:
B- the same matrix on rank zero, not set on other ranks
Level: intermediate
-seealso: , Mat, MATMPIADJ, MatCreate(), MatCreateMPIAdj(), MatSetValues(), MatMPIAdjToSeq()
External Links
- PETSc Manual:
Mat/MatMPIAdjToSeqRankZero
PETSc.LibPETSc.MatMPIBAIJGetSeqBAIJ — Method
colmap::Vector{PetscInt} = MatMPIBAIJGetSeqBAIJ(petsclib::PetscLibType,A::PetscMat, Ad::PetscMat, Ao::PetscMat)External Links
- PETSc Manual:
Mat/MatMPIBAIJGetSeqBAIJ
PETSc.LibPETSc.MatMPIBAIJSetHashTableFactor — Method
MatMPIBAIJSetHashTableFactor(petsclib::PetscLibType,mat::PetscMat, fact::PetscReal)Sets the factor required to compute the size of the matrices hash table
Input Parameters:
mat- the matrixfact- factor
Options Database Key:
-mat_use_hash_table <fact>- provide the factor
Level: advanced
-seealso: Mat, MATMPIBAIJ, MatSetOption()
External Links
- PETSc Manual:
Mat/MatMPIBAIJSetHashTableFactor
PETSc.LibPETSc.MatMPIBAIJSetPreallocation — Method
MatMPIBAIJSetPreallocation(petsclib::PetscLibType,B::PetscMat, bs::PetscInt, d_nz::PetscInt, d_nnz::Vector{PetscInt}, o_nz::PetscInt, o_nnz::Vector{PetscInt})Allocates memory for a sparse parallel matrix in MATMPIBAIJ format (block compressed row).
Collective
Input Parameters:
B- the matrixbs- size of block, the blocks are ALWAYS square. One can useMatSetBlockSizes()to set a different row and column blocksize but the row
blocksize always defines the size of the blocks. The column blocksize sets the blocksize of the vectors obtained with MatCreateVecs()
d_nz- number of block nonzeros per block row in diagonal portion of local
submatrix (same for all local rows)
d_nnz- array containing the number of block nonzeros in the various block rows
of the in diagonal portion of the local (possibly different for each block row) or NULL. If you plan to factor the matrix you must leave room for the diagonal entry and set it even if it is zero.
o_nz- number of block nonzeros per block row in the off-diagonal portion of local
submatrix (same for all local rows).
o_nnz- array containing the number of nonzeros in the various block rows of the
off-diagonal portion of the local submatrix (possibly different for each block row) or NULL.
If the *nnz parameter is given then the *nz parameter is ignored
Options Database Keys:
-mat_block_size- size of the blocks to use-mat_use_hash_table <fact>- set hash table factor
Level: intermediate
-seealso: Mat, MATMPIBAIJ, MatCreate(), MatCreateSeqBAIJ(), MatSetValues(), MatCreateBAIJ(), MatMPIBAIJSetPreallocationCSR(), PetscSplitOwnership()
External Links
- PETSc Manual:
Mat/MatMPIBAIJSetPreallocation
PETSc.LibPETSc.MatMPIBAIJSetPreallocationCSR — Method
MatMPIBAIJSetPreallocationCSR(petsclib::PetscLibType,B::PetscMat, bs::PetscInt, i::Vector{PetscInt}, j::Vector{PetscInt}, v::Vector{PetscScalar})Creates a sparse parallel matrix in MATBAIJ format using the given nonzero structure and (optional) numerical values
Collective
Input Parameters:
B- the matrixbs- the block sizei- the indices intojfor the start of each local row (starts with zero)j- the column indices for each local row (starts with zero) these must be sorted for each rowv- optional values in the matrix, useNULLif not provided
Level: advanced
-seealso: Mat, MatCreate(), MatCreateSeqAIJ(), MatSetValues(), MatMPIBAIJSetPreallocation(), MatCreateAIJ(), MATMPIAIJ, MatCreateMPIBAIJWithArrays(), MATMPIBAIJ
External Links
- PETSc Manual:
Mat/MatMPIBAIJSetPreallocationCSR
PETSc.LibPETSc.MatMPIDenseSetPreallocation — Method
MatMPIDenseSetPreallocation(petsclib::PetscLibType,B::PetscMat, data::PetscScalar)Sets the array used to store the matrix entries
Collective
Input Parameters:
B- the matrixdata- optional location of matrix data. Set toNULLfor PETSc
to control all matrix memory allocation.
Level: intermediate
-seealso: , Mat, MATMPIDENSE, MatCreate(), MatCreateSeqDense(), MatSetValues()
External Links
- PETSc Manual:
Mat/MatMPIDenseSetPreallocation
PETSc.LibPETSc.MatMPISBAIJSetPreallocation — Method
MatMPISBAIJSetPreallocation(petsclib::PetscLibType,B::PetscMat, bs::PetscInt, d_nz::PetscInt, d_nnz::Vector{PetscInt}, o_nz::PetscInt, o_nnz::Vector{PetscInt})For good matrix assembly performance the user should preallocate the matrix storage by setting the parameters dnz (or dnnz) and onz (or onnz). By setting these parameters accurately, performance can be increased by more than a factor of 50.
Collective
Input Parameters:
B- the matrixbs- size of block, the blocks are ALWAYS square. One can use MatSetBlockSizes() to set a different row and column blocksize but the row
blocksize always defines the size of the blocks. The column blocksize sets the blocksize of the vectors obtained with MatCreateVecs()
d_nz- number of block nonzeros per block row in diagonal portion of local
submatrix (same for all local rows)
d_nnz- array containing the number of block nonzeros in the various block rows
in the upper triangular and diagonal part of the in diagonal portion of the local (possibly different for each block row) or NULL. If you plan to factor the matrix you must leave room for the diagonal entry and set a value even if it is zero.
o_nz- number of block nonzeros per block row in the off-diagonal portion of local
submatrix (same for all local rows).
o_nnz- array containing the number of nonzeros in the various block rows of the
off-diagonal portion of the local submatrix that is right of the diagonal (possibly different for each block row) or NULL.
Options Database Keys:
-mat_no_unroll- uses code that does not unroll the loops in the
block calculations (much slower)
-mat_block_size- size of the blocks to use
Level: intermediate
-seealso: , Mat, MATMPISBAIJ, MATSBAIJ, MatCreate(), MatCreateSeqSBAIJ(), MatSetValues(), MatCreateBAIJ(), PetscSplitOwnership()
External Links
- PETSc Manual:
Mat/MatMPISBAIJSetPreallocation
PETSc.LibPETSc.MatMPISBAIJSetPreallocationCSR — Method
MatMPISBAIJSetPreallocationCSR(petsclib::PetscLibType,B::PetscMat, bs::PetscInt, i::Vector{PetscInt}, j::Vector{PetscInt}, v::Vector{PetscScalar})Creates a sparse parallel matrix in MATMPISBAIJ format using the given nonzero structure and (optional) numerical values
Collective
Input Parameters:
B- the matrixbs- the block sizei- the indices intojfor the start of each local row (indices start with zero)j- the column indices for each local row (indices start with zero) these must be sorted for each rowv- optional values in the matrix, passNULLif not provided
Level: advanced
-seealso: , Mat, MATMPISBAIJ, MatCreate(), MatCreateSeqAIJ(), MatSetValues(), MatMPIBAIJSetPreallocation(), MatCreateAIJ(), MATMPIAIJ, MatCreateMPISBAIJWithArrays()
External Links
- PETSc Manual:
Mat/MatMPISBAIJSetPreallocationCSR
PETSc.LibPETSc.MatMPISELLGetLocalMatCondensed — Method
MatMPISELLGetLocalMatCondensed(petsclib::PetscLibType,A::PetscMat, scall::MatReuse, row::IS, col::IS, A_loc::PetscMat)Creates a MATSEQSELL matrix from an MATMPISELL matrix by taking all its local rows and NON-ZERO columns
Not Collective
Input Parameters:
A- the matrixscall- eitherMAT_INITIAL_MATRIXorMAT_REUSE_MATRIXrow- index sets of rows to extract (orNULL)col- index sets of columns to extract (orNULL)
Output Parameter:
A_loc- the local sequential matrix generated
Level: advanced
-seealso: Mat, MATSEQSELL, MATMPISELL, MatGetOwnershipRange(), MatMPISELLGetLocalMat()
External Links
- PETSc Manual:
Mat/MatMPISELLGetLocalMatCondensed
PETSc.LibPETSc.MatMPISELLGetSeqSELL — Method
colmap::Vector{PetscInt} = MatMPISELLGetSeqSELL(petsclib::PetscLibType,A::PetscMat, Ad::PetscMat, Ao::PetscMat)Returns the local pieces of this distributed matrix
Not Collective
Input Parameter:
A- theMATMPISELLmatrix
Output Parameters:
Ad- The diagonal portion ofAAo- The off-diagonal portion ofAcolmap- An array mapping local column numbers ofAoto global column numbers of the parallel matrix
Level: advanced
-seealso: Mat, MATSEQSELL, MATMPISELL
External Links
- PETSc Manual:
Mat/MatMPISELLGetSeqSELL
PETSc.LibPETSc.MatMPISELLSetPreallocation — Method
MatMPISELLSetPreallocation(petsclib::PetscLibType,B::PetscMat, d_nz::PetscInt, d_nnz::Vector{PetscInt}, o_nz::PetscInt, o_nnz::Vector{PetscInt})Preallocates memory for a MATMPISELL sparse parallel matrix in sell format. For good matrix assembly performance the user should preallocate the matrix storage by setting the parameters d_nz (or d_nnz) and o_nz (or o_nnz).
Collective
Input Parameters:
B- the matrixd_nz- number of nonzeros per row in DIAGONAL portion of local submatrix
(same value is used for all local rows)
d_nnz- array containing the number of nonzeros in the various rows of the
DIAGONAL portion of the local submatrix (possibly different for each row) or NULL (PETSC_NULL_INTEGER in Fortran), if d_nz is used to specify the nonzero structure. The size of this array is equal to the number of local rows, i.e 'm'. For matrices that will be factored, you must leave room for (and set) the diagonal entry even if it is zero.
o_nz- number of nonzeros per row in the OFF-DIAGONAL portion of local
submatrix (same value is used for all local rows).
o_nnz- array containing the number of nonzeros in the various rows of the
OFF-DIAGONAL portion of the local submatrix (possibly different for each row) or NULL (PETSC_NULL_INTEGER in Fortran), if o_nz is used to specify the nonzero structure. The size of this array is equal to the number of local rows, i.e 'm'.
Example usage: Consider the following 8x8 matrix with 34 non-zero values, that is assembled across 3 processors. Lets assume that proc0 owns 3 rows, proc1 owns 3 rows, proc2 owns 2 rows. This division can be shown as follows
-seealso: Mat, MatCreate(), MatCreateSeqSELL(), MatSetValues(), MatCreateSELL(), MATMPISELL, MatGetInfo(), PetscSplitOwnership(), MATSELL
External Links
- PETSc Manual:
Mat/MatMPISELLSetPreallocation
PETSc.LibPETSc.MatMatInterpolate — Method
MatMatInterpolate(petsclib::PetscLibType,A::PetscMat, x::PetscMat, y::PetscMat)Y = AX or A^TX depending on the shape of A
Neighbor-wise Collective
Input Parameters:
A- the matrixx- the input dense matrix
Output Parameter:
y- the output dense matrix
Level: intermediate
-seealso: , Mat, MatInterpolate(), MatRestrict(), MatMatRestrict(), PCMG
External Links
- PETSc Manual:
Mat/MatMatInterpolate
PETSc.LibPETSc.MatMatInterpolateAdd — Method
MatMatInterpolateAdd(petsclib::PetscLibType,A::PetscMat, x::PetscMat, w::PetscMat, y::PetscMat)Y = W + AX or W + A^TX depending on the shape of A
Neighbor-wise Collective
Input Parameters:
A- the matrixx- the input dense matrix to be multipliedw- the input dense matrix to be added to the result
Output Parameter:
y- the output dense matrix
Level: intermediate
-seealso: , Mat, MatInterpolateAdd(), MatMatInterpolate(), MatMatRestrict(), PCMG
External Links
- PETSc Manual:
Mat/MatMatInterpolateAdd
PETSc.LibPETSc.MatMatMatMult — Method
MatMatMatMult(petsclib::PetscLibType,A::PetscMat, B::PetscMat, C::PetscMat, scall::MatReuse, fill::PetscReal, D::PetscMat)Performs matrix
Neighbor-wise Collective
Input Parameters:
A- the left matrixB- the middle matrixC- the right matrixscall- eitherMAT_INITIAL_MATRIXorMAT_REUSE_MATRIXfill- expected fill as ratio of nnz(D)/(nnz(A) + nnz(B)+nnz(C)), usePETSC_DETERMINEorPETSC_CURRENTif you do not have a good estimate
if the result is a dense matrix this is irrelevant
Output Parameter:
D- the product matrix
Level: intermediate
-seealso: , Mat, MatProductCreate(), MATPRODUCT_ABC, MatMatMult, MatPtAP(), MatMatTransposeMult(), MatTransposeMatMult()
External Links
- PETSc Manual:
Mat/MatMatMatMult
PETSc.LibPETSc.MatMatMult — Method
MatMatMult(petsclib::PetscLibType,A::PetscMat, B::PetscMat, scall::MatReuse, fill::PetscReal, C::PetscMat)Performs matrix
Neighbor-wise Collective
Input Parameters:
A- the left matrixB- the right matrixscall- eitherMAT_INITIAL_MATRIXorMAT_REUSE_MATRIXfill- expected fill as ratio of nnz(C)/(nnz(A) + nnz(B)), usePETSC_DETERMINEorPETSC_CURRENTif you do not have a good estimate
if the result is a dense matrix this is irrelevant
Output Parameter:
C- the product matrix
-seealso: , Mat, MatProductType, MATPRODUCT_AB, MatTransposeMatMult(), MatMatTransposeMult(), MatPtAP(), MatProductCreate(), MatProductSymbolic(), MatProductReplaceMats(), MatProductNumeric()
External Links
- PETSc Manual:
Mat/MatMatMult
PETSc.LibPETSc.MatMatMultEqual — Method
flg::PetscBool = MatMatMultEqual(petsclib::PetscLibType,A::PetscMat, B::PetscMat, C::PetscMat, n::PetscInt)Test ABx = C*x for n random vector x
Collective
Input Parameters:
A- the first matrixB- the second matrixC- the third matrixn- number of random vectors to be tested
Output Parameter:
flg-PETSC_TRUEif the products are equal;PETSC_FALSEotherwise.
Level: intermediate
-seealso: Mat, MatMultEqual(), MatMultAddEqual(), MatMultTransposeEqual()
External Links
- PETSc Manual:
Mat/MatMatMultEqual
PETSc.LibPETSc.MatMatRestrict — Method
MatMatRestrict(petsclib::PetscLibType,A::PetscMat, x::PetscMat, y::PetscMat)Y = AX or A^TX depending on the shape of A
Neighbor-wise Collective
Input Parameters:
A- the matrixx- the input dense matrix
Output Parameter:
y- the output dense matrix
Level: intermediate
-seealso: , Mat, MatRestrict(), MatInterpolate(), MatMatInterpolate(), PCMG
External Links
- PETSc Manual:
Mat/MatMatRestrict
PETSc.LibPETSc.MatMatSolve — Method
MatMatSolve(petsclib::PetscLibType,A::PetscMat, B::PetscMat, X::PetscMat)Solves A X = B, given a factored matrix.
Neighbor-wise Collective
Input Parameters:
A- the factored matrixB- the right-hand-side matrixMATDENSE(or sparseMATAIJ– when using MUMPS)
Output Parameter:
X- the result matrix (dense matrix)
Level: developer
-seealso: , Mat, Matrix Factorization, MatGetFactor(), MatSolve(), MatMatSolveTranspose(), MatLUFactor(), MatCholeskyFactor()
External Links
- PETSc Manual:
Mat/MatMatSolve
PETSc.LibPETSc.MatMatSolveTranspose — Method
MatMatSolveTranspose(petsclib::PetscLibType,A::PetscMat, B::PetscMat, X::PetscMat)Solves A^T X = B , given a factored matrix.
Neighbor-wise Collective
Input Parameters:
A- the factored matrixB- the right-hand-side matrix (MATDENSEmatrix)
Output Parameter:
X- the result matrix (dense matrix)
Level: developer
-seealso: , Mat, Matrix Factorization, MatGetFactor(), MatSolveTranspose(), MatMatSolve(), MatLUFactor(), MatCholeskyFactor()
External Links
- PETSc Manual:
Mat/MatMatSolveTranspose
PETSc.LibPETSc.MatMatTransposeMult — Method
MatMatTransposeMult(petsclib::PetscLibType,A::PetscMat, B::PetscMat, scall::MatReuse, fill::PetscReal, C::PetscMat)Performs matrix
Neighbor-wise Collective
Input Parameters:
A- the left matrixB- the right matrixscall- eitherMAT_INITIAL_MATRIXorMAT_REUSE_MATRIXfill- expected fill as ratio of nnz(C)/(nnz(A) + nnz(B)), usePETSC_DETERMINEorPETSC_CURRENTif not known
Output Parameter:
C- the product matrix
Options Database Key:
-matmattransmult_mpidense_mpidense_via {allgatherv,cyclic}- Choose between algorithms forMATMPIDENSEmatrices: the
first redundantly copies the transposed B matrix on each process and requires O(log P) communication complexity; the second never stores more than one portion of the B matrix at a time but requires O(P) communication complexity.
Level: intermediate
-seealso: , Mat, MatProductCreate(), MATPRODUCT_ABt, MatMatMult(), MatTransposeMatMult() MatPtAP(), MatProductAlgorithm, MatProductType
External Links
- PETSc Manual:
Mat/MatMatTransposeMult
PETSc.LibPETSc.MatMatTransposeMultEqual — Method
flg::PetscBool = MatMatTransposeMultEqual(petsclib::PetscLibType,A::PetscMat, B::PetscMat, C::PetscMat, n::PetscInt)Test AB^Tx = C*x for n random vector x
Collective
Input Parameters:
A- the first matrixB- the second matrixC- the third matrixn- number of random vectors to be tested
Output Parameter:
flg-PETSC_TRUEif the products are equal;PETSC_FALSEotherwise.
Level: intermediate
-seealso: Mat, MatMatMultEqual(), MatMultEqual(), MatMultAddEqual(), MatMultTransposeEqual()
External Links
- PETSc Manual:
Mat/MatMatTransposeMultEqual
PETSc.LibPETSc.MatMatTransposeSolve — Method
MatMatTransposeSolve(petsclib::PetscLibType,A::PetscMat, Bt::PetscMat, X::PetscMat)Solves A X = B^T, given a factored matrix.
Neighbor-wise Collective
Input Parameters:
A- the factored matrixBt- the transpose of right-hand-side matrix as aMATDENSE
Output Parameter:
X- the result matrix (dense matrix)
Level: developer
-seealso: , Mat, Matrix Factorization, MatMatSolve(), MatMatSolveTranspose(), MatLUFactor(), MatCholeskyFactor()
External Links
- PETSc Manual:
Mat/MatMatTransposeSolve
PETSc.LibPETSc.MatMeshToCellGraph — Method
MatMeshToCellGraph(petsclib::PetscLibType,mesh::PetscMat, ncommonnodes::PetscInt, dual::PetscMat)Convert a mesh to a cell graph.
Collective
Input Parameters:
mesh- the graph that represents the coupling of the vertices of the meshncommonnodes- mesh elements that share this number of common nodes are considered neighbors, use 2 for triangles and
quadrilaterials, 3 for tetrahedrals and 4 for hexahedrals
Output Parameter:
dual- the dual graph
Level: advanced
-seealso: MatCreateMPIAdj(), MatPartitioningCreate()
External Links
- PETSc Manual:
Mat/MatMeshToCellGraph
PETSc.LibPETSc.MatMissingDiagonal — Method
missing::PetscBool,dd::PetscInt = MatMissingDiagonal(petsclib::PetscLibType,mat::PetscMat)Determine if sparse matrix is missing a diagonal entry (or block entry for MATBAIJ and MATSBAIJ matrices) in the nonzero structure
Not Collective
Input Parameter:
mat- the matrix
Output Parameters:
missing- is any diagonal entry missingdd- first diagonal entry that is missing (optional) on this process
Level: advanced
External Links
- PETSc Manual:
Mat/MatMissingDiagonal
PETSc.LibPETSc.MatMult — Method
MatMult(petsclib::PetscLibType,mat::PetscMat, x::PetscVec, y::PetscVec)Computes the matrix
Neighbor-wise Collective
Input Parameters:
mat- the matrixx- the vector to be multiplied
Output Parameter:
y- the result
Level: beginner
-seealso: , Mat, MatMultTranspose(), MatMultAdd(), MatMultTransposeAdd()
External Links
- PETSc Manual:
Mat/MatMult
PETSc.LibPETSc.MatMultAdd — Method
MatMultAdd(petsclib::PetscLibType,mat::PetscMat, v1::PetscVec, v2::PetscVec, v3::PetscVec)Computes v3 = v2 + A * v1.
Neighbor-wise Collective
Input Parameters:
mat- the matrixv1- the vector to be multiplied bymatv2- the vector to be added to the result
Output Parameter:
v3- the result
Level: beginner
-seealso: , Mat, MatMultTranspose(), MatMult(), MatMultTransposeAdd()
External Links
- PETSc Manual:
Mat/MatMultAdd
PETSc.LibPETSc.MatMultAddEqual — Method
flg::PetscBool = MatMultAddEqual(petsclib::PetscLibType,A::PetscMat, B::PetscMat, n::PetscInt)Compares matrix
Collective
Input Parameters:
A- the first matrixB- the second matrixn- number of random vectors to be tested
Output Parameter:
flg-PETSC_TRUEif the products are equal;PETSC_FALSEotherwise.
Level: intermediate
-seealso: Mat, MatMultEqual(), MatMultTransposeEqual(), MatMultTransposeAddEqual()
External Links
- PETSc Manual:
Mat/MatMultAddEqual
PETSc.LibPETSc.MatMultDiagonalBlock — Method
MatMultDiagonalBlock(petsclib::PetscLibType,mat::PetscMat, x::PetscVec, y::PetscVec)Computes the matrix
Collective
Input Parameters:
mat- the matrixx- the vector to be multiplied
Output Parameter:
y- the result
Level: developer
-seealso: , Mat, MatMult(), MatMultTranspose(), MatMultAdd(), MatMultTransposeAdd()
External Links
- PETSc Manual:
Mat/MatMultDiagonalBlock
PETSc.LibPETSc.MatMultEqual — Method
flg::PetscBool = MatMultEqual(petsclib::PetscLibType,A::PetscMat, B::PetscMat, n::PetscInt)Compares matrix
Collective
Input Parameters:
A- the first matrixB- the second matrixn- number of random vectors to be tested
Output Parameter:
flg-PETSC_TRUEif the products are equal;PETSC_FALSEotherwise.
Level: intermediate
-seealso: Mat, MatMultAddEqual(), MatMultTransposeEqual(), MatMultTransposeAddEqual(), MatIsLinear(), MatEqual()
External Links
- PETSc Manual:
Mat/MatMultEqual
PETSc.LibPETSc.MatMultHermitianTranspose — Method
MatMultHermitianTranspose(petsclib::PetscLibType,mat::PetscMat, x::PetscVec, y::PetscVec)Computes matrix Hermitian
Neighbor-wise Collective
Input Parameters:
mat- the matrixx- the vector to be multiplied
Output Parameter:
y- the result
Level: beginner
-seealso: , Mat, MatMult(), MatMultAdd(), MatMultHermitianTransposeAdd(), MatMultTranspose()
External Links
- PETSc Manual:
Mat/MatMultHermitianTranspose
PETSc.LibPETSc.MatMultHermitianTransposeAdd — Method
MatMultHermitianTransposeAdd(petsclib::PetscLibType,mat::PetscMat, v1::PetscVec, v2::PetscVec, v3::PetscVec)Computes v3 = v2 + A^H * v1.
Neighbor-wise Collective
Input Parameters:
mat- the matrixv1- the vector to be multiplied by the Hermitian transposev2- the vector to be added to the result
Output Parameter:
v3- the result
Level: beginner
-seealso: , Mat, MatMultHermitianTranspose(), MatMultTranspose(), MatMultAdd(), MatMult()
External Links
- PETSc Manual:
Mat/MatMultHermitianTransposeAdd
PETSc.LibPETSc.MatMultHermitianTransposeAddEqual — Method
flg::PetscBool = MatMultHermitianTransposeAddEqual(petsclib::PetscLibType,A::PetscMat, B::PetscMat, n::PetscInt)Compares matrix
Collective
Input Parameters:
A- the first matrixB- the second matrixn- number of random vectors to be tested
Output Parameter:
flg-PETSC_TRUEif the products are equal;PETSC_FALSEotherwise.
Level: intermediate
-seealso: Mat, MatMatMultEqual(), MatMultEqual(), MatMultAddEqual(), MatMultTransposeEqual()
External Links
- PETSc Manual:
Mat/MatMultHermitianTransposeAddEqual
PETSc.LibPETSc.MatMultHermitianTransposeEqual — Method
flg::PetscBool = MatMultHermitianTransposeEqual(petsclib::PetscLibType,A::PetscMat, B::PetscMat, n::PetscInt)Compares matrix
Collective
Input Parameters:
A- the first matrixB- the second matrixn- number of random vectors to be tested
Output Parameter:
flg-PETSC_TRUEif the products are equal;PETSC_FALSEotherwise.
Level: intermediate
-seealso: Mat, MatMatMultEqual(), MatMultEqual(), MatMultAddEqual(), MatMultTransposeEqual()
External Links
- PETSc Manual:
Mat/MatMultHermitianTransposeEqual
PETSc.LibPETSc.MatMultTranspose — Method
MatMultTranspose(petsclib::PetscLibType,mat::PetscMat, x::PetscVec, y::PetscVec)Computes matrix transpose times a vector y = A^T * x.
Neighbor-wise Collective
Input Parameters:
mat- the matrixx- the vector to be multiplied
Output Parameter:
y- the result
Level: beginner
-seealso: , Mat, MatMult(), MatMultAdd(), MatMultTransposeAdd(), MatMultHermitianTranspose(), MatTranspose()
External Links
- PETSc Manual:
Mat/MatMultTranspose
PETSc.LibPETSc.MatMultTransposeAdd — Method
MatMultTransposeAdd(petsclib::PetscLibType,mat::PetscMat, v1::PetscVec, v2::PetscVec, v3::PetscVec)Computes v3 = v2 + A^T * v1.
Neighbor-wise Collective
Input Parameters:
mat- the matrixv1- the vector to be multiplied by the transpose of the matrixv2- the vector to be added to the result
Output Parameter:
v3- the result
Level: beginner
-seealso: , Mat, MatMultTranspose(), MatMultAdd(), MatMult()
External Links
- PETSc Manual:
Mat/MatMultTransposeAdd
PETSc.LibPETSc.MatMultTransposeAddEqual — Method
flg::PetscBool = MatMultTransposeAddEqual(petsclib::PetscLibType,A::PetscMat, B::PetscMat, n::PetscInt)Compares matrix
Collective
Input Parameters:
A- the first matrixB- the second matrixn- number of random vectors to be tested
Output Parameter:
flg-PETSC_TRUEif the products are equal;PETSC_FALSEotherwise.
Level: intermediate
-seealso: Mat, MatMultEqual(), MatMultAddEqual(), MatMultTransposeEqual()
External Links
- PETSc Manual:
Mat/MatMultTransposeAddEqual
PETSc.LibPETSc.MatMultTransposeEqual — Method
flg::PetscBool = MatMultTransposeEqual(petsclib::PetscLibType,A::PetscMat, B::PetscMat, n::PetscInt)Compares matrix
Collective
Input Parameters:
A- the first matrixB- the second matrixn- number of random vectors to be tested
Output Parameter:
flg-PETSC_TRUEif the products are equal;PETSC_FALSEotherwise.
Level: intermediate
-seealso: Mat, MatMultEqual(), MatMultAddEqual(), MatMultTransposeAddEqual()
External Links
- PETSc Manual:
Mat/MatMultTransposeEqual
PETSc.LibPETSc.MatMumpsGetCntl — Method
val::PetscReal = MatMumpsGetCntl(petsclib::PetscLibType,F::PetscMat, icntl::PetscInt)Get MUMPS parameter CNTL() <https://mumps
Logically Collective
Input Parameters:
F- the factored matrix obtained by callingMatGetFactor()with aMatSolverTypeofMATSOLVERMUMPSand aMatFactorTypeofMAT_FACTOR_LUorMAT_FACTOR_CHOLESKYicntl- index of MUMPS parameter array CNTL()
Output Parameter:
val- value of MUMPS CNTL(icntl)
Level: beginner
-seealso: , Mat, MatGetFactor(), MatMumpsSetIcntl(), MatMumpsGetIcntl(), MatMumpsSetCntl(), MatMumpsGetInfo(), MatMumpsGetInfog(), MatMumpsGetRinfo(), MatMumpsGetRinfog()
External Links
- PETSc Manual:
Mat/MatMumpsGetCntl
PETSc.LibPETSc.MatMumpsGetIcntl — Method
ival::PetscInt = MatMumpsGetIcntl(petsclib::PetscLibType,F::PetscMat, icntl::PetscInt)Get MUMPS parameter ICNTL() <https://mumps
Logically Collective
Input Parameters:
F- the factored matrix obtained by callingMatGetFactor()with aMatSolverTypeofMATSOLVERMUMPSand aMatFactorTypeofMAT_FACTOR_LUorMAT_FACTOR_CHOLESKYicntl- index of MUMPS parameter array ICNTL()
Output Parameter:
ival- value of MUMPS ICNTL(icntl)
Level: beginner
-seealso: , Mat, MatGetFactor(), MatMumpsSetIcntl(), MatMumpsSetCntl(), MatMumpsGetCntl(), MatMumpsGetInfo(), MatMumpsGetInfog(), MatMumpsGetRinfo(), MatMumpsGetRinfog()
External Links
- PETSc Manual:
Mat/MatMumpsGetIcntl
PETSc.LibPETSc.MatMumpsGetInfo — Method
ival::PetscInt = MatMumpsGetInfo(petsclib::PetscLibType,F::PetscMat, icntl::PetscInt)Get MUMPS parameter INFO() <https://mumps
Logically Collective
Input Parameters:
F- the factored matrix obtained by callingMatGetFactor()with aMatSolverTypeofMATSOLVERMUMPSand aMatFactorTypeofMAT_FACTOR_LUorMAT_FACTOR_CHOLESKYicntl- index of MUMPS parameter array INFO()
Output Parameter:
ival- value of MUMPS INFO(icntl)
Level: beginner
-seealso: , Mat, MatGetFactor(), MatMumpsSetIcntl(), MatMumpsGetIcntl(), MatMumpsSetCntl(), MatMumpsGetCntl(), MatMumpsGetInfog(), MatMumpsGetRinfo(), MatMumpsGetRinfog()
External Links
- PETSc Manual:
Mat/MatMumpsGetInfo
PETSc.LibPETSc.MatMumpsGetInfog — Method
ival::PetscInt = MatMumpsGetInfog(petsclib::PetscLibType,F::PetscMat, icntl::PetscInt)Get MUMPS parameter INFOG() <https://mumps
Logically Collective
Input Parameters:
F- the factored matrix obtained by callingMatGetFactor()with aMatSolverTypeofMATSOLVERMUMPSand aMatFactorTypeofMAT_FACTOR_LUorMAT_FACTOR_CHOLESKYicntl- index of MUMPS parameter array INFOG()
Output Parameter:
ival- value of MUMPS INFOG(icntl)
Level: beginner
-seealso: , Mat, MatGetFactor(), MatMumpsSetIcntl(), MatMumpsGetIcntl(), MatMumpsSetCntl(), MatMumpsGetCntl(), MatMumpsGetInfo(), MatMumpsGetRinfo(), MatMumpsGetRinfog()
External Links
- PETSc Manual:
Mat/MatMumpsGetInfog
PETSc.LibPETSc.MatMumpsGetInverse — Method
MatMumpsGetInverse(petsclib::PetscLibType,F::PetscMat, spRHS::PetscMat)Get user
Logically Collective
Input Parameter:
F- the factored matrix obtained by callingMatGetFactor()with aMatSolverTypeofMATSOLVERMUMPSand aMatFactorTypeofMAT_FACTOR_LUorMAT_FACTOR_CHOLESKY
Output Parameter:
spRHS- sequential sparse matrix inMATTRANSPOSEVIRTUALformat with requested entries of inverse ofA
Level: beginner
-seealso: , Mat, MatGetFactor(), MatCreateTranspose()
External Links
- PETSc Manual:
Mat/MatMumpsGetInverse
PETSc.LibPETSc.MatMumpsGetInverseTranspose — Method
MatMumpsGetInverseTranspose(petsclib::PetscLibType,F::PetscMat, spRHST::PetscMat)Get user
Logically Collective
Input Parameter:
F- the factored matrix of A obtained by callingMatGetFactor()with aMatSolverTypeofMATSOLVERMUMPSand aMatFactorTypeofMAT_FACTOR_LUorMAT_FACTOR_CHOLESKY
Output Parameter:
spRHST- sequential sparse matrix inMATAIJformat containing the requested entries of inverse ofA^T
Level: beginner
-seealso: , Mat, MatGetFactor(), MatCreateTranspose(), MatMumpsGetInverse()
External Links
- PETSc Manual:
Mat/MatMumpsGetInverseTranspose
PETSc.LibPETSc.MatMumpsGetNullPivots — Method
size::PetscInt = MatMumpsGetNullPivots(petsclib::PetscLibType,F::PetscMat, array::PetscInt)Get MUMPS parameter PIVNUL_LIST() <https://mumps
Logically Collective
Input Parameter:
F- the factored matrix obtained by callingMatGetFactor()with aMatSolverTypeofMATSOLVERMUMPSand aMatFactorTypeofMAT_FACTOR_LUorMAT_FACTOR_CHOLESKY
Output Parameters:
size- local size of the array. The size of the array is non-zero only on MPI rank 0array- array of rows with null pivot, these rows follow 0-based indexing. The array gets allocated within the function and the user is responsible
for freeing this array.
Level: beginner
-seealso: , Mat, MatGetFactor(), MatMumpsSetIcntl(), MatMumpsGetIcntl(), MatMumpsSetCntl(), MatMumpsGetCntl(), MatMumpsGetInfo(), MatMumpsGetInfog(), MatMumpsGetRinfo()
External Links
- PETSc Manual:
Mat/MatMumpsGetNullPivots
PETSc.LibPETSc.MatMumpsGetRinfo — Method
val::PetscReal = MatMumpsGetRinfo(petsclib::PetscLibType,F::PetscMat, icntl::PetscInt)Get MUMPS parameter RINFO() <https://mumps
Logically Collective
Input Parameters:
F- the factored matrix obtained by callingMatGetFactor()with aMatSolverTypeofMATSOLVERMUMPSand aMatFactorTypeofMAT_FACTOR_LUorMAT_FACTOR_CHOLESKYicntl- index of MUMPS parameter array RINFO()
Output Parameter:
val- value of MUMPS RINFO(icntl)
Level: beginner
-seealso: , Mat, MatGetFactor(), MatMumpsSetIcntl(), MatMumpsGetIcntl(), MatMumpsSetCntl(), MatMumpsGetCntl(), MatMumpsGetInfo(), MatMumpsGetInfog(), MatMumpsGetRinfog()
External Links
- PETSc Manual:
Mat/MatMumpsGetRinfo
PETSc.LibPETSc.MatMumpsGetRinfog — Method
val::PetscReal = MatMumpsGetRinfog(petsclib::PetscLibType,F::PetscMat, icntl::PetscInt)Get MUMPS parameter RINFOG() <https://mumps
Logically Collective
Input Parameters:
F- the factored matrix obtained by callingMatGetFactor()with aMatSolverTypeofMATSOLVERMUMPSand aMatFactorTypeofMAT_FACTOR_LUorMAT_FACTOR_CHOLESKYicntl- index of MUMPS parameter array RINFOG()
Output Parameter:
val- value of MUMPS RINFOG(icntl)
Level: beginner
-seealso: , Mat, MatGetFactor(), MatMumpsSetIcntl(), MatMumpsGetIcntl(), MatMumpsSetCntl(), MatMumpsGetCntl(), MatMumpsGetInfo(), MatMumpsGetInfog(), MatMumpsGetRinfo()
External Links
- PETSc Manual:
Mat/MatMumpsGetRinfog
PETSc.LibPETSc.MatMumpsSetBlk — Method
MatMumpsSetBlk(petsclib::PetscLibType,F::PetscMat, nblk::PetscInt, blkvar::Vector{PetscInt}, blkptr::Vector{PetscInt})Set user
Not collective, only relevant on the first process of the MPI communicator
Input Parameters:
F- the factored matrix of A obtained by callingMatGetFactor()with aMatSolverTypeofMATSOLVERMUMPSand aMatFactorTypeofMAT_FACTOR_LUorMAT_FACTOR_CHOLESKYnblk- the number of blocksblkvar- see MUMPS documentation,blkvar(blkptr(iblk):blkptr(iblk+1)-1), (iblk=1, nblk) holds the variables associated to blockiblkblkptr- array starting at 1 and of sizenblk + 1storing the prefix sum of all blocks
Level: advanced
-seealso: , MATSOLVERMUMPS, Mat, MatGetFactor(), MatMumpsSetIcntl(), MatSetVariableBlockSizes()
External Links
- PETSc Manual:
Mat/MatMumpsSetBlk
PETSc.LibPETSc.MatMumpsSetCntl — Method
MatMumpsSetCntl(petsclib::PetscLibType,F::PetscMat, icntl::PetscInt, val::PetscReal)Set MUMPS parameter CNTL() <https://mumps
Logically Collective
Input Parameters:
F- the factored matrix obtained by callingMatGetFactor()with aMatSolverTypeofMATSOLVERMUMPSand aMatFactorTypeofMAT_FACTOR_LUorMAT_FACTOR_CHOLESKYicntl- index of MUMPS parameter arrayCNTL()val- value of MUMPSCNTL(icntl)
Options Database Key:
-mat_mumps_cntl_<icntl> <val>- change the option numbered icntl to ival
Level: beginner
-seealso: , Mat, MatGetFactor(), MatMumpsSetIcntl(), MatMumpsGetIcntl(), MatMumpsGetCntl(), MatMumpsGetInfo(), MatMumpsGetInfog(), MatMumpsGetRinfo(), MatMumpsGetRinfog()
External Links
- PETSc Manual:
Mat/MatMumpsSetCntl
PETSc.LibPETSc.MatMumpsSetIcntl — Method
MatMumpsSetIcntl(petsclib::PetscLibType,F::PetscMat, icntl::PetscInt, ival::PetscInt)Set MUMPS parameter ICNTL() <https://mumps
Logically Collective
Input Parameters:
F- the factored matrix obtained by callingMatGetFactor()with aMatSolverTypeofMATSOLVERMUMPSand aMatFactorTypeofMAT_FACTOR_LUorMAT_FACTOR_CHOLESKYicntl- index of MUMPS parameter arrayICNTL()ival- value of MUMPSICNTL(icntl)
Options Database Key:
-mat_mumps_icntl_<icntl> <ival>- change the option numberedicntltoival
Level: beginner
-seealso: , Mat, MatGetFactor(), MatMumpsGetIcntl(), MatMumpsSetCntl(), MatMumpsGetCntl(), MatMumpsGetInfo(), MatMumpsGetInfog(), MatMumpsGetRinfo(), MatMumpsGetRinfog()
External Links
- PETSc Manual:
Mat/MatMumpsSetIcntl
PETSc.LibPETSc.MatNestGetISs — Method
MatNestGetISs(petsclib::PetscLibType,A::PetscMat, rows::Vector{IS}, cols::Vector{IS})Returns the index sets partitioning the row and column spaces of a MATNEST
Not Collective
Input Parameter:
A-MATNESTmatrix
Output Parameters:
rows- array of row index sets (passNULLto ignore)cols- array of column index sets (passNULLto ignore)
Level: advanced
-seealso: , Mat, MATNEST, MatNestGetSubMat(), MatNestGetSubMats(), MatNestGetSize(), MatNestGetLocalISs(), MatCreateNest(), MatNestSetSubMats()
External Links
- PETSc Manual:
Mat/MatNestGetISs
PETSc.LibPETSc.MatNestGetLocalISs — Method
MatNestGetLocalISs(petsclib::PetscLibType,A::PetscMat, rows::Vector{IS}, cols::Vector{IS})Returns the index sets partitioning the row and column spaces of a MATNEST
Not Collective
Input Parameter:
A-MATNESTmatrix
Output Parameters:
rows- array of row index sets (passNULLto ignore)cols- array of column index sets (passNULLto ignore)
Level: advanced
-seealso: , Mat, MATNEST, MatNestGetSubMat(), MatNestGetSubMats(), MatNestGetSize(), MatNestGetISs(), MatCreateNest(), MatNestSetSubMats(), MatNestSetSubMat()
External Links
- PETSc Manual:
Mat/MatNestGetLocalISs
PETSc.LibPETSc.MatNestGetSize — Method
M::PetscInt,N::PetscInt = MatNestGetSize(petsclib::PetscLibType,A::PetscMat)Returns the size of the MATNEST matrix.
Not Collective
Input Parameter:
A-MATNESTmatrix
Output Parameters:
M- number of rows in the nested matN- number of cols in the nested mat
Level: developer
-seealso: , Mat, MATNEST, MatNestGetSubMat(), MatNestGetSubMats(), MatCreateNest(), MatNestGetLocalISs(), MatNestGetISs()
External Links
- PETSc Manual:
Mat/MatNestGetSize
PETSc.LibPETSc.MatNestGetSubMat — Method
MatNestGetSubMat(petsclib::PetscLibType,A::PetscMat, idxm::PetscInt, jdxm::PetscInt, sub::PetscMat)Returns a single, sub
Not Collective
Input Parameters:
A-MATNESTmatrixidxm- index of the matrix within the nest matrixjdxm- index of the matrix within the nest matrix
Output Parameter:
sub- matrix at indexidxm,jdxmwithin the nest matrix
Level: developer
-seealso: , Mat, MATNEST, MatNestGetSize(), MatNestGetSubMats(), MatCreateNest(), MatNestSetSubMat(), MatNestGetLocalISs(), MatNestGetISs()
External Links
- PETSc Manual:
Mat/MatNestGetSubMat
PETSc.LibPETSc.MatNestGetSubMats — Method
M::PetscInt,N::PetscInt = MatNestGetSubMats(petsclib::PetscLibType,A::PetscMat, mat::PetscMat)Returns the entire two dimensional array of matrices defining a MATNEST matrix.
Not Collective
Input Parameter:
A- nest matrix
Output Parameters:
M- number of submatrix rows in the nest matrixN- number of submatrix columns in the nest matrixmat- array of matrices
Level: developer
-seealso: , Mat, MATNEST, MatNestGetSize(), MatNestGetSubMat(), MatNestGetLocalISs(), MatCreateNest(), MatNestSetSubMats(), MatNestGetISs(), MatNestSetSubMat()
External Links
- PETSc Manual:
Mat/MatNestGetSubMats
PETSc.LibPETSc.MatNestSetSubMat — Method
MatNestSetSubMat(petsclib::PetscLibType,A::PetscMat, idxm::PetscInt, jdxm::PetscInt, sub::PetscMat)Set a single submatrix in the MATNEST
Logically Collective
Input Parameters:
A-MATNESTmatrixidxm- index of the matrix within the nest matrixjdxm- index of the matrix within the nest matrixsub- matrix at indexidxm,jdxmwithin the nest matrix
Level: developer
-seealso: , Mat, MATNEST, MatNestSetSubMats(), MatNestGetSubMats(), MatNestGetLocalISs(), MatCreateNest(), MatNestGetSubMat(), MatNestGetISs(), MatNestGetSize()
External Links
- PETSc Manual:
Mat/MatNestSetSubMat
PETSc.LibPETSc.MatNestSetSubMats — Method
MatNestSetSubMats(petsclib::PetscLibType,A::PetscMat, nr::PetscInt, is_row::Vector{IS}, nc::PetscInt, is_col::Vector{IS}, a::Vector{PetscMat})Sets the nested submatrices in a MATNEST
Collective
Input Parameters:
A-MATNESTmatrixnr- number of nested row blocksis_row- index sets for each nested row block, orNULLto make contiguousnc- number of nested column blocksis_col- index sets for each nested column block, orNULLto make contiguousa- array of nr imes nc submatrices, orNULL
Level: advanced
-seealso: , Mat, MATNEST, MatCreateNest(), MatNestSetSubMat(), MatNestGetSubMat(), MatNestGetSubMats()
External Links
- PETSc Manual:
Mat/MatNestSetSubMats
PETSc.LibPETSc.MatNestSetVecType — Method
MatNestSetVecType(petsclib::PetscLibType,A::PetscMat, vtype::VecType)Sets the type of Vec returned by MatCreateVecs()
Not Collective
Input Parameters:
A-MATNESTmatrixvtype-VecTypeto use for creating vectors
Level: developer
-seealso: , Mat, MATNEST, MatCreateVecs(), MatCreateNest(), VecType
External Links
- PETSc Manual:
Mat/MatNestSetVecType
PETSc.LibPETSc.MatNorm — Method
nrm::PetscReal = MatNorm(petsclib::PetscLibType,mat::PetscMat, type::NormType)Calculates various norms of a matrix.
Collective
Input Parameters:
mat- the matrixtype- the type of norm,NORM_1,NORM_FROBENIUS,NORM_INFINITY
Output Parameter:
nrm- the resulting norm
Level: intermediate
External Links
- PETSc Manual:
Mat/MatNorm
PETSc.LibPETSc.MatNormalGetMat — Method
MatNormalGetMat(petsclib::PetscLibType,A::PetscMat, M::PetscMat)Gets the Mat object stored inside a MATNORMAL
Logically Collective
Input Parameter:
A- theMATNORMALmatrix
Output Parameter:
M- the matrix object stored insideA
Level: intermediate
-seealso: , Mat, MATNORMAL, MATNORMALHERMITIAN, MatCreateNormal()
External Links
- PETSc Manual:
Mat/MatNormalGetMat
PETSc.LibPETSc.MatNormalHermitianGetMat — Method
MatNormalHermitianGetMat(petsclib::PetscLibType,A::PetscMat, M::PetscMat)Gets the Mat object stored inside a MATNORMALHERMITIAN
Logically Collective
Input Parameter:
A- theMATNORMALHERMITIANmatrix
Output Parameter:
M- the matrix object stored insideA
Level: intermediate
-seealso: , Mat, MATNORMALHERMITIAN, MatCreateNormalHermitian()
External Links
- PETSc Manual:
Mat/MatNormalHermitianGetMat
PETSc.LibPETSc.MatOrderingRegister — Method
MatOrderingRegister(petsclib::PetscLibType,sname::Vector{Cchar}, fnc::external)Adds a new sparse matrix ordering to the matrix package.
Not Collective, No Fortran Support
Input Parameters:
sname- name of ordering (for exampleMATORDERINGND)function- function pointer that creates the ordering
Level: developer
-seealso: Mat, MatOrderingType, MatOrderingRegisterAll(), MatGetOrdering()
External Links
- PETSc Manual:
Mat/MatOrderingRegister
PETSc.LibPETSc.MatPermute — Method
MatPermute(petsclib::PetscLibType,mat::PetscMat, row::IS, col::IS, B::PetscMat)Creates a new matrix with rows and columns permuted from the original.
Collective
Input Parameters:
mat- the matrix to permuterow- row permutation, each processor supplies only the permutation for its rowscol- column permutation, each processor supplies only the permutation for its columns
Output Parameter:
B- the permuted matrix
Level: advanced
-seealso: , Mat, MatGetOrdering(), ISAllGather(), MatCreateSubMatrix()
External Links
- PETSc Manual:
Mat/MatPermute
PETSc.LibPETSc.MatPreallocatorPreallocate — Method
MatPreallocatorPreallocate(petsclib::PetscLibType,mat::PetscMat, fill::PetscBool, A::PetscMat)Preallocates the A matrix, using information from a MATPREALLOCATOR mat, optionally filling A with zeros
Input Parameters:
mat- theMATPREALLOCATORpreallocator matrixfill- fill the matrix with zerosA- the matrix to be preallocated
-seealso: MATPREALLOCATOR, MatXAIJSetPreallocation()
External Links
- PETSc Manual:
Mat/MatPreallocatorPreallocate
PETSc.LibPETSc.MatProductClear — Method
MatProductClear(petsclib::PetscLibType,mat::PetscMat)Clears from the matrix any internal data structures related to the computation of the values of the matrix from matrix
Collective
Input Parameter:
mat- the matrix whose values are to be computed via a matrix-matrix product operation
Options Database Key:
-mat_product_clear- Clear intermediate data structures afterMatProductNumeric()has been called
Level: intermediate
-seealso: , MatProduct, Mat, MatProductCreate()
External Links
- PETSc Manual:
Mat/MatProductClear
PETSc.LibPETSc.MatProductCreate — Method
D::PetscMat = MatProductCreate(petsclib::PetscLibType,A::PetscMat, B::PetscMat, C::PetscMat)create a matrix to hold the result of a matrix
Collective
Input Parameters:
A- the first matrixB- the second matrixC- the third matrix (orNULL)
Output Parameter:
D- the matrix whose values are to be computed via a matrix-matrix product operation
Level: intermediate
Example: -seealso: , MatProduct, Mat, MatProductCreateWithMat(), MatProductSetType(), MatProductSetAlgorithm(), MatProductClear()
External Links
- PETSc Manual:
Mat/MatProductCreate
PETSc.LibPETSc.MatProductCreateWithMat — Method
MatProductCreateWithMat(petsclib::PetscLibType,A::PetscMat, B::PetscMat, C::PetscMat, D::PetscMat)Set a given matrix to have its values computed via matrix
Collective
Input Parameters:
A- the first matrixB- the second matrixC- the third matrix (optional, useNULLif not needed)D- the matrix whose values are to be computed via a matrix-matrix product operation
Level: intermediate
-seealso: , MatProduct, Mat, MatProductType, MatProductSetType(), MatProductAlgorithm, MatProductSetAlgorithm, MatProductCreate(), MatProductClear()
External Links
- PETSc Manual:
Mat/MatProductCreateWithMat
PETSc.LibPETSc.MatProductGetAlgorithm — Method
MatProductGetAlgorithm(petsclib::PetscLibType,mat::PetscMat, alg::MatProductAlgorithm)Returns the selected algorithm for a matrix
Not Collective
Input Parameter:
mat- the matrix whose values are computed via a matrix-matrix product operation
Output Parameter:
alg- the selected algorithm of the matrix product, e.g.,MATPRODUCTALGORITHMDEFAULT.
Level: intermediate
-seealso: , MatProduct, Mat, MatProductSetAlgorithm()
External Links
- PETSc Manual:
Mat/MatProductGetAlgorithm
PETSc.LibPETSc.MatProductGetMats — Method
MatProductGetMats(petsclib::PetscLibType,mat::PetscMat, A::PetscMat, B::PetscMat, C::PetscMat)Returns the matrices associated with the matrix
Not Collective
Input Parameter:
mat- the matrix whose values are to be computed via a matrix-matrix product operation
Output Parameters:
A- the first matrixB- the second matrixC- the third matrix (may beNULLfor someMatProductType)
Level: intermediate
-seealso: , MatProduct, Mat, MatProductCreateWithMat(), MatProductSetType(), MatProductSetAlgorithm(), MatProductCreate()
External Links
- PETSc Manual:
Mat/MatProductGetMats
PETSc.LibPETSc.MatProductGetType — Method
mtype::MatProductType = MatProductGetType(petsclib::PetscLibType,mat::PetscMat)Returns the type of matrix
Not Collective
Input Parameter:
mat- the matrix whose values are to be computed via a matrix-matrix product operation
Output Parameter:
mtype- theMatProductType
Level: intermediate
-seealso: , MatProduct, Mat, MatProductCreateWithMat(), MatProductSetType(), MatProductCreate(), MatProductType, MatProductAlgorithm
External Links
- PETSc Manual:
Mat/MatProductGetType
PETSc.LibPETSc.MatProductNumeric — Method
MatProductNumeric(petsclib::PetscLibType,mat::PetscMat)Compute a matrix
Collective
Input/Output Parameter:
mat- the matrix whose values are computed via a matrix-matrix product operation
Level: intermediate
-seealso: , MatProduct, Mat, MatProductSetAlgorithm(), MatProductSetType(), MatProductCreate(), MatSetType(), MatProductSymbolic()
External Links
- PETSc Manual:
Mat/MatProductNumeric
PETSc.LibPETSc.MatProductReplaceMats — Method
MatProductReplaceMats(petsclib::PetscLibType,A::PetscMat, B::PetscMat, C::PetscMat, D::PetscMat)Replace the input matrices for the matrix
Collective
Input Parameters:
A- the matrix orNULLif not being replacedB- the matrix orNULLif not being replacedC- the matrix orNULLif not being replacedD- the matrix whose values are computed via a matrix-matrix product operation
Level: intermediate
-seealso: , MatProduct, Mat, MatProductCreate(), MatProductSetFromOptions(), MatProductSymbolic(), MatProductClear()
External Links
- PETSc Manual:
Mat/MatProductReplaceMats
PETSc.LibPETSc.MatProductSetAlgorithm — Method
MatProductSetAlgorithm(petsclib::PetscLibType,mat::PetscMat, alg::MatProductAlgorithm)Requests a particular algorithm for a matrix
Collective
Input Parameters:
mat- the matrix whose values are computed via a matrix-matrix product operationalg- particular implementation algorithm of the matrix product, e.g.,MATPRODUCTALGORITHMDEFAULT.
Options Database Key:
-mat_product_algorithm <algorithm>- Sets the algorithm, seeMatProductAlgorithm
Level: intermediate
-seealso: , MatProduct, Mat, MatProductClear(), MatProductSetType(), MatProductSetFill(), MatProductCreate(), MatProductAlgorithm, MatProductType, MatProductGetAlgorithm()
External Links
- PETSc Manual:
Mat/MatProductSetAlgorithm
PETSc.LibPETSc.MatProductSetFill — Method
MatProductSetFill(petsclib::PetscLibType,mat::PetscMat, fill::PetscReal)Set an expected fill of the matrix whose values are computed via a matrix
Collective
Input Parameters:
mat- the matrix whose values are to be computed via a matrix-matrix product operationfill- expected fill as ratio of nnz(mat)/(nnz(A) + nnz(B) + nnz(C)); usePETSC_DETERMINEorPETSC_CURRENTif you do not have a good estimate.
If the product is a dense matrix, this value is not used.
Level: intermediate
-seealso: , MatProduct, PETSC_DETERMINE, Mat, MatProductSetFromOptions(), MatProductSetType(), MatProductSetAlgorithm(), MatProductCreate()
External Links
- PETSc Manual:
Mat/MatProductSetFill
PETSc.LibPETSc.MatProductSetFromOptions — Method
MatProductSetFromOptions(petsclib::PetscLibType,mat::PetscMat)Sets the options for the computation of a matrix the algorithm etc are determined from the options database.
Logically Collective
Input Parameter:
mat- the matrix whose values are computed via a matrix-matrix product operation
Options Database Keys:
-mat_product_clear- Clear intermediate data structures afterMatProductNumeric()has been called-mat_product_algorithm <algorithm>- Sets the algorithm, seeMatProductAlgorithmfor possible values-mat_product_algorithm_backend_cpu- Use the CPU to perform the computation even if the matrix is a GPU matrix
Level: intermediate
-seealso: , MatProduct, Mat, MatSetFromOptions(), MatProductCreate(), MatProductCreateWithMat(), MatProductNumeric(), MatProductSetType(), MatProductSetAlgorithm(), MatProductAlgorithm
External Links
- PETSc Manual:
Mat/MatProductSetFromOptions
PETSc.LibPETSc.MatProductSetType — Method
MatProductSetType(petsclib::PetscLibType,mat::PetscMat, productype::MatProductType)Sets a particular matrix
Collective
Input Parameters:
mat- the matrix whose values are computed via a matrix-matrix product operationproductype- matrix product type, e.g.,MATPRODUCT_AB,MATPRODUCT_AtB,MATPRODUCT_ABt,MATPRODUCT_PtAP,MATPRODUCT_RARt,MATPRODUCT_ABC,
see MatProductType
Level: intermediate
-seealso: , MatProduct, Mat, MatProductCreate(), MatProductType, MATPRODUCT_AB, MATPRODUCT_AtB, MATPRODUCT_ABt, MATPRODUCT_PtAP, MATPRODUCT_RARt, MATPRODUCT_ABC
External Links
- PETSc Manual:
Mat/MatProductSetType
PETSc.LibPETSc.MatProductSymbolic — Method
MatProductSymbolic(petsclib::PetscLibType,mat::PetscMat)Perform the symbolic portion of a matrix product to be done with MatProductNumeric()
Collective
Input/Output Parameter:
mat- the matrix whose values are to be computed via a matrix-matrix product operation
Level: intermediate
-seealso: , MatProduct, Mat, MatProductCreate(), MatProductCreateWithMat(), MatProductSetFromOptions(), MatProductNumeric(), MatProductSetType(), MatProductSetAlgorithm()
External Links
- PETSc Manual:
Mat/MatProductSymbolic
PETSc.LibPETSc.MatProductView — Method
MatProductView(petsclib::PetscLibType,mat::PetscMat, viewer::PetscViewer)View the private matrix
Logically Collective
Input Parameters:
mat- the matrix obtained withMatProductCreate()orMatProductCreateWithMat()viewer- where the information on the matrix-matrix algorithm ofmatshould be reviewed
Level: intermediate
-seealso: , MatProductType, Mat, MatProductSetFromOptions(), MatView(), MatProductCreate(), MatProductCreateWithMat()
External Links
- PETSc Manual:
Mat/MatProductView
PETSc.LibPETSc.MatPropagateSymmetryOptions — Method
MatPropagateSymmetryOptions(petsclib::PetscLibType,A::PetscMat, B::PetscMat)Propagates symmetry options set on a matrix to another matrix
Not Collective
Input Parameters:
A- the matrix we wish to propagate options fromB- the matrix we wish to propagate options to
Level: beginner
-seealso: , Mat, MatSetOption(), MatIsSymmetricKnown(), MatIsSPDKnown(), MatIsHermitianKnown(), MatIsStructurallySymmetricKnown()
External Links
- PETSc Manual:
Mat/MatPropagateSymmetryOptions
PETSc.LibPETSc.MatPtAP — Method
MatPtAP(petsclib::PetscLibType,A::PetscMat, P::PetscMat, scall::MatReuse, fill::PetscReal, C::PetscMat)Creates the matrix product C = P^T * A * P
Neighbor-wise Collective
Input Parameters:
A- the matrixP- the projection matrixscall- eitherMAT_INITIAL_MATRIXorMAT_REUSE_MATRIXfill- expected fill as ratio of nnz(C)/(nnz(A) + nnz(P)), usePETSC_DETERMINEorPETSC_CURRENTif you do not have a good estimate
if the result is a dense matrix this is irrelevant
Output Parameter:
C- the product matrix
Level: intermediate
-seealso: , Mat, MatProductCreate(), MatMatMult(), MatRARt()
External Links
- PETSc Manual:
Mat/MatPtAP
PETSc.LibPETSc.MatPtAPMultEqual — Method
flg::PetscBool = MatPtAPMultEqual(petsclib::PetscLibType,A::PetscMat, B::PetscMat, C::PetscMat, n::PetscInt)Compares matrix
Collective
Input Parameters:
A- the first matrixB- the second matrixC- the third matrixn- number of random vectors to be tested
Output Parameter:
flg-PETSC_TRUEif the products are equal;PETSC_FALSEotherwise.
Level: intermediate
-seealso: Mat, MatMatMultEqual(), MatMultEqual(), MatMultAddEqual(), MatMultTransposeEqual()
External Links
- PETSc Manual:
Mat/MatPtAPMultEqual
PETSc.LibPETSc.MatPythonCreate — Method
A::PetscMat = MatPythonCreate(petsclib::PetscLibType,comm::MPI_Comm, m::PetscInt, n::PetscInt, M::PetscInt, N::PetscInt, pyname::Vector{Cchar})Create a Mat object implemented in Python.
Collective
Input Parameters:
comm- MPI communicatorm- number of local rows (orPETSC_DECIDEto have calculated ifMis given)n- number of local columns (orPETSC_DECIDEto have calculated ifNis given)M- number of global rows (orPETSC_DECIDEto have calculated ifmis given)N- number of global columns (orPETSC_DECIDEto have calculated ifnis given)pyname- full dotted Python name [package].module[.{class|function}]
Output Parameter:
A- the matrix
Level: intermediate
-seealso: , Mat, MatType, MATPYTHON, MatPythonSetType(), PetscPythonInitialize()
External Links
- PETSc Manual:
Mat/MatPythonCreate
PETSc.LibPETSc.MatPythonGetType — Method
pyname::Vector{Cchar} = MatPythonGetType(petsclib::PetscLibType,mat::PetscMat)Get the Python name of a Mat object implemented in Python.
Not Collective
Input Parameter:
mat- the matrix
Output Parameter:
pyname- full dotted Python name [package].module[.{class|function}]
Level: intermediate
-seealso: , Mat, MatType, MatCreate(), MatSetType(), MATPYTHON, PetscPythonInitialize(), MatPythonSetType()
External Links
- PETSc Manual:
Mat/MatPythonGetType
PETSc.LibPETSc.MatPythonSetType — Method
MatPythonSetType(petsclib::PetscLibType,mat::PetscMat, pyname::Vector{Cchar})Initialize a Mat object implemented in Python.
Collective
Input Parameters:
mat- the matrix object.pyname- full dotted Python name [package].module[.{class|function}]
Options Database Key:
-mat_python_type <pyname>- python class
Level: intermediate
-seealso: , Mat, MatType, MatCreate(), MatSetType(), MATPYTHON, PetscPythonInitialize()
External Links
- PETSc Manual:
Mat/MatPythonSetType
PETSc.LibPETSc.MatQRFactor — Method
MatQRFactor(petsclib::PetscLibType,mat::PetscMat, col::IS, info::MatFactorInfo)Performs in
Collective
Input Parameters:
mat- the matrixcol- column permutationinfo- options for factorization, includes
-seealso: , Mat, Matrix Factorization, MatFactorInfo, MatGetFactor(), MatQRFactorSymbolic(), MatQRFactorNumeric(), MatLUFactor(), MatSetUnfactored()
External Links
- PETSc Manual:
Mat/MatQRFactor
PETSc.LibPETSc.MatQRFactorNumeric — Method
MatQRFactorNumeric(petsclib::PetscLibType,fact::PetscMat, mat::PetscMat, info::MatFactorInfo)Performs numeric QR factorization of a matrix. Call this routine after first calling MatGetFactor(), and MatQRFactorSymbolic().
Collective
Input Parameters:
fact- the factor matrix obtained withMatGetFactor()mat- the matrixinfo- options for factorization
Level: developer
-seealso: , Mat, Matrix Factorization, MatFactorInfo, MatGetFactor(), MatQRFactor(), MatQRFactorSymbolic(), MatLUFactor()
External Links
- PETSc Manual:
Mat/MatQRFactorNumeric
PETSc.LibPETSc.MatQRFactorSymbolic — Method
MatQRFactorSymbolic(petsclib::PetscLibType,fact::PetscMat, mat::PetscMat, col::IS, info::MatFactorInfo)Performs symbolic QR factorization of matrix. Call this routine after MatGetFactor() but before calling MatQRFactorNumeric().
Collective
Input Parameters:
fact- the factor matrix obtained withMatGetFactor()mat- the matrixcol- column permutationinfo- options for factorization, includes
-seealso: , Mat, Matrix Factorization, MatGetFactor(), MatFactorInfo, MatQRFactor(), MatQRFactorNumeric(), MatLUFactor(), MatFactorInfoInitialize()
External Links
- PETSc Manual:
Mat/MatQRFactorSymbolic
PETSc.LibPETSc.MatRARt — Method
MatRARt(petsclib::PetscLibType,A::PetscMat, R::PetscMat, scall::MatReuse, fill::PetscReal, C::PetscMat)Creates the matrix product C = R * A * R^T
Neighbor-wise Collective
Input Parameters:
A- the matrixR- the projection matrixscall- eitherMAT_INITIAL_MATRIXorMAT_REUSE_MATRIXfill- expected fill as ratio of nnz(C)/nnz(A), usePETSC_DETERMINEorPETSC_CURRENTif you do not have a good estimate
if the result is a dense matrix this is irrelevant
Output Parameter:
C- the product matrix
Level: intermediate
-seealso: , Mat, MatProductCreate(), MatMatMult(), MatPtAP()
External Links
- PETSc Manual:
Mat/MatRARt
PETSc.LibPETSc.MatRARtMultEqual — Method
flg::PetscBool = MatRARtMultEqual(petsclib::PetscLibType,A::PetscMat, B::PetscMat, C::PetscMat, n::PetscInt)Compares matrix
Collective
Input Parameters:
A- the first matrixB- the second matrixC- the third matrixn- number of random vectors to be tested
Output Parameter:
flg-PETSC_TRUEif the products are equal;PETSC_FALSEotherwise.
Level: intermediate
-seealso: Mat, MatMatMultEqual(), MatMultEqual(), MatMultAddEqual(), MatMultTransposeEqual()
External Links
- PETSc Manual:
Mat/MatRARtMultEqual
PETSc.LibPETSc.MatRealPart — Method
MatRealPart(petsclib::PetscLibType,mat::PetscMat)Zeros out the imaginary part of the matrix
Logically Collective
Input Parameter:
mat- the matrix
Level: advanced
-seealso: , Mat, MatImaginaryPart()
External Links
- PETSc Manual:
Mat/MatRealPart
PETSc.LibPETSc.MatRegister — Method
MatRegister(petsclib::PetscLibType,sname::Vector{Cchar}, fnc::external)Adds a new matrix type implementation that is usable as a Mat in PETSc
Not Collective, No Fortran Support
Input Parameters:
sname- name of a new user-defined matrix typefunction- routine to create method context
Level: advanced
-seealso: , Mat, MatType, MatSetType(), MatRegisterAll()
External Links
- PETSc Manual:
Mat/MatRegister
PETSc.LibPETSc.MatRegisterRootName — Method
MatRegisterRootName(petsclib::PetscLibType,rname::Vector{Cchar}, sname::Vector{Cchar}, mname::Vector{Cchar})Registers a name that can be used for either a sequential or its corresponding parallel matrix type.
Input Parameters:
rname- the rootname, for example,MATAIJsname- the name of the sequential matrix type, for example,MATSEQAIJmname- the name of the parallel matrix type, for example,MATMPIAIJ
Level: developer
-seealso: , Mat, MatType, PetscObjectBaseTypeCompare()
External Links
- PETSc Manual:
Mat/MatRegisterRootName
PETSc.LibPETSc.MatReorderForNonzeroDiagonal — Method
MatReorderForNonzeroDiagonal(petsclib::PetscLibType,mat::PetscMat, abstol::PetscReal, ris::IS, cis::IS)Changes matrix ordering to remove zeros from diagonal. This may help in the PCLU factorization to prevent a zero pivot.
Collective
Input Parameters:
mat- matrix to reorderabstol- absolute tolerance, it attempts to move all values smaller off the diagonalris- the row reorderingcis- the column reordering; this may be changed
Level: intermediate
Options Database Key:
-pc_factor_nonzeros_along_diagonal- Reorder to remove zeros from diagonal
-seealso: Mat, MatGetFactor(), MatGetOrdering()
External Links
- PETSc Manual:
Mat/MatReorderForNonzeroDiagonal
PETSc.LibPETSc.MatReorderingSeqSBAIJ — Method
MatReorderingSeqSBAIJ(petsclib::PetscLibType,A::PetscMat, perm::IS)External Links
- PETSc Manual:
Mat/MatReorderingSeqSBAIJ
PETSc.LibPETSc.MatResetHash — Method
MatResetHash(petsclib::PetscLibType,A::PetscMat)Reset the matrix so that it will use a hash table for the next round of MatSetValues() and MatAssemblyBegin()/MatAssemblyEnd().
Collective
Input Parameter:
A- the matrix
Level: intermediate
-seealso: , Mat, MatResetPreallocation()
External Links
- PETSc Manual:
Mat/MatResetHash
PETSc.LibPETSc.MatResetPreallocation — Method
MatResetPreallocation(petsclib::PetscLibType,A::PetscMat)Reset matrix to use the original preallocation values provided by the user, for example with MatXAIJSetPreallocation()
Collective
Input Parameter:
A- the matrix
Level: beginner
-seealso: , Mat, MatSeqAIJSetPreallocation(), MatMPIAIJSetPreallocation(), MatXAIJSetPreallocation()
External Links
- PETSc Manual:
Mat/MatResetPreallocation
PETSc.LibPETSc.MatResidual — Method
MatResidual(petsclib::PetscLibType,mat::PetscMat, b::PetscVec, x::PetscVec, r::PetscVec)Default routine to calculate the residual r = b
Collective
Input Parameters:
mat- the matrixb- the right-hand-sidex- the approximate solution
Output Parameter:
r- location to store the residual
Level: developer
-seealso: , Mat, MatMult(), MatMultAdd(), PCMGSetResidual()
External Links
- PETSc Manual:
Mat/MatResidual
PETSc.LibPETSc.MatRestoreColumnIJ — Method
n::PetscInt,ia::Vector{PetscInt},ja::Vector{PetscInt},done::PetscBool = MatRestoreColumnIJ(petsclib::PetscLibType,mat::PetscMat, shift::PetscInt, symmetric::PetscBool, inodecompressed::PetscBool)Call after you are completed with the ia,ja indices obtained with MatGetColumnIJ().
Collective
Input Parameters:
mat- the matrixshift- 1 or zero indicating we want the indices starting at 0 or 1symmetric-PETSC_TRUEorPETSC_FALSEindicating the matrix data structure should be symmetrizedinodecompressed-PETSC_TRUEorPETSC_FALSEindicating if the nonzero structure of the
inodes or the nonzero elements is wanted. For MATBAIJ matrices the compressed version is always used.
Output Parameters:
n- size of (possibly compressed) matrixia- the column pointersja- the row indicesdone-PETSC_TRUEorPETSC_FALSEindicated that the values have been returned
Level: developer
-seealso: , Mat, MatGetColumnIJ(), MatRestoreRowIJ()
External Links
- PETSc Manual:
Mat/MatRestoreColumnIJ
PETSc.LibPETSc.MatRestoreLocalSubMatrix — Method
MatRestoreLocalSubMatrix(petsclib::PetscLibType,mat::PetscMat, isrow::IS, iscol::IS, submat::PetscMat)Restores a reference to a submatrix specified in local numbering obtained with MatGetLocalSubMatrix()
Not Collective
Input Parameters:
mat- matrix to extract local submatrix fromisrow- local row indices for submatrixiscol- local column indices for submatrixsubmat- the submatrix
Level: intermediate
-seealso: , Mat, MatGetLocalSubMatrix()
External Links
- PETSc Manual:
Mat/MatRestoreLocalSubMatrix
PETSc.LibPETSc.MatRestoreNullSpaces — Method
MatRestoreNullSpaces(petsclib::PetscLibType,n::PetscInt, mat::Vector{PetscMat}, nullsp::Vector{MatNullSpace})sets the null spaces, transpose null spaces, and near null spaces obtained with MatGetNullSpaces() for an array of matrices
Logically Collective
Input Parameters:
n- the number of matricesmat- the array of matricesnullsp- an array of null spaces
Level: developer
-seealso: , Mat, MatCreate(), MatNullSpaceCreate(), MatSetNearNullSpace(), MatGetNullSpace(), MatSetTransposeNullSpace(), MatGetTransposeNullSpace(), MatNullSpaceRemove(), MatGetNullSpaces()
External Links
- PETSc Manual:
Mat/MatRestoreNullSpaces
PETSc.LibPETSc.MatRestoreRow — Method
ncols::PetscInt,cols::Vector{PetscInt},vals::Vector{PetscScalar} = MatRestoreRow(petsclib::PetscLibType,mat::PetscMat, row::PetscInt)Frees any temporary space allocated by MatGetRow().
Not Collective
Input Parameters:
mat- the matrixrow- the row to getncols- the number of nonzeroscols- the columns of the nonzerosvals- if nonzero the column values
Level: advanced
External Links
- PETSc Manual:
Mat/MatRestoreRow
PETSc.LibPETSc.MatRestoreRowIJ — Method
n::PetscInt,ia::Vector{PetscInt},ja::Vector{PetscInt},done::PetscBool = MatRestoreRowIJ(petsclib::PetscLibType,mat::PetscMat, shift::PetscInt, symmetric::PetscBool, inodecompressed::PetscBool)Call after you are completed with the ia,ja indices obtained with MatGetRowIJ().
Collective
Input Parameters:
mat- the matrixshift- 1 or zero indicating we want the indices starting at 0 or 1symmetric-PETSC_TRUEorPETSC_FALSEindicating the matrix data structure should be symmetrizedinodecompressed-PETSC_TRUEorPETSC_FALSEindicating if the nonzero structure of the
inodes or the nonzero elements is wanted. For MATBAIJ matrices the compressed version is always used.
n- size of (possibly compressed) matrixia- the row pointersja- the column indices
Output Parameter:
done-PETSC_TRUEorPETSC_FALSEindicated that the values have been returned
Level: developer
-seealso: , Mat, MatGetRowIJ(), MatRestoreColumnIJ()
External Links
- PETSc Manual:
Mat/MatRestoreRowIJ
PETSc.LibPETSc.MatRestoreRowUpperTriangular — Method
MatRestoreRowUpperTriangular(petsclib::PetscLibType,mat::PetscMat)Disable calls to MatGetRow() for matrix in MATSBAIJ format.
Not Collective
Input Parameter:
mat- the matrix
Level: advanced
-seealso: , Mat, MATSBAIJ, MatGetRowUpperTriangular()
External Links
- PETSc Manual:
Mat/MatRestoreRowUpperTriangular
PETSc.LibPETSc.MatRestrict — Method
MatRestrict(petsclib::PetscLibType,A::PetscMat, x::PetscVec, y::PetscVec)y = Ax or A^Tx
Neighbor-wise Collective
Input Parameters:
A- the matrixx- the vector to be restricted
Output Parameter:
y- the resulting vector
Level: intermediate
-seealso: , Mat, MatMultAdd(), MatMultTransposeAdd(), MatInterpolate(), PCMG
External Links
- PETSc Manual:
Mat/MatRestrict
PETSc.LibPETSc.MatRetrieveValues — Method
MatRetrieveValues(petsclib::PetscLibType,mat::PetscMat)Retrieves the copy of the matrix values that was stored with MatStoreValues()
Logically Collect
Input Parameter:
mat- the matrix (currently onlyMATAIJmatrices support this option)
Level: advanced
-seealso: , Mat, MatStoreValues()
External Links
- PETSc Manual:
Mat/MatRetrieveValues
PETSc.LibPETSc.MatSNESMFGetReuseBase — Method
use::PetscBool = MatSNESMFGetReuseBase(petsclib::PetscLibType,J::PetscMat)Determines if the base vector is to be used for differencing even if the function provided to SNESSetFunction() is not the same as that provided to MatMFFDSetFunction().
Logically Collective
Input Parameter:
J- theMATMFFDmatrix
Output Parameter:
use- if true always reuse the base vector instead of recomputing f(u) even if the function in theMATMFFDis
not SNESComputeFunction()
Level: advanced
-seealso: , Mat, SNES, MatSNESMFSetReuseBase(), MatCreateSNESMF()
External Links
- PETSc Manual:
Snes/MatSNESMFGetReuseBase
PETSc.LibPETSc.MatSNESMFGetSNES — Method
MatSNESMFGetSNES(petsclib::PetscLibType,J::PetscMat, snes::PetscSNES)returns the SNES associated with a matrix created with MatCreateSNESMF()
Not Collective
Input Parameter:
J- the matrix
Output Parameter:
snes- theSNESobject
Level: advanced
-seealso: , Mat, SNES, MatCreateSNESMF()
External Links
- PETSc Manual:
Snes/MatSNESMFGetSNES
PETSc.LibPETSc.MatSNESMFMoreSetParameters — Method
MatSNESMFMoreSetParameters(petsclib::PetscLibType,mat::PetscMat, error::PetscReal, umin::PetscReal, h::PetscReal)Sets the parameters for the approximation of matrix-vector products using finite differences, see MatCreateSNESMFMore()
Input Parameters:
mat- the matrixerror- relative error (should be set to the square root of the relative error in the function evaluations)umin- minimum allowable u-valueh- differencing parameter
Options Database Keys:
-snes_mf_err <error_rel>- seeMatCreateSNESMF()-snes_mf_umin <umin>- seeMatCreateSNESMF()-snes_mf_compute_err- compute the square root or relative error in function-snes_mf_freq_err <freq>- set the frequency to recompute the parameters-snes_mf_jorge- use the method of Jorge More
Level: advanced
-seealso: , SNES, MatCreateSNESMF(), MatCreateSNESMFMore()
External Links
- PETSc Manual:
Snes/MatSNESMFMoreSetParameters
PETSc.LibPETSc.MatSNESMFSetReuseBase — Method
MatSNESMFSetReuseBase(petsclib::PetscLibType,J::PetscMat, use::PetscBool)Causes the base vector to be used for differencing even if the function provided to SNESSetFunction() is not the same as that provided to MatMFFDSetFunction().
Logically Collective
Input Parameters:
J- theMATMFFDmatrixuse- if true always reuse the base vector instead of recomputing f(u) even if the function in theMATMFFDis
not SNESComputeFunction()
Level: advanced
-seealso: , SNES, MATMFFD, MatMFFDSetFunction(), SNESSetFunction(), MatCreateSNESMF(), MatSNESMFGetReuseBase()
External Links
- PETSc Manual:
Snes/MatSNESMFSetReuseBase
PETSc.LibPETSc.MatSOR — Method
MatSOR(petsclib::PetscLibType,mat::PetscMat, b::PetscVec, omega::PetscReal, flag::MatSORType, shift::PetscReal, its::PetscInt, lits::PetscInt, x::PetscVec)Computes relaxation (SOR, Gauss
Neighbor-wise Collective
Input Parameters:
mat- the matrixb- the right-hand sideomega- the relaxation factorflag- flag indicating the type of SOR (see below)shift- diagonal shiftits- the number of iterationslits- the number of local iterations
Output Parameter:
x- the solution (can contain an initial guess, use optionSOR_ZERO_INITIAL_GUESSto indicate no guess)
SOR Flags:
SOR_FORWARD_SWEEP- forward SORSOR_BACKWARD_SWEEP- backward SORSOR_SYMMETRIC_SWEEP- SSOR (symmetric SOR)SOR_LOCAL_FORWARD_SWEEP- local forward SORSOR_LOCAL_BACKWARD_SWEEP- local forward SORSOR_LOCAL_SYMMETRIC_SWEEP- local SSORSOR_EISENSTAT- SOR with Eisenstat trickSOR_APPLY_UPPER,SOR_APPLY_LOWER- applies
upper/lower triangular part of matrix to vector (with omega)
SOR_ZERO_INITIAL_GUESS- zero initial guess
Level: developer
-seealso: , Mat, MatMult(), KSP, PC, MatGetFactor()
External Links
- PETSc Manual:
Mat/MatSOR
PETSc.LibPETSc.MatSTRUMPACKGetColPerm — Method
cperm::PetscBool = MatSTRUMPACKGetColPerm(petsclib::PetscLibType,F::PetscMat)Get whether STRUMPACK https://portal.nersc.gov/project/sparse/strumpack/master will try to permute the columns of the matrix in order to get a nonzero diagonal
Logically Collective
Input Parameters:
F- the factored matrix obtained by callingMatGetFactor()
Output Parameter:
cperm- Indicates whether STRUMPACK will permute columns
Level: intermediate
-seealso: MATSOLVERSTRUMPACK, , MatSTRUMPACKSetReordering(), Mat, MatGetFactor(), MatSTRUMPACKSetColPerm()
External Links
- PETSc Manual:
Mat/MatSTRUMPACKGetColPerm
PETSc.LibPETSc.MatSTRUMPACKGetCompAbsTol — Method
atol::PetscReal = MatSTRUMPACKGetCompAbsTol(petsclib::PetscLibType,F::PetscMat)Get STRUMPACK https://portal.nersc.gov/project/sparse/strumpack/master absolute tolerance for compression
Logically Collective
Input Parameters:
F- the factored matrix obtained by callingMatGetFactor()
Output Parameter:
atol- absolute compression tolerance
Level: intermediate
-seealso: MATSOLVERSTRUMPACK, , Mat, MatGetFactor(), MatSTRUMPACKSetCompAbsTol(), MatSTRUMPACKSetReordering(), MatSTRUMPACKSetColPerm()
External Links
- PETSc Manual:
Mat/MatSTRUMPACKGetCompAbsTol
PETSc.LibPETSc.MatSTRUMPACKGetCompButterflyLevels — Method
bfly_lvls::PetscInt = MatSTRUMPACKGetCompButterflyLevels(petsclib::PetscLibType,F::PetscMat)Get STRUMPACK https://portal.nersc.gov/project/sparse/strumpack/master number of butterfly levels in HODLR compression (requires ButterflyPACK support)
Logically Collective
Input Parameters:
F- the factored matrix obtained by callingMatGetFactor()from PETSc-STRUMPACK interface
Output Parameter:
bfly_lvls- Number of levels of butterfly compression in HODLR compression
Level: intermediate
-seealso: MATSOLVERSTRUMPACK, MatGetFactor(), MatSTRUMPACKSetCompButterflyLevels()
External Links
- PETSc Manual:
Mat/MatSTRUMPACKGetCompButterflyLevels
PETSc.LibPETSc.MatSTRUMPACKGetCompLeafSize — Method
leaf_size::PetscInt = MatSTRUMPACKGetCompLeafSize(petsclib::PetscLibType,F::PetscMat)Get STRUMPACK https://portal.nersc.gov/project/sparse/strumpack/master leaf size for HSS, BLR, HODLR...
Logically Collective
Input Parameters:
F- the factored matrix obtained by callingMatGetFactor()from PETSc-STRUMPACK interface
Output Parameter:
leaf_size- Size of diagonal blocks in rank-structured approximation
Level: intermediate
-seealso: MATSOLVERSTRUMPACK, , Mat, MatGetFactor(), MatSTRUMPACKSetCompLeafSize(), MatSTRUMPACKSetReordering(), MatSTRUMPACKSetColPerm()
External Links
- PETSc Manual:
Mat/MatSTRUMPACKGetCompLeafSize
PETSc.LibPETSc.MatSTRUMPACKGetCompLossyPrecision — Method
lossy_prec::PetscInt = MatSTRUMPACKGetCompLossyPrecision(petsclib::PetscLibType,F::PetscMat)Get STRUMPACK https://portal.nersc.gov/project/sparse/strumpack/master precision for lossy compression (requires ZFP support)
Logically Collective
Input Parameters:
F- the factored matrix obtained by callingMatGetFactor()from PETSc-STRUMPACK interface
Output Parameter:
lossy_prec- Number of bitplanes to use in lossy compression
Level: intermediate
-seealso: MATSOLVERSTRUMPACK, MatGetFactor(), MatSTRUMPACKSetCompLossyPrecision()
External Links
- PETSc Manual:
Mat/MatSTRUMPACKGetCompLossyPrecision
PETSc.LibPETSc.MatSTRUMPACKGetCompMinSepSize — Method
min_sep_size::PetscInt = MatSTRUMPACKGetCompMinSepSize(petsclib::PetscLibType,F::PetscMat)Get STRUMPACK https://portal.nersc.gov/project/sparse/strumpack/master minimum separator size for low
Logically Collective
Input Parameters:
F- the factored matrix obtained by callingMatGetFactor()from PETSc-STRUMPACK interface
Output Parameter:
min_sep_size- minimum dense matrix size for low-rank approximation
Level: intermediate
-seealso: MATSOLVERSTRUMPACK, MatGetFactor(), MatSTRUMPACKSetCompMinSepSize()
External Links
- PETSc Manual:
Mat/MatSTRUMPACKGetCompMinSepSize
PETSc.LibPETSc.MatSTRUMPACKGetCompRelTol — Method
rtol::PetscReal = MatSTRUMPACKGetCompRelTol(petsclib::PetscLibType,F::PetscMat)Get STRUMPACK https://portal.nersc.gov/project/sparse/strumpack/master relative tolerance for compression
Logically Collective
Input Parameters:
F- the factored matrix obtained by callingMatGetFactor()
Output Parameter:
rtol- relative compression tolerance
Level: intermediate
-seealso: MATSOLVERSTRUMPACK, , Mat, MatGetFactor(), MatSTRUMPACKSetCompRelTol(), MatSTRUMPACKSetReordering(), MatSTRUMPACKSetColPerm()
External Links
- PETSc Manual:
Mat/MatSTRUMPACKGetCompRelTol
PETSc.LibPETSc.MatSTRUMPACKGetCompression — Method
MatSTRUMPACKGetCompression(petsclib::PetscLibType,F::PetscMat, comp::MatSTRUMPACKCompressionType)Get STRUMPACK https://portal.nersc.gov/project/sparse/strumpack/master compression type
Input Parameters:
F- the factored matrix obtained by callingMatGetFactor()from PETSc-STRUMPACK interface
Output Parameter:
comp- Type of compression to be used in the approximate sparse factorization
Level: intermediate
-seealso: MATSOLVERSTRUMPACK, MatGetFactor(), MatSTRUMPACKCompressionType, MatSTRUMPACKSetCompression()
External Links
- PETSc Manual:
Mat/MatSTRUMPACKGetCompression
PETSc.LibPETSc.MatSTRUMPACKGetGPU — Method
gpu::PetscBool = MatSTRUMPACKGetGPU(petsclib::PetscLibType,F::PetscMat)Get whether STRUMPACK https://portal.nersc.gov/project/sparse/strumpack/master will try to use GPU acceleration (not supported for all compression types)
Logically Collective
Input Parameters:
F- the factored matrix obtained by callingMatGetFactor()from PETSc-STRUMPACK interface
Output Parameter:
gpu- whether or not STRUMPACK will try to use GPU acceleration
Level: intermediate
-seealso: MATSOLVERSTRUMPACK, MatGetFactor(), MatSTRUMPACKSetGPU()
External Links
- PETSc Manual:
Mat/MatSTRUMPACKGetGPU
PETSc.LibPETSc.MatSTRUMPACKGetReordering — Method
MatSTRUMPACKGetReordering(petsclib::PetscLibType,F::PetscMat, reordering::MatSTRUMPACKReordering)Get STRUMPACK https://portal.nersc.gov/project/sparse/strumpack/master fill
Logically Collective
Input Parameters:
F- the factored matrix obtained by callingMatGetFactor()from PETSc-STRUMPACK interface
Output Parameter:
reordering- the code to be used to find the fill-reducing reordering
Level: intermediate
-seealso: MATSOLVERSTRUMPACK, , Mat, MatSTRUMPACKReordering, MatGetFactor(), MatSTRUMPACKSetReordering(), MatSTRUMPACKSetColPerm()
External Links
- PETSc Manual:
Mat/MatSTRUMPACKGetReordering
PETSc.LibPETSc.MatSTRUMPACKSetColPerm — Method
MatSTRUMPACKSetColPerm(petsclib::PetscLibType,F::PetscMat, cperm::PetscBool)Set whether STRUMPACK https://portal.nersc.gov/project/sparse/strumpack/master should try to permute the columns of the matrix in order to get a nonzero diagonal
Logically Collective
Input Parameters:
F- the factored matrix obtained by callingMatGetFactor()cperm-PETSC_TRUEto permute (internally) the columns of the matrix
Options Database Key:
-mat_strumpack_colperm <cperm>- true to use the permutation
Level: intermediate
-seealso: MATSOLVERSTRUMPACK, , MatSTRUMPACKSetReordering(), Mat, MatGetFactor(), MatSTRUMPACKGetColPerm()
External Links
- PETSc Manual:
Mat/MatSTRUMPACKSetColPerm
PETSc.LibPETSc.MatSTRUMPACKSetCompAbsTol — Method
MatSTRUMPACKSetCompAbsTol(petsclib::PetscLibType,F::PetscMat, atol::PetscReal)Set STRUMPACK https://portal.nersc.gov/project/sparse/strumpack/master absolute tolerance for compression
Logically Collective
Input Parameters:
F- the factored matrix obtained by callingMatGetFactor()atol- absolute compression tolerance
Options Database Key:
-mat_strumpack_compression_abs_tol <1e-10>- Absolute compression tolerance, when using-pctype ilu
Level: intermediate
-seealso: MATSOLVERSTRUMPACK, , Mat, MatGetFactor(), MatSTRUMPACKGetCompAbsTol(), MatSTRUMPACKSetReordering(), MatSTRUMPACKSetColPerm()
External Links
- PETSc Manual:
Mat/MatSTRUMPACKSetCompAbsTol
PETSc.LibPETSc.MatSTRUMPACKSetCompButterflyLevels — Method
MatSTRUMPACKSetCompButterflyLevels(petsclib::PetscLibType,F::PetscMat, bfly_lvls::PetscInt)Set STRUMPACK https://portal.nersc.gov/project/sparse/strumpack/master number of butterfly levels in HODLR compression (requires ButterflyPACK support)
Logically Collective
Input Parameters:
F- the factored matrix obtained by callingMatGetFactor()from PETSc-STRUMPACK interfacebfly_lvls- Number of levels of butterfly compression in HODLR compression
Options Database Key:
-mat_strumpack_compression_butterfly_levels <bfly_lvls>- Number of levels in the hierarchically off-diagonal matrix for which to use butterfly,
when using -pctype ilu, (BLR_)HODLR compression
Level: intermediate
-seealso: MATSOLVERSTRUMPACK, MatGetFactor(), MatSTRUMPACKGetCompButterflyLevels()
External Links
- PETSc Manual:
Mat/MatSTRUMPACKSetCompButterflyLevels
PETSc.LibPETSc.MatSTRUMPACKSetCompLeafSize — Method
MatSTRUMPACKSetCompLeafSize(petsclib::PetscLibType,F::PetscMat, leaf_size::PetscInt)Set STRUMPACK https://portal.nersc.gov/project/sparse/strumpack/master leaf size for HSS, BLR, HODLR...
Logically Collective
Input Parameters:
F- the factored matrix obtained by callingMatGetFactor()from PETSc-STRUMPACK interfaceleaf_size- Size of diagonal blocks in rank-structured approximation
Options Database Key:
-mat_strumpack_compression_leaf_size- Size of diagonal blocks in rank-structured approximation, when using-pctype ilu
Level: intermediate
-seealso: MATSOLVERSTRUMPACK, , Mat, MatGetFactor(), MatSTRUMPACKGetCompLeafSize(), MatSTRUMPACKSetReordering(), MatSTRUMPACKSetColPerm()
External Links
- PETSc Manual:
Mat/MatSTRUMPACKSetCompLeafSize
PETSc.LibPETSc.MatSTRUMPACKSetCompLossyPrecision — Method
MatSTRUMPACKSetCompLossyPrecision(petsclib::PetscLibType,F::PetscMat, lossy_prec::PetscInt)Set STRUMPACK https://portal.nersc.gov/project/sparse/strumpack/master precision for lossy compression (requires ZFP support)
Logically Collective
Input Parameters:
F- the factored matrix obtained by callingMatGetFactor()from PETSc-STRUMPACK interfacelossy_prec- Number of bitplanes to use in lossy compression
Options Database Key:
-mat_strumpack_compression_lossy_precision <lossy_prec>- Precision when using lossy compression [1-64], when using-pctype ilu -mat_strumpack_compression MAT_STRUMPACK_COMPRESSION_TYPE_LOSSY
Level: intermediate
-seealso: MATSOLVERSTRUMPACK, MatGetFactor(), MatSTRUMPACKGetCompLossyPrecision()
External Links
- PETSc Manual:
Mat/MatSTRUMPACKSetCompLossyPrecision
PETSc.LibPETSc.MatSTRUMPACKSetCompMinSepSize — Method
MatSTRUMPACKSetCompMinSepSize(petsclib::PetscLibType,F::PetscMat, min_sep_size::PetscInt)Set STRUMPACK https://portal.nersc.gov/project/sparse/strumpack/master minimum separator size for low
Logically Collective
Input Parameters:
F- the factored matrix obtained by callingMatGetFactor()from PETSc-STRUMPACK interfacemin_sep_size- minimum dense matrix size for low-rank approximation
Options Database Key:
-mat_strumpack_compression_min_sep_size <min_sep_size>- Minimum size of dense sub-block for low-rank compression
Level: intermediate
-seealso: MATSOLVERSTRUMPACK, MatGetFactor(), MatSTRUMPACKGetCompMinSepSize()
External Links
- PETSc Manual:
Mat/MatSTRUMPACKSetCompMinSepSize
PETSc.LibPETSc.MatSTRUMPACKSetCompRelTol — Method
MatSTRUMPACKSetCompRelTol(petsclib::PetscLibType,F::PetscMat, rtol::PetscReal)Set STRUMPACK https://portal.nersc.gov/project/sparse/strumpack/master relative tolerance for compression
Logically Collective
Input Parameters:
F- the factored matrix obtained by callingMatGetFactor()rtol- relative compression tolerance
Options Database Key:
-mat_strumpack_compression_rel_tol <1e-4>- Relative compression tolerance, when using-pctype ilu
Level: intermediate
-seealso: MATSOLVERSTRUMPACK, , Mat, MatGetFactor(), MatSTRUMPACKGetCompRelTol(), MatSTRUMPACKSetReordering(), MatSTRUMPACKSetColPerm()
External Links
- PETSc Manual:
Mat/MatSTRUMPACKSetCompRelTol
PETSc.LibPETSc.MatSTRUMPACKSetCompression — Method
MatSTRUMPACKSetCompression(petsclib::PetscLibType,F::PetscMat, comp::MatSTRUMPACKCompressionType)Set STRUMPACK https://portal.nersc.gov/project/sparse/strumpack/master compression type
Input Parameters:
F- the factored matrix obtained by callingMatGetFactor()from PETSc-STRUMPACK interfacecomp- Type of compression to be used in the approximate sparse factorization
Options Database Key:
-mat_strumpack_compression <NONE>- Type of rank-structured compression in sparse LU factors (choose one of) NONE HSS BLR HODLR BLRHODLR ZFPBLR_HODLR LOSSLESS LOSSY
Level: intermediate
-seealso: MATSOLVERSTRUMPACK, MatGetFactor(), MatSTRUMPACKCompressionType, MatSTRUMPACKGetCompression()
External Links
- PETSc Manual:
Mat/MatSTRUMPACKSetCompression
PETSc.LibPETSc.MatSTRUMPACKSetGPU — Method
MatSTRUMPACKSetGPU(petsclib::PetscLibType,F::PetscMat, gpu::PetscBool)Set whether STRUMPACK https://portal.nersc.gov/project/sparse/strumpack/master should enable GPU acceleration (not supported for all compression types)
Logically Collective
Input Parameters:
F- the factored matrix obtained by callingMatGetFactor()from PETSc-STRUMPACK interfacegpu- whether or not to use GPU acceleration
Options Database Key:
-mat_strumpack_gpu <gpu>- true to use gpu offload
Level: intermediate
-seealso: MATSOLVERSTRUMPACK, MatGetFactor(), MatSTRUMPACKGetGPU()
External Links
- PETSc Manual:
Mat/MatSTRUMPACKSetGPU
PETSc.LibPETSc.MatSTRUMPACKSetGeometricComponents — Method
MatSTRUMPACKSetGeometricComponents(petsclib::PetscLibType,F::PetscMat, nc::PetscInt)Set STRUMPACK https://portal.nersc.gov/project/sparse/strumpack/master number of degrees of freedom per mesh point, for use with GEOMETRIC ordering.
Logically Collective
Input Parameters:
F- the factored matrix obtained by callingMatGetFactor()from PETSc-STRUMPACK interfacenc- Number of components/dof's per grid point
Options Database Key:
-mat_strumpack_geometric_components <1>- Number of components per mesh point, for geometric nested dissection ordering
Level: intermediate
-seealso: MATSOLVERSTRUMPACK, MatGetFactor()
External Links
- PETSc Manual:
Mat/MatSTRUMPACKSetGeometricComponents
PETSc.LibPETSc.MatSTRUMPACKSetGeometricNxyz — Method
MatSTRUMPACKSetGeometricNxyz(petsclib::PetscLibType,F::PetscMat, nx::PetscInt, ny::PetscInt, nz::PetscInt)Set STRUMPACK https://portal.nersc.gov/project/sparse/strumpack/master mesh x, y and z dimensions, for use with GEOMETRIC ordering.
Logically Collective
Input Parameters:
F- the factored matrix obtained by callingMatGetFactor()from PETSc-STRUMPACK interfacenx- x dimension of the meshny- y dimension of the meshnz- z dimension of the mesh
Level: intermediate
-seealso: MATSOLVERSTRUMPACK, MatGetFactor()
External Links
- PETSc Manual:
Mat/MatSTRUMPACKSetGeometricNxyz
PETSc.LibPETSc.MatSTRUMPACKSetGeometricWidth — Method
MatSTRUMPACKSetGeometricWidth(petsclib::PetscLibType,F::PetscMat, w::PetscInt)Set STRUMPACK https://portal.nersc.gov/project/sparse/strumpack/master width of the separator, for use with GEOMETRIC ordering.
Logically Collective
Input Parameters:
F- the factored matrix obtained by callingMatGetFactor()from PETSc-STRUMPACK interfacew- width of the separator
Options Database Key:
-mat_strumpack_geometric_width <1>- Width of the separator of the mesh, for geometric nested dissection ordering
Level: intermediate
-seealso: MATSOLVERSTRUMPACK, MatGetFactor()
External Links
- PETSc Manual:
Mat/MatSTRUMPACKSetGeometricWidth
PETSc.LibPETSc.MatSTRUMPACKSetReordering — Method
MatSTRUMPACKSetReordering(petsclib::PetscLibType,F::PetscMat, reordering::MatSTRUMPACKReordering)Set STRUMPACK https://portal.nersc.gov/project/sparse/strumpack/master fill
Logically Collective
Input Parameters:
F- the factored matrix obtained by callingMatGetFactor()from PETSc-STRUMPACK interfacereordering- the code to be used to find the fill-reducing reordering
Options Database Key:
-mat_strumpack_reordering <METIS>- Sparsity reducing matrix reordering, seeMatSTRUMPACKReordering
Level: intermediate
-seealso: MATSOLVERSTRUMPACK, , Mat, MatSTRUMPACKReordering, MatGetFactor(), MatSTRUMPACKSetColPerm(), MatSTRUMPACKGetReordering()
External Links
- PETSc Manual:
Mat/MatSTRUMPACKSetReordering
PETSc.LibPETSc.MatScaLAPACKGetBlockSizes — Method
mb::PetscInt,nb::PetscInt = MatScaLAPACKGetBlockSizes(petsclib::PetscLibType,A::PetscMat)Gets the block sizes used in the distribution of the MATSCALAPACK matrix
Not Collective
Input Parameter:
A- aMATSCALAPACKmatrix
Output Parameters:
mb- the row block sizenb- the column block size
Level: intermediate
-seealso: , Mat, MATSCALAPACK, MatCreateScaLAPACK(), MatScaLAPACKSetBlockSizes()
External Links
- PETSc Manual:
Mat/MatScaLAPACKGetBlockSizes
PETSc.LibPETSc.MatScaLAPACKSetBlockSizes — Method
MatScaLAPACKSetBlockSizes(petsclib::PetscLibType,A::PetscMat, mb::PetscInt, nb::PetscInt)Sets the block sizes to be used for the distribution of the MATSCALAPACK matrix
Logically Collective
Input Parameters:
A- aMATSCALAPACKmatrixmb- the row block sizenb- the column block size
Level: intermediate
-seealso: , Mat, MATSCALAPACK, MatCreateScaLAPACK(), MatScaLAPACKGetBlockSizes()
External Links
- PETSc Manual:
Mat/MatScaLAPACKSetBlockSizes
PETSc.LibPETSc.MatScale — Method
MatScale(petsclib::PetscLibType,mat::PetscMat, a::PetscScalar)Scales all elements of a matrix by a given number.
Logically Collective
Input Parameters:
mat- the matrix to be scaleda- the scaling value
Level: intermediate
-seealso: , Mat, MatDiagonalScale()
External Links
- PETSc Manual:
Mat/MatScale
PETSc.LibPETSc.MatScatterGetVecScatter — Method
MatScatterGetVecScatter(petsclib::PetscLibType,mat::PetscMat, scatter::VecScatter)Returns the user
Logically Collective
Input Parameter:
mat- the matrix, should have been created with MatCreateScatter() or have typeMATSCATTER
Output Parameter:
scatter- the scatter context
Level: intermediate
-seealso: , Mat, MATSCATTER, MatCreateScatter(), MatScatterSetVecScatter()
External Links
- PETSc Manual:
Mat/MatScatterGetVecScatter
PETSc.LibPETSc.MatScatterSetVecScatter — Method
MatScatterSetVecScatter(petsclib::PetscLibType,mat::PetscMat, scatter::VecScatter)sets the scatter that the matrix is to apply as its linear operator in a MATSCATTER
Logically Collective
Input Parameters:
mat- theMATSCATTERmatrixscatter- the scatter context create withVecScatterCreate()
Level: advanced
-seealso: , Mat, MATSCATTER, MatCreateScatter()
External Links
- PETSc Manual:
Mat/MatScatterSetVecScatter
PETSc.LibPETSc.MatSchurComplementComputeExplicitOperator — Method
MatSchurComplementComputeExplicitOperator(petsclib::PetscLibType,A::PetscMat, S::PetscMat)Compute the Schur complement matrix explicitly
Collective
Input Parameter:
A- the matrix obtained withMatCreateSchurComplement()
Output Parameter:
S- the Schur complement matrix
Level: advanced
-seealso: , MatCreateSchurComplement(), MatSchurComplementUpdateSubMatrices(), MatSchurComplementGetPmat()
External Links
- PETSc Manual:
Ksp/MatSchurComplementComputeExplicitOperator
PETSc.LibPETSc.MatSchurComplementGetAinvType — Method
ainvtype::MatSchurComplementAinvType = MatSchurComplementGetAinvType(petsclib::PetscLibType,S::PetscMat)get the type of approximation for the inverse of the (0,0) block used in forming Sp in MatSchurComplementGetPmat()
Not Collective
Input Parameter:
S- matrix obtained withMatCreateSchurComplement()(or equivalent) and implementing the action of A11 - A10 ksp(A00,Ap00) A01
Output Parameter:
ainvtype- type of approximation used to form approximate Schur complement Sp = A11 - A10 inv(DIAGFORM(A00)) A01:
MAT_SCHUR_COMPLEMENT_AINV_DIAG, MAT_SCHUR_COMPLEMENT_AINV_LUMP, MAT_SCHUR_COMPLEMENT_AINV_BLOCK_DIAG, or MAT_SCHUR_COMPLEMENT_AINV_FULL
Level: advanced
-seealso: , MatSchurComplementAinvType, MatCreateSchurComplement(), MatGetSchurComplement(), MatSchurComplementGetPmat(), MatSchurComplementSetAinvType()
External Links
- PETSc Manual:
Ksp/MatSchurComplementGetAinvType
PETSc.LibPETSc.MatSchurComplementGetKSP — Method
MatSchurComplementGetKSP(petsclib::PetscLibType,S::PetscMat, ksp::PetscKSP)Gets the KSP object that is used to solve with A00 in the Schur complement matrix S = A11
Not Collective
Input Parameter:
S- matrix obtained withMatCreateSchurComplement()(or equivalent) and implementing the action of A11 - A10 ksp(A00,Ap00) A01
Output Parameter:
ksp- the linear solver object
Options Database Key:
-fieldsplit_<splitname_0>_XXX- setsKSPandPCoptions for the 0-split solver inside the Schur complement used inPCFIELDSPLIT; default <splitname_0> is 0.
Level: intermediate
-seealso: , Mat, MatSchurComplementSetKSP(), MatCreateSchurComplement(), MatCreateNormal(), MatMult(), MatCreate()
External Links
- PETSc Manual:
Ksp/MatSchurComplementGetKSP
PETSc.LibPETSc.MatSchurComplementGetPmat — Method
MatSchurComplementGetPmat(petsclib::PetscLibType,S::PetscMat, preuse::MatReuse, Sp::PetscMat)Obtain a matrix for preconditioning the Schur complement by assembling Sp = A11
Collective
Input Parameters:
S- matrix obtained with MatCreateSchurComplement() (or equivalent) that implements the action of A11 - A10 ksp(A00,Ap00) A01preuse-MAT_INITIAL_MATRIXfor a newSp, orMAT_REUSE_MATRIXto reuse an existingSp, orMAT_IGNORE_MATRIXto put nothing inSp
Output Parameter:
Sp- approximate Schur complement suitable for preconditioning the exact Schur complement S = A11 - A10 inv(A00) A01
Level: advanced
-seealso: , MatCreateSubMatrix(), PCFIELDSPLIT, MatGetSchurComplement(), MatCreateSchurComplement(), MatSchurComplementSetAinvType()
External Links
- PETSc Manual:
Ksp/MatSchurComplementGetPmat
PETSc.LibPETSc.MatSchurComplementGetSubMatrices — Method
MatSchurComplementGetSubMatrices(petsclib::PetscLibType,S::PetscMat, A00::PetscMat, Ap00::PetscMat, A01::PetscMat, A10::PetscMat, A11::PetscMat)Get the individual submatrices in the Schur complement
Collective
Input Parameter:
S- matrix obtained withMatCreateSchurComplement()(or equivalent) and implementing the action of A11 - A10 ksp(A00,Ap00) A01
Output Parameters:
A00- the upper-left block of the original matrix A = [A00 A01; A10 A11]Ap00- matrix from which the preconditioner is constructed for use in ksp(A00,Ap00) to approximate the action of A^{-1}A01- the upper-right block of the original matrix A = [A00 A01; A10 A11]A10- the lower-left block of the original matrix A = [A00 A01; A10 A11]A11- (optional) the lower-right block of the original matrix A = [A00 A01; A10 A11]
Level: intermediate
-seealso: , MatCreateNormal(), MatMult(), MatCreate(), MatSchurComplementGetKSP(), MatCreateSchurComplement(), MatSchurComplementUpdateSubMatrices()
External Links
- PETSc Manual:
Ksp/MatSchurComplementGetSubMatrices
PETSc.LibPETSc.MatSchurComplementSetAinvType — Method
MatSchurComplementSetAinvType(petsclib::PetscLibType,S::PetscMat, ainvtype::MatSchurComplementAinvType)set the type of approximation used for the inverse of the (0,0) block used in forming Sp in MatSchurComplementGetPmat()
Not Collective
Input Parameters:
S- matrix obtained withMatCreateSchurComplement()(or equivalent) and implementing the action of A11 - A10 ksp(A00,Ap00) A01ainvtype- type of approximation to be used to form approximate Schur complement Sp = A11 - A10 inv(DIAGFORM(A00)) A01:
MAT_SCHUR_COMPLEMENT_AINV_DIAG, MAT_SCHUR_COMPLEMENT_AINV_LUMP, MAT_SCHUR_COMPLEMENT_AINV_BLOCK_DIAG, or MAT_SCHUR_COMPLEMENT_AINV_FULL
Options Database Key:
-mat_schur_complement_ainv_type diag | lump | blockdiag | full- set schur complement type
Level: advanced
-seealso: , MatSchurComplementAinvType, MatCreateSchurComplement(), MatGetSchurComplement(), MatSchurComplementGetPmat(), MatSchurComplementGetAinvType()
External Links
- PETSc Manual:
Ksp/MatSchurComplementSetAinvType
PETSc.LibPETSc.MatSchurComplementSetKSP — Method
MatSchurComplementSetKSP(petsclib::PetscLibType,S::PetscMat, ksp::PetscKSP)Sets the KSP object that is used to solve with A00 in the Schur complement matrix S = A11
Not Collective
Input Parameters:
S- matrix created withMatCreateSchurComplement()ksp- the linear solver object
Level: developer
-seealso: , Mat, MatSchurComplementGetKSP(), MatCreateSchurComplement(), MatCreateNormal(), MatMult(), MatCreate(), MATSCHURCOMPLEMENT
External Links
- PETSc Manual:
Ksp/MatSchurComplementSetKSP
PETSc.LibPETSc.MatSchurComplementSetSubMatrices — Method
MatSchurComplementSetSubMatrices(petsclib::PetscLibType,S::PetscMat, A00::PetscMat, Ap00::PetscMat, A01::PetscMat, A10::PetscMat, A11::PetscMat)Sets the matrices that define the Schur complement
Collective
Input Parameters:
S- matrix obtained withMatSetType(S,MATSCHURCOMPLEMENT)A00- the upper-left block of the original matrix A = [A00 A01; A10 A11]Ap00- matrix from which the preconditioner is constructed for use in ksp(A00,Ap00) to approximate the action of A00^{-1}A01- the upper-right block of the original matrix A = [A00 A01; A10 A11]A10- the lower-left block of the original matrix A = [A00 A01; A10 A11]A11- (optional) the lower-right block of the original matrix A = [A00 A01; A10 A11]
Level: intermediate
-seealso: , Mat, MatCreateNormal(), MatMult(), MatCreate(), MatSchurComplementGetKSP(), MatSchurComplementUpdateSubMatrices(), MatCreateTranspose(), MatCreateSchurComplement(), MatGetSchurComplement()
External Links
- PETSc Manual:
Ksp/MatSchurComplementSetSubMatrices
PETSc.LibPETSc.MatSchurComplementUpdateSubMatrices — Method
MatSchurComplementUpdateSubMatrices(petsclib::PetscLibType,S::PetscMat, A00::PetscMat, Ap00::PetscMat, A01::PetscMat, A10::PetscMat, A11::PetscMat)Updates the Schur complement matrix object with new submatrices
Collective
Input Parameters:
S- matrix obtained withMatCreateSchurComplement()(orMatSchurSetSubMatrices()) and implementing the action of A11 - A10 ksp(A00,Ap00) A01A00- the upper-left block of the original matrix A = [A00 A01; A10 A11]Ap00- matrix from which the preconditioner is constructed for use in ksp(A00,Ap00) to approximate the action of A00^{-1}A01- the upper-right block of the original matrix A = [A00 A01; A10 A11]A10- the lower-left block of the original matrix A = [A00 A01; A10 A11]A11- (optional) the lower-right block of the original matrix A = [A00 A01; A10 A11]
Level: intermediate
-seealso: , Mat, MatCreateNormal(), MatMult(), MatCreate(), MatSchurComplementGetKSP(), MatCreateSchurComplement()
External Links
- PETSc Manual:
Ksp/MatSchurComplementUpdateSubMatrices
PETSc.LibPETSc.MatSelectVariableBlockSizes — Method
MatSelectVariableBlockSizes(petsclib::PetscLibType,subA::PetscMat, A::PetscMat, isrow::IS)When creating a submatrix, pass on the variable block sizes
Not Collective
Input Parameter:
subA- the submatrixA- the original matrixisrow- TheISof selected rows for the submatrix, must be sorted
Level: developer
-seealso: , Mat, MatSetVariableBlockSizes(), MatComputeVariableBlockEnvelope()
External Links
- PETSc Manual:
Mat/MatSelectVariableBlockSizes
PETSc.LibPETSc.MatSeqAIJGetArray — Method
array::Vector{PetscScalar} = MatSeqAIJGetArray(petsclib::PetscLibType,A::PetscMat)gives read/write access to the array where the data for a MATSEQAIJ matrix is stored
Not Collective
Input Parameter:
A- aMATSEQAIJmatrix
Output Parameter:
array- pointer to the data
Level: intermediate
-seealso: , Mat, MatSeqAIJRestoreArray()
External Links
- PETSc Manual:
Mat/MatSeqAIJGetArray
PETSc.LibPETSc.MatSeqAIJGetArrayRead — Method
array::Vector{PetscScalar} = MatSeqAIJGetArrayRead(petsclib::PetscLibType,A::PetscMat)gives read
Not Collective; No Fortran Support
Input Parameter:
A- aMATSEQAIJmatrix
Output Parameter:
array- pointer to the data
Level: intermediate
-seealso: , Mat, MatSeqAIJGetArray(), MatSeqAIJRestoreArrayRead()
External Links
- PETSc Manual:
Mat/MatSeqAIJGetArrayRead
PETSc.LibPETSc.MatSeqAIJGetArrayWrite — Method
array::Vector{PetscScalar} = MatSeqAIJGetArrayWrite(petsclib::PetscLibType,A::PetscMat)gives write
Not Collective; No Fortran Support
Input Parameter:
A- aMATSEQAIJmatrix
Output Parameter:
array- pointer to the data
Level: intermediate
-seealso: , Mat, MatSeqAIJGetArray(), MatSeqAIJRestoreArrayRead()
External Links
- PETSc Manual:
Mat/MatSeqAIJGetArrayWrite
PETSc.LibPETSc.MatSeqAIJGetCSRAndMemType — Method
i::Vector{PetscInt},j::Vector{PetscInt},a::Vector{PetscScalar},mtype::PetscMemType = MatSeqAIJGetCSRAndMemType(petsclib::PetscLibType,mat::PetscMat)Get the CSR arrays and the memory type of the MATSEQAIJ matrix
Not Collective; No Fortran Support
Input Parameter:
mat- a matrix of typeMATSEQAIJor its subclasses
Output Parameters:
i- row map array of the matrixj- column index array of the matrixa- data array of the matrixmtype- memory type of the arrays
Level: developer
-seealso: , Mat, MatSeqAIJGetArray(), MatSeqAIJGetArrayRead()
External Links
- PETSc Manual:
Mat/MatSeqAIJGetCSRAndMemType
PETSc.LibPETSc.MatSeqAIJGetMaxRowNonzeros — Method
nz::PetscInt = MatSeqAIJGetMaxRowNonzeros(petsclib::PetscLibType,A::PetscMat)returns the maximum number of nonzeros in any row
Not Collective
Input Parameter:
A- aMATSEQAIJmatrix
Output Parameter:
nz- the maximum number of nonzeros in any row
Level: intermediate
-seealso: , Mat, MatSeqAIJRestoreArray()
External Links
- PETSc Manual:
Mat/MatSeqAIJGetMaxRowNonzeros
PETSc.LibPETSc.MatSeqAIJKron — Method
MatSeqAIJKron(petsclib::PetscLibType,A::PetscMat, B::PetscMat, reuse::MatReuse, C::PetscMat)Computes C, the Kronecker product of A and B.
Input Parameters:
A- left-hand side matrixB- right-hand side matrixreuse- eitherMAT_INITIAL_MATRIXorMAT_REUSE_MATRIX
Output Parameter:
C- Kronecker product ofAandB
Level: intermediate
-seealso: , Mat, MatCreateSeqAIJ(), MATSEQAIJ, MATKAIJ, MatReuse
External Links
- PETSc Manual:
Mat/MatSeqAIJKron
PETSc.LibPETSc.MatSeqAIJRegister — Method
MatSeqAIJRegister(petsclib::PetscLibType,sname::Vector{Cchar}, fnc::external)Not Collective, No Fortran Support
Input Parameters:
sname- name of a new user-defined matrix type, for exampleMATSEQAIJCRLfunction- routine to convert to subtype
Level: advanced
-seealso: , Mat, MatSeqAIJRegisterAll()
External Links
- PETSc Manual:
Mat/MatSeqAIJRegister
PETSc.LibPETSc.MatSeqAIJRestoreArray — Method
array::Vector{PetscScalar} = MatSeqAIJRestoreArray(petsclib::PetscLibType,A::PetscMat)returns access to the array where the data for a MATSEQAIJ matrix is stored obtained by MatSeqAIJGetArray()
Not Collective
Input Parameters:
A- aMATSEQAIJmatrixarray- pointer to the data
Level: intermediate
-seealso: , Mat, MatSeqAIJGetArray()
External Links
- PETSc Manual:
Mat/MatSeqAIJRestoreArray
PETSc.LibPETSc.MatSeqAIJRestoreArrayRead — Method
array::Vector{PetscScalar} = MatSeqAIJRestoreArrayRead(petsclib::PetscLibType,A::PetscMat)restore the read
Not Collective; No Fortran Support
Input Parameter:
A- aMATSEQAIJmatrix
Output Parameter:
array- pointer to the data
Level: intermediate
-seealso: , Mat, MatSeqAIJGetArray(), MatSeqAIJGetArrayRead()
External Links
- PETSc Manual:
Mat/MatSeqAIJRestoreArrayRead
PETSc.LibPETSc.MatSeqAIJRestoreArrayWrite — Method
array::Vector{PetscScalar} = MatSeqAIJRestoreArrayWrite(petsclib::PetscLibType,A::PetscMat)restore the read
Not Collective; No Fortran Support
Input Parameter:
A- a MATSEQAIJ matrix
Output Parameter:
array- pointer to the data
Level: intermediate
-seealso: , Mat, MatSeqAIJGetArray(), MatSeqAIJGetArrayRead()
External Links
- PETSc Manual:
Mat/MatSeqAIJRestoreArrayWrite
PETSc.LibPETSc.MatSeqAIJSetColumnIndices — Method
indices::PetscInt = MatSeqAIJSetColumnIndices(petsclib::PetscLibType,mat::PetscMat)Set the column indices for all the rows in the matrix.
Input Parameters:
mat- theMATSEQAIJmatrixindices- the column indices
Level: advanced
External Links
- PETSc Manual:
Mat/MatSeqAIJSetColumnIndices
PETSc.LibPETSc.MatSeqAIJSetPreallocation — Method
MatSeqAIJSetPreallocation(petsclib::PetscLibType,B::PetscMat, nz::PetscInt, nnz::Vector{PetscInt})For good matrix assembly performance the user should preallocate the matrix storage by setting the parameter nz (or the array nnz). By setting these parameters accurately, performance during matrix assembly can be increased by more than a factor of 50.
Collective
Input Parameters:
B- The matrixnz- number of nonzeros per row (same for all rows)nnz- array containing the number of nonzeros in the various rows
(possibly different for each row) or NULL
Options Database Keys:
-mat_no_inode- Do not use inodes-mat_inode_limit <limit>- Sets inode limit (max limit=5)
Level: intermediate
-seealso: , Mat, MatCreate(), MatCreateAIJ(), MatSetValues(), MatSeqAIJSetColumnIndices(), MatCreateSeqAIJWithArrays(), MatGetInfo(), MatSeqAIJSetTotalPreallocation()
External Links
- PETSc Manual:
Mat/MatSeqAIJSetPreallocation
PETSc.LibPETSc.MatSeqAIJSetPreallocationCSR — Method
MatSeqAIJSetPreallocationCSR(petsclib::PetscLibType,B::PetscMat, i::Vector{PetscInt}, j::Vector{PetscInt}, v::Vector{PetscScalar})Allocates memory for a sparse sequential matrix in MATSEQAIJ format.
Input Parameters:
B- the matrixi- the indices intojfor the start of each row (indices start with zero)j- the column indices for each row (indices start with zero) these must be sorted for each rowv- optional values in the matrix, useNULLif not provided
Level: developer
-seealso: , Mat, MatCreate(), MatCreateSeqAIJ(), MatSetValues(), MatSeqAIJSetPreallocation(), MATSEQAIJ, MatResetPreallocation()
External Links
- PETSc Manual:
Mat/MatSeqAIJSetPreallocationCSR
PETSc.LibPETSc.MatSeqAIJSetTotalPreallocation — Method
MatSeqAIJSetTotalPreallocation(petsclib::PetscLibType,A::PetscMat, nztotal::PetscInt)Sets an upper bound on the total number of expected nonzeros in the matrix.
Input Parameters:
A- theMATSEQAIJmatrixnztotal- bound on the number of nonzeros
Level: advanced
-seealso: , Mat, MatSetOption(), MAT_SORTED_FULL, MatSetValues(), MatSeqAIJSetPreallocation()
External Links
- PETSc Manual:
Mat/MatSeqAIJSetTotalPreallocation
PETSc.LibPETSc.MatSeqAIJSetType — Method
MatSeqAIJSetType(petsclib::PetscLibType,mat::PetscMat, matype::MatType)Converts a MATSEQAIJ matrix to a subtype
Collective
Input Parameters:
mat- the matrix objectmatype- matrix type
Options Database Key:
-mat_seqaij_type <method>- for example seqaijcrl
Level: intermediate
-seealso: , Mat, PCSetType(), VecSetType(), MatCreate(), MatType
External Links
- PETSc Manual:
Mat/MatSeqAIJSetType
PETSc.LibPETSc.MatSeqAIJSetValuesLocalFast — Method
MatSeqAIJSetValuesLocalFast(petsclib::PetscLibType,A::PetscMat, m::PetscInt, im::Vector{PetscInt}, n::PetscInt, in::Vector{PetscInt}, v::Vector{PetscScalar}, is::InsertMode)External Links
- PETSc Manual:
Mat/MatSeqAIJSetValuesLocalFast
PETSc.LibPETSc.MatSeqBAIJGetArray — Method
array::Vector{PetscScalar} = MatSeqBAIJGetArray(petsclib::PetscLibType,A::PetscMat)gives read/write access to the array where the data for a MATSEQBAIJ matrix is stored
Not Collective
Input Parameter:
A- aMATSEQBAIJmatrix
Output Parameter:
array- pointer to the data
Level: intermediate
-seealso: , Mat, MATSEQBAIJ, MatSeqBAIJRestoreArray(), MatSeqAIJGetArray(), MatSeqAIJRestoreArray()
External Links
- PETSc Manual:
Mat/MatSeqBAIJGetArray
PETSc.LibPETSc.MatSeqBAIJRestoreArray — Method
array::Vector{PetscScalar} = MatSeqBAIJRestoreArray(petsclib::PetscLibType,A::PetscMat)returns access to the array where the data for a MATSEQBAIJ matrix is stored obtained by MatSeqBAIJGetArray()
Not Collective
Input Parameters:
A- aMATSEQBAIJmatrixarray- pointer to the data
Level: intermediate
-seealso: , Mat, MatSeqBAIJGetArray(), MatSeqAIJGetArray(), MatSeqAIJRestoreArray()
External Links
- PETSc Manual:
Mat/MatSeqBAIJRestoreArray
PETSc.LibPETSc.MatSeqBAIJSetColumnIndices — Method
indices::PetscInt = MatSeqBAIJSetColumnIndices(petsclib::PetscLibType,mat::PetscMat)Set the column indices for all the block rows in the matrix.
Input Parameters:
mat- theMATSEQBAIJmatrixindices- the block column indices
Level: advanced
-seealso: , Mat, MATSEQBAIJ, MatSetValues()
External Links
- PETSc Manual:
Mat/MatSeqBAIJSetColumnIndices
PETSc.LibPETSc.MatSeqBAIJSetPreallocation — Method
MatSeqBAIJSetPreallocation(petsclib::PetscLibType,B::PetscMat, bs::PetscInt, nz::PetscInt, nnz::Vector{PetscInt})Sets the block size and expected nonzeros per row in the matrix. For good matrix assembly performance the user should preallocate the matrix storage by setting the parameter nz (or the array nnz).
Collective
Input Parameters:
B- the matrixbs- size of block, the blocks are ALWAYS square. One can useMatSetBlockSizes()to set a different row and column blocksize but the row
blocksize always defines the size of the blocks. The column blocksize sets the blocksize of the vectors obtained with MatCreateVecs()
nz- number of block nonzeros per block row (same for all rows)nnz- array containing the number of block nonzeros in the various block rows
(possibly different for each block row) or NULL
Options Database Keys:
-mat_no_unroll- uses code that does not unroll the loops in the block calculations (much slower)-mat_block_size- size of the blocks to use
Level: intermediate
-seealso: , Mat, Sparse Matrices, MatCreate(), MatCreateSeqAIJ(), MatSetValues(), MatCreateBAIJ(), MatGetInfo()
External Links
- PETSc Manual:
Mat/MatSeqBAIJSetPreallocation
PETSc.LibPETSc.MatSeqBAIJSetPreallocationCSR — Method
MatSeqBAIJSetPreallocationCSR(petsclib::PetscLibType,B::PetscMat, bs::PetscInt, i::Vector{PetscInt}, j::Vector{PetscInt}, v::Vector{PetscScalar})Creates a sparse sequential matrix in MATSEQBAIJ format using the given nonzero structure and (optional) numerical values
Collective
Input Parameters:
B- the matrixbs- the blocksizei- the indices intojfor the start of each local row (indices start with zero)j- the column indices for each local row (indices start with zero) these must be sorted for each rowv- optional values in the matrix, useNULLif not provided
Level: advanced
-seealso: , Mat, MatCreate(), MatCreateSeqBAIJ(), MatSetValues(), MatSeqBAIJSetPreallocation(), MATSEQBAIJ
External Links
- PETSc Manual:
Mat/MatSeqBAIJSetPreallocationCSR
PETSc.LibPETSc.MatSeqDenseInvert — Method
MatSeqDenseInvert(petsclib::PetscLibType,A::PetscMat)External Links
- PETSc Manual:
Mat/MatSeqDenseInvert
PETSc.LibPETSc.MatSeqDenseSetPreallocation — Method
MatSeqDenseSetPreallocation(petsclib::PetscLibType,B::PetscMat, data::Vector{PetscScalar})Sets the array used for storing the matrix elements of a MATSEQDENSE matrix
Collective
Input Parameters:
B- the matrixdata- the array (orNULL)
Level: intermediate
-seealso: , Mat, MATSEQDENSE, MatCreate(), MatCreateDense(), MatSetValues(), MatDenseSetLDA()
External Links
- PETSc Manual:
Mat/MatSeqDenseSetPreallocation
PETSc.LibPETSc.MatSeqSBAIJGetArray — Method
array::Vector{PetscScalar} = MatSeqSBAIJGetArray(petsclib::PetscLibType,A::PetscMat)gives access to the array where the numerical data for a MATSEQSBAIJ matrix is stored
Not Collective
Input Parameter:
A- aMATSEQSBAIJmatrix
Output Parameter:
array- pointer to the data
Level: intermediate
-seealso: , Mat, MATSEQSBAIJ, MatSeqSBAIJRestoreArray(), MatSeqAIJGetArray(), MatSeqAIJRestoreArray()
External Links
- PETSc Manual:
Mat/MatSeqSBAIJGetArray
PETSc.LibPETSc.MatSeqSBAIJRestoreArray — Method
array::Vector{PetscScalar} = MatSeqSBAIJRestoreArray(petsclib::PetscLibType,A::PetscMat)returns access to the array where the numerical data for a MATSEQSBAIJ matrix is stored obtained by MatSeqSBAIJGetArray()
Not Collective
Input Parameters:
A- aMATSEQSBAIJmatrixarray- pointer to the data
Level: intermediate
-seealso: , Mat, MATSEQSBAIJ, MatSeqSBAIJGetArray(), MatSeqAIJGetArray(), MatSeqAIJRestoreArray()
External Links
- PETSc Manual:
Mat/MatSeqSBAIJRestoreArray
PETSc.LibPETSc.MatSeqSBAIJSetColumnIndices — Method
indices::PetscInt = MatSeqSBAIJSetColumnIndices(petsclib::PetscLibType,mat::PetscMat)Set the column indices for all the rows in a MATSEQSBAIJ matrix.
Input Parameters:
mat- theMATSEQSBAIJmatrixindices- the column indices
Level: advanced
-seealso: , Mat, MATSEQSBAIJ, MatCreateSeqSBAIJ
External Links
- PETSc Manual:
Mat/MatSeqSBAIJSetColumnIndices
PETSc.LibPETSc.MatSeqSBAIJSetPreallocation — Method
MatSeqSBAIJSetPreallocation(petsclib::PetscLibType,B::PetscMat, bs::PetscInt, nz::PetscInt, nnz::Vector{PetscInt})Creates a sparse symmetric matrix in block AIJ (block compressed row) MATSEQSBAIJ format. For good matrix assembly performance the user should preallocate the matrix storage by setting the parameter nz (or the array nnz).
Collective
Input Parameters:
B- the symmetric matrixbs- size of block, the blocks are ALWAYS square. One can useMatSetBlockSizes()to set a different row and column blocksize but the row
blocksize always defines the size of the blocks. The column blocksize sets the blocksize of the vectors obtained with MatCreateVecs()
nz- number of block nonzeros per block row (same for all rows)nnz- array containing the number of block nonzeros in the upper triangular plus
diagonal portion of each block (possibly different for each block row) or NULL
Options Database Keys:
-mat_no_unroll- uses code that does not unroll the loops in the block calculations (much slower)-mat_block_size- size of the blocks to use (only works if a negative bs is passed in
Level: intermediate
-seealso: , Mat, Sparse Matrices, MATSEQSBAIJ, MatCreate(), MatCreateSeqAIJ(), MatSetValues(), MatCreateSBAIJ()
External Links
- PETSc Manual:
Mat/MatSeqSBAIJSetPreallocation
PETSc.LibPETSc.MatSeqSBAIJSetPreallocationCSR — Method
MatSeqSBAIJSetPreallocationCSR(petsclib::PetscLibType,B::PetscMat, bs::PetscInt, i::Vector{PetscInt}, j::Vector{PetscInt}, v::Vector{PetscScalar})Creates a sparse parallel matrix in MATSEQSBAIJ format using the given nonzero structure and (optional) numerical values
Input Parameters:
B- the matrixbs- size of block, the blocks are ALWAYS square.i- the indices intojfor the start of each local row (indices start with zero)j- the column indices for each local row (indices start with zero) these must be sorted for each rowv- optional values in the matrix, useNULLif not provided
Level: advanced
-seealso: , Mat, MATSEQSBAIJ, MatCreate(), MatCreateSeqSBAIJ(), MatSetValuesBlocked(), MatSeqSBAIJSetPreallocation()
External Links
- PETSc Manual:
Mat/MatSeqSBAIJSetPreallocationCSR
PETSc.LibPETSc.MatSeqSELLGetAvgSliceWidth — Method
slicewidth::PetscReal = MatSeqSELLGetAvgSliceWidth(petsclib::PetscLibType,A::PetscMat)returns the average slice width.
Not Collective
Input Parameter:
A- a MATSEQSELL matrix
Output Parameter:
slicewidth- average slice width
Level: intermediate
-seealso: MATSEQSELL, MatSeqSELLGetMaxSliceWidth()
External Links
- PETSc Manual:
Mat/MatSeqSELLGetAvgSliceWidth
PETSc.LibPETSc.MatSeqSELLGetFillRatio — Method
ratio::PetscReal = MatSeqSELLGetFillRatio(petsclib::PetscLibType,A::PetscMat)returns a ratio that indicates the irregularity of the matrix.
Not Collective
Input Parameter:
A- a MATSEQSELL matrix
Output Parameter:
ratio- ratio of number of padded zeros to number of allocated elements
Level: intermediate
-seealso: MATSEQSELL, MatSeqSELLGetAvgSliceWidth()
External Links
- PETSc Manual:
Mat/MatSeqSELLGetFillRatio
PETSc.LibPETSc.MatSeqSELLGetMaxSliceWidth — Method
slicewidth::PetscInt = MatSeqSELLGetMaxSliceWidth(petsclib::PetscLibType,A::PetscMat)returns the maximum slice width.
Not Collective
Input Parameter:
A- a MATSEQSELL matrix
Output Parameter:
slicewidth- maximum slice width
Level: intermediate
-seealso: MATSEQSELL, MatSeqSELLGetAvgSliceWidth()
External Links
- PETSc Manual:
Mat/MatSeqSELLGetMaxSliceWidth
PETSc.LibPETSc.MatSeqSELLGetVarSliceSize — Method
variance::PetscReal = MatSeqSELLGetVarSliceSize(petsclib::PetscLibType,A::PetscMat)returns the variance of the slice size.
Not Collective
Input Parameter:
A- a MATSEQSELL matrix
Output Parameter:
variance- variance of the slice size
Level: intermediate
-seealso: MATSEQSELL, MatSeqSELLSetSliceHeight()
External Links
- PETSc Manual:
Mat/MatSeqSELLGetVarSliceSize
PETSc.LibPETSc.MatSeqSELLSetPreallocation — Method
MatSeqSELLSetPreallocation(petsclib::PetscLibType,B::PetscMat, rlenmax::PetscInt, rlen::Vector{PetscInt})For good matrix assembly performance the user should preallocate the matrix storage by setting the parameter nz (or the array nnz).
Collective
Input Parameters:
B- TheMATSEQSELLmatrixrlenmax- number of nonzeros per row (same for all rows), ignored ifrlenis providedrlen- array containing the number of nonzeros in the various rows (possibly different for each row) orNULL
Level: intermediate
-seealso: Mat, MATSEQSELL, MATSELL, MatCreate(), MatCreateSELL(), MatSetValues(), MatGetInfo()
External Links
- PETSc Manual:
Mat/MatSeqSELLSetPreallocation
PETSc.LibPETSc.MatSeqSELLSetSliceHeight — Method
MatSeqSELLSetSliceHeight(petsclib::PetscLibType,A::PetscMat, sliceheight::PetscInt)sets the slice height.
Not Collective
Input Parameters:
A- a MATSEQSELL matrixsliceheight- slice height
-seealso: MATSEQSELL, MatSeqSELLGetVarSliceSize()
External Links
- PETSc Manual:
Mat/MatSeqSELLSetSliceHeight
PETSc.LibPETSc.MatSetBindingPropagates — Method
MatSetBindingPropagates(petsclib::PetscLibType,A::PetscMat, flg::PetscBool)Sets whether the state of being bound to the CPU for a GPU matrix type propagates to child and some other associated objects
Input Parameters:
A- the matrixflg- flag indicating whether the boundtocpu flag should be propagated
Level: developer
-seealso: , Mat, VecSetBindingPropagates(), MatGetBindingPropagates()
External Links
- PETSc Manual:
Mat/MatSetBindingPropagates
PETSc.LibPETSc.MatSetBlockSize — Method
MatSetBlockSize(petsclib::PetscLibType,mat::PetscMat, bs::PetscInt)Sets the matrix block size.
Logically Collective
Input Parameters:
mat- the matrixbs- block size
Level: intermediate
-seealso: , Mat, MATBAIJ, MATSBAIJ, MATAIJ, MatCreateSeqBAIJ(), MatCreateBAIJ(), MatGetBlockSize(), MatSetBlockSizes(), MatGetBlockSizes()
External Links
- PETSc Manual:
Mat/MatSetBlockSize
PETSc.LibPETSc.MatSetBlockSizes — Method
MatSetBlockSizes(petsclib::PetscLibType,mat::PetscMat, rbs::PetscInt, cbs::PetscInt)Sets the matrix block row and column sizes.
Logically Collective
Input Parameters:
mat- the matrixrbs- row block sizecbs- column block size
Level: intermediate
-seealso: , Mat, MatCreateSeqBAIJ(), MatCreateBAIJ(), MatGetBlockSize(), MatSetBlockSize(), MatGetBlockSizes()
External Links
- PETSc Manual:
Mat/MatSetBlockSizes
PETSc.LibPETSc.MatSetBlockSizesFromMats — Method
MatSetBlockSizesFromMats(petsclib::PetscLibType,mat::PetscMat, fromRow::PetscMat, fromCol::PetscMat)Sets the matrix block row and column sizes to match a pair of matrices
Logically Collective
Input Parameters:
mat- the matrixfromRow- matrix from which to copy row block sizefromCol- matrix from which to copy column block size (can be same as fromRow)
Level: developer
-seealso: , Mat, MatCreateSeqBAIJ(), MatCreateBAIJ(), MatGetBlockSize(), MatSetBlockSizes()
External Links
- PETSc Manual:
Mat/MatSetBlockSizesFromMats
PETSc.LibPETSc.MatSetDM — Method
MatSetDM(petsclib::PetscLibType,A::PetscMat, dm::PetscDM)Sets the DM defining the data layout of the matrix
Not Collective
Input Parameters:
A- TheMatdm- TheDM
Level: developer
Note: This is rarely used in practice, rather DMCreateMatrix() is used to create a matrix associated with a particular DM
Developer Note: Since the Mat class doesn't know about the DM class the DM object is associated with the Mat through a PetscObjectCompose() operation
See also:
DM, MatGetDM(), DMCreateMatrix(), DMSetMatType()
External Links
- PETSc Manual:
DM/MatSetDM
PETSc.LibPETSc.MatSetErrorIfFailure — Method
MatSetErrorIfFailure(petsclib::PetscLibType,mat::PetscMat, flg::PetscBool)Causes Mat to generate an immediate error, for example a zero pivot, is detected.
Logically Collective
Input Parameters:
mat- matrix obtained fromMatCreate()flg-PETSC_TRUEindicates you want the error generated
Level: advanced
-seealso: , Mat, PCSetErrorIfFailure(), KSPConvergedReason, SNESConvergedReason
External Links
- PETSc Manual:
Mat/MatSetErrorIfFailure
PETSc.LibPETSc.MatSetFactorType — Method
MatSetFactorType(petsclib::PetscLibType,mat::PetscMat, t::MatFactorType)sets the type of factorization a matrix is
Logically Collective
Input Parameters:
mat- the matrixt- the type, one ofMAT_FACTOR_NONE,MAT_FACTOR_LU,MAT_FACTOR_CHOLESKY,MAT_FACTOR_ILU,MAT_FACTOR_ICC,MAT_FACTOR_ILUDT,MAT_FACTOR_QR
Level: intermediate
-seealso: , Mat, Matrix Factorization, MatFactorType, MatGetFactor(), MatGetFactorType(), MAT_FACTOR_NONE, MAT_FACTOR_LU, MAT_FACTOR_CHOLESKY, MAT_FACTOR_ILU, MAT_FACTOR_ICC,MAT_FACTOR_ILUDT, MAT_FACTOR_QR
External Links
- PETSc Manual:
Mat/MatSetFactorType
PETSc.LibPETSc.MatSetFromOptions — Method
MatSetFromOptions(petsclib::PetscLibType,B::PetscMat)Creates a matrix where the type is determined from the options database.
Collective
Input Parameter:
B- the matrix
Options Database Keys:
-mat_type seqaij-MATSEQAIJtype, usesMatCreateSeqAIJ()-mat_type mpiaij-MATMPIAIJtype, usesMatCreateAIJ()-mat_type seqdense-MATSEQDENSEtype, usesMatCreateSeqDense()-mat_type mpidense-MATMPIDENSE, usesMatCreateDense()-mat_type seqbaij-MATSEQBAIJ, usesMatCreateSeqBAIJ()-mat_type mpibaij-MATMPIBAIJ, usesMatCreateBAIJ()
See the manpages for particular formats (e.g., MATSEQAIJ) for additional format-specific options.
Level: beginner
-seealso: , Mat, MatCreateSeqAIJ(), MatCreateAIJ(), MatCreateSeqDense(), MatCreateDense(), MatCreateSeqBAIJ(), MatCreateBAIJ(), MatCreateSeqSBAIJ(), MatCreateSBAIJ(), MatConvert()
External Links
- PETSc Manual:
Mat/MatSetFromOptions
PETSc.LibPETSc.MatSetHPL — Method
MatSetHPL(petsclib::PetscLibType,A::PetscMat, iseed::Cint)fills a MATSEQDENSE matrix using the HPL 2.3 random matrix generation routine
Collective
Input Parameters:
A- the matrixiseed- the random number seed
Level: intermediate
External Links
- PETSc Manual:
Mat/MatSetHPL
PETSc.LibPETSc.MatSetInf — Method
PETSc.LibPETSc.MatSetLayouts — Method
MatSetLayouts(petsclib::PetscLibType,A::PetscMat, rmap::PetscLayout, cmap::PetscLayout)Sets the PetscLayout objects for rows and columns of a matrix
Logically Collective
Input Parameters:
A- the matrixrmap- row layoutcmap- column layout
Level: advanced
-seealso: , Mat, PetscLayout, MatCreateVecs(), MatGetLocalToGlobalMapping(), MatGetLayouts()
External Links
- PETSc Manual:
Mat/MatSetLayouts
PETSc.LibPETSc.MatSetLocalToGlobalMapping — Method
MatSetLocalToGlobalMapping(petsclib::PetscLibType,x::PetscMat, rmapping::ISLocalToGlobalMapping, cmapping::ISLocalToGlobalMapping)Sets a local the routine MatSetValuesLocal() to allow users to insert matrix entries using a local (per-processor) numbering.
Not Collective
Input Parameters:
x- the matrixrmapping- row mapping created withISLocalToGlobalMappingCreate()orISLocalToGlobalMappingCreateIS()cmapping- column mapping
Level: intermediate
-seealso: , Mat, DM, DMCreateMatrix(), MatGetLocalToGlobalMapping(), MatAssemblyBegin(), MatAssemblyEnd(), MatSetValues(), MatSetValuesLocal(), MatGetValuesLocal()
External Links
- PETSc Manual:
Mat/MatSetLocalToGlobalMapping
PETSc.LibPETSc.MatSetNearNullSpace — Method
MatSetNearNullSpace(petsclib::PetscLibType,mat::PetscMat, nullsp::MatNullSpace)attaches a null space to a matrix, which is often the null space (rigid body modes) of the operator without boundary conditions This null space will be used to provide near null space vectors to a multigrid preconditioner built from this matrix.
Logically Collective
Input Parameters:
mat- the matrixnullsp- the null space object
Level: advanced
-seealso: , Mat, MatNullSpace, MatCreate(), MatNullSpaceCreate(), MatSetNullSpace(), MatNullSpaceCreateRigidBody(), MatGetNearNullSpace()
External Links
- PETSc Manual:
Mat/MatSetNearNullSpace
PETSc.LibPETSc.MatSetNullSpace — Method
MatSetNullSpace(petsclib::PetscLibType,mat::PetscMat, nullsp::MatNullSpace)attaches a null space to a matrix.
Logically Collective
Input Parameters:
mat- the matrixnullsp- the null space object
Level: advanced
-seealso: , Mat, MatCreate(), MatNullSpaceCreate(), MatSetNearNullSpace(), MatGetNullSpace(), MatSetTransposeNullSpace(), MatGetTransposeNullSpace(), MatNullSpaceRemove(), KSPSetPCSide()
External Links
- PETSc Manual:
Mat/MatSetNullSpace
PETSc.LibPETSc.MatSetOption — Method
MatSetOption(petsclib::PetscLibType,mat::PetscMat, op::MatOption, flg::PetscBool)Sets a parameter option for a matrix. Some options may be specific to certain storage formats. Some options determine how values will be inserted (or added). Sorted, row-oriented input will generally assemble the fastest. The default is row-oriented.
Logically Collective for certain operations, such as MAT_SPD, not collective for MAT_ROW_ORIENTED, see MatOption
Input Parameters:
mat- the matrixop- the option, one of those listed below (and possibly others),flg- turn the option on (PETSC_TRUE) or off (PETSC_FALSE)
Options Describing Matrix Structure:
MAT_SPD- symmetric positive definiteMAT_SYMMETRIC- symmetric in terms of both structure and valueMAT_HERMITIAN- transpose is the complex conjugationMAT_STRUCTURALLY_SYMMETRIC- symmetric nonzero structureMAT_SYMMETRY_ETERNAL- indicates the symmetry (or Hermitian structure) or its absence will persist through any changes to the matrixMAT_STRUCTURAL_SYMMETRY_ETERNAL- indicates the structural symmetry or its absence will persist through any changes to the matrixMAT_SPD_ETERNAL- indicates the value ofMAT_SPD(true or false) will persist through any changes to the matrix
These are not really options of the matrix, they are knowledge about the structure of the matrix that users may provide so that they do not need to be computed (usually at a high cost)
Options For Use with MatSetValues(): Insert a logically dense subblock, which can be
MAT_ROW_ORIENTED- row-oriented (default)
These options reflect the data you pass in with MatSetValues(); it has nothing to do with how the data is stored internally in the matrix data structure.
When (re)assembling a matrix, we can restrict the input for efficiency/debugging purposes. These options include
MAT_NEW_NONZERO_LOCATIONS- additional insertions will be allowed if they generate a new nonzero (slow)MAT_FORCE_DIAGONAL_ENTRIES- forces diagonal entries to be allocatedMAT_IGNORE_OFF_PROC_ENTRIES- drops off-processor entriesMAT_NEW_NONZERO_LOCATION_ERR- generates an error for new matrix entryMAT_USE_HASH_TABLE- uses a hash table to speed up matrix assemblyMAT_NO_OFF_PROC_ENTRIES- you know each process will only set values for its own rows, will generate an error if
any process sets values for another process. This avoids all reductions in the MatAssembly routines and thus improves performance for very large process counts.
MAT_SUBSET_OFF_PROC_ENTRIES- you know that the first assembly after setting this flag will set a superset
of the off-process entries required for all subsequent assemblies. This avoids a rendezvous step in the MatAssembly functions, instead sending only neighbor messages.
Level: intermediate
-seealso: , MatOption, Mat, MatGetOption()
External Links
- PETSc Manual:
Mat/MatSetOption
PETSc.LibPETSc.MatSetOptionsPrefix — Method
MatSetOptionsPrefix(petsclib::PetscLibType,A::PetscMat, prefix::Vector{Cchar})Sets the prefix used for searching for all Mat options in the database.
Logically Collective
Input Parameters:
A- the matrixprefix- the prefix to prepend to all option names
Level: advanced
-seealso: , Mat, MatSetFromOptions(), MatSetOptionsPrefixFactor()
External Links
- PETSc Manual:
Mat/MatSetOptionsPrefix
PETSc.LibPETSc.MatSetOptionsPrefixFactor — Method
MatSetOptionsPrefixFactor(petsclib::PetscLibType,A::PetscMat, prefix::Vector{Cchar})Sets the prefix used for searching for all matrix factor options in the database for for matrices created with MatGetFactor()
Logically Collective
Input Parameters:
A- the matrixprefix- the prefix to prepend to all option names for the factored matrix
Level: developer
-seealso: , Mat, Matrix Factorization, MatGetFactor(), MatSetFromOptions(), MatSetOptionsPrefix(), MatAppendOptionsPrefixFactor()
External Links
- PETSc Manual:
Mat/MatSetOptionsPrefixFactor
PETSc.LibPETSc.MatSetPreallocationCOO — Method
MatSetPreallocationCOO(petsclib::PetscLibType,A::PetscMat, ncoo::PetscCount, coo_i::Vector{PetscInt}, coo_j::Vector{PetscInt})set preallocation for matrices using a coordinate format of the entries with global indices
Collective
Input Parameters:
A- matrix being preallocatedncoo- number of entriescoo_i- row indicescoo_j- column indices
Level: beginner
-seealso: , Mat, MatSetValuesCOO(), MatSeqAIJSetPreallocation(), MatMPIAIJSetPreallocation(), MatSeqBAIJSetPreallocation(), MatMPIBAIJSetPreallocation(), MatSeqSBAIJSetPreallocation(), MatMPISBAIJSetPreallocation(), MatSetPreallocationCOOLocal(), DMSetMatrixPreallocateSkip(), MatCreateSeqAIJFromTriple()
External Links
- PETSc Manual:
Mat/MatSetPreallocationCOO
PETSc.LibPETSc.MatSetPreallocationCOOLocal — Method
MatSetPreallocationCOOLocal(petsclib::PetscLibType,A::PetscMat, ncoo::PetscCount, coo_i::Vector{PetscInt}, coo_j::Vector{PetscInt})set preallocation for matrices using a coordinate format of the entries with local indices
Collective
Input Parameters:
A- matrix being preallocatedncoo- number of entriescoo_i- row indices (local numbering; may be modified)coo_j- column indices (local numbering; may be modified)
Level: beginner
-seealso: , Mat, MatSetValuesCOO(), MatSeqAIJSetPreallocation(), MatMPIAIJSetPreallocation(), MatSeqBAIJSetPreallocation(), MatMPIBAIJSetPreallocation(), MatSeqSBAIJSetPreallocation(), MatMPISBAIJSetPreallocation(), MatSetPreallocationCOO(), DMSetMatrixPreallocateSkip()
External Links
- PETSc Manual:
Mat/MatSetPreallocationCOOLocal
PETSc.LibPETSc.MatSetRandom — Method
MatSetRandom(petsclib::PetscLibType,x::PetscMat, rctx::PetscRandom)Sets all components of a matrix to random numbers.
Logically Collective
Input Parameters:
x- the matrixrctx- thePetscRandomobject, formed byPetscRandomCreate(), orNULLand
it will create one internally.
Example: -seealso: , Mat, PetscRandom, PetscRandomCreate(), MatZeroEntries(), MatSetValues(), PetscRandomDestroy()
External Links
- PETSc Manual:
Mat/MatSetRandom
PETSc.LibPETSc.MatSetSizes — Method
MatSetSizes(petsclib::PetscLibType,A::PetscMat, m::PetscInt, n::PetscInt, M::PetscInt, N::PetscInt)Sets the local and global sizes, and checks to determine compatibility
Collective
Input Parameters:
A- the matrixm- number of local rows (orPETSC_DECIDE)n- number of local columns (orPETSC_DECIDE)M- number of global rows (orPETSC_DETERMINE)N- number of global columns (orPETSC_DETERMINE)
Level: beginner
-seealso: , Mat, MatGetSize(), PetscSplitOwnership(), MatGetOwnershipRange(), MatGetOwnershipRanges(), MatGetOwnershipRangeColumn(), MatGetOwnershipRangesColumn(), PetscLayout, VecSetSizes()
External Links
- PETSc Manual:
Mat/MatSetSizes
PETSc.LibPETSc.MatSetStencil — Method
MatSetStencil(petsclib::PetscLibType,mat::PetscMat, dim::PetscInt, dims::Vector{PetscInt}, starts::Vector{PetscInt}, dof::PetscInt)Sets the grid information for setting values into a matrix via MatSetValuesStencil()
Not Collective
Input Parameters:
mat- the matrixdim- dimension of the grid 1, 2, or 3dims- number of grid points in x, y, and z direction, including ghost points on your processorstarts- starting point of ghost nodes on your processor in x, y, and z directiondof- number of degrees of freedom per node
Level: beginner
-seealso: , Mat, MatStencil, MatSetOption(), MatAssemblyBegin(), MatAssemblyEnd(), MatSetValuesBlocked(), MatSetValuesLocal() MatSetValues(), MatSetValuesBlockedStencil(), MatSetValuesStencil()
External Links
- PETSc Manual:
Mat/MatSetStencil
PETSc.LibPETSc.MatSetTransposeNullSpace — Method
MatSetTransposeNullSpace(petsclib::PetscLibType,mat::PetscMat, nullsp::MatNullSpace)attaches the null space of a transpose of a matrix to the matrix
Logically Collective
Input Parameters:
mat- the matrixnullsp- the null space object
Level: advanced
-seealso: , Mat, MatNullSpace, MatCreate(), MatNullSpaceCreate(), MatSetNearNullSpace(), MatGetNullSpace(), MatSetNullSpace(), MatGetTransposeNullSpace(), MatNullSpaceRemove(), KSPSetPCSide()
External Links
- PETSc Manual:
Mat/MatSetTransposeNullSpace
PETSc.LibPETSc.MatSetType — Method
MatSetType(petsclib::PetscLibType,mat::PetscMat, matype::MatType)Builds matrix object for a particular matrix type
Collective
Input Parameters:
mat- the matrix objectmatype- matrix type
Options Database Key:
-mat_type <method>- Sets the type; seeMatType
Level: intermediate
-seealso: , Mat, PCSetType(), VecSetType(), MatCreate(), MatType
External Links
- PETSc Manual:
Mat/MatSetType
PETSc.LibPETSc.MatSetUnfactored — Method
MatSetUnfactored(petsclib::PetscLibType,mat::PetscMat)Resets a factored matrix to be treated as unfactored.
Logically Collective
Input Parameter:
mat- the factored matrix to be reset
Level: developer
-seealso: , Mat, PCFactorSetUseInPlace(), PCFactorGetUseInPlace()
External Links
- PETSc Manual:
Mat/MatSetUnfactored
PETSc.LibPETSc.MatSetUp — Method
MatSetUp(petsclib::PetscLibType,A::PetscMat)Sets up the internal matrix data structures for later use by the matrix
Collective
Input Parameter:
A- the matrix
Level: advanced
-seealso: , Mat, MatMult(), MatCreate(), MatDestroy(), MatXAIJSetPreallocation()
External Links
- PETSc Manual:
Mat/MatSetUp
PETSc.LibPETSc.MatSetValue — Method
MatSetValue(petsclib::PetscLibType,mat::PetscMat, i::PetscInt, j::PetscInt, va::PetscScalar, mode::InsertMode)External Links
- PETSc Manual:
Mat/MatSetValue
PETSc.LibPETSc.MatSetValueLocal — Method
MatSetValueLocal(petsclib::PetscLibType,mat::PetscMat, i::PetscInt, j::PetscInt, va::PetscScalar, mode::InsertMode)External Links
- PETSc Manual:
Mat/MatSetValueLocal
PETSc.LibPETSc.MatSetValues — Method
MatSetValues(petsclib::PetscLibType,mat::AbstractPetscMat, m::PetscInt, idxm::Vector{PetscInt}, n::PetscInt, idxn::Vector{PetscInt}, v::Vector{PetscScalar}, addv::InsertMode)Inserts or adds a block of values into a matrix. These values may be cached, so MatAssemblyBegin() and MatAssemblyEnd() MUST be called after all calls to MatSetValues() have been completed.
Not Collective
Input Parameters:
mat- the matrixm- the number of rowsidxm- the global indices of the rowsn- the number of columnsidxn- the global indices of the columnsv- a one-dimensional array that contains the values implicitly stored as a two-dimensional array, by default in row-major order.
See MAT_ROW_ORIENTED in MatSetOption() for how to use column-major order.
addv- eitherADD_VALUESto add values to any existing entries, orINSERT_VALUESto replace existing entries with new values
Level: beginner
-seealso: , Mat, MatSetOption(), MatAssemblyBegin(), MatAssemblyEnd(), MatSetValuesBlocked(), MatSetValuesLocal(), InsertMode, INSERT_VALUES, ADD_VALUES
External Links
- PETSc Manual:
Mat/MatSetValues
PETSc.LibPETSc.MatSetValuesBatch — Method
MatSetValuesBatch(petsclib::PetscLibType,mat::PetscMat, nb::PetscInt, bs::PetscInt, rows::Vector{PetscInt}, v::Vector{PetscScalar})Adds (ADD_VALUES) many blocks of values into a matrix at once. The blocks must all be square and the same size. Currently, this can only be called once and creates the given matrix.
Not Collective
Input Parameters:
mat- the matrixnb- the number of blocksbs- the number of rows (and columns) in each blockrows- a concatenation of the rows for each blockv- a concatenation of logically two-dimensional arrays of values
Level: advanced
-seealso: , Mat, MatSetOption(), MatAssemblyBegin(), MatAssemblyEnd(), MatSetValuesBlocked(), MatSetValuesLocal(), InsertMode, INSERT_VALUES, ADD_VALUES, MatSetValues(), MatSetPreallocationCOO(), MatSetValuesCOO()
External Links
- PETSc Manual:
Mat/MatSetValuesBatch
PETSc.LibPETSc.MatSetValuesBlocked — Method
MatSetValuesBlocked(petsclib::PetscLibType,mat::PetscMat, m::PetscInt, idxm::Vector{PetscInt}, n::PetscInt, idxn::Vector{PetscInt}, v::Vector{PetscScalar}, addv::InsertMode)Inserts or adds a block of values into a matrix.
Not Collective
Input Parameters:
mat- the matrixm- the number of block rowsidxm- the global block indicesn- the number of block columnsidxn- the global block indicesv- a one-dimensional array that contains the values implicitly stored as a two-dimensional array, by default in row-major order.
See MAT_ROW_ORIENTED in MatSetOption() for how to use column-major order.
addv- eitherADD_VALUESto add values to any existing entries, orINSERT_VALUESreplaces existing entries with new values
Level: intermediate
-seealso: , Mat, MatSetBlockSize(), MatSetOption(), MatAssemblyBegin(), MatAssemblyEnd(), MatSetValues(), MatSetValuesBlockedLocal()
External Links
- PETSc Manual:
Mat/MatSetValuesBlocked
PETSc.LibPETSc.MatSetValuesBlockedLocal — Method
MatSetValuesBlockedLocal(petsclib::PetscLibType,mat::PetscMat, nrow::PetscInt, irow::Vector{PetscInt}, ncol::PetscInt, icol::Vector{PetscInt}, y::Vector{PetscScalar}, addv::InsertMode)Inserts or adds values into certain locations of a matrix, using a local ordering of the nodes a block at a time.
Not Collective
Input Parameters:
mat- the matrixnrow- number of rowsirow- the row local indicesncol- number of columnsicol- the column local indicesy- a one-dimensional array that contains the values implicitly stored as a two-dimensional array, by default in row-major order.
See MAT_ROW_ORIENTED in MatSetOption() for how to use column-major order.
addv- eitherADD_VALUESto add values to any existing entries, orINSERT_VALUESto replace existing entries with new values
Level: intermediate
-seealso: , Mat, MatSetBlockSize(), MatSetLocalToGlobalMapping(), MatAssemblyBegin(), MatAssemblyEnd(), MatSetValuesLocal(), MatSetValuesBlocked()
External Links
- PETSc Manual:
Mat/MatSetValuesBlockedLocal
PETSc.LibPETSc.MatSetValuesBlockedStencil — Method
MatSetValuesBlockedStencil(petsclib::PetscLibType,mat::PetscMat, m::PetscInt, idxm::Vector{MatStencil}, n::PetscInt, idxn::Vector{MatStencil}, v::Vector{PetscScalar}, addv::InsertMode)Inserts or adds a block of values into a matrix. Using structured grid indexing
Not Collective
Input Parameters:
mat- the matrixm- number of rows being enteredidxm- grid coordinates for matrix rows being enteredn- number of columns being enteredidxn- grid coordinates for matrix columns being enteredv- a one-dimensional array that contains the values implicitly stored as a two-dimensional array, by default in row-major order.
See MAT_ROW_ORIENTED in MatSetOption() for how to use column-major order.
addv- eitherADD_VALUESto add to existing entries orINSERT_VALUESto replace existing entries with new values
Level: beginner
-seealso: , Mat, DMDA, MatSetOption(), MatAssemblyBegin(), MatAssemblyEnd(), MatSetValuesBlocked(), MatSetValuesLocal() MatSetValues(), MatSetValuesStencil(), MatSetStencil(), DMCreateMatrix(), DMDAVecGetArray(), MatStencil, MatSetBlockSize(), MatSetLocalToGlobalMapping()
External Links
- PETSc Manual:
Mat/MatSetValuesBlockedStencil
PETSc.LibPETSc.MatSetValuesCOO — Method
MatSetValuesCOO(petsclib::PetscLibType,A::PetscMat, coo_v::Vector{PetscScalar}, imode::InsertMode)set values at once in a matrix preallocated using MatSetPreallocationCOO()
Collective
Input Parameters:
A- matrix being preallocatedcoo_v- the matrix values (can beNULL)imode- the insert mode
Level: beginner
-seealso: , Mat, MatSetPreallocationCOO(), MatSetPreallocationCOOLocal(), InsertMode, INSERT_VALUES, ADD_VALUES
External Links
- PETSc Manual:
Mat/MatSetValuesCOO
PETSc.LibPETSc.MatSetValuesIS — Method
MatSetValuesIS(petsclib::PetscLibType,mat::PetscMat, ism::IS, isn::IS, v::Vector{PetscScalar}, addv::InsertMode)Inserts or adds a block of values into a matrix using an IS to indicate the rows and columns These values may be cached, so MatAssemblyBegin() and MatAssemblyEnd() MUST be called after all calls to MatSetValues() have been completed.
Not Collective
Input Parameters:
mat- the matrixism- the rows to provideisn- the columns to providev- a one-dimensional array that contains the values implicitly stored as a two-dimensional array, by default in row-major order.
See MAT_ROW_ORIENTED in MatSetOption() for how to use column-major order.
addv- eitherADD_VALUESto add values to any existing entries, orINSERT_VALUESto replace existing entries with new values
Level: beginner
-seealso: , Mat, MatSetOption(), MatSetValues(), MatAssemblyBegin(), MatAssemblyEnd(), MatSetValuesBlocked(), MatSetValuesLocal(), InsertMode, INSERT_VALUES, ADD_VALUES
External Links
- PETSc Manual:
Mat/MatSetValuesIS
PETSc.LibPETSc.MatSetValuesLocal — Method
MatSetValuesLocal(petsclib::PetscLibType,mat::PetscMat, nrow::PetscInt, irow::Vector{PetscInt}, ncol::PetscInt, icol::Vector{PetscInt}, y::Vector{PetscScalar}, addv::InsertMode)Inserts or adds values into certain locations of a matrix, using a local numbering of the rows and columns.
Not Collective
Input Parameters:
mat- the matrixnrow- number of rowsirow- the row local indicesncol- number of columnsicol- the column local indicesy- a one-dimensional array that contains the values implicitly stored as a two-dimensional array, by default in row-major order.
See MAT_ROW_ORIENTED in MatSetOption() for how to use column-major order.
addv- eitherADD_VALUESto add values to any existing entries, orINSERT_VALUESto replace existing entries with new values
Level: intermediate
-seealso: , Mat, MatAssemblyBegin(), MatAssemblyEnd(), MatSetValues(), MatSetLocalToGlobalMapping(), MatGetValuesLocal()
External Links
- PETSc Manual:
Mat/MatSetValuesLocal
PETSc.LibPETSc.MatSetValuesRow — Method
MatSetValuesRow(petsclib::PetscLibType,mat::PetscMat, row::PetscInt, v::Vector{PetscScalar})Inserts a row (block row for MATBAIJ matrices) of nonzero values into a matrix
Not Collective
Input Parameters:
mat- the matrixrow- the (block) row to setv- a logically two-dimensional (column major) array of values for block matrices with blocksize larger than one, otherwise a one dimensional array of values
Level: advanced
-seealso: , Mat, MatSetValues(), MatSetOption(), MatAssemblyBegin(), MatAssemblyEnd(), MatSetValuesBlocked(), MatSetValuesLocal(), InsertMode, INSERT_VALUES, ADD_VALUES
External Links
- PETSc Manual:
Mat/MatSetValuesRow
PETSc.LibPETSc.MatSetValuesRowLocal — Method
MatSetValuesRowLocal(petsclib::PetscLibType,mat::PetscMat, row::PetscInt, v::Vector{PetscScalar})Inserts a row (block row for MATBAIJ matrices) of nonzero values into a matrix
Not Collective
Input Parameters:
mat- the matrixrow- the (block) row to setv- a one-dimensional array that contains the values. ForMATBAIJthey are implicitly stored as a two-dimensional array, by default in row-major order.
See MAT_ROW_ORIENTED in MatSetOption() for how to use column-major order.
Level: intermediate
-seealso: , Mat, MatSetOption(), MatAssemblyBegin(), MatAssemblyEnd(), MatSetValuesBlocked(), MatSetValuesLocal(), InsertMode, INSERT_VALUES, ADD_VALUES, MatSetValues(), MatSetValuesRow(), MatSetLocalToGlobalMapping()
External Links
- PETSc Manual:
Mat/MatSetValuesRowLocal
PETSc.LibPETSc.MatSetValuesStencil — Method
MatSetValuesStencil(petsclib::PetscLibType,mat::PetscMat, m::PetscInt, idxm::Vector{MatStencil}, n::PetscInt, idxn::Vector{MatStencil}, v::Vector{PetscScalar}, addv::InsertMode)Inserts or adds a block of values into a matrix. Using structured grid indexing
Not Collective
Input Parameters:
mat- the matrixm- number of rows being enteredidxm- grid coordinates (and component number when dof > 1) for matrix rows being enteredn- number of columns being enteredidxn- grid coordinates (and component number when dof > 1) for matrix columns being enteredv- a one-dimensional array that contains the values implicitly stored as a two-dimensional array, by default in row-major order.
See MAT_ROW_ORIENTED in MatSetOption() for how to use column-major order.
addv- eitherADD_VALUESto add to existing entries at that location orINSERT_VALUESto replace existing entries with new values
Level: beginner
-seealso: , Mat, DMDA, MatSetOption(), MatAssemblyBegin(), MatAssemblyEnd(), MatSetValuesBlocked(), MatSetValuesLocal() MatSetValues(), MatSetValuesBlockedStencil(), MatSetStencil(), DMCreateMatrix(), DMDAVecGetArray(), MatStencil
External Links
- PETSc Manual:
Mat/MatSetValuesStencil
PETSc.LibPETSc.MatSetVariableBlockSizes — Method
MatSetVariableBlockSizes(petsclib::PetscLibType,mat::PetscMat, nblocks::PetscInt, bsizes::Vector{PetscInt})Sets diagonal point
Not Collective
Input Parameters:
mat- the matrixnblocks- the number of blocks on this process, each block can only exist on a single processbsizes- the block sizes
Level: intermediate
-seealso: , Mat, MatCreateSeqBAIJ(), MatCreateBAIJ(), MatGetBlockSize(), MatSetBlockSizes(), MatGetBlockSizes(), MatGetVariableBlockSizes(), MatComputeVariableBlockEnvelope(), PCVPBJACOBI
External Links
- PETSc Manual:
Mat/MatSetVariableBlockSizes
PETSc.LibPETSc.MatSetVecType — Method
MatSetVecType(petsclib::PetscLibType,mat::PetscMat, vtype::VecType)Set the vector type the matrix will return with MatCreateVecs()
Collective
Input Parameters:
mat- the matrix objectvtype- vector type
Level: advanced
-seealso: , Mat, VecType, VecSetType(), MatGetVecType()
External Links
- PETSc Manual:
Mat/MatSetVecType
PETSc.LibPETSc.MatShellGetContext — Method
MatShellGetContext(petsclib::PetscLibType,mat::PetscMat, ctx::Cvoid)Returns the user
Not Collective
Input Parameter:
mat- the matrix, should have been created withMatCreateShell()
Output Parameter:
ctx- the user provided context
Level: advanced
-seealso: , Mat, MATSHELL, MatCreateShell(), MatShellSetOperation(), MatShellSetContext()
External Links
- PETSc Manual:
Mat/MatShellGetContext
PETSc.LibPETSc.MatShellSetContext — Method
MatShellSetContext(petsclib::PetscLibType,mat::PetscMat, ctx::Cvoid)sets the context for a MATSHELL shell matrix
Logically Collective
Input Parameters:
mat- theMATSHELLshell matrixctx- the context
Level: advanced
-seealso: , Mat, MATSHELL, MatCreateShell(), MatShellGetContext(), MatShellGetOperation()
External Links
- PETSc Manual:
Mat/MatShellSetContext
PETSc.LibPETSc.MatShellSetContextDestroy — Method
MatShellSetContextDestroy(petsclib::PetscLibType,mat::PetscMat, f::PetscCtxDestroyFn)sets the destroy function for a MATSHELL shell matrix context
Logically Collective
Input Parameters:
mat- the shell matrixf- the context destroy function, seePetscCtxDestroyFnfor calling sequence
Level: advanced
-seealso: , Mat, MATSHELL, MatCreateShell(), MatShellSetContext(), PetscCtxDestroyFn
External Links
- PETSc Manual:
Mat/MatShellSetContextDestroy
PETSc.LibPETSc.MatShellSetManageScalingShifts — Method
MatShellSetManageScalingShifts(petsclib::PetscLibType,A::PetscMat)Allows the user to control the scaling and shift operations of the MATSHELL. Must be called immediately after MatCreateShell()
Logically Collective
Input Parameter:
A- theMATSHELLshell matrix
Level: advanced
-seealso: , Mat, MATSHELL, MatCreateShell(), MatShellGetContext(), MatShellGetOperation(), MatShellSetContext(), MatShellSetOperation()
External Links
- PETSc Manual:
Mat/MatShellSetManageScalingShifts
PETSc.LibPETSc.MatShellSetMatProductOperation — Method
MatShellSetMatProductOperation(petsclib::PetscLibType,A::PetscMat, ptype::MatProductType, symbolic::external, numeric::external, destroy::external, Btype::MatType, Ctype::MatType)Allows user to set a matrix matrix operation for a MATSHELL shell matrix.
Logically Collective; No Fortran Support
Input Parameters:
A- theMATSHELLshell matrixptype- the product typesymbolic- the function for the symbolic phase (can beNULL)numeric- the function for the numerical phasedestroy- the function for the destruction of the needed data generated during the symbolic phase (can beNULL)Btype- the matrix type for the matrix to be multiplied againstCtype- the matrix type for the result (can beNULL)
Level: advanced
-seealso: , Mat, MATSHELL, MatCreateShell(), MatShellGetContext(), MatShellGetOperation(), MatShellSetContext(), MatSetOperation(), MatProductType, MatType, MatSetUp()
External Links
- PETSc Manual:
Mat/MatShellSetMatProductOperation
PETSc.LibPETSc.MatShellSetOperation — Method
MatShellSetOperation(petsclib::PetscLibType, mat::PetscMat, op::MatOperation, g::Ptr)Allows user to set a matrix operation for a MATSHELL shell matrix.
Logically Collective
Input Parameters: mat - the MATSHELL shell matrix op - the name of the operation g - a pointer to the function that provides the operation created with @cfunction
Level: advanced
-seealso: Mat, MATSHELL, MatCreateShell(), MatShellGetContext(), MatShellGetOperation(), MatShellSetContext(), MatSetOperation(), MatShellSetManageScalingShifts(), MatShellSetMatProductOperation()
External Links
- PETSc Manual:
Mat/MatShellSetOperation
PETSc.LibPETSc.MatShellSetVecType — Method
MatShellSetVecType(petsclib::PetscLibType,mat::PetscMat, vtype::VecType)Sets the VecType of Vec returned by MatCreateVecs()
Logically Collective
Input Parameters:
mat- theMATSHELLshell matrixvtype- type to use for creating vectors
Level: advanced
-seealso: , Mat, MATSHELL, MatCreateVecs()
External Links
- PETSc Manual:
Mat/MatShellSetVecType
PETSc.LibPETSc.MatShellTestMult — Method
flg::PetscBool = MatShellTestMult(petsclib::PetscLibType,mat::PetscMat, f::external, base::PetscVec, ctx::Cvoid)Compares the multiply routine provided to the MATSHELL with differencing on a given function.
Logically Collective; No Fortran Support
Input Parameters:
mat- theMATSHELLshell matrixf- the functionbase- differences are computed around this vector, seeMatMFFDSetBase(), for Jacobians this is the point at which the Jacobian is being evaluatedctx- an optional context for the function
Output Parameter:
flg-PETSC_TRUEif the multiply is likely correct
Options Database Key:
-mat_shell_test_mult_view- print if any differences are detected between the products and print the difference
Level: advanced
-seealso: , Mat, MATSHELL, MatCreateShell(), MatShellGetContext(), MatShellGetOperation(), MatShellTestMultTranspose()
External Links
- PETSc Manual:
Mat/MatShellTestMult
PETSc.LibPETSc.MatShellTestMultTranspose — Method
flg::PetscBool = MatShellTestMultTranspose(petsclib::PetscLibType,mat::PetscMat, f::external, base::PetscVec, ctx::Cvoid)Compares the multiply transpose routine provided to the MATSHELL with differencing on a given function.
Logically Collective; No Fortran Support
Input Parameters:
mat- theMATSHELLshell matrixf- the functionbase- differences are computed around this vector, seeMatMFFDSetBase(), for Jacobians this is the point at which the Jacobian is being evaluatedctx- an optional context for the function
Output Parameter:
flg-PETSC_TRUEif the multiply is likely correct
Options Database Key:
-mat_shell_test_mult_view- print if any differences are detected between the products and print the difference
Level: advanced
-seealso: , Mat, MATSHELL, MatCreateShell(), MatShellGetContext(), MatShellGetOperation(), MatShellTestMult()
External Links
- PETSc Manual:
Mat/MatShellTestMultTranspose
PETSc.LibPETSc.MatShift — Method
MatShift(petsclib::PetscLibType,Y::PetscMat, a::PetscScalar)Computes Y = Y + a I, where a is a PetscScalar
Neighbor-wise Collective
Input Parameters:
Y- the matrixa- thePetscScalar
Level: intermediate
-seealso: , Mat, MatDiagonalSet(), MatScale(), MatDiagonalScale()
External Links
- PETSc Manual:
Mat/MatShift
PETSc.LibPETSc.MatSolve — Method
MatSolve(petsclib::PetscLibType,mat::PetscMat, b::PetscVec, x::PetscVec)Solves A x = b, given a factored matrix.
Neighbor-wise Collective
Input Parameters:
mat- the factored matrixb- the right-hand-side vector
Output Parameter:
x- the result vector
Level: developer
-seealso: , Mat, Matrix Factorization, MatGetFactor(), MatLUFactor(), MatSolveAdd(), MatSolveTranspose(), MatSolveTransposeAdd()
External Links
- PETSc Manual:
Mat/MatSolve
PETSc.LibPETSc.MatSolveAdd — Method
MatSolveAdd(petsclib::PetscLibType,mat::PetscMat, b::PetscVec, y::PetscVec, x::PetscVec)Computes x = y + A^{
Neighbor-wise Collective
Input Parameters:
mat- the factored matrixb- the right-hand-side vectory- the vector to be added to
Output Parameter:
x- the result vector
Level: developer
-seealso: , Mat, Matrix Factorization, MatSolve(), MatGetFactor(), MatSolveTranspose(), MatSolveTransposeAdd()
External Links
- PETSc Manual:
Mat/MatSolveAdd
PETSc.LibPETSc.MatSolveTranspose — Method
MatSolveTranspose(petsclib::PetscLibType,mat::PetscMat, b::PetscVec, x::PetscVec)Solves A^T x = b, given a factored matrix.
Neighbor-wise Collective
Input Parameters:
mat- the factored matrixb- the right-hand-side vector
Output Parameter:
x- the result vector
Level: developer
-seealso: , Mat, MatGetFactor(), KSP, MatSolve(), MatSolveAdd(), MatSolveTransposeAdd()
External Links
- PETSc Manual:
Mat/MatSolveTranspose
PETSc.LibPETSc.MatSolveTransposeAdd — Method
MatSolveTransposeAdd(petsclib::PetscLibType,mat::PetscMat, b::PetscVec, y::PetscVec, x::PetscVec)Computes x = y + A^{ factored matrix.
Neighbor-wise Collective
Input Parameters:
mat- the factored matrixb- the right-hand-side vectory- the vector to be added to
Output Parameter:
x- the result vector
Level: developer
-seealso: , Mat, MatGetFactor(), MatSolve(), MatSolveAdd(), MatSolveTranspose()
External Links
- PETSc Manual:
Mat/MatSolveTransposeAdd
PETSc.LibPETSc.MatSolverTypeRegister — Method
MatSolverTypeRegister(petsclib::PetscLibType,package::MatSolverType, mtype::MatType, ftype::MatFactorType, createfactor::external)Registers a MatSolverType that works for a particular matrix type
Logically Collective, No Fortran Support
Input Parameters:
package- name of the package, for examplepetscorsuperlumtype- the matrix type that works with this packageftype- the type of factorization supported by the packagecreatefactor- routine that will create the factored matrix ready to be used
Level: developer
-seealso: , Mat, Matrix Factorization, MatFactorGetSolverType(), MatCopy(), MatDuplicate(), MatGetFactorAvailable(), MatGetFactor()
External Links
- PETSc Manual:
Mat/MatSolverTypeRegister
PETSc.LibPETSc.MatSolves — Method
MatSolves(petsclib::PetscLibType,mat::PetscMat, b::Vecs, x::Vecs)Solves A x = b, given a factored matrix, for a collection of vectors
Neighbor-wise Collective
Input Parameters:
mat- the factored matrix obtained withMatGetFactor()b- the right-hand-side vectors
Output Parameter:
x- the result vectors
Level: developer
-seealso: , Mat, Vecs, MatSolveAdd(), MatSolveTranspose(), MatSolveTransposeAdd(), MatSolve()
External Links
- PETSc Manual:
Mat/MatSolves
PETSc.LibPETSc.MatStashGetInfo — Method
nstash::PetscInt,reallocs::PetscInt,bnstash::PetscInt,breallocs::PetscInt = MatStashGetInfo(petsclib::PetscLibType,mat::PetscMat)Gets how many values are currently in the matrix stash, i.e. need to be communicated to other processors during the MatAssemblyBegin()/MatAssemblyEnd() process
Not Collective
Input Parameter:
mat- the matrix
Output Parameters:
nstash- the size of the stashreallocs- the number of additional mallocs incurred.bnstash- the size of the block stashbreallocs- the number of additional mallocs incurred.in the block stash
Level: advanced
-seealso: , MatAssemblyBegin(), MatAssemblyEnd(), Mat, MatStashSetInitialSize()
External Links
- PETSc Manual:
Mat/MatStashGetInfo
PETSc.LibPETSc.MatStashSetInitialSize — Method
MatStashSetInitialSize(petsclib::PetscLibType,mat::PetscMat, size::PetscInt, bsize::PetscInt)sets the sizes of the matrix stash, that is used during the assembly process to store values that belong to other processors.
Not Collective
Input Parameters:
mat- the matrixsize- the initial size of the stash.bsize- the initial size of the block-stash(if used).
Options Database Keys:
-matstash_initial_size <size> or <size0,size1,...sizep-1>- set initial size-matstash_block_initial_size <bsize> or <bsize0,bsize1,...bsizep-1>- set initial block size
Level: intermediate
-seealso: , MatAssemblyBegin(), MatAssemblyEnd(), Mat, MatStashGetInfo()
External Links
- PETSc Manual:
Mat/MatStashSetInitialSize
PETSc.LibPETSc.MatStoreValues — Method
MatStoreValues(petsclib::PetscLibType,mat::PetscMat)Stashes a copy of the matrix values; this allows reusing of the linear part of a Jacobian, while recomputing only the nonlinear portion.
Logically Collect
Input Parameter:
mat- the matrix (currently onlyMATAIJmatrices support this option)
Level: advanced
-seealso: , Mat, MatRetrieveValues()
External Links
- PETSc Manual:
Mat/MatStoreValues
PETSc.LibPETSc.MatSubMatrixVirtualUpdate — Method
MatSubMatrixVirtualUpdate(petsclib::PetscLibType,N::PetscMat, A::PetscMat, isrow::IS, iscol::IS)Updates a MATSUBMATRIX virtual submatrix
Collective
Input Parameters:
N- submatrix to updateA- full matrix in the submatrixisrow- rows in the update (same as the first time the submatrix was created)iscol- columns in the update (same as the first time the submatrix was created)
Level: developer
-seealso: , Mat, MATSUBMATRIX, MatCreateSubMatrixVirtual()
External Links
- PETSc Manual:
Mat/MatSubMatrixVirtualUpdate
PETSc.LibPETSc.MatSubdomainsCreateCoalesce — Method
n::PetscInt,iss::Vector{IS} = MatSubdomainsCreateCoalesce(petsclib::PetscLibType,A::PetscMat, N::PetscInt)Creates index subdomains by coalescing adjacent MPI processes' ownership ranges.
Collective
Input Parameters:
A- the matrix to create subdomains fromN- requested number of subdomains
Output Parameters:
n- number of subdomains resulting on this MPI processiss-ISlist with indices of subdomains on this MPI process
Level: advanced
External Links
- PETSc Manual:
Mat/MatSubdomainsCreateCoalesce
PETSc.LibPETSc.MatSuperluDistGetDiagU — Method
diagU::PetscScalar = MatSuperluDistGetDiagU(petsclib::PetscLibType,F::PetscMat)External Links
- PETSc Manual:
Mat/MatSuperluDistGetDiagU
PETSc.LibPETSc.MatSuperluSetILUDropTol — Method
MatSuperluSetILUDropTol(petsclib::PetscLibType,F::PetscMat, dtol::PetscReal)Set SuperLU https://portal.nersc.gov/project/sparse/superlu/superlu_ug.pdf ILU drop tolerance
Logically Collective
Input Parameters:
F- the factored matrix obtained by callingMatGetFactor()dtol- drop tolerance
Options Database Key:
-mat_superlu_ilu_droptol <dtol>- the drop tolerance
Level: beginner
-seealso: , Mat, MatGetFactor(), MATSOLVERSUPERLU
External Links
- PETSc Manual:
Mat/MatSuperluSetILUDropTol
PETSc.LibPETSc.MatTransColoringApplyDenToSp — Method
MatTransColoringApplyDenToSp(petsclib::PetscLibType,matcoloring::MatTransposeColoring, Cden::PetscMat, Csp::PetscMat)Given a symbolic matrix product C{sp} = A*B^T for which a MatTransposeColoring context has been created and a dense matrix C{den} = A*B^T{dense} in which `B^T{dens}is obtained fromMatTransColoringApplySpToDen()`, recover sparse matrix C{sp} from C{den}.
Collective
Input Parameters:
matcoloring- coloring context created withMatTransposeColoringCreate()Cden- matrix product of a sparse matrix and a dense matrix Btdense
Output Parameter:
Csp- sparse matrix
Level: developer
-seealso: , Mat, MatTransposeColoringCreate(), MatTransposeColoringDestroy(), MatTransColoringApplySpToDen()
External Links
- PETSc Manual:
Mat/MatTransColoringApplyDenToSp
PETSc.LibPETSc.MatTransColoringApplySpToDen — Method
MatTransColoringApplySpToDen(petsclib::PetscLibType,coloring::MatTransposeColoring, B::PetscMat, Btdense::PetscMat)Given a symbolic matrix product C = A*B^T for which a MatTransposeColoring context has been created, computes a dense B^T by applying MatTransposeColoring to sparse B.
Collective
Input Parameters:
coloring- coloring context created withMatTransposeColoringCreate()B- sparse matrix
Output Parameter:
Btdense- dense matrix B^T
Level: developer
-seealso: , Mat, MatTransposeColoringCreate(), MatTransposeColoringDestroy(), MatTransColoringApplyDenToSp()
External Links
- PETSc Manual:
Mat/MatTransColoringApplySpToDen
PETSc.LibPETSc.MatTranspose — Method
MatTranspose(petsclib::PetscLibType,mat::PetscMat, reuse::MatReuse, B::PetscMat)Computes the transpose of a matrix, either in
Collective
Input Parameters:
mat- the matrix to transposereuse- eitherMAT_INITIAL_MATRIX,MAT_REUSE_MATRIX, orMAT_INPLACE_MATRIX
Output Parameter:
B- the transpose of the matrix
Level: intermediate
-seealso: , Mat, MatTransposeSetPrecursor(), MatMultTranspose(), MatMultTransposeAdd(), MatIsTranspose(), MatReuse, MAT_INITIAL_MATRIX, MAT_REUSE_MATRIX, MAT_INPLACE_MATRIX, MatTransposeSymbolic(), MatCreateTranspose()
External Links
- PETSc Manual:
Mat/MatTranspose
PETSc.LibPETSc.MatTransposeGetMat — Method
MatTransposeGetMat(petsclib::PetscLibType,A::PetscMat, M::PetscMat)Gets the Mat object stored inside a MATTRANSPOSEVIRTUAL
Logically Collective
Input Parameter:
A- theMATTRANSPOSEVIRTUALmatrix
Output Parameter:
M- the matrix object stored insideA
Level: intermediate
-seealso: , Mat, MATTRANSPOSEVIRTUAL, MatCreateTranspose()
External Links
- PETSc Manual:
Mat/MatTransposeGetMat
PETSc.LibPETSc.MatTransposeMatMult — Method
MatTransposeMatMult(petsclib::PetscLibType,A::PetscMat, B::PetscMat, scall::MatReuse, fill::PetscReal, C::PetscMat)Performs matrix
Neighbor-wise Collective
Input Parameters:
A- the left matrixB- the right matrixscall- eitherMAT_INITIAL_MATRIXorMAT_REUSE_MATRIXfill- expected fill as ratio of nnz(C)/(nnz(A) + nnz(B)), usePETSC_DETERMINEorPETSC_CURRENTif not known
Output Parameter:
C- the product matrix
Level: intermediate
-seealso: , Mat, MatProductCreate(), MATPRODUCT_AtB, MatMatMult(), MatMatTransposeMult(), MatPtAP()
External Links
- PETSc Manual:
Mat/MatTransposeMatMult
PETSc.LibPETSc.MatTransposeMatMultEqual — Method
flg::PetscBool = MatTransposeMatMultEqual(petsclib::PetscLibType,A::PetscMat, B::PetscMat, C::PetscMat, n::PetscInt)Test A^TBx = C*x for n random vector x
Collective
Input Parameters:
A- the first matrixB- the second matrixC- the third matrixn- number of random vectors to be tested
Output Parameter:
flg-PETSC_TRUEif the products are equal;PETSC_FALSEotherwise.
Level: intermediate
-seealso: Mat, MatMatMultEqual(), MatMultEqual(), MatMultAddEqual(), MatMultTransposeEqual()
External Links
- PETSc Manual:
Mat/MatTransposeMatMultEqual
PETSc.LibPETSc.MatTransposeSetPrecursor — Method
MatTransposeSetPrecursor(petsclib::PetscLibType,mat::PetscMat, B::PetscMat)Set the matrix from which the second matrix will receive numerical transpose data with a call to MatTranspose(A,MAT_REUSE_MATRIX,&B) when B was not obtained with MatTranspose(A,MAT_INITIAL_MATRIX,&B)
Collective
Input Parameter:
mat- the matrix to provide the transpose
Output Parameter:
B- the matrix to contain the transpose; it MUST have the nonzero structure of the transpose of A or the code will crash or generate incorrect results
Level: advanced
-seealso: , Mat, MatTransposeSymbolic(), MatTranspose(), MatMultTranspose(), MatMultTransposeAdd(), MatIsTranspose(), MatReuse, MAT_INITIAL_MATRIX, MAT_REUSE_MATRIX, MAT_INPLACE_MATRIX
External Links
- PETSc Manual:
Mat/MatTransposeSetPrecursor
PETSc.LibPETSc.MatTransposeSymbolic — Method
MatTransposeSymbolic(petsclib::PetscLibType,A::PetscMat, B::PetscMat)Computes the symbolic part of the transpose of a matrix.
Collective
Input Parameter:
A- the matrix to transpose
Output Parameter:
B- the transpose. This is a complete matrix but the numerical portion is invalid. One can callMatTranspose(A,MAT_REUSE_MATRIX,&B) to compute the
numerical portion.
Level: intermediate
-seealso: , Mat, MatTransposeSetPrecursor(), MatTranspose(), MatMultTranspose(), MatMultTransposeAdd(), MatIsTranspose(), MatReuse, MAT_INITIAL_MATRIX, MAT_REUSE_MATRIX, MAT_INPLACE_MATRIX
External Links
- PETSc Manual:
Mat/MatTransposeSymbolic
PETSc.LibPETSc.MatUpdateMPIAIJWithArray — Method
MatUpdateMPIAIJWithArray(petsclib::PetscLibType,mat::PetscMat, v::Vector{PetscScalar})updates an MATMPIAIJ matrix using an array that contains the nonzero values
Collective
Input Parameters:
mat- the matrixv- matrix values, stored by row
Level: intermediate
-seealso: , Mat, MatCreate(), MatCreateSeqAIJ(), MatSetValues(), MatMPIAIJSetPreallocation(), MatMPIAIJSetPreallocationCSR(), MATMPIAIJ, MatCreateAIJ(), MatCreateMPIAIJWithSplitArrays(), MatUpdateMPIAIJWithArrays(), MatSetPreallocationCOO(), MatSetValuesCOO()
External Links
- PETSc Manual:
Mat/MatUpdateMPIAIJWithArray
PETSc.LibPETSc.MatUpdateMPIAIJWithArrays — Method
MatUpdateMPIAIJWithArrays(petsclib::PetscLibType,mat::PetscMat, m::PetscInt, n::PetscInt, M::PetscInt, N::PetscInt, Ii::Vector{PetscInt}, J::Vector{PetscInt}, v::Vector{PetscScalar})updates a MATMPIAIJ matrix using arrays that contain in standard CSR format for the local rows. Only the numerical values are updated the other arrays must be identical to what was passed from MatCreateMPIAIJWithArrays()
Deprecated: Use MatUpdateMPIAIJWithArray()
Collective
Input Parameters:
mat- the matrixm- number of local rows (Cannot bePETSC_DECIDE)n- This value should be the same as the local size used in creating the
x vector for the matrix-vector product y = Ax. (or PETSC_DECIDE to have calculated if N is given) For square matrices n is almost always m.
M- number of global rows (orPETSC_DETERMINEto have calculated if m is given)N- number of global columns (orPETSC_DETERMINEto have calculated if n is given)Ii- row indices; that is Ii[0] = 0, Ii[row] = Ii[row-1] + number of elements in that row of the matrixJ- column indicesv- matrix values
Level: deprecated
-seealso: , Mat, MATMPIAIJ, MatCreate(), MatCreateSeqAIJ(), MatSetValues(), MatMPIAIJSetPreallocation(), MatMPIAIJSetPreallocationCSR(), MatCreateAIJ(), MatCreateMPIAIJWithSplitArrays(), MatUpdateMPIAIJWithArray(), MatSetPreallocationCOO(), MatSetValuesCOO()
External Links
- PETSc Manual:
Mat/MatUpdateMPIAIJWithArrays
PETSc.LibPETSc.MatView — Method
MatView(petsclib::PetscLibType,mat::PetscMat, viewer::PetscViewer)display information about a matrix in a variety ways
Collective on viewer
Input Parameters:
mat- the matrixviewer- visualization context
Options Database Keys:
-mat_view ::ascii_info- Prints info on matrix at conclusion ofMatAssemblyEnd()-mat_view ::ascii_info_detail- Prints more detailed info-mat_view- Prints matrix in ASCII format-mat_view ::ascii_matlab- Prints matrix in MATLAB format-mat_view draw- PetscDraws nonzero structure of matrix, usingMatView()andPetscDrawOpenX().-display <name>- Sets display name (default is host)-draw_pause <sec>- Sets number of seconds to pause after display-mat_view socket- Sends matrix to socket, can be accessed from MATLAB (see Users-Manual: ch_matlab for details)-viewer_socket_machine <machine>- --viewer_socket_port <port>- --mat_view binary- save matrix to file in binary format-viewer_binary_filename <name>- -
Level: beginner
-seealso: , Mat, PetscViewerPushFormat(), PetscViewerASCIIOpen(), PetscViewerDrawOpen(), PetscViewer, PetscViewerSocketOpen(), PetscViewerBinaryOpen(), MatLoad(), MatViewFromOptions()
External Links
- PETSc Manual:
Mat/MatView
PETSc.LibPETSc.MatViewFromOptions — Method
MatViewFromOptions(petsclib::PetscLibType,A::PetscMat, obj::PetscObject, name::Vector{Cchar})View properties of the matrix based on options set in the options database
Collective
Input Parameters:
A- the matrixobj- optional additional object that provides the options prefix to usename- command line option
Options Database Key:
-mat_view [viewertype]:...- the viewer and its options
Level: intermediate
-seealso: , Mat, MatView(), PetscObjectViewFromOptions(), MatCreate()
External Links
- PETSc Manual:
Mat/MatViewFromOptions
PETSc.LibPETSc.MatXAIJSetPreallocation — Method
MatXAIJSetPreallocation(petsclib::PetscLibType,A::PetscMat, bs::PetscInt, dnnz::Vector{PetscInt}, onnz::Vector{PetscInt}, dnnzu::Vector{PetscInt}, onnzu::Vector{PetscInt})set preallocation for serial and parallel MATAIJ, MATBAIJ, and MATSBAIJ matrices and their unassembled versions.
Collective
Input Parameters:
A- matrix being preallocatedbs- block sizednnz- number of nonzero column blocks per block row of diagonal part of parallel matrixonnz- number of nonzero column blocks per block row of off-diagonal part of parallel matrixdnnzu- number of nonzero column blocks per block row of upper-triangular part of diagonal part of parallel matrixonnzu- number of nonzero column blocks per block row of upper-triangular part of off-diagonal part of parallel matrix
Level: beginner
-seealso: , Mat, MatSeqAIJSetPreallocation(), MatMPIAIJSetPreallocation(), MatSeqBAIJSetPreallocation(), MatMPIBAIJSetPreallocation(), MatSeqSBAIJSetPreallocation(), MatMPISBAIJSetPreallocation(), PetscSplitOwnership()
External Links
- PETSc Manual:
Mat/MatXAIJSetPreallocation
PETSc.LibPETSc.MatZeroEntries — Method
MatZeroEntries(petsclib::PetscLibType,mat::PetscMat)Zeros all entries of a matrix. For sparse matrices this routine retains the old nonzero structure.
Logically Collective
Input Parameter:
mat- the matrix
Level: intermediate
-seealso: , Mat, MatZeroRows(), MatZeroRowsColumns()
External Links
- PETSc Manual:
Mat/MatZeroEntries
PETSc.LibPETSc.MatZeroRows — Method
MatZeroRows(petsclib::PetscLibType,mat::PetscMat, numRows::PetscInt, rows::Vector{PetscInt}, diag::PetscScalar, x::PetscVec, b::PetscVec)Zeros all entries (except possibly the main diagonal) of a set of rows of a matrix.
Collective
Input Parameters:
mat- the matrixnumRows- the number of rows to zerorows- the global row indicesdiag- value put in the diagonal of the zeroed rowsx- optional vector of solutions for zeroed rows (other entries in vector are not used), these must be set before this callb- optional vector of right-hand side, that will be adjusted by provided solution entries
Level: intermediate
-seealso: , Mat, MatZeroRowsIS(), MatZeroRowsColumns(), MatZeroRowsLocalIS(), MatZeroRowsStencil(), MatZeroEntries(), MatZeroRowsLocal(), MatSetOption(), MatZeroRowsColumnsLocal(), MatZeroRowsColumnsLocalIS(), MatZeroRowsColumnsIS(), MatZeroRowsColumnsStencil(), PCREDISTRIBUTE, MAT_KEEP_NONZERO_PATTERN
External Links
- PETSc Manual:
Mat/MatZeroRows
PETSc.LibPETSc.MatZeroRowsColumns — Method
MatZeroRowsColumns(petsclib::PetscLibType,mat::PetscMat, numRows::PetscInt, rows::Vector{PetscInt}, diag::PetscScalar, x::PetscVec, b::PetscVec)Zeros all entries (except possibly the main diagonal) of a set of rows and columns of a matrix.
Collective
Input Parameters:
mat- the matrixnumRows- the number of rows/columns to zerorows- the global row indicesdiag- value put in the diagonal of the eliminated rowsx- optional vector of the solution for zeroed rows (other entries in vector are not used), these must be set before this callb- optional vector of the right-hand side, that will be adjusted by provided solution entries
Level: intermediate
-seealso: , Mat, MatZeroRowsIS(), MatZeroRows(), MatZeroRowsLocalIS(), MatZeroRowsStencil(), MatZeroEntries(), MatZeroRowsLocal(), MatSetOption(), MatZeroRowsColumnsLocal(), MatZeroRowsColumnsLocalIS(), MatZeroRowsColumnsIS(), MatZeroRowsColumnsStencil()
External Links
- PETSc Manual:
Mat/MatZeroRowsColumns
PETSc.LibPETSc.MatZeroRowsColumnsIS — Method
MatZeroRowsColumnsIS(petsclib::PetscLibType,mat::PetscMat, is::IS, diag::PetscScalar, x::PetscVec, b::PetscVec)Zeros all entries (except possibly the main diagonal) of a set of rows and columns of a matrix.
Collective
Input Parameters:
mat- the matrixis- the rows to zerodiag- value put in all diagonals of eliminated rows (0.0 will even eliminate diagonal entry)x- optional vector of solutions for zeroed rows (other entries in vector are not used)b- optional vector of right-hand side, that will be adjusted by provided solution
Level: intermediate
-seealso: , Mat, MatZeroRowsIS(), MatZeroRowsColumns(), MatZeroRowsLocalIS(), MatZeroRowsStencil(), MatZeroEntries(), MatZeroRowsLocal(), MatSetOption(), MatZeroRowsColumnsLocal(), MatZeroRowsColumnsLocalIS(), MatZeroRows(), MatZeroRowsColumnsStencil()
External Links
- PETSc Manual:
Mat/MatZeroRowsColumnsIS
PETSc.LibPETSc.MatZeroRowsColumnsLocal — Method
MatZeroRowsColumnsLocal(petsclib::PetscLibType,mat::PetscMat, numRows::PetscInt, rows::Vector{PetscInt}, diag::PetscScalar, x::PetscVec, b::PetscVec)Zeros all entries (except possibly the main diagonal) of a set of rows and columns of a matrix; using local numbering of rows.
Collective
Input Parameters:
mat- the matrixnumRows- the number of rows to removerows- the global row indicesdiag- value put in all diagonals of eliminated rowsx- optional vector of solutions for zeroed rows (other entries in vector are not used)b- optional vector of right-hand side, that will be adjusted by provided solution
Level: intermediate
-seealso: , Mat, MatZeroRowsIS(), MatZeroRowsColumns(), MatZeroRowsLocalIS(), MatZeroRowsStencil(), MatZeroEntries(), MatZeroRowsLocal(), MatSetOption(), MatZeroRows(), MatZeroRowsColumnsLocalIS(), MatZeroRowsColumnsIS(), MatZeroRowsColumnsStencil()
External Links
- PETSc Manual:
Mat/MatZeroRowsColumnsLocal
PETSc.LibPETSc.MatZeroRowsColumnsLocalIS — Method
MatZeroRowsColumnsLocalIS(petsclib::PetscLibType,mat::PetscMat, is::IS, diag::PetscScalar, x::PetscVec, b::PetscVec)Zeros all entries (except possibly the main diagonal) of a set of rows and columns of a matrix; using local numbering of rows.
Collective
Input Parameters:
mat- the matrixis- index set of rows to removediag- value put in all diagonals of eliminated rowsx- optional vector of solutions for zeroed rows (other entries in vector are not used)b- optional vector of right-hand side, that will be adjusted by provided solution
Level: intermediate
-seealso: , Mat, MatZeroRowsIS(), MatZeroRowsColumns(), MatZeroRowsLocalIS(), MatZeroRowsStencil(), MatZeroEntries(), MatZeroRowsLocal(), MatSetOption(), MatZeroRowsColumnsLocal(), MatZeroRows(), MatZeroRowsColumnsIS(), MatZeroRowsColumnsStencil()
External Links
- PETSc Manual:
Mat/MatZeroRowsColumnsLocalIS
PETSc.LibPETSc.MatZeroRowsColumnsStencil — Method
MatZeroRowsColumnsStencil(petsclib::PetscLibType,mat::PetscMat, numRows::PetscInt, rows::Vector{MatStencil}, diag::PetscScalar, x::PetscVec, b::PetscVec)Zeros all row and column entries (except possibly the main diagonal) of a set of rows and columns of a matrix.
Collective
Input Parameters:
mat- the matrixnumRows- the number of rows/columns to removerows- the grid coordinates (and component number when dof > 1) for matrix rowsdiag- value put in all diagonals of eliminated rows (0.0 will even eliminate diagonal entry)x- optional vector of solutions for zeroed rows (other entries in vector are not used)b- optional vector of right-hand side, that will be adjusted by provided solution
Level: intermediate
-seealso: , Mat, MatZeroRowsIS(), MatZeroRowsColumns(), MatZeroRowsLocalIS(), MatZeroRowsStencil(), MatZeroEntries(), MatZeroRowsLocal(), MatSetOption(), MatZeroRowsColumnsLocal(), MatZeroRowsColumnsLocalIS(), MatZeroRowsColumnsIS(), MatZeroRows()
External Links
- PETSc Manual:
Mat/MatZeroRowsColumnsStencil
PETSc.LibPETSc.MatZeroRowsIS — Method
MatZeroRowsIS(petsclib::PetscLibType,mat::PetscMat, is::IS, diag::PetscScalar, x::PetscVec, b::PetscVec)Zeros all entries (except possibly the main diagonal) of a set of rows of a matrix indicated by an IS
Collective
Input Parameters:
mat- the matrixis- index set,IS, of rows to remove (ifNULLthen no row is removed)diag- value put in all diagonals of eliminated rowsx- optional vector of solutions for zeroed rows (other entries in vector are not used)b- optional vector of right-hand side, that will be adjusted by provided solution
Level: intermediate
-seealso: , Mat, MatZeroRows(), MatZeroRowsColumns(), MatZeroRowsLocalIS(), MatZeroRowsStencil(), MatZeroEntries(), MatZeroRowsLocal(), MatSetOption(), MatZeroRowsColumnsLocal(), MatZeroRowsColumnsLocalIS(), MatZeroRowsColumnsIS(), MatZeroRowsColumnsStencil(), IS
External Links
- PETSc Manual:
Mat/MatZeroRowsIS
PETSc.LibPETSc.MatZeroRowsLocal — Method
MatZeroRowsLocal(petsclib::PetscLibType,mat::PetscMat, numRows::PetscInt, rows::Vector{PetscInt}, diag::PetscScalar, x::PetscVec, b::PetscVec)Zeros all entries (except possibly the main diagonal) of a set of rows of a matrix; using local numbering of rows.
Collective
Input Parameters:
mat- the matrixnumRows- the number of rows to removerows- the local row indicesdiag- value put in all diagonals of eliminated rowsx- optional vector of solutions for zeroed rows (other entries in vector are not used)b- optional vector of right-hand side, that will be adjusted by provided solution
Level: intermediate
-seealso: , Mat, MatZeroRowsIS(), MatZeroRowsColumns(), MatZeroRowsLocalIS(), MatZeroRowsStencil(), MatZeroEntries(), MatZeroRows(), MatSetOption(), MatZeroRowsColumnsLocal(), MatZeroRowsColumnsLocalIS(), MatZeroRowsColumnsIS(), MatZeroRowsColumnsStencil()
External Links
- PETSc Manual:
Mat/MatZeroRowsLocal
PETSc.LibPETSc.MatZeroRowsLocalIS — Method
MatZeroRowsLocalIS(petsclib::PetscLibType,mat::PetscMat, is::IS, diag::PetscScalar, x::PetscVec, b::PetscVec)Zeros all entries (except possibly the main diagonal) of a set of rows of a matrix; using local numbering of rows.
Collective
Input Parameters:
mat- the matrixis- index set of rows to removediag- value put in all diagonals of eliminated rowsx- optional vector of solutions for zeroed rows (other entries in vector are not used)b- optional vector of right-hand side, that will be adjusted by provided solution
Level: intermediate
-seealso: , Mat, MatZeroRowsIS(), MatZeroRowsColumns(), MatZeroRows(), MatZeroRowsStencil(), MatZeroEntries(), MatZeroRowsLocal(), MatSetOption(), MatZeroRowsColumnsLocal(), MatZeroRowsColumnsLocalIS(), MatZeroRowsColumnsIS(), MatZeroRowsColumnsStencil()
External Links
- PETSc Manual:
Mat/MatZeroRowsLocalIS
PETSc.LibPETSc.MatZeroRowsStencil — Method
MatZeroRowsStencil(petsclib::PetscLibType,mat::PetscMat, numRows::PetscInt, rows::Vector{MatStencil}, diag::PetscScalar, x::PetscVec, b::PetscVec)Zeros all entries (except possibly the main diagonal) of a set of rows of a matrix indicated by a MatStencil. These rows must be local to the process.
Collective
Input Parameters:
mat- the matrixnumRows- the number of rows to removerows- the grid coordinates (and component number when dof > 1) for matrix rows indicated by an array ofMatStencildiag- value put in all diagonals of eliminated rows (0.0 will even eliminate diagonal entry)x- optional vector of solutions for zeroed rows (other entries in vector are not used)b- optional vector of right-hand side, that will be adjusted by provided solution
Level: intermediate
-seealso: , Mat, MatStencil, MatZeroRowsIS(), MatZeroRowsColumns(), MatZeroRowsLocalIS(), MatZeroRows(), MatZeroEntries(), MatZeroRowsLocal(), MatSetOption(), MatZeroRowsColumnsLocal(), MatZeroRowsColumnsLocalIS(), MatZeroRowsColumnsIS(), MatZeroRowsColumnsStencil()
External Links
- PETSc Manual:
Mat/MatZeroRowsStencil
PETSc.LibPETSc.MatCoarsenApply — Method
MatCoarsenApply(petsclib::PetscLibType,coarser::MatCoarsen)Gets a coarsen for a matrix.
Collective
Input Parameter:
coarser- the coarsen
Options Database Keys:
-mat_coarsen_type mis|hem|misk- mis: maximal independent set based; misk: distance k MIS; hem: heavy edge matching-mat_coarsen_view- view the coarsening object
Level: advanced
-seealso: MatCoarsen, MatCoarsenSetFromOptions(), MatCoarsenSetType(), MatCoarsenRegister(), MatCoarsenCreate(), MatCoarsenDestroy(), MatCoarsenSetAdjacency() MatCoarsenGetData()
External Links
- PETSc Manual:
Mat/MatCoarsenApply
PETSc.LibPETSc.MatCoarsenCreate — Method
newcrs::MatCoarsen = MatCoarsenCreate(petsclib::PetscLibType,comm::MPI_Comm)Creates a coarsen context.
Collective
Input Parameter:
comm- MPI communicator
Output Parameter:
newcrs- location to put the context
Level: advanced
-seealso: MatCoarsen, MatCoarsenSetType(), MatCoarsenApply(), MatCoarsenDestroy(), MatCoarsenSetAdjacency(), MatCoarsenGetData()
External Links
- PETSc Manual:
Mat/MatCoarsenCreate
PETSc.LibPETSc.MatCoarsenDestroy — Method
MatCoarsenDestroy(petsclib::PetscLibType,agg::MatCoarsen)Destroys the coarsen context.
Collective
Input Parameter:
agg- the coarsen context
Level: advanced
-seealso: MatCoarsen, MatCoarsenCreate()
External Links
- PETSc Manual:
Mat/MatCoarsenDestroy
PETSc.LibPETSc.MatCoarsenGetData — Method
MatCoarsenGetData(petsclib::PetscLibType,coarser::MatCoarsen, llist::PetscCoarsenData)Gets the weights for vertices for a coarsener.
Logically Collective, No Fortran Support
Input Parameter:
coarser- the coarsen context
Output Parameter:
llist- linked list of aggregates
Level: advanced
-seealso: MatCoarsen, MatCoarsenApply(), MatCoarsenCreate(), MatCoarsenSetType(), PetscCoarsenData
External Links
- PETSc Manual:
Mat/MatCoarsenGetData
PETSc.LibPETSc.MatCoarsenGetType — Method
type::MatCoarsenType = MatCoarsenGetType(petsclib::PetscLibType,coarsen::MatCoarsen)Gets the Coarsen method type and name (as a string) from the coarsen context.
Not Collective
Input Parameter:
coarsen- the coarsen context
Output Parameter:
type- coarsener type
Level: advanced
-seealso: MatCoarsen, MatCoarsenCreate(), MatCoarsenType, MatCoarsenSetType(), MatCoarsenRegister()
External Links
- PETSc Manual:
Mat/MatCoarsenGetType
PETSc.LibPETSc.MatCoarsenMISKGetDistance — Method
k::PetscInt = MatCoarsenMISKGetDistance(petsclib::PetscLibType,crs::MatCoarsen)gets the distance to be used by MISK
Collective
Input Parameter:
crs- the coarsen
Output Parameter:
k- the distance
Level: advanced
-seealso: MATCOARSENMISK, MatCoarsen, MatCoarsenSetFromOptions(), MatCoarsenSetType(), MatCoarsenRegister(), MatCoarsenCreate(), MatCoarsenDestroy(), MatCoarsenSetAdjacency(), MatCoarsenGetData()
External Links
- PETSc Manual:
Mat/MatCoarsenMISKGetDistance
PETSc.LibPETSc.MatCoarsenMISKSetDistance — Method
MatCoarsenMISKSetDistance(petsclib::PetscLibType,crs::MatCoarsen, k::PetscInt)the distance to be used by MISK
Collective
Input Parameters:
crs- the coarsenk- the distance
Options Database Key:
-mat_coarsen_misk_distance <k>- distance for MIS
Level: advanced
-seealso: MATCOARSENMISK, MatCoarsen, MatCoarsenSetFromOptions(), MatCoarsenSetType(), MatCoarsenRegister(), MatCoarsenCreate(), MatCoarsenDestroy(), MatCoarsenSetAdjacency(), MatCoarsenMISKGetDistance() MatCoarsenGetData()
External Links
- PETSc Manual:
Mat/MatCoarsenMISKSetDistance
PETSc.LibPETSc.MatCoarsenRegister — Method
MatCoarsenRegister(petsclib::PetscLibType,sname::String, fnc::external)Adds a new sparse matrix coarsening algorithm to the matrix package.
Logically Collective, No Fortran Support
Input Parameters:
sname- name of coarsen (for exampleMATCOARSENMIS)function- function pointer that creates the coarsen type
Level: developer
-seealso: MatCoarsen, MatCoarsenType, MatCoarsenSetType(), MatCoarsenCreate(), MatCoarsenRegisterDestroy(), MatCoarsenRegisterAll()
External Links
- PETSc Manual:
Mat/MatCoarsenRegister
PETSc.LibPETSc.MatCoarsenSetAdjacency — Method
MatCoarsenSetAdjacency(petsclib::PetscLibType,agg::MatCoarsen, adj::PetscMat)Sets the adjacency graph (matrix) of the thing to be coarsened.
Collective
Input Parameters:
agg- the coarsen contextadj- the adjacency matrix
Level: advanced
-seealso: MatCoarsen, MatCoarsenSetFromOptions(), Mat, MatCoarsenCreate(), MatCoarsenApply()
External Links
- PETSc Manual:
Mat/MatCoarsenSetAdjacency
PETSc.LibPETSc.MatCoarsenSetFromOptions — Method
MatCoarsenSetFromOptions(petsclib::PetscLibType,coarser::MatCoarsen)Sets various coarsen options from the options database.
Collective
Input Parameter:
coarser- the coarsen context.
Options Database Key:
-mat_coarsen_type <type>- mis: maximal independent set based; misk: distance k MIS; hem: heavy edge matching-mat_coarsen_max_it <its> number of iterations to use in the coarsening process- seeMatCoarsenSetMaximumIterations()
Level: advanced
-seealso: MatCoarsen, MatCoarsenType, MatCoarsenApply(), MatCoarsenCreate(), MatCoarsenSetType(), MatCoarsenSetMaximumIterations()
External Links
- PETSc Manual:
Mat/MatCoarsenSetFromOptions
PETSc.LibPETSc.MatCoarsenSetGreedyOrdering — Method
MatCoarsenSetGreedyOrdering(petsclib::PetscLibType,coarser::MatCoarsen, perm::IS)Sets the ordering of the vertices to use with a greedy coarsening method
Logically Collective
Input Parameters:
coarser- the coarsen contextperm- vertex ordering of (greedy) algorithm
Level: advanced
-seealso: MatCoarsen, MatCoarsenType, MatCoarsenCreate(), MatCoarsenSetType()
External Links
- PETSc Manual:
Mat/MatCoarsenSetGreedyOrdering
PETSc.LibPETSc.MatCoarsenSetMaximumIterations — Method
MatCoarsenSetMaximumIterations(petsclib::PetscLibType,coarse::MatCoarsen, n::PetscInt)Maximum MATCOARSENHEM iterations to use
Logically Collective
Input Parameters:
coarse- the coarsen contextn- number of HEM iterations
Options Database Key:
-mat_coarsen_max_it <default=4>- MaximumMATCOARSENHEMiterations to use
Level: intermediate
-seealso: MatCoarsen, MatCoarsenType, MatCoarsenApply(), MatCoarsenCreate(), MatCoarsenSetType()
External Links
- PETSc Manual:
Mat/MatCoarsenSetMaximumIterations
PETSc.LibPETSc.MatCoarsenSetStrengthIndex — Method
MatCoarsenSetStrengthIndex(petsclib::PetscLibType,coarse::MatCoarsen, n::PetscInt, idx::Vector{PetscInt})Index array to use for index to use for strength of connection
Logically Collective
Input Parameters:
coarse- the coarsen contextn- number of indicesidx- array of indices
Options Database Key:
-mat_coarsen_strength_index- array of subset of variables per vertex to use for strength norm, -1 for using all (default)
Level: intermediate
-seealso: MatCoarsen, MatCoarsenType, MatCoarsenApply(), MatCoarsenCreate(), MatCoarsenSetType()
External Links
- PETSc Manual:
Mat/MatCoarsenSetStrengthIndex
PETSc.LibPETSc.MatCoarsenSetStrictAggs — Method
MatCoarsenSetStrictAggs(petsclib::PetscLibType,agg::MatCoarsen, str::PetscBool)Set whether to keep strict (non overlapping) aggregates in the linked list of aggregates for a coarsen context
Logically Collective
Input Parameters:
agg- the coarsen contextstr-PETSC_TRUEkeep strict aggregates,PETSC_FALSEallow overlap
Level: advanced
-seealso: MatCoarsen, MatCoarsenCreate(), MatCoarsenSetFromOptions()
External Links
- PETSc Manual:
Mat/MatCoarsenSetStrictAggs
PETSc.LibPETSc.MatCoarsenSetThreshold — Method
MatCoarsenSetThreshold(petsclib::PetscLibType,coarse::MatCoarsen, b::PetscReal)Set the threshold for HEM
Logically Collective
Input Parameters:
coarse- the coarsen contextb- threshold value
Options Database Key:
-mat_coarsen_threshold <-1>- threshold
Level: intermediate
-seealso: MatCoarsen, MatCoarsenType, MatCoarsenApply(), MatCoarsenCreate(), MatCoarsenSetType()
External Links
- PETSc Manual:
Mat/MatCoarsenSetThreshold
PETSc.LibPETSc.MatCoarsenSetType — Method
MatCoarsenSetType(petsclib::PetscLibType,coarser::MatCoarsen, type::MatCoarsenType)Sets the type of aggregator to use
Collective
Input Parameters:
coarser- the coarsen context.type- a known coarsening method
Options Database Key:
-mat_coarsen_type <type>- maximal independent set based; distance k MIS; heavy edge matching
Level: advanced
-seealso: MatCoarsen, MatCoarsenCreate(), MatCoarsenApply(), MatCoarsenType, MatCoarsenGetType()
External Links
- PETSc Manual:
Mat/MatCoarsenSetType
PETSc.LibPETSc.MatCoarsenView — Method
MatCoarsenView(petsclib::PetscLibType,agg::MatCoarsen, viewer::PetscViewer)Prints the coarsen data structure.
Collective
Input Parameters:
agg- the coarsen contextviewer- optional visualization context
For viewing the options database see MatCoarsenViewFromOptions()
Level: advanced
-seealso: MatCoarsen, PetscViewer, PetscViewerASCIIOpen(), MatCoarsenViewFromOptions
External Links
- PETSc Manual:
Mat/MatCoarsenView
PETSc.LibPETSc.MatCoarsenViewFromOptions — Method
MatCoarsenViewFromOptions(petsclib::PetscLibType,A::MatCoarsen, obj::PetscObject, name::String)View the coarsener from the options database
Collective
Input Parameters:
A- the coarsen contextobj- Optional object that provides the prefix for the option namename- command line option (usually-mat_coarsen_view)
Options Database Key:
-mat_coarsen_view [viewertype]:...- the viewer and its options
-seealso: MatCoarsen, MatCoarsenView, PetscObjectViewFromOptions(), MatCoarsenCreate()
External Links
- PETSc Manual:
Mat/MatCoarsenViewFromOptions
PETSc.LibPETSc.MatColoringApply — Method
MatColoringApply(petsclib::PetscLibType,mc::MatColoring, coloring::ISColoring)Apply the coloring to the matrix, producing index sets corresponding to a number of independent sets in the induced graph.
Collective
Input Parameter:
mc- theMatColoringcontext
Output Parameter:
coloring- theISColoringinstance containing the coloring
Level: beginner
-seealso: ISColoring, MatColoring, MatColoringCreate()
External Links
- PETSc Manual:
Mat/MatColoringApply
PETSc.LibPETSc.MatColoringCreate — Method
mcptr::MatColoring = MatColoringCreate(petsclib::PetscLibType,m::PetscMat)Creates a matrix coloring context.
Collective
Input Parameter:
m- aMatfrom which a coloring is derived
Output Parameter:
mcptr- the newMatColoringcontext
Options Database Keys:
-mat_coloring_type- the type of coloring algorithm used. SeeMatColoringType.-mat_coloring_maxcolors- the maximum number of relevant colors, all nodes not in a color are in maxcolors+1-mat_coloring_distance- compute a distance 1,2,... coloring.-mat_coloring_view- print information about the coloring and the produced index sets-mat_coloring_test- debugging option that prints all coloring incompatibilities-mat_is_coloring_test- debugging option that throws an error if MatColoringApply() generates an incorrect iscoloring
Level: beginner
-seealso: MatColoringSetFromOptions(), MatColoring, MatColoringApply(), MatFDColoringCreate(), DMCreateColoring(), MatColoringType
External Links
- PETSc Manual:
Mat/MatColoringCreate
PETSc.LibPETSc.MatColoringCreateWeights — Method
MatColoringCreateWeights(petsclib::PetscLibType,mc::MatColoring, weights::PetscReal, lperm::PetscInt)External Links
- PETSc Manual:
Mat/MatColoringCreateWeights
PETSc.LibPETSc.MatColoringDestroy — Method
MatColoringDestroy(petsclib::PetscLibType,mc::MatColoring)Destroys the matrix coloring context
Collective
Input Parameter:
mc- theMatColoringcontext
Level: beginner
-seealso: MatColoring, MatColoringCreate(), MatColoringApply()
External Links
- PETSc Manual:
Mat/MatColoringDestroy
PETSc.LibPETSc.MatColoringGetDegrees — Method
degrees::PetscInt = MatColoringGetDegrees(petsclib::PetscLibType,G::PetscMat, distance::PetscInt)External Links
- PETSc Manual:
Mat/MatColoringGetDegrees
PETSc.LibPETSc.MatColoringGetDistance — Method
dist::PetscInt = MatColoringGetDistance(petsclib::PetscLibType,mc::MatColoring)Gets the distance of the coloring
Logically Collective
Input Parameter:
mc- theMatColoringcontext
Output Parameter:
dist- the current distance being used for the coloring.
Level: beginner
-seealso: MatColoring, MatColoringSetDistance(), MatColoringApply()
External Links
- PETSc Manual:
Mat/MatColoringGetDistance
PETSc.LibPETSc.MatColoringGetMaxColors — Method
maxcolors::PetscInt = MatColoringGetMaxColors(petsclib::PetscLibType,mc::MatColoring)Gets the maximum number of colors
Logically Collective
Input Parameter:
mc- theMatColoringcontext
Output Parameter:
maxcolors- the current maximum number of colors to produce
Level: beginner
-seealso: MatColoring, MatColoringSetMaxColors(), MatColoringApply()
External Links
- PETSc Manual:
Mat/MatColoringGetMaxColors
PETSc.LibPETSc.MatColoringPatch — Method
MatColoringPatch(petsclib::PetscLibType,mat::PetscMat, ncolors::PetscInt, n::PetscInt, colorarray::Vector{ISColoringValue}, iscoloring::ISColoring)Used inside matrix coloring routines that use MatGetRowIJ() and/or MatGetColumnIJ().
Collective
Input Parameters:
mat- the matrixncolors- maximum color valuen- number of entries in colorarraycolorarray- array indicating color for each column
Output Parameter:
iscoloring- coloring generated using colorarray information
Level: developer
-seealso: , Mat, MatGetRowIJ(), MatGetColumnIJ()
External Links
- PETSc Manual:
Mat/MatColoringPatch
PETSc.LibPETSc.MatColoringRegister — Method
MatColoringRegister(petsclib::PetscLibType,sname::String, fnc::external)Adds a new sparse matrix coloring to the matrix package.
Not Collective, No Fortran Support
Input Parameters:
sname- name of Coloring (for exampleMATCOLORINGSL)function- function pointer that creates the coloring
Level: developer
-seealso: MatColoringType, MatColoringRegisterDestroy(), MatColoringRegisterAll()
External Links
- PETSc Manual:
Mat/MatColoringRegister
PETSc.LibPETSc.MatColoringSetDistance — Method
MatColoringSetDistance(petsclib::PetscLibType,mc::MatColoring, dist::PetscInt)Sets the distance of the coloring
Logically Collective
Input Parameters:
mc- theMatColoringcontextdist- the distance the coloring should compute
Options Database Key:
-mat_coloring_type- the type of coloring algorithm used. SeeMatColoringType.
Level: beginner
-seealso: MatColoring, MatColoringSetFromOptions(), MatColoringGetDistance(), MatColoringApply()
External Links
- PETSc Manual:
Mat/MatColoringSetDistance
PETSc.LibPETSc.MatColoringSetFromOptions — Method
MatColoringSetFromOptions(petsclib::PetscLibType,mc::MatColoring)Sets MatColoring options from options database
Collective
Input Parameter:
mc-MatColoringcontext
Options Database Keys:
-mat_coloring_type- the type of coloring algorithm used. SeeMatColoringType.-mat_coloring_maxcolors- the maximum number of relevant colors, all nodes not in a color are in maxcolors+1-mat_coloring_distance- compute a distance 1,2,... coloring.-mat_coloring_view- print information about the coloring and the produced index sets-snes_fd_color- instruct SNES to using coloring and thenMatFDColoringto compute the Jacobians-snes_fd_color_use_mat- instructSNESto color the matrix directly instead of theDMfrom which the matrix comes (the default)
Level: beginner
-seealso: MatColoring, MatColoringApply(), MatColoringSetDistance(), MatColoringSetType(), SNESComputeJacobianDefaultColor(), MatColoringType
External Links
- PETSc Manual:
Mat/MatColoringSetFromOptions
PETSc.LibPETSc.MatColoringSetMaxColors — Method
MatColoringSetMaxColors(petsclib::PetscLibType,mc::MatColoring, maxcolors::PetscInt)Sets the maximum number of colors to produce
Logically Collective
Input Parameters:
mc- theMatColoringcontextmaxcolors- the maximum number of colors to produce
Level: beginner
-seealso: MatColoring, MatColoringGetMaxColors(), MatColoringApply()
External Links
- PETSc Manual:
Mat/MatColoringSetMaxColors
PETSc.LibPETSc.MatColoringSetType — Method
MatColoringSetType(petsclib::PetscLibType,mc::MatColoring, type::MatColoringType)Sets the type of coloring algorithm used
Collective
Input Parameters:
mc- theMatColoringcontexttype- the type of coloring
Options Database Key:
-mat_coloring_type type- the name of the type
Level: beginner
-seealso: MatColoring, MatColoringSetFromOptions(), MatColoringType, MatColoringCreate(), MatColoringApply()
External Links
- PETSc Manual:
Mat/MatColoringSetType
PETSc.LibPETSc.MatColoringSetWeightType — Method
MatColoringSetWeightType(petsclib::PetscLibType,mc::MatColoring, wt::MatColoringWeightType)Set the type of weight computation used while computing the coloring
Logically Collective
Input Parameters:
mc- theMatColoringcontextwt- the weight type
Level: beginner
-seealso: MatColoring, MatColoringWeightType, MatColoringApply()
External Links
- PETSc Manual:
Mat/MatColoringSetWeightType
PETSc.LibPETSc.MatColoringSetWeights — Method
weights::PetscReal,lperm::PetscInt = MatColoringSetWeights(petsclib::PetscLibType,mc::MatColoring)External Links
- PETSc Manual:
Mat/MatColoringSetWeights
PETSc.LibPETSc.MatColoringView — Method
MatColoringView(petsclib::PetscLibType,mc::MatColoring, viewer::PetscViewer)Output details about the MatColoring.
Collective
Input Parameters:
mc- theMatColoringcontextviewer- the Viewer context
Level: beginner
-seealso: PetscViewer, MatColoring, MatColoringApply()
External Links
- PETSc Manual:
Mat/MatColoringView
PETSc.LibPETSc.MatFDColoringApply — Method
MatFDColoringApply(petsclib::PetscLibType,J::PetscMat, coloring::MatFDColoring, x1::PetscVec, sctx::Cvoid)Given a matrix for which a MatFDColoring context has been created, computes the Jacobian for a function via finite differences.
Collective
Input Parameters:
J- matrix to store Jacobian entries intocoloring- coloring context created withMatFDColoringCreate()x1- location at which Jacobian is to be computedsctx- context required by function, if this is being used with theSNESsolver then it isSNESobject, otherwise it isNULL
Options Database Keys:
-mat_fd_type- "wp" or "ds" (seeMATMFFD_WPorMATMFFD_DS)-mat_fd_coloring_view- Activates basic viewing or coloring-mat_fd_coloring_view draw- Activates drawing of coloring-mat_fd_coloring_view ::ascii_info- Activates viewing of coloring info
Level: intermediate
-seealso: Mat, MatFDColoring, MatFDColoringCreate(), MatFDColoringDestroy(), MatFDColoringView(), MatFDColoringSetFunction(), MatFDColoringSetValues()
External Links
- PETSc Manual:
Mat/MatFDColoringApply
PETSc.LibPETSc.MatFDColoringCreate — Method
color::MatFDColoring = MatFDColoringCreate(petsclib::PetscLibType,mat::PetscMat, iscoloring::ISColoring)Creates a matrix coloring context for finite difference computation of Jacobians.
Collective
Input Parameters:
mat- the matrix containing the nonzero structure of the Jacobianiscoloring- the coloring of the matrix; usually obtained withMatColoringCreate()orDMCreateColoring()
Output Parameter:
color- the new coloring context
Level: intermediate
-seealso: Mat, MatFDColoring, MatFDColoringDestroy(), SNESComputeJacobianDefaultColor(), ISColoringCreate(), MatFDColoringSetFunction(), MatFDColoringSetFromOptions(), MatFDColoringApply(), MatFDColoringView(), MatFDColoringSetParameters(), MatColoringCreate(), DMCreateColoring(), MatFDColoringSetValues()
External Links
- PETSc Manual:
Mat/MatFDColoringCreate
PETSc.LibPETSc.MatFDColoringDestroy — Method
MatFDColoringDestroy(petsclib::PetscLibType,c::MatFDColoring)Destroys a matrix coloring context that was created via MatFDColoringCreate().
Collective
Input Parameter:
c- coloring context
Level: intermediate
-seealso: Mat, MatFDColoring, MatFDColoringCreate()
External Links
- PETSc Manual:
Mat/MatFDColoringDestroy
PETSc.LibPETSc.MatFDColoringGetFunction — Method
MatFDColoringGetFunction(petsclib::PetscLibType,matfd::MatFDColoring, f::MatFDColoringFn, fctx::Cvoid)Gets the function to use for computing the Jacobian.
Not Collective
Input Parameter:
matfd- the coloring context
Output Parameters:
f- the function, seeMatFDColoringFnfor the calling sequencefctx- the optional user-defined function context
Level: intermediate
-seealso: Mat, MatFDColoring, MatFDColoringCreate(), MatFDColoringSetFunction(), MatFDColoringSetFromOptions(), MatFDColoringFn
External Links
- PETSc Manual:
Mat/MatFDColoringGetFunction
PETSc.LibPETSc.MatFDColoringGetPerturbedColumns — Method
n::PetscInt,cols::Vector{PetscInt} = MatFDColoringGetPerturbedColumns(petsclib::PetscLibType,coloring::MatFDColoring)Returns the indices of the columns that that are currently being perturbed.
Not Collective
Input Parameter:
coloring- coloring context created withMatFDColoringCreate()
Output Parameters:
n- the number of local columns being perturbedcols- the column indices, in global numbering
Level: advanced
-seealso: Mat, MatFDColoring, MatFDColoringCreate(), MatFDColoringDestroy(), MatFDColoringView(), MatFDColoringApply()
External Links
- PETSc Manual:
Mat/MatFDColoringGetPerturbedColumns
PETSc.LibPETSc.MatFDColoringSetBlockSize — Method
MatFDColoringSetBlockSize(petsclib::PetscLibType,matfd::MatFDColoring, brows::PetscInt, bcols::PetscInt)Sets block size for efficient inserting entries of Jacobian matrix.
Logically Collective
Input Parameters:
matfd- the coloring contextbrows- number of rows in the blockbcols- number of columns in the block
Level: intermediate
-seealso: Mat, MatFDColoring, MatFDColoringCreate(), MatFDColoringSetFromOptions()
External Links
- PETSc Manual:
Mat/MatFDColoringSetBlockSize
PETSc.LibPETSc.MatFDColoringSetF — Method
MatFDColoringSetF(petsclib::PetscLibType,fd::MatFDColoring, F::PetscVec)External Links
- PETSc Manual:
Mat/MatFDColoringSetF
PETSc.LibPETSc.MatFDColoringSetFromOptions — Method
MatFDColoringSetFromOptions(petsclib::PetscLibType,matfd::MatFDColoring)Sets coloring finite difference parameters from the options database.
Collective
The Jacobian, F'(u), is estimated with the differencing approximation -seealso: Mat, MatFDColoring, MatFDColoringCreate(), MatFDColoringView(), MatFDColoringSetParameters()
External Links
- PETSc Manual:
Mat/MatFDColoringSetFromOptions
PETSc.LibPETSc.MatFDColoringSetFunction — Method
MatFDColoringSetFunction(petsclib::PetscLibType,matfd::MatFDColoring, f::MatFDColoringFn, fctx::Cvoid)Sets the function to use for computing the Jacobian.
Logically Collective
Input Parameters:
matfd- the coloring contextf- the function, seeMatFDColoringFnfor the calling sequencefctx- the optional user-defined function context
Level: advanced
-seealso: Mat, MatFDColoring, MatFDColoringCreate(), MatFDColoringGetFunction(), MatFDColoringSetFromOptions(), MatFDColoringFn
External Links
- PETSc Manual:
Mat/MatFDColoringSetFunction
PETSc.LibPETSc.MatFDColoringSetParameters — Method
MatFDColoringSetParameters(petsclib::PetscLibType,matfd::MatFDColoring, error::PetscReal, umin::PetscReal)Sets the parameters for the approximation of a sparse Jacobian matrix using finite differences and matrix coloring
Logically Collective
Input Parameters:
matfd- the coloring contexterror- relative errorumin- minimum allowable u-value magnitude
Level: advanced
-seealso: Mat, MatFDColoring, MatFDColoringCreate(), MatFDColoringSetFromOptions()
External Links
- PETSc Manual:
Mat/MatFDColoringSetParameters
PETSc.LibPETSc.MatFDColoringSetType — Method
MatFDColoringSetType(petsclib::PetscLibType,matfd::MatFDColoring, type::MatMFFDType)Sets the approach for computing the finite difference parameter
Collective
Input Parameters:
matfd- the coloring contexttype- eitherMATMFFD_WPorMATMFFD_DS
Options Database Key:
-mat_fd_type- "wp" or "ds"
Level: intermediate
-seealso: Mat, MatFDColoring, MatFDColoringCreate(), MatFDColoringView(), MatFDColoringSetParameters()
External Links
- PETSc Manual:
Mat/MatFDColoringSetType
PETSc.LibPETSc.MatFDColoringSetUp — Method
MatFDColoringSetUp(petsclib::PetscLibType,mat::PetscMat, iscoloring::ISColoring, color::MatFDColoring)Sets up the internal data structures of matrix coloring context for the later use.
Collective
Input Parameters:
mat- the matrix containing the nonzero structure of the Jacobianiscoloring- the coloring of the matrix; usually obtained withMatGetColoring()orDMCreateColoring()color- the matrix coloring context
Level: beginner
-seealso: Mat, MatFDColoring, MatFDColoringCreate(), MatFDColoringDestroy()
External Links
- PETSc Manual:
Mat/MatFDColoringSetUp
PETSc.LibPETSc.MatFDColoringSetValues — Method
MatFDColoringSetValues(petsclib::PetscLibType,J::PetscMat, coloring::MatFDColoring, y::Vector{PetscScalar})takes a matrix in compressed color format and enters the matrix into a PETSc Mat
Collective
Input Parameters:
J- the sparse matrixcoloring- created withMatFDColoringCreate()and a local coloringy- column major storage of matrix values with one color of values per column, the number of rows ofyshould match
the number of local rows of J and the number of columns is the number of colors.
Level: intermediate
-seealso: , Mat, MatFDColoringCreate(), ISColoring, ISColoringCreate(), ISColoringSetType(), IS_COLORING_LOCAL, MatFDColoringSetBlockSize()
External Links
- PETSc Manual:
Mat/MatFDColoringSetValues
PETSc.LibPETSc.MatFDColoringUseDM — Method
MatFDColoringUseDM(petsclib::PetscLibType,coloring::PetscMat, fdcoloring::MatFDColoring)allows a MatFDColoring object to use the DM associated with the matrix to compute a IS_COLORING_LOCAL coloring
Input Parameters:
coloring- The matrix to get theDMfromfdcoloring- theMatFDColoringobject
Level: advanced
Developer Note: This routine exists because the PETSc Mat library does not know about the DM objects
See also:
DM, MatFDColoring, MatFDColoringCreate(), ISColoringType
External Links
- PETSc Manual:
Dm/MatFDColoringUseDM
PETSc.LibPETSc.MatFDColoringView — Method
MatFDColoringView(petsclib::PetscLibType,c::MatFDColoring, viewer::PetscViewer)Views a finite difference coloring context.
Collective
Input Parameters:
c- the coloring contextviewer- visualization context
Level: intermediate
-seealso: Mat, MatFDColoring, MatFDColoringCreate()
External Links
- PETSc Manual:
Mat/MatFDColoringView
PETSc.LibPETSc.MatMFFDCheckPositivity — Method
MatMFFDCheckPositivity(petsclib::PetscLibType,dummy::Cvoid, U::PetscVec, a::PetscVec, h::PetscScalar)Checks that all entries in U + h*a are positive or zero, decreases h until this is satisfied for a MATMFFD matrix
Logically Collective
Input Parameters:
dummy- context variable (unused)U- base vector that is added toa- vector that is addedh- scaling factor ona, may be changed on output
Options Database Keys:
-mat_mffd_check_positivity <bool>- Ensure that U + h*a is nonnegative
Level: advanced
-seealso: , Mat, MATMFFD, MatMFFDSetCheckh()
External Links
- PETSc Manual:
Mat/MatMFFDCheckPositivity
PETSc.LibPETSc.MatMFFDComputeJacobian — Method
MatMFFDComputeJacobian(petsclib::PetscLibType,snes::PetscSNES, x::PetscVec, jac::PetscMat, B::PetscMat, dummy::Cvoid)Tells the matrix Jacobian matrix-vector products will be computed at, i.e. J(x) * a. The x is obtained from the SNES object (using SNESGetSolution()).
Collective
Input Parameters:
snes- the nonlinear solver contextx- the point at which the Jacobian-vector products will be performedjac- the matrix-free Jacobian object ofMatTypeMATMFFD, likely obtained withMatCreateSNESMF()B- either the same asjacor another matrix type (ignored)dummy- the user context (ignored)
Options Database Key:
-snes_mf- use the matrix created withMatSNESMFCreate()to setup the Jacobian for each new solution in the Newton process
Level: developer
-seealso: , MatMFFDGetH(), MatCreateSNESMF(), MatMFFDSetBase(), MatCreateMFFD(), MATMFFD, MatMFFDSetHHistory(), MatMFFDSetFunctionError(), SNESSetJacobian()
External Links
- PETSc Manual:
Snes/MatMFFDComputeJacobian
PETSc.LibPETSc.MatMFFDDSSetUmin — Method
MatMFFDDSSetUmin(petsclib::PetscLibType,A::PetscMat, umin::PetscReal)Sets the "umin" parameter used by the PETSc routine for computing the differencing parameter, h, which is used for matrix-free Jacobian-vector products for a MATMFFD matrix.
Input Parameters:
A- theMATMFFDmatrixumin- the parameter
Level: advanced
-seealso: MATMFFD, MatMFFDSetFunctionError(), MatCreateSNESMF()
External Links
- PETSc Manual:
Mat/MatMFFDDSSetUmin
PETSc.LibPETSc.MatMFFDFinalizePackage — Method
MatMFFDFinalizePackage(petsclib::PetscLibType)This function destroys everything in the MATMFFDpackage. It is called fromPetscFinalize()`.
Level: developer
-seealso: , Mat, MATMFFD, PetscFinalize(), MatCreateMFFD(), MatCreateSNESMF()
External Links
- PETSc Manual:
Mat/MatMFFDFinalizePackage
PETSc.LibPETSc.MatMFFDGetH — Method
h::PetscScalar = MatMFFDGetH(petsclib::PetscLibType,mat::PetscMat)Gets the last value that was used as the differencing for a MATMFFD matrix parameter.
Not Collective
Input Parameters:
mat- theMATMFFDmatrix
Output Parameter:
h- the differencing step size
Level: advanced
-seealso: , Mat, MATMFFD, MatCreateSNESMF(), MatMFFDSetHHistory(), MatCreateMFFD(), MatMFFDResetHHistory()
External Links
- PETSc Manual:
Mat/MatMFFDGetH
PETSc.LibPETSc.MatMFFDInitializePackage — Method
MatMFFDInitializePackage(petsclib::PetscLibType)This function initializes everything in the MATMFFDpackage. It is called fromMatInitializePackage()`.
Level: developer
-seealso: , Mat, MATMFFD, PetscInitialize()
External Links
- PETSc Manual:
Mat/MatMFFDInitializePackage
PETSc.LibPETSc.MatMFFDRegister — Method
MatMFFDRegister(petsclib::PetscLibType,sname::String, fnc::external)Adds a method to the MATMFFD registry.
Not Collective, No Fortran Support
Input Parameters:
sname- name of a new user-defined compute-h modulefunction- routine to create method context
Level: developer
-seealso: , Mat, MATMFFD, MatMFFDRegisterAll(), MatMFFDRegisterDestroy()
External Links
- PETSc Manual:
Mat/MatMFFDRegister
PETSc.LibPETSc.MatMFFDResetHHistory — Method
MatMFFDResetHHistory(petsclib::PetscLibType,J::PetscMat)Resets the counter to zero to begin collecting a new set of differencing histories for the MATMFFD matrix
Logically Collective
Input Parameter:
J- the matrix-free matrix context
Level: advanced
-seealso: , Mat, MATMFFD, MatMFFDGetH(), MatCreateSNESMF(), MatMFFDSetHHistory(), MatMFFDSetFunctionError()
External Links
- PETSc Manual:
Mat/MatMFFDResetHHistory
PETSc.LibPETSc.MatMFFDSetBase — Method
MatMFFDSetBase(petsclib::PetscLibType,J::PetscMat, U::PetscVec, F::PetscVec)Sets the vector U at which matrix vector products of the Jacobian are computed for the MATMFFD matrix
Logically Collective
Input Parameters:
J- theMATMFFDmatrixU- the vectorF- (optional) vector that contains F(u) if it has been already computed
Level: advanced
-seealso: , Mat, MATMFFD, MatMult()
External Links
- PETSc Manual:
Mat/MatMFFDSetBase
PETSc.LibPETSc.MatMFFDSetCheckh — Method
MatMFFDSetCheckh(petsclib::PetscLibType,J::PetscMat, fun::MatMFFDCheckhFn, ctx::Cvoid)Sets a function that checks the computed h and adjusts it to satisfy some criteria for the MATMFFD matrix
Logically Collective
Input Parameters:
J- theMATMFFDmatrixfun- the function that checksh, seeMatMFFDCheckhFnctx- any context needed by the function
Options Database Keys:
-mat_mffd_check_positivity <bool>- Ensure that U + h*a is non-negative
Level: advanced
-seealso: , Mat, MATMFFD, MatMFFDCheckhFn, MatMFFDCheckPositivity()
External Links
- PETSc Manual:
Mat/MatMFFDSetCheckh
PETSc.LibPETSc.MatMFFDSetFunction — Method
MatMFFDSetFunction(petsclib::PetscLibType,mat::PetscMat, func::MatMFFDFn, funcctx::Cvoid)Sets the function used in applying the matrix
Logically Collective
Input Parameters:
mat- the matrix-free matrixMATMFFDcreated viaMatCreateSNESMF()orMatCreateMFFD()func- the function to usefuncctx- optional function context passed to function
Level: advanced
-seealso: , Mat, MATMFFD, MatMFFDFn, MatCreateSNESMF(), MatMFFDGetH(), MatCreateMFFD(), MatMFFDSetHHistory(), MatMFFDResetHHistory(), SNESSetFunction()
External Links
- PETSc Manual:
Mat/MatMFFDSetFunction
PETSc.LibPETSc.MatMFFDSetFunctionError — Method
MatMFFDSetFunctionError(petsclib::PetscLibType,mat::PetscMat, error::PetscReal)Sets the error_rel for the approximation of matrix
Logically Collective
Input Parameters:
mat- theMATMFFDmatrix-free matrixerror- relative error (should be set to the square root of the relative error in the function evaluations)
Options Database Key:
-mat_mffd_err <error_rel>- Sets error_rel
Level: advanced
-seealso: , Mat, MATMFFD, MatCreateSNESMF(), MatMFFDGetH(), MatCreateMFFD(), MatMFFDSetHHistory(), MatMFFDResetHHistory()
External Links
- PETSc Manual:
Mat/MatMFFDSetFunctionError
PETSc.LibPETSc.MatMFFDSetFunctioni — Method
MatMFFDSetFunctioni(petsclib::PetscLibType,mat::PetscMat, funci::MatMFFDiFn)Sets the function for computing a single component for a MATMFFD matrix
Logically Collective
Input Parameters:
mat- the matrix-free matrixMATMFFDfunci- the function to use
Level: advanced
-seealso: , Mat, MATMFFD, MatMFFDiFn, MatCreateSNESMF(), MatMFFDGetH(), MatMFFDSetHHistory(), MatMFFDResetHHistory(), SNESSetFunction(), MatGetDiagonal()
External Links
- PETSc Manual:
Mat/MatMFFDSetFunctioni
PETSc.LibPETSc.MatMFFDSetFunctioniBase — Method
MatMFFDSetFunctioniBase(petsclib::PetscLibType,mat::PetscMat, func::MatMFFDiBaseFn)Sets the function to compute the base vector for a single component function evaluation for a MATMFFD matrix
Logically Collective
Input Parameters:
mat- theMATMFFDmatrix-free matrixfunc- the function to use
Level: advanced
-seealso: , Mat, MATMFFD, MatCreateSNESMF(), MatMFFDGetH(), MatCreateMFFD(), MatMFFDSetHHistory(), MatMFFDResetHHistory(), SNESSetFunction(), MatGetDiagonal()
External Links
- PETSc Manual:
Mat/MatMFFDSetFunctioniBase
PETSc.LibPETSc.MatMFFDSetHHistory — Method
MatMFFDSetHHistory(petsclib::PetscLibType,J::PetscMat, history::Vector{PetscScalar}, nhistory::PetscInt)Sets an array to collect a history of the differencing values (h) computed for the matrix-free product MATMFFD matrix
Logically Collective
Input Parameters:
J- theMATMFFDmatrix-free matrixhistory- space to hold the historynhistory- number of entries in history, if more entries are generated than
nhistory, then the later ones are discarded
Level: advanced
-seealso: , Mat, MATMFFD, MatMFFDGetH(), MatCreateSNESMF(), MatMFFDResetHHistory(), MatMFFDSetFunctionError()
External Links
- PETSc Manual:
Mat/MatMFFDSetHHistory
PETSc.LibPETSc.MatMFFDSetOptionsPrefix — Method
MatMFFDSetOptionsPrefix(petsclib::PetscLibType,mat::PetscMat, prefix::String)Sets the prefix used for searching for all MATMFFD` options in the database.
Collective
Input Parameters:
mat- theMATMFFDcontextprefix- the prefix to prepend to all option names
-seealso: , Mat, MATMFFD, MatSetFromOptions(), MatCreateSNESMF(), MatCreateMFFD()
External Links
- PETSc Manual:
Mat/MatMFFDSetOptionsPrefix
PETSc.LibPETSc.MatMFFDSetPeriod — Method
MatMFFDSetPeriod(petsclib::PetscLibType,mat::PetscMat, period::PetscInt)Sets how often the step
Logically Collective
Input Parameters:
mat- theMATMFFDmatrix-free matrixperiod- 1 for every time, 2 for every second etc
Options Database Key:
-mat_mffd_period <period>- Sets how oftenhis recomputed
Level: advanced
-seealso: , Mat, MATMFFD, MatCreateSNESMF(), MatMFFDGetH(), MatMFFDSetHHistory(), MatMFFDResetHHistory()
External Links
- PETSc Manual:
Mat/MatMFFDSetPeriod
PETSc.LibPETSc.MatMFFDSetType — Method
MatMFFDSetType(petsclib::PetscLibType,mat::PetscMat, ftype::MatMFFDType)Sets the method that is used to compute the differencing parameter for finite difference matrix-free formulations.
Input Parameters:
mat- the "matrix-free" matrix created viaMatCreateSNESMF(), orMatCreateMFFD()
or MatSetType(mat,MATMFFD);
ftype- the type requested, eitherMATMFFD_WPorMATMFFD_DS
Level: advanced
-seealso: , Mat, MATMFFD, MATMFFD_WP, MATMFFD_DS, MatCreateSNESMF(), MatMFFDRegister(), MatMFFDSetFunction(), MatCreateMFFD()
External Links
- PETSc Manual:
Mat/MatMFFDSetType
PETSc.LibPETSc.MatMFFDWPSetComputeNormU — Method
MatMFFDWPSetComputeNormU(petsclib::PetscLibType,A::PetscMat, flag::PetscBool)Sets whether it computes the ||U|| used by the Walker PETSc routine for computing h. With any Krylov solver this need only be computed during the first iteration and kept for later.
Input Parameters:
A- theMATMFFDmatrixflag-PETSC_TRUEcauses it to compute ||U||,PETSC_FALSEuses the previous value
Options Database Key:
-mat_mffd_compute_normu <true,false>- true by default, false can save calculations but you
must be sure that ||U|| has not changed in the mean time.
Level: advanced
-seealso: MATMFFD_WP, MATMFFD, MatMFFDSetFunctionError(), MatCreateSNESMF()
External Links
- PETSc Manual:
Mat/MatMFFDWPSetComputeNormU
PETSc.LibPETSc.MatNullSpaceCreate — Method
SP::MatNullSpace = MatNullSpaceCreate(petsclib::PetscLibType,comm::MPI_Comm, has_cnst::PetscBool, n::PetscInt, vecs::Vector{PetscVec})Creates a MatNullSpace data structure used to project vectors out of null spaces.
Collective
Input Parameters:
comm- the MPI communicator associated with the objecthas_cnst-PETSC_TRUEif the null space contains the constant vector; otherwisePETSC_FALSEn- number of vectors (excluding constant vector) in null spacevecs- the vectors that span the null space (excluding the constant vector);
these vectors must be orthonormal. These vectors are NOT copied, so do not change them after this call. You should free the array that you pass in and destroy the vectors (this will reduce the reference count for them by one).
Output Parameter:
SP- the null space context
Level: advanced
-seealso: , Mat, MatNullSpace, MatNullSpaceDestroy(), MatNullSpaceRemove(), MatSetNullSpace(), MatNullSpaceSetFunction()
External Links
- PETSc Manual:
Mat/MatNullSpaceCreate
PETSc.LibPETSc.MatNullSpaceCreateRigidBody — Method
sp::MatNullSpace = MatNullSpaceCreateRigidBody(petsclib::PetscLibType,coords::PetscVec)create rigid body modes from coordinates
Collective
Input Parameter:
coords- block of coordinates of each node, must have block size set
Output Parameter:
sp- the null space
Level: advanced
-seealso: , Mat, MatNullSpace, MatNullSpaceCreate(), MatSetNearNullSpace(), MatSetNullSpace(), PCGAMG
External Links
- PETSc Manual:
Mat/MatNullSpaceCreateRigidBody
PETSc.LibPETSc.MatNullSpaceDestroy — Method
MatNullSpaceDestroy(petsclib::PetscLibType,sp::MatNullSpace)Destroys a data structure used to project vectors out of null spaces.
Collective
Input Parameter:
sp- the null space context to be destroyed
Level: advanced
-seealso: , Mat, MatNullSpace, MatNullSpaceCreate(), MatNullSpaceRemove(), MatNullSpaceSetFunction()
External Links
- PETSc Manual:
Mat/MatNullSpaceDestroy
PETSc.LibPETSc.MatNullSpaceGetVecs — Method
has_const::PetscBool,n::PetscInt = MatNullSpaceGetVecs(petsclib::PetscLibType,sp::MatNullSpace, vecs::Vector{PetscVec})get the vectors defining the null space
Not Collective
Input Parameter:
sp- null space object
Output Parameters:
has_const-PETSC_TRUEif the null space contains the constant vector, otherwisePETSC_FALSEn- number of vectors (excluding constant vector) in the null spacevecs- returns array of lengthncontaining the orthonormal vectors that span the null space (excluding the constant vector),NULLifnis 0
Level: developer
-seealso: , Mat, MatNullSpace, MatNullSpaceCreate(), MatGetNullSpace(), MatGetNearNullSpace()
External Links
- PETSc Manual:
Mat/MatNullSpaceGetVecs
PETSc.LibPETSc.MatNullSpaceRemove — Method
MatNullSpaceRemove(petsclib::PetscLibType,sp::MatNullSpace, vec::PetscVec)Removes all the components of a null space from a vector.
Collective
Input Parameters:
sp- the null space context (if this isNULLthen no null space is removed)vec- the vector from which the null space is to be removed
Level: advanced
-seealso: , Mat, MatNullSpace, MatNullSpaceCreate(), MatNullSpaceDestroy(), MatNullSpaceSetFunction()
External Links
- PETSc Manual:
Mat/MatNullSpaceRemove
PETSc.LibPETSc.MatNullSpaceSetFunction — Method
MatNullSpaceSetFunction(petsclib::PetscLibType,sp::MatNullSpace, rem::MatNullSpaceRemoveFn, ctx::Cvoid)set a function that removes a null space from a vector out of null spaces.
Logically Collective
Input Parameters:
sp- theMatNullSpacenull space objectrem- the function that removes the null spacectx- context for the remove function
Level: advanced
-seealso: , Mat, MatNullSpace, MatNullSpaceDestroy(), MatNullSpaceRemove(), MatSetNullSpace(), MatNullSpaceCreate(), MatNullSpaceRemoveFn
External Links
- PETSc Manual:
Mat/MatNullSpaceSetFunction
PETSc.LibPETSc.MatNullSpaceTest — Method
isNull::PetscBool = MatNullSpaceTest(petsclib::PetscLibType,sp::MatNullSpace, mat::PetscMat)Tests if the claimed null space is really a null space of a matrix
Collective
Input Parameters:
sp- the null space contextmat- the matrix
Output Parameter:
isNull-PETSC_TRUEif the nullspace is valid for this matrix
Level: advanced
-seealso: , Mat, MatNullSpace, MatNullSpaceCreate(), MatNullSpaceDestroy(), MatNullSpaceSetFunction()
External Links
- PETSc Manual:
Mat/MatNullSpaceTest
PETSc.LibPETSc.MatNullSpaceView — Method
MatNullSpaceView(petsclib::PetscLibType,sp::MatNullSpace, viewer::PetscViewer)Visualizes a null space object.
Collective
Input Parameters:
sp- the null spaceviewer- visualization context
Level: advanced
-seealso: , Mat, MatNullSpace, PetscViewer, MatNullSpaceCreate(), PetscViewerASCIIOpen()
External Links
- PETSc Manual:
Mat/MatNullSpaceView
PETSc.LibPETSc.MatPartitioningApply — Method
MatPartitioningApply(petsclib::PetscLibType,matp::MatPartitioning, partitioning::IS)Gets a partitioning for the graph represented by a sparse matrix.
Collective
Input Parameter:
matp- the matrix partitioning object
Output Parameter:
partitioning- the partitioning. For each local node this tells the MPI rank that that node is assigned to.
Options Database Keys:
-mat_partitioning_type <type>- set the partitioning package or algorithm to use-mat_partitioning_view- display information about the partitioning object
Level: beginner
The user can define additional partitionings; see MatPartitioningRegister().
-seealso: , Mat, MatPartitioning, MatPartitioningType, MatPartitioningRegister(), MatPartitioningCreate(), MatPartitioningDestroy(), MatPartitioningSetAdjacency(), ISPartitioningToNumbering(), ISPartitioningCount()
External Links
- PETSc Manual:
Mat/MatPartitioningApply
PETSc.LibPETSc.MatPartitioningApplyND — Method
MatPartitioningApplyND(petsclib::PetscLibType,matp::MatPartitioning, partitioning::IS)Gets a nested dissection partitioning for a matrix.
Collective
Input Parameter:
matp- the matrix partitioning object
Output Parameter:
partitioning- the partitioning. For each local node, a positive value indicates the processor
number the node has been assigned to. Negative x values indicate the separator level -(x+1).
Level: intermediate
-seealso: , Mat, MatPartitioningRegister(), MatPartitioningCreate(), MatPartitioningDestroy(), MatPartitioningSetAdjacency(), ISPartitioningToNumbering(), ISPartitioningCount()
External Links
- PETSc Manual:
Mat/MatPartitioningApplyND
PETSc.LibPETSc.MatPartitioningChacoGetEigenNumber — Method
num::PetscInt = MatPartitioningChacoGetEigenNumber(petsclib::PetscLibType,part::MatPartitioning)Gets the number of eigenvectors used by Chaco.
Not Collective
Input Parameter:
part- the partitioning context
Output Parameter:
num- number of eigenvectors
Level: advanced
-seealso: MatPartitioningType, MatPartitioning, MATPARTITIONINGCHACO, MatPartitioningChacoSetEigenNumber()
External Links
- PETSc Manual:
Mat/MatPartitioningChacoGetEigenNumber
PETSc.LibPETSc.MatPartitioningChacoGetEigenSolver — Method
MatPartitioningChacoGetEigenSolver(petsclib::PetscLibType,part::MatPartitioning, method::MPChacoEigenType)Get the eigensolver used by the Chaco partitioner.
Not Collective
Input Parameter:
part- the partitioning context
Output Parameter:
method- the method
Level: advanced
-seealso: MatPartitioningType, MatPartitioning, MATPARTITIONINGCHACO, MatPartitioningChacoSetEigenSolver()
External Links
- PETSc Manual:
Mat/MatPartitioningChacoGetEigenSolver
PETSc.LibPETSc.MatPartitioningChacoGetEigenTol — Method
tol::PetscReal = MatPartitioningChacoGetEigenTol(petsclib::PetscLibType,part::MatPartitioning)Gets the eigensolver tolerance used by Chaco
Not Collective
Input Parameter:
part- the partitioning context
Output Parameter:
tol- the tolerance
Level: advanced
-seealso: MatPartitioningType, MatPartitioning, MATPARTITIONINGCHACO, MatPartitioningChacoSetEigenTol()
External Links
- PETSc Manual:
Mat/MatPartitioningChacoGetEigenTol
PETSc.LibPETSc.MatPartitioningChacoGetGlobal — Method
MatPartitioningChacoGetGlobal(petsclib::PetscLibType,part::MatPartitioning, method::MPChacoGlobalType)Get the global method used by the Chaco partitioner.
Not Collective
Input Parameter:
part- the partitioning context
Output Parameter:
method- the method
Level: advanced
-seealso: MatPartitioningType, MATPARTITIONINGCHACO, MatPartitioningChacoSetGlobal()
External Links
- PETSc Manual:
Mat/MatPartitioningChacoGetGlobal
PETSc.LibPETSc.MatPartitioningChacoGetLocal — Method
MatPartitioningChacoGetLocal(petsclib::PetscLibType,part::MatPartitioning, method::MPChacoLocalType)Get local method used by the Chaco partitioner.
Not Collective
Input Parameter:
part- the partitioning context
Output Parameter:
method- the method
Level: advanced
-seealso: MatPartitioningType, MATPARTITIONINGCHACO, MatPartitioningChacoSetLocal()
External Links
- PETSc Manual:
Mat/MatPartitioningChacoGetLocal
PETSc.LibPETSc.MatPartitioningChacoSetCoarseLevel — Method
MatPartitioningChacoSetCoarseLevel(petsclib::PetscLibType,part::MatPartitioning, level::PetscReal)Set the coarse level parameter for the Chaco partitioner.
Collective
Input Parameters:
part- the partitioning contextlevel- the coarse level in range [0.0,1.0]
Options Database Key:
-mat_partitioning_chaco_coarse <l>- Coarse level
Level: advanced
-seealso: MatPartitioningType, MatPartitioning, MATPARTITIONINGCHACO
External Links
- PETSc Manual:
Mat/MatPartitioningChacoSetCoarseLevel
PETSc.LibPETSc.MatPartitioningChacoSetEigenNumber — Method
MatPartitioningChacoSetEigenNumber(petsclib::PetscLibType,part::MatPartitioning, num::PetscInt)Sets the number of eigenvectors to compute by Chaco during partitioning during partitioning.
Collective
Input Parameters:
part- the partitioning contextnum- the number of eigenvectors
Options Database Key:
-mat_partitioning_chaco_eigen_number <n>- Number of eigenvectors
-seealso: MatPartitioningType, MatPartitioning, MATPARTITIONINGCHACO, MatPartitioningChacoSetEigenSolver(), MatPartitioningChacoGetEigenTol()
External Links
- PETSc Manual:
Mat/MatPartitioningChacoSetEigenNumber
PETSc.LibPETSc.MatPartitioningChacoSetEigenSolver — Method
MatPartitioningChacoSetEigenSolver(petsclib::PetscLibType,part::MatPartitioning, method::MPChacoEigenType)Set the eigensolver method for Chaco partitioner.
Collective
Input Parameters:
part- the partitioning contextmethod- one ofMP_CHACO_LANCZOSorMP_CHACO_RQI
Options Database Key:
-mat_partitioning_chaco_eigen_solver <method>- the eigensolver
Level: advanced
-seealso: MatPartitioningType, MatPartitioning, MATPARTITIONINGCHACO, MatPartitioningChacoSetEigenTol(), MatPartitioningChacoSetEigenNumber(), MatPartitioningChacoGetEigenSolver()
External Links
- PETSc Manual:
Mat/MatPartitioningChacoSetEigenSolver
PETSc.LibPETSc.MatPartitioningChacoSetEigenTol — Method
MatPartitioningChacoSetEigenTol(petsclib::PetscLibType,part::MatPartitioning, tol::PetscReal)Sets the tolerance for the eigensolver used by Chaco
Collective
Input Parameters:
part- the partitioning contexttol- the tolerance
Options Database Key:
-mat_partitioning_chaco_eigen_tol <tol>- Tolerance for eigensolver
-seealso: MatPartitioningType, MatPartitioning, MATPARTITIONINGCHACO, MatPartitioningChacoSetEigenSolver(), MatPartitioningChacoGetEigenTol()
External Links
- PETSc Manual:
Mat/MatPartitioningChacoSetEigenTol
PETSc.LibPETSc.MatPartitioningChacoSetGlobal — Method
MatPartitioningChacoSetGlobal(petsclib::PetscLibType,part::MatPartitioning, method::MPChacoGlobalType)Set the global method for Chaco partitioner.
Collective
Input Parameters:
part- the partitioning contextmethod- one ofMP_CHACO_MULTILEVEL,MP_CHACO_SPECTRAL,MP_CHACO_LINEAR,
MP_CHACO_RANDOM or MP_CHACO_SCATTERED
Options Database Key:
-mat_partitioning_chaco_global <method>- the global method
Level: advanced
-seealso: MatPartitioning, MatPartioningSetType(), MatPartitioningType, MATPARTITIONINGCHACO, MatPartitioningChacoSetLocal(), MatPartitioningChacoGetGlobal()
External Links
- PETSc Manual:
Mat/MatPartitioningChacoSetGlobal
PETSc.LibPETSc.MatPartitioningChacoSetLocal — Method
MatPartitioningChacoSetLocal(petsclib::PetscLibType,part::MatPartitioning, method::MPChacoLocalType)Set the local method for the Chaco partitioner.
Collective
Input Parameters:
part- the partitioning contextmethod- one ofMP_CHACO_KERNIGHANorMP_CHACO_NONE
Options Database Key:
-mat_partitioning_chaco_local <method>- the local method
Level: advanced
-seealso: MatPartitioningType, MATPARTITIONINGCHACO, MatPartitioningChacoSetGlobal(), MatPartitioningChacoGetLocal()
External Links
- PETSc Manual:
Mat/MatPartitioningChacoSetLocal
PETSc.LibPETSc.MatPartitioningCreate — Method
newp::MatPartitioning = MatPartitioningCreate(petsclib::PetscLibType,comm::MPI_Comm)Creates a partitioning context.
Collective
Input Parameter:
comm- MPI communicator
Output Parameter:
newp- location to put the context
Level: beginner
-seealso: , Mat, MatPartitioning, MatPartitioningSetType(), MatPartitioningApply(), MatPartitioningDestroy(), MatPartitioningSetAdjacency()
External Links
- PETSc Manual:
Mat/MatPartitioningCreate
PETSc.LibPETSc.MatPartitioningDestroy — Method
MatPartitioningDestroy(petsclib::PetscLibType,part::MatPartitioning)Destroys the partitioning context.
Collective
Input Parameter:
part- the partitioning context
Level: beginner
-seealso: , Mat, MatPartitioning, MatPartitioningType, MatPartitioningCreate()
External Links
- PETSc Manual:
Mat/MatPartitioningDestroy
PETSc.LibPETSc.MatPartitioningGetType — Method
type::MatPartitioningType = MatPartitioningGetType(petsclib::PetscLibType,partitioning::MatPartitioning)Gets the Partitioning method type and name (as a string) from the partitioning context.
Not Collective
Input Parameter:
partitioning- the partitioning context
Output Parameter:
type- partitioner type
Level: intermediate
-seealso: , Mat, MatPartitioning, MatPartitioningType, MatPartitioningCreate(), MatPartitioningRegisterDestroy(), MatPartitioningRegisterAll()
External Links
- PETSc Manual:
Mat/MatPartitioningGetType
PETSc.LibPETSc.MatPartitioningGetUseEdgeWeights — Method
use_edge_weights::PetscBool = MatPartitioningGetUseEdgeWeights(petsclib::PetscLibType,part::MatPartitioning)Get a flag that indicates whether or not to edge weights are used.
Logically Collective
Input Parameter:
part- the partitioning context
Output Parameter:
use_edge_weights- the flag indicateing whether or not to edge weights are used.
Level: beginner
-seealso: , Mat, MatPartitioning, MatPartitioningCreate(), MatPartitioningSetType(), MatPartitioningSetVertexWeights(), MatPartitioningSetPartitionWeights(), MatPartitioningSetUseEdgeWeights
External Links
- PETSc Manual:
Mat/MatPartitioningGetUseEdgeWeights
PETSc.LibPETSc.MatPartitioningHierarchicalGetCoarseparts — Method
MatPartitioningHierarchicalGetCoarseparts(petsclib::PetscLibType,part::MatPartitioning, coarseparts::IS)External Links
- PETSc Manual:
Mat/MatPartitioningHierarchicalGetCoarseparts
PETSc.LibPETSc.MatPartitioningHierarchicalGetFineparts — Method
MatPartitioningHierarchicalGetFineparts(petsclib::PetscLibType,part::MatPartitioning, fineparts::IS)External Links
- PETSc Manual:
Mat/MatPartitioningHierarchicalGetFineparts
PETSc.LibPETSc.MatPartitioningHierarchicalSetNcoarseparts — Method
MatPartitioningHierarchicalSetNcoarseparts(petsclib::PetscLibType,part::MatPartitioning, ncoarseparts::PetscInt)External Links
- PETSc Manual:
Mat/MatPartitioningHierarchicalSetNcoarseparts
PETSc.LibPETSc.MatPartitioningHierarchicalSetNfineparts — Method
MatPartitioningHierarchicalSetNfineparts(petsclib::PetscLibType,part::MatPartitioning, nfineparts::PetscInt)External Links
- PETSc Manual:
Mat/MatPartitioningHierarchicalSetNfineparts
PETSc.LibPETSc.MatPartitioningImprove — Method
MatPartitioningImprove(petsclib::PetscLibType,matp::MatPartitioning, partitioning::IS)Improves the quality of a given partition.
Collective
Input Parameters:
matp- the matrix partitioning objectpartitioning- the original partitioning. For each local node this tells the processor
number that that node is assigned to.
Options Database Key:
-mat_partitioning_improve- improve the quality of the given partition
Level: beginner
-seealso: , Mat, MatPartitioning, MatPartitioningType, MatPartitioningApply(), MatPartitioningCreate(), MatPartitioningDestroy(), MatPartitioningSetAdjacency(), ISPartitioningToNumbering(), ISPartitioningCount()
External Links
- PETSc Manual:
Mat/MatPartitioningImprove
PETSc.LibPETSc.MatPartitioningPTScotchGetImbalance — Method
imb::PetscReal = MatPartitioningPTScotchGetImbalance(petsclib::PetscLibType,part::MatPartitioning)Gets the value of the load imbalance ratio used during strategy selection.
Not Collective
Input Parameter:
part- the partitioning context
Output Parameter:
imb- the load imbalance ratio
Level: advanced
-seealso: MATPARTITIONINGSCOTCH, MatPartitioningPTScotchSetImbalance()
External Links
- PETSc Manual:
Mat/MatPartitioningPTScotchGetImbalance
PETSc.LibPETSc.MatPartitioningPTScotchGetStrategy — Method
MatPartitioningPTScotchGetStrategy(petsclib::PetscLibType,part::MatPartitioning, strategy::MPPTScotchStrategyType)Gets the strategy used in PTScotch.
Not Collective
Input Parameter:
part- the partitioning context
Output Parameter:
strategy- the strategy
Level: advanced
-seealso: MATPARTITIONINGSCOTCH, MatPartitioningPTScotchSetStrategy()
External Links
- PETSc Manual:
Mat/MatPartitioningPTScotchGetStrategy
PETSc.LibPETSc.MatPartitioningPTScotchSetImbalance — Method
MatPartitioningPTScotchSetImbalance(petsclib::PetscLibType,part::MatPartitioning, imb::PetscReal)Sets the value of the load imbalance ratio to be used during strategy selection.
Collective
Input Parameters:
part- the partitioning contextimb- the load imbalance ratio
Options Database Key:
-mat_partitioning_ptscotch_imbalance <imb>- set load imbalance ratio
-seealso: MATPARTITIONINGSCOTCH, MatPartitioningPTScotchSetStrategy(), MatPartitioningPTScotchGetImbalance()
External Links
- PETSc Manual:
Mat/MatPartitioningPTScotchSetImbalance
PETSc.LibPETSc.MatPartitioningPTScotchSetStrategy — Method
MatPartitioningPTScotchSetStrategy(petsclib::PetscLibType,part::MatPartitioning, strategy::MPPTScotchStrategyType)Sets the strategy to be used in PTScotch.
Collective
Input Parameters:
part- the partitioning contextstrategy- the strategy, one of
-seealso: MATPARTITIONINGSCOTCH, MatPartitioningPTScotchSetImbalance(), MatPartitioningPTScotchGetStrategy()
External Links
- PETSc Manual:
Mat/MatPartitioningPTScotchSetStrategy
PETSc.LibPETSc.MatPartitioningParmetisGetEdgeCut — Method
cut::PetscInt = MatPartitioningParmetisGetEdgeCut(petsclib::PetscLibType,part::MatPartitioning)Returns the number of edge cuts in the vertex partition.
Input Parameter:
part- the partitioning context
Output Parameter:
cut- the edge cut
Level: advanced
-seealso: MATPARTITIONINGPARMETIS
External Links
- PETSc Manual:
Mat/MatPartitioningParmetisGetEdgeCut
PETSc.LibPETSc.MatPartitioningParmetisSetCoarseSequential — Method
MatPartitioningParmetisSetCoarseSequential(petsclib::PetscLibType,part::MatPartitioning)Use the sequential code to do the partitioning of the coarse grid.
Logically Collective
Input Parameter:
part- the partitioning context
Level: advanced
-seealso: MATPARTITIONINGPARMETIS
External Links
- PETSc Manual:
Mat/MatPartitioningParmetisSetCoarseSequential
PETSc.LibPETSc.MatPartitioningParmetisSetRepartition — Method
MatPartitioningParmetisSetRepartition(petsclib::PetscLibType,part::MatPartitioning)Repartition current mesh to rebalance computation.
Logically Collective
Input Parameter:
part- the partitioning context
Level: advanced
-seealso: MATPARTITIONINGPARMETIS
External Links
- PETSc Manual:
Mat/MatPartitioningParmetisSetRepartition
PETSc.LibPETSc.MatPartitioningPartySetBipart — Method
MatPartitioningPartySetBipart(petsclib::PetscLibType,part::MatPartitioning, bp::PetscBool)Activate or deactivate recursive bisection in the Party partitioner
Collective
Input Parameters:
part- the partitioning contextbp- boolean flag
Options Database Key:
-mat_partitioning_party_bipart- Bipartitioning option on/off
Level: advanced
-seealso: MATPARTITIONINGPARTY
External Links
- PETSc Manual:
Mat/MatPartitioningPartySetBipart
PETSc.LibPETSc.MatPartitioningPartySetCoarseLevel — Method
MatPartitioningPartySetCoarseLevel(petsclib::PetscLibType,part::MatPartitioning, level::PetscReal)Set the coarse level parameter for the Party partitioner.
Collective
Input Parameters:
part- the partitioning contextlevel- the coarse level in range [0.0,1.0]
Options Database Key:
-mat_partitioning_party_coarse <l>- Coarse level
Level: advanced
-seealso: MATPARTITIONINGPARTY
External Links
- PETSc Manual:
Mat/MatPartitioningPartySetCoarseLevel
PETSc.LibPETSc.MatPartitioningPartySetGlobal — Method
MatPartitioningPartySetGlobal(petsclib::PetscLibType,part::MatPartitioning, glob::String)Set global method for Party partitioner.
Collective
Input Parameters:
part- the partitioning contextglobal- a string representing the method
Options Database Key:
-mat_partitioning_party_global <method>- the global method
Level: advanced
-seealso: MATPARTITIONINGPARTY, MatPartitioningPartySetLocal()
External Links
- PETSc Manual:
Mat/MatPartitioningPartySetGlobal
PETSc.LibPETSc.MatPartitioningPartySetLocal — Method
MatPartitioningPartySetLocal(petsclib::PetscLibType,part::MatPartitioning, loc::String)Set local method used by the Party partitioner.
Collective
Input Parameters:
part- the partitioning contextlocal- a string representing the method
Options Database Key:
-mat_partitioning_party_local <method>- the local method
Level: advanced
-seealso: MATPARTITIONINGPARTY, MatPartitioningPartySetGlobal()
External Links
- PETSc Manual:
Mat/MatPartitioningPartySetLocal
PETSc.LibPETSc.MatPartitioningPartySetMatchOptimization — Method
MatPartitioningPartySetMatchOptimization(petsclib::PetscLibType,part::MatPartitioning, opt::PetscBool)Activate matching optimization for graph reduction.
Collective
Input Parameters:
part- the partitioning contextopt- boolean flag
Options Database Key:
-mat_partitioning_party_match_optimization- Matching optimization on/off
Level: advanced
-seealso: MATPARTITIONINGPARTY
External Links
- PETSc Manual:
Mat/MatPartitioningPartySetMatchOptimization
PETSc.LibPETSc.MatPartitioningRegister — Method
MatPartitioningRegister(petsclib::PetscLibType,sname::String, fnc::external)Adds a new sparse matrix partitioning to the matrix package.
Not Collective, No Fortran Support
Input Parameters:
sname- name of partitioning (for exampleMATPARTITIONINGCURRENT) orMATPARTITIONINGPARMETISfunction- function pointer that creates the partitioning type
Level: developer
-seealso: , Mat, MatPartitioning, MatPartitioningType, MatPartitioningCreate(), MatPartitioningRegisterDestroy(), MatPartitioningRegisterAll()
External Links
- PETSc Manual:
Mat/MatPartitioningRegister
PETSc.LibPETSc.MatPartitioningSetAdjacency — Method
MatPartitioningSetAdjacency(petsclib::PetscLibType,part::MatPartitioning, adj::PetscMat)Sets the adjacency graph (matrix) of the thing to be partitioned.
Collective
Input Parameters:
part- the partitioning contextadj- the adjacency matrix, this can be anyMatTypebut the natural representation isMATMPIADJ
Level: beginner
-seealso: , Mat, MatPartitioning, MatPartitioningType, MatPartitioningCreate()
External Links
- PETSc Manual:
Mat/MatPartitioningSetAdjacency
PETSc.LibPETSc.MatPartitioningSetFromOptions — Method
MatPartitioningSetFromOptions(petsclib::PetscLibType,part::MatPartitioning)Sets various partitioning options from the options database for the partitioning object
Collective
Input Parameter:
part- the partitioning context.
Options Database Keys:
-mat_partitioning_type <type>- (for instance, parmetis), use -help for a list of available methods-mat_partitioning_nparts- number of subgraphs
Level: beginner
-seealso: , Mat, MatPartitioning
External Links
- PETSc Manual:
Mat/MatPartitioningSetFromOptions
PETSc.LibPETSc.MatPartitioningSetNParts — Method
MatPartitioningSetNParts(petsclib::PetscLibType,part::MatPartitioning, n::PetscInt)Set how many partitions need to be created; by default this is one per processor. Certain partitioning schemes may in fact only support that option.
Collective
Input Parameters:
part- the partitioning contextn- the number of partitions
Level: intermediate
-seealso: , Mat, MatPartitioning, MatPartitioningCreate(), MatPartitioningApply()
External Links
- PETSc Manual:
Mat/MatPartitioningSetNParts
PETSc.LibPETSc.MatPartitioningSetNumberVertexWeights — Method
MatPartitioningSetNumberVertexWeights(petsclib::PetscLibType,partitioning::MatPartitioning, ncon::PetscInt)Sets the number of weights per vertex
Not Collective
Input Parameters:
partitioning- the partitioning contextncon- the number of weights
Level: intermediate
-seealso: , Mat, MatPartitioning, MatPartitioningSetVertexWeights()
External Links
- PETSc Manual:
Mat/MatPartitioningSetNumberVertexWeights
PETSc.LibPETSc.MatPartitioningSetPartitionWeights — Method
MatPartitioningSetPartitionWeights(petsclib::PetscLibType,part::MatPartitioning, weights::Vector{PetscReal})Sets the weights for each partition.
Logically Collective
Input Parameters:
part- the partitioning contextweights- An array of size nparts that is used to specify the fraction of
vertex weight that should be distributed to each sub-domain for the balance constraint. If all of the sub-domains are to be of the same size, then each of the nparts elements should be set to a value of 1/nparts. Note that the sum of all of the weights should be one.
Level: beginner
-seealso: , Mat, MatPartitioning, MatPartitioningSetVertexWeights(), MatPartitioningCreate(), MatPartitioningSetType()
External Links
- PETSc Manual:
Mat/MatPartitioningSetPartitionWeights
PETSc.LibPETSc.MatPartitioningSetType — Method
MatPartitioningSetType(petsclib::PetscLibType,part::MatPartitioning, type::MatPartitioningType)Sets the type of partitioner to use
Collective
Input Parameters:
part- the partitioning context.type- a known method
Options Database Key:
-mat_partitioning_type <type>- (for instance, parmetis), use -help for a list of available methods or seeMatPartitioningType
Level: intermediate
-seealso: , Mat, MatPartitioning, MatPartitioningCreate(), MatPartitioningApply(), MatPartitioningType
External Links
- PETSc Manual:
Mat/MatPartitioningSetType
PETSc.LibPETSc.MatPartitioningSetUseEdgeWeights — Method
MatPartitioningSetUseEdgeWeights(petsclib::PetscLibType,part::MatPartitioning, use_edge_weights::PetscBool)Set a flag to indicate whether or not to use edge weights.
Logically Collective
Input Parameters:
part- the partitioning contextuse_edge_weights- the flag indicateing whether or not to use edge weights. By default no edge weights will be used,
that is, useedgeweights is set to FALSE. If set useedgeweights to TRUE, users need to make sure legal edge weights are stored in an ADJ matrix.
Options Database Key:
-mat_partitioning_use_edge_weights- (true or false)
Level: beginner
-seealso: , Mat, MatPartitioning, MatPartitioningCreate(), MatPartitioningSetType(), MatPartitioningSetVertexWeights(), MatPartitioningSetPartitionWeights()
External Links
- PETSc Manual:
Mat/MatPartitioningSetUseEdgeWeights
PETSc.LibPETSc.MatPartitioningSetVertexWeights — Method
MatPartitioningSetVertexWeights(petsclib::PetscLibType,part::MatPartitioning, weights::Vector{PetscInt})Sets the weights for vertices for a partitioning.
Logically Collective
Input Parameters:
part- the partitioning contextweights- the weights, on each process this array must have the same size as the number of local rows times the value passed withMatPartitioningSetNumberVertexWeights()or
1 if that is not provided
Level: beginner
-seealso: , Mat, MatPartitioning, MatPartitioningCreate(), MatPartitioningSetType(), MatPartitioningSetPartitionWeights(), MatPartitioningSetNumberVertexWeights()
External Links
- PETSc Manual:
Mat/MatPartitioningSetVertexWeights
PETSc.LibPETSc.MatPartitioningView — Method
MatPartitioningView(petsclib::PetscLibType,part::MatPartitioning, viewer::PetscViewer)Prints the partitioning data structure.
Collective
Input Parameters:
part- the partitioning contextviewer- optional visualization context
Level: intermediate
-seealso: , Mat, MatPartitioning, PetscViewer, PetscViewerASCIIOpen()
External Links
- PETSc Manual:
Mat/MatPartitioningView
PETSc.LibPETSc.MatPartitioningViewFromOptions — Method
MatPartitioningViewFromOptions(petsclib::PetscLibType,A::MatPartitioning, obj::PetscObject, name::String)View a partitioning context from the options database
Collective
Input Parameters:
A- the partitioning contextobj- Optional object that provides the prefix used in the options database checkname- command line option
Options Database Key:
-mat_partitioning_view [viewertype]:...- the viewer and its options
Level: intermediate
-seealso: , Mat, MatPartitioning, MatPartitioningView(), PetscObjectViewFromOptions(), MatPartitioningCreate()
External Links
- PETSc Manual:
Mat/MatPartitioningViewFromOptions
PETSc.LibPETSc.MatPartitioningViewImbalance — Method
MatPartitioningViewImbalance(petsclib::PetscLibType,matp::MatPartitioning, partitioning::IS)Display partitioning imbalance information.
Collective
Input Parameters:
matp- the matrix partitioning objectpartitioning- the partitioning. For each local node this tells the MPI rank that that node is assigned to.
Options Database Key:
-mat_partitioning_view_balance- view the balance information from the last partitioning
Level: beginner
-seealso: , Mat, MatPartitioning, MatPartitioningType, MatPartitioningApply(), MatPartitioningView()
External Links
- PETSc Manual:
Mat/MatPartitioningViewImbalance
PETSc.LibPETSc.MatTransposeColoringCreate — Method
color::MatTransposeColoring = MatTransposeColoringCreate(petsclib::PetscLibType,mat::PetscMat, iscoloring::ISColoring)Creates a matrix coloring context for the matrix product C = A*B^T.
Collective
Input Parameters:
mat- the matrix product Ciscoloring- the coloring of the matrix; usually obtained withMatColoringCreate()orDMCreateColoring()
Output Parameter:
color- the new coloring context
Level: intermediate
-seealso: , Mat, MatTransposeColoringDestroy(), MatTransColoringApplySpToDen(), MatTransColoringApplyDenToSp()
External Links
- PETSc Manual:
Mat/MatTransposeColoringCreate
PETSc.LibPETSc.MatTransposeColoringDestroy — Method
MatTransposeColoringDestroy(petsclib::PetscLibType,c::MatTransposeColoring)Destroys a coloring context for matrix product C = A*B^T that was created via MatTransposeColoringCreate().
Collective
Input Parameter:
c- coloring context
Level: intermediate
-seealso: , Mat, MatTransposeColoringCreate()
External Links
- PETSc Manual:
Mat/MatTransposeColoringDestroy