Fast Auxiliary Space Preconditioning  1.8.4 Feb/15/2016
smoother_bsr.c File Reference

Smoothers for dBSRmat matrices. More...

#include <math.h>
#include "fasp.h"
#include "fasp_functs.h"

Go to the source code of this file.

Functions

void fasp_smoother_dbsr_jacobi (dBSRmat *A, dvector *b, dvector *u)
 Jacobi relaxation. More...
 
void fasp_smoother_dbsr_jacobi_setup (dBSRmat *A, dvector *b, dvector *u, REAL *diaginv)
 Setup for jacobi relaxation, fetch the diagonal sub-block matrixes and make them inverse first. More...
 
void fasp_smoother_dbsr_jacobi1 (dBSRmat *A, dvector *b, dvector *u, REAL *diaginv)
 Jacobi relaxation. More...
 
void fasp_smoother_dbsr_gs (dBSRmat *A, dvector *b, dvector *u, INT order, INT *mark)
 Gauss-Seidel relaxation. More...
 
void fasp_smoother_dbsr_gs1 (dBSRmat *A, dvector *b, dvector *u, INT order, INT *mark, REAL *diaginv)
 Gauss-Seidel relaxation. More...
 
void fasp_smoother_dbsr_gs_ascend (dBSRmat *A, dvector *b, dvector *u, REAL *diaginv)
 Gauss-Seidel relaxation in the ascending order. More...
 
void fasp_smoother_dbsr_gs_ascend1 (dBSRmat *A, dvector *b, dvector *u)
 Gauss-Seidel relaxation in the ascending order. More...
 
void fasp_smoother_dbsr_gs_descend (dBSRmat *A, dvector *b, dvector *u, REAL *diaginv)
 Gauss-Seidel relaxation in the descending order. More...
 
void fasp_smoother_dbsr_gs_descend1 (dBSRmat *A, dvector *b, dvector *u)
 Gauss-Seidel relaxation in the descending order. More...
 
void fasp_smoother_dbsr_gs_order1 (dBSRmat *A, dvector *b, dvector *u, REAL *diaginv, INT *mark)
 Gauss-Seidel relaxation in the user-defined order. More...
 
void fasp_smoother_dbsr_gs_order2 (dBSRmat *A, dvector *b, dvector *u, INT *mark, REAL *work)
 Gauss-Seidel relaxation in the user-defined order. More...
 
void fasp_smoother_dbsr_sor (dBSRmat *A, dvector *b, dvector *u, INT order, INT *mark, REAL weight)
 SOR relaxation. More...
 
void fasp_smoother_dbsr_sor1 (dBSRmat *A, dvector *b, dvector *u, INT order, INT *mark, REAL *diaginv, REAL weight)
 SOR relaxation. More...
 
void fasp_smoother_dbsr_sor_ascend (dBSRmat *A, dvector *b, dvector *u, REAL *diaginv, REAL weight)
 SOR relaxation in the ascending order. More...
 
void fasp_smoother_dbsr_sor_descend (dBSRmat *A, dvector *b, dvector *u, REAL *diaginv, REAL weight)
 SOR relaxation in the descending order. More...
 
void fasp_smoother_dbsr_sor_order (dBSRmat *A, dvector *b, dvector *u, REAL *diaginv, INT *mark, REAL weight)
 SOR relaxation in the user-defined order. More...
 
void fasp_smoother_dbsr_ilu (dBSRmat *A, dvector *b, dvector *x, void *data)
 ILU method as the smoother in solving Au=b with multigrid method. More...
 

Detailed Description

Smoothers for dBSRmat matrices.

Definition in file smoother_bsr.c.

Function Documentation

void fasp_smoother_dbsr_gs ( dBSRmat A,
dvector b,
dvector u,
INT  order,
INT mark 
)

Gauss-Seidel relaxation.

Parameters
APointer to dBSRmat: the coefficient matrix
bPointer to dvector: the right hand side
uPointer to dvector: the unknowns (IN: initial, OUT: approximation)
orderFlag to indicate the order for smoothing If mark = NULL ASCEND 12: in ascending order DESCEND 21: in descending order If mark != NULL: in the user-defined order
markPointer to NULL or to the user-defined ordering
Author
Zhiyang Zhou
Date
2010/10/25

Modified by Chunsheng Feng, Zheng Li on 08/03/2012

Definition at line 411 of file smoother_bsr.c.

void fasp_smoother_dbsr_gs1 ( dBSRmat A,
dvector b,
dvector u,
INT  order,
INT mark,
REAL diaginv 
)

Gauss-Seidel relaxation.

Parameters
APointer to dBSRmat: the coefficient matrix
bPointer to dvector: the right hand side
uPointer to dvector: the unknowns (IN: initial, OUT: approximation)
orderFlag to indicate the order for smoothing If mark = NULL ASCEND 12: in ascending order DESCEND 21: in descending order If mark != NULL: in the user-defined order
markPointer to NULL or to the user-defined ordering
diaginvInverses for all the diagonal blocks of A
Author
Zhiyang Zhou
Date
2010/10/25

