naginterfaces.library.sparse.complex_gen_precon_bdilu¶
- naginterfaces.library.sparse.complex_gen_precon_bdilu(n, nnz, a, irow, icol, istb, indb, lfill, dtol, milu, ipivp, ipivq, pstrat=None)[source]¶
complex_gen_precon_bdilu
computes a block diagonal incomplete factorization of a complex sparse non-Hermitian matrix, represented in coordinate storage format. The diagonal blocks may be composed of arbitrary rows and the corresponding columns, and may overlap. This factorization can be used to provide a block Jacobi or additive Schwarz preconditioner, for use in combination withcomplex_gen_solve_bdilu()
orcomplex_gen_basic_solver()
.For full information please refer to the NAG Library document for f11dt
https://www.nag.com/numeric/nl/nagdoc_29.2/flhtml/f11/f11dtf.html
- Parameters
- nint
, the order of the matrix .
- nnzint
The number of nonzero elements in the matrix .
- acomplex, array-like, shape
The nonzero elements in the matrix , ordered by increasing row index, and by increasing column index within each row. Multiple entries for the same row and column indices are not permitted. The function
complex_gen_sort()
may be used to order the elements in this way.- irowint, array-like, shape
The row indices of the nonzero elements supplied in .
- icolint, array-like, shape
The column indices of the nonzero elements supplied in .
- istbint, array-like, shape
, for , holds the indices in arrays , , and that, on successful exit from this function, define block . holds the sum of the number of rows in all blocks plus .
- indbint, array-like, shape
must hold the row indices appearing in each diagonal block, stored consecutively. Thus the elements to are the row indices in the th block, for .
- lfillint, array-like, shape
If its value is the maximum level of fill allowed in the decomposition of the block (see Further Comments). A negative value of indicates that will be used to control the fill in block instead.
- dtolfloat, array-like, shape
If then is used as a drop tolerance in block to control the fill-in (see Further Comments); otherwise is not referenced.
- milustr, length 1, array-like, shape
, for , indicates whether or not the factorization in block should be modified to preserve row-sums (see Further Comments for complex_gen_precon_ilu).
The factorization is modified.
The factorization is not modified.
- ipivpint, array-like, shape
If , and must specify the row and column indices of the element used as a pivot at elimination stage of the factorization of the block. Otherwise and need not be initialized.
- ipivqint, array-like, shape
If , and must specify the row and column indices of the element used as a pivot at elimination stage of the factorization of the block. Otherwise and need not be initialized.
- pstratNone or str, length 1, array-like, shape , optional
Note: if this argument is None then a default value will be used, determined as follows: .
, for , specifies the pivoting strategy to be adopted in the block as follows:
No pivoting is carried out.
Pivoting is carried out according to the user-defined input values of and .
Partial pivoting by columns for stability is carried out.
Complete pivoting by rows for sparsity, and by columns for stability, is carried out.
- Returns
- acomplex, ndarray, shape
The first entries of contain the nonzero elements of and the next entries contain the elements of the matrices , for stored consecutively. Within each block the matrix elements are ordered by increasing row index, and by increasing column index within each row.
- irowint, ndarray, shape
The row indices of the nonzero elements returned in .
- icolint, ndarray, shape
The column indices of the nonzero elements returned in .
- ipivpint, ndarray, shape
The row and column indices of the pivot elements, arranged consecutively for each block, as for . If and , the element in row and column of was used as the pivot at elimination stage .
- ipivqint, ndarray, shape
The row and column indices of the pivot elements, arranged consecutively for each block, as for . If and , the element in row and column of was used as the pivot at elimination stage .
- istrint, ndarray, shape
, gives the index in the arrays , and of row of the matrix , for , for .
contains .
- idiagint, ndarray, shape
, gives the index in the arrays , and of the diagonal element in row of the matrix , for , for .
- nnzcint
The sum total number of nonzero elements in the matrices , for .
- npivmint, ndarray, shape
If it gives the number of pivots which were modified during the factorization to ensure that exists.
If no pivot modifications were required, but a local restart occurred (see Further Comments for complex_gen_precon_ilu). The quality of the preconditioner will generally depend on the returned values of , for .
If is large, for some , the preconditioner may not be satisfactory.
In this case it may be advantageous to call
complex_gen_precon_bdilu
again with an increased value of , a reduced value of , or .
- Raises
- NagValueError
- (errno )
On entry, and .
Constraint: .
- (errno )
On entry, and .
Constraint: .
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, for , and .
Constraint: , for .
- (errno )
On entry, and .
Constraint: , for
- (errno )
On entry, , and .
Constraint: .
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, and .
Constraint: .
- (errno )
On entry, .
Constraint: , for .
- (errno )
On entry, .
Constraint: , , or for all .
- (errno )
On entry, .
Constraint: or for all .
- (errno )
On entry, and .
Constraint: , for .
- (errno )
On entry, and .
Constraint: , for .
- (errno )
On entry, element of was out of order.
- (errno )
On entry, location of was a duplicate.
- (errno )
On entry, the user-supplied value of for block lies outside its range.
- (errno )
On entry, the user-supplied value of for block was repeated.
- (errno )
On entry, the user-supplied value of for block lies outside its range.
- (errno )
On entry, the user-supplied value of for block was repeated.
- (errno )
The number of nonzero entries in the decomposition is too large.
The decomposition has been terminated before completion.
Either increase , or reduce the fill by reducing , or increasing .
- Notes
complex_gen_precon_bdilu
computes an incomplete factorization (see Meijerink and Van der Vorst (1977) and Meijerink and Van der Vorst (1981)) of the (possibly overlapping) diagonal blocks , , of a complex sparse non-Hermitian matrix . The factorization is intended primarily for use as a block Jacobi or additive Schwarz preconditioner (see Saad (1996)), with one of the iterative solverscomplex_gen_solve_bdilu()
andcomplex_gen_basic_solver()
.The diagonal blocks need not consist of consecutive rows and columns of , but may be composed of arbitrarily indexed rows, and the corresponding columns, as defined in the arguments and . Any given row or column index may appear in more than one diagonal block, resulting in overlap. Each diagonal block , , is factorized as:
where
and is lower triangular with unit diagonal elements, is diagonal, is upper triangular with unit diagonals, and are permutation matrices, and is a remainder matrix.
The amount of fill-in occurring in the factorization of block can vary from zero to complete fill, and can be controlled by specifying either the maximum level of fill , or the drop tolerance .
The parameter defines the pivoting strategy to be used in block . The options currently available are no pivoting, user-defined pivoting, partial pivoting by columns for stability, and complete pivoting by rows for sparsity and by columns for stability. The factorization may optionally be modified to preserve the row-sums of the original block matrix.
The sparse matrix is represented in coordinate storage (CS) format (see the F11 Introduction). The array stores all the nonzero elements of the matrix , while arrays and store the corresponding row and column indices respectively. Multiple nonzero elements may not be specified for the same row and column index.
The preconditioning matrices , , are returned in terms of the CS representations of the matrices
- References
Meijerink, J and Van der Vorst, H, 1977, An iterative solution method for linear systems of which the coefficient matrix is a symmetric M-matrix, Math. Comput. (31), 148–162
Meijerink, J and Van der Vorst, H, 1981, Guidelines for the usage of incomplete decompositions in solving sets of linear equations as they occur in practical problems, J. Comput. Phys. (44), 134–155
Saad, Y, 1996, Iterative Methods for Sparse Linear Systems, PWS Publishing Company, Boston, MA