Fast Auxiliary Space Preconditioning 2.7.7 Aug/28/2022
Loading...
Searching...
No Matches
ItrSmootherBSR.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, 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...
 

Variables

REAL ilu_solve_time = 0.0
 

Detailed Description

Smoothers for dBSRmat matrices.

Note
This file contains Level-2 (Itr) functions. It requires: AuxArray.c, AuxMemory.c, AuxMessage.c, AuxThreads.c, AuxTiming.c, BlaSmallMatInv.c, BlaSmallMat.c, BlaArray.c, BlaSpmvBSR.c, and PreBSR.c

Copyright (C) 2009–Present by the FASP team. All rights reserved.

Released under the terms of the GNU Lesser General Public License 3.0 or later.

// TODO: Need to optimize routines here! –Chensong

Definition in file ItrSmootherBSR.c.

Function Documentation

◆ fasp_smoother_dbsr_gs()

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 410 of file ItrSmootherBSR.c.

◆ fasp_smoother_dbsr_gs1()

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 520 of file ItrSmootherBSR.c.

◆ fasp_smoother_dbsr_gs_ascend()

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 552 of file ItrSmootherBSR.c.

◆ fasp_smoother_dbsr_gs_ascend1()

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 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 619 of file ItrSmootherBSR.c.

◆ fasp_smoother_dbsr_gs_descend()

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 683 of file ItrSmootherBSR.c.

◆ fasp_smoother_dbsr_gs_descend1()

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 751 of file ItrSmootherBSR.c.

◆ fasp_smoother_dbsr_gs_order1()

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 816 of file ItrSmootherBSR.c.

◆ fasp_smoother_dbsr_gs_order2()

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 888 of file ItrSmootherBSR.c.

◆ fasp_smoother_dbsr_ilu()

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, Zheng Li
Date
2010/10/25

NOTE: Add multi-threads parallel ILU block by Zheng Li 12/04/2016.

form residual zr = b - A x

solve LU z=zr

x=x+z

Definition at line 1479 of file ItrSmootherBSR.c.

◆ fasp_smoother_dbsr_jacobi()

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 59 of file ItrSmootherBSR.c.

◆ fasp_smoother_dbsr_jacobi1()

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 263 of file ItrSmootherBSR.c.

◆ fasp_smoother_dbsr_jacobi_setup()

void fasp_smoother_dbsr_jacobi_setup ( dBSRmat A,
REAL diaginv 
)

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

Parameters
APointer to dBSRmat: the coefficient matrix
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 163 of file ItrSmootherBSR.c.

◆ fasp_smoother_dbsr_sor()

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 959 of file ItrSmootherBSR.c.

◆ fasp_smoother_dbsr_sor1()

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 1075 of file ItrSmootherBSR.c.

◆ fasp_smoother_dbsr_sor_ascend()

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 1115 of file ItrSmootherBSR.c.

◆ fasp_smoother_dbsr_sor_descend()

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 1234 of file ItrSmootherBSR.c.

◆ fasp_smoother_dbsr_sor_order()

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 1358 of file ItrSmootherBSR.c.

Variable Documentation

◆ ilu_solve_time

REAL ilu_solve_time = 0.0

ILU time for the SOLVE phase

Definition at line 39 of file ItrSmootherBSR.c.