Definition at line 531 of file smoother_bsr.c.

void fasp_smoother_dbsr_gs_ascend ( dBSRmat A,
dvector b,
dvector u,
REAL diaginv 
)

Gauss-Seidel relaxation in the ascending order.

Parameters
APointer to dBSRmat: the coefficient matrix
bPointer to dvector: the right hand side
uPointer to dvector: the unknowns (IN: initial guess, OUT: approximation)
diaginvInverses for all the diagonal blocks of A
Author
Zhiyang Zhou
Date
2010/10/25

Definition at line 568 of file smoother_bsr.c.

void fasp_smoother_dbsr_gs_ascend1 ( dBSRmat A,
dvector b,
dvector u 
)

Gauss-Seidel relaxation in the ascending order.

Parameters
APointer to dBSRmat: the coefficient matrix
bPointer to dvector: the right hand side
uPointer to dvector: the unknowns (IN: initial guess, OUT: approximation)
Author
Xiaozhe
Date
01/01/2014
Note
The only difference between the functions 'fasp_smoother_dbsr_gs_ascend1' and 'fasp_smoother_dbsr_gs_ascend' is that we don't have to multiply by the inverses of the diagonal blocks in each ROW since matrix A has been such scaled that all the diagonal blocks become identity matrices.

Definition at line 641 of file smoother_bsr.c.

void fasp_smoother_dbsr_gs_descend ( dBSRmat A,
dvector b,
dvector u,
REAL diaginv 
)

Gauss-Seidel relaxation in the descending order.

Parameters
APointer to dBSRmat: the coefficient matrix
bPointer to dvector: the right hand side
uPointer to dvector: the unknowns (IN: initial guess, OUT: approximation)
diaginvInverses for all the diagonal blocks of A
Author
Zhiyang Zhou
Date
2010/10/25

Definition at line 712 of file smoother_bsr.c.

void fasp_smoother_dbsr_gs_descend1 ( dBSRmat A,
dvector b,
dvector u 
)

Gauss-Seidel relaxation in the descending order.

Parameters
APointer to dBSRmat: the coefficient matrix
bPointer to dvector: the right hand side
uPointer to dvector: the unknowns (IN: initial guess, OUT: approximation)
Author
Xiaozhe Hu
Date
01/01/2014
Note
The only difference between the functions 'fasp_smoother_dbsr_gs_ascend1' and 'fasp_smoother_dbsr_gs_ascend' is that we don't have to multiply by the inverses of the diagonal blocks in each ROW since matrix A has been such scaled that all the diagonal blocks become identity matrices.

Definition at line 786 of file smoother_bsr.c.

void fasp_smoother_dbsr_gs_order1 ( dBSRmat A,
dvector b,
dvector u,
REAL diaginv,
INT mark 
)

Gauss-Seidel relaxation in the user-defined order.

Parameters
APointer to dBSRmat: the coefficient matrix
bPointer to dvector: the right hand side
uPointer to dvector: the unknowns (IN: initial guess, OUT: approximation)
diaginvInverses for all the diagonal blocks of A
markPointer to the user-defined ordering
Author
Zhiyang Zhou
Date
2010/10/25

Definition at line 858 of file smoother_bsr.c.

void fasp_smoother_dbsr_gs_order2 ( dBSRmat A,
dvector b,
dvector u,
INT mark,
REAL work 
)

Gauss-Seidel relaxation in the user-defined order.

Parameters
APointer to dBSRmat: the coefficient matrix
bPointer to dvector: the right hand side
uPointer to dvector: the unknowns (IN: initial guess, OUT: approximation)
markPointer to the user-defined ordering
workWork temp array
Author
Zhiyang Zhou
Date
2010/11/08
Note
The only difference between the functions 'fasp_smoother_dbsr_gs_order2' and 'fasp_smoother_dbsr_gs_order1' lies in that we don't have to multiply by the inverses of the diagonal blocks in each ROW since matrix A has been such scaled that all the diagonal blocks become identity matrices.

Definition at line 936 of file smoother_bsr.c.

void fasp_smoother_dbsr_ilu ( dBSRmat A,
dvector b,
dvector x,
void *  data 
)

ILU method as the smoother in solving Au=b with multigrid method.

Parameters
APointer to dBSRmat: the coefficient matrix
bPointer to dvector: the right hand side
xPointer to dvector: the unknowns (IN: initial, OUT: approximation)
dataPointer to user defined data
Author
Zhiyang Zhou
Date
2010/10/25 Adjust the work space of ilu smoother by Zheng Li 04/26/2015.

form residual zr = b - A x

solve LU z=zr

x=x+z

Definition at line 1566 of file smoother_bsr.c.

void fasp_smoother_dbsr_jacobi ( dBSRmat A,
dvector b,
dvector u 
)

Jacobi relaxation.

