MatSOR#

Computes relaxation (SOR, Gauss-Seidel) sweeps.

Synopsis#

#include "petscmat.h" 
PetscErrorCode MatSOR(Mat mat, Vec b, PetscReal omega, MatSORType flag, PetscReal shift, PetscInt its, PetscInt lits, Vec x)

Neighbor-wise Collective

Input Parameters#

  • mat - the matrix

  • b - the right-hand side

  • omega - the relaxation factor

  • flag - flag indicating the type of SOR (see below)

  • shift - diagonal shift

  • its - the number of iterations

  • lits - the number of local iterations

Output Parameter#

SOR Flags#

Notes#

SOR_LOCAL_FORWARD_SWEEP, SOR_LOCAL_BACKWARD_SWEEP, and SOR_LOCAL_SYMMETRIC_SWEEP perform separate independent smoothings on each processor.

Application programmers will not generally use MatSOR() directly, but instead will employ PCSOR or PCEISENSTAT

For MATBAIJ, MATSBAIJ, and MATAIJ matrices with inodes, this does a block SOR smoothing, otherwise it does a pointwise smoothing. For MATAIJ matrices with inodes, the block sizes are determined by the inode sizes, not the block size set with MatSetBlockSize()

Vectors x and b CANNOT be the same

The flags are implemented as bitwise inclusive or operations. For example, use (SOR_ZERO_INITIAL_GUESS | SOR_SYMMETRIC_SWEEP) to specify a zero initial guess for SSOR.

Developer Note#

We should add block SOR support for MATAIJ matrices with block size set to greater than one and no inodes

See Also#

Matrices, Mat, MatMult(), KSP, PC, MatGetFactor()

Level#

developer

Location#

src/mat/interface/matrix.c

Examples#

src/tao/pde_constrained/tutorials/parabolic.c
src/tao/pde_constrained/tutorials/hyperbolic.c

Implementations#

MatSOR_MPIAIJ() in src/mat/impls/aij/mpi/mpiaij.c
MatSOR_SeqAIJ() in src/mat/impls/aij/seq/aij.c
MatSOR_SeqAIJSELL() in src/mat/impls/aij/seq/aijsell/aijsell.c
MatSOR_MPIBAIJ() in src/mat/impls/baij/mpi/mpibaij.c
MatSOR_SeqBAIJ() in src/mat/impls/baij/seq/baij.c
MatSOR_BlockMat() in src/mat/impls/blockmat/seq/blockmat.c
MatSOR_ConstantDiagonal() in src/mat/impls/cdiagonal/cdiagonal.c
MatSOR_SeqDense() in src/mat/impls/dense/seq/dense.c
MatSOR_SeqKAIJ() in src/mat/impls/kaij/kaij.c
MatSOR_MPISBAIJ() in src/mat/impls/sbaij/mpi/mpisbaij.c
MatSOR_SeqSBAIJ() in src/mat/impls/sbaij/seq/relax.h
MatSOR_MPISELL() in src/mat/impls/sell/mpi/mpisell.c
MatSOR_SeqSELL() in src/mat/impls/sell/seq/sell.c


Index of all Mat routines
Table of Contents for all manual pages
Index of all manual pages