6.4.3. LU Factorization

Up: Contents Next: Block Jacobi and Overlapping Additive Schwarz Preconditioners Previous: SOR and SSOR Preconditioners

The LU preconditioner provides several options. The first, given by the command

   ierr = PCLUSetUseInPlace(PC pc); 
causes the factorization to be performed in-place and hence destroys the original matrix. The options database variant of this command is -pc_lu_in_place. Another direct preconditioner option is selecting the ordering of equations with the command
   -mat_order <ordering> 
The possible orderings are
These orderings can also be set through the options database by specifying one of the following: -mat_ordering_type natural, -mat_ordering_type nd, -mat_ordering_type 1wd, -mat_ordering_type rcm, -mat_ordering_type qmd. In addition, see MatGetOrdering(), discussed in Section Matrix Factorization .

The sparse LU factorization provided in PETSc does not perform pivoting for numerical stability (since they are designed to preserve nonzero structure), thus occasionally a LU factorization will fail with a zero pivot when, in fact, the matrix is non-singular. The option -pc_lu_nonzeros_along_diagonal <tol> will often help eliminate the zero pivot, by preprocessing the the column ordering to remove small values from the diagonal. Here, tol is an optional tolerance to decide if a value is nonzero; by default it is 1.e-10.

In addition, Section Sparse Matrix Factorization provides information on preallocation of memory for anticipated fill during factorization. Such tuning can significantly enhance performance, since it eliminates the considerable overhead for dynamic memory allocation.


Up: Contents Next: Block Jacobi and Overlapping Additive Schwarz Preconditioners Previous: SOR and SSOR Preconditioners