Parameters
APointer to dBSRmat: the coefficient matrix
bPointer to dvector: the right hand side
uPointer to dvector: the unknowns (IN: initial, OUT: approximation)
Author
Zhiyang Zhou
Date
2010/10/25

Modified by Chunsheng Feng, Zheng Li on 08/02/2012

Definition at line 33 of file smoother_bsr.c.

void fasp_smoother_dbsr_jacobi1 ( dBSRmat A,
dvector b,
dvector u,
REAL diaginv 
)

Jacobi relaxation.

Parameters
APointer to dBSRmat: the coefficient matrix
bPointer to dvector: the right hand side
uPointer to dvector: the unknowns (IN: initial, OUT: approximation)
diaginvInverses for all the diagonal blocks of A
Author
Zhiyang Zhou
Date
2010/10/25

Modified by Chunsheng Feng, Zheng Li on 08/03/2012

Definition at line 257 of file smoother_bsr.c.

void fasp_smoother_dbsr_jacobi_setup ( dBSRmat A,
dvector b,
dvector u,
REAL diaginv 
)

Setup for jacobi relaxation, fetch the diagonal sub-block matrixes and make them inverse first.

Parameters
APointer to dBSRmat: the coefficient matrix
bPointer to dvector: the right hand side
uPointer to dvector: the unknowns (IN: initial, OUT: approximation)
diaginvInverse of the diagonal entries
Author
Zhiyang Zhou
Date
10/25/2010

Modified by Chunsheng Feng, Zheng Li on 08/02/2012

Definition at line 148 of file smoother_bsr.c.

void fasp_smoother_dbsr_sor ( dBSRmat A,
dvector b,
dvector u,
INT  order,
INT mark,
REAL  weight 
)

SOR relaxation.

Parameters
APointer to dBSRmat: the coefficient matrix
bPointer to dvector: the right hand side
uPointer to dvector: the unknowns (IN: initial guess, OUT: approximation)
orderFlag to indicate the order for smoothing If mark = NULL ASCEND 12: in ascending order DESCEND 21: in descending order If mark != NULL: in the user-defined order
markPointer to NULL or to the user-defined ordering
weightOver-relaxation weight
Author
Zhiyang Zhou
Date
2010/10/25

Modified by Chunsheng Feng, Zheng Li on 08/03/2012

Definition at line 1013 of file smoother_bsr.c.

void fasp_smoother_dbsr_sor1 ( dBSRmat A,
dvector b,
dvector u,
INT  order,
INT mark,
REAL diaginv,
REAL  weight 
)

SOR relaxation.

Parameters
APointer to dBSRmat: the coefficient matrix
bPointer to dvector: the right hand side
uPointer to dvector: the unknowns (IN: initial guess, OUT: approximation)
orderFlag to indicate the order for smoothing If mark = NULL ASCEND 12: in ascending order DESCEND 21: in descending order If mark != NULL: in the user-defined order
markPointer to NULL or to the user-defined ordering
diaginvInverses for all the diagonal blocks of A
weightOver-relaxation weight
Author
Zhiyang Zhou
Date
2010/10/25

Definition at line 1135 of file smoother_bsr.c.

void fasp_smoother_dbsr_sor_ascend ( dBSRmat A,
dvector b,
dvector u,
REAL diaginv,
REAL  weight 
)

SOR relaxation in the ascending order.

Parameters
APointer to dBSRmat: the coefficient matrix
bPointer to dvector: the right hand side
uPointer to dvector: the unknowns (IN: initial guess, OUT: approximation)
diaginvInverses for all the diagonal blocks of A
weightOver-relaxation weight
Author
Zhiyang Zhou
Date
2010/10/25

Modified by Chunsheng Feng, Zheng Li on 2012/09/04

Definition at line 1176 of file smoother_bsr.c.

void fasp_smoother_dbsr_sor_descend ( dBSRmat A,
dvector b,
dvector u,
REAL diaginv,
REAL  weight 
)

SOR relaxation in the descending order.

Parameters
APointer to dBSRmat: the coefficient matrix
bPointer to dvector: the right hand side
uPointer to dvector: the unknowns (IN: initial guess, OUT: approximation)
diaginvInverses for all the diagonal blocks of A
weightOver-relaxation weight
Author
Zhiyang Zhou
Date
2010/10/25

Modified by Chunsheng Feng, Zheng Li on 2012/09/04

Definition at line 1305 of file smoother_bsr.c.

void fasp_smoother_dbsr_sor_order ( dBSRmat A,
dvector b,
dvector u,
REAL diaginv,
INT mark,
REAL  weight 
)

SOR relaxation in the user-defined order.

Parameters
APointer to dBSRmat: the coefficient matrix
bPointer to dvector: the right hand side
uPointer to dvector: the unknowns (IN: initial, OUT: approximation)
diaginvInverses for all the diagonal blocks of A
markPointer to the user-defined ordering
weightOver-relaxation weight
Author
Zhiyang Zhou
Date
2010/10/25

Modified by Chunsheng Feng, Zheng Li on 2012/09/04

Definition at line 1436 of file smoother_bsr.c.