20#include "fasp_functs.h"
26#include "PreMGUtil.inl"
27#include "PreMGSmoother.inl"
57 const REAL tol = param->
tol*1e-4;
60 dvector *b0 = &mgl[level].
b, *e0 = &mgl[level].
x;
61 dvector *b1 = &mgl[level+1].
b, *e1 = &mgl[level+1].
x;
72 printf(
"### DEBUG: [-Begin-] %s ...\n", __FUNCTION__);
73 printf(
"### DEBUG: n=%d, nnz=%d\n", mgl[0].A.row, mgl[0].
A.
nnz);
77 printf(
"AMG level %d, smoother %d.\n", level, smoother);
79 if ( level < mgl[level].num_levels-1 ) {
82 if ( level < mgl[level].ILU_levels ) {
87 0,m0-1,1,relax,ndeg,smooth_order,ordering);
107 if ( level < mgl[level].ILU_levels ) {
112 0,m0-1,-1,relax,ndeg,smooth_order,ordering);
119 switch (coarse_solver) {
124 fasp_pardiso_solve(A0, b0, e0, &mgl[level].pdata, 0);
139 fasp_umfpack_solve(A0, b0, e0, mgl[level].Numeric, 0);
153 fasp_coarse_itsolver(A0, b0, e0, tol, prtlvl);
160 printf(
"### DEBUG: [--End--] %s ...\n", __FUNCTION__);
void fasp_darray_cp(const INT n, const REAL *x, REAL *y)
Copy an array to the other y=x.
void fasp_dvec_set(INT n, dvector *x, const REAL val)
Initialize dvector x[i]=val for i=0:n-1.
void fasp_blas_dcsr_mxv(const dCSRmat *A, const REAL *x, REAL *y)
Matrix-vector multiplication y = A*x.
void fasp_blas_dcsr_aAxpy(const REAL alpha, const dCSRmat *A, const REAL *x, REAL *y)
Matrix-vector multiplication y = alpha*A*x + y.
void fasp_smoother_dcsr_ilu(dCSRmat *A, dvector *b, dvector *x, void *data)
ILU method as a smoother.
void fasp_solver_mgrecur(AMG_data *mgl, AMG_param *param, INT level)
Solve Ax=b with recursive multigrid K-cycle.
int fasp_solver_mumps_steps(dCSRmat *ptrA, dvector *b, dvector *u, Mumps_data *mumps)
Solve Ax=b by MUMPS in three steps.
int fasp_solver_superlu(dCSRmat *ptrA, dvector *b, dvector *u, const SHORT prtlvl)
Solve Au=b by SuperLU.
Main header file for the FASP project.
#define SHORT
FASP integer and floating point numbers.
dCSRmat A
pointer to the matrix at level level_num
Mumps_data mumps
data for MUMPS
dvector b
pointer to the right-hand side at level level_num
dvector x
pointer to the iterative solution at level level_num
dvector w
temporary work space
ivector cfmark
pointer to the CF marker at level level_num
ILU_data LU
ILU matrix for ILU smoother.
Parameters for AMG methods.
SHORT print_level
print level for AMG
SHORT polynomial_degree
degree of the polynomial smoother
REAL tol
stopping tolerance for AMG solver
SHORT coarse_solver
coarse solver type
REAL relaxation
relaxation parameter for Jacobi and SOR smoother
SHORT smoother
smoother type
SHORT cycle_type
type of AMG cycle
SHORT postsmooth_iter
number of postsmoothers
SHORT presmooth_iter
number of presmoothers
SHORT smooth_order
smoother order
Sparse matrix of REAL type in CSR format.
REAL * val
nonzero entries of A
INT row
row number of matrix A, m
INT nnz
number of nonzero entries
Vector with n entries of REAL type.
REAL * val
actual vector entries
INT * val
actual vector entries