SLESSetOperators
Sets the matrix associated with the linear system and a (possibly) different one associated with the preconditioner.
Synopsis
int SLESSetOperators(SLES sles,Mat Amat,Mat Pmat,MatStructure flag)
Collective on SLES and
Mat
Input Parameters
sles | - the sles context
|
Amat | - the matrix associated with the linear system
|
Pmat | - matrix to be used in constructing preconditioner, usually the same
as Amat.
|
flag | - flag indicating information about the preconditioner matrix structure
during successive linear solves. This flag is ignored the first time a
linear system is solved, and thus is irrelevant when solving just one linear
system.
|
Notes
The flag can be used to eliminate unnecessary work in the
preconditionerduring the repeated solution of linear systems of the same size.
Theavailable options
are
SAME_PRECONDITIONER -
Pmat is identical during successive linear solves.
This option is intended for folks who are using
different Amat and Pmat matrices and want to reuse the
same preconditioner matrix. For example, this option
saves work by not recomputing incomplete factorization
for ILU/ICC preconditioners.
SAME_NONZERO_PATTERN -
Pmat has the same nonzero structure during
successive linear solves.
DIFFERENT_NONZERO_PATTERN -
Pmat does not have the same nonzero structure.
Caution
If you specify SAME_NONZERO_PATTERN, PETSc believes your
assertionand does not check the structure of the matrix. If you
erroneouslyclaim that the structure is the same when it actually is not, the
newpreconditioner will not function correctly. Thus, use this
optimizationfeature carefully!
If in doubt about whether your preconditioner matrix has
changedstructure or not, use the flag DIFFERENT_NONZERO_PATTERN.
Keywords
SLES, set, operators, matrix, preconditioner, linear system
See Also
SLESSolve()
Examples
src/sles/examples/tutorials/ex6f.F
src/sles/examples/tutorials/ex11f.F
src/sles/examples/tutorials/ex1f.F
src/sles/examples/tutorials/ex2f.F
src/sles/examples/tutorials/ex14f.F
src/sles/examples/tutorials/ex13f.F
src/sles/examples/tutorials/ex15f.F
src/sles/examples/tutorials/ex10.c
src/sles/examples/tutorials/ex4.c
src/sles/examples/tutorials/ex1.c
src/sles/examples/tutorials/ex2.c
src/sles/examples/tutorials/ex3.c
src/sles/examples/tutorials/ex7.c
src/sles/examples/tutorials/ex8.c
src/sles/examples/tutorials/ex9.c
src/sles/examples/tutorials/ex11.c
src/sles/examples/tutorials/ex14.c
src/sles/examples/tutorials/ex13.c
src/sles/examples/tutorials/ex15.c
src/sles/examples/tutorials/ex16.c
src/sles/examples/tutorials/ex12.c
Examples
src/sles/examples/tutorials/ex5.c
Location: src/sles/interface/sles.c
SLES Index
Table of Contents