19#include "fasp_functs.h"
63 REAL AMG_start = 0, AMG_end;
72 printf(
"### DEBUG: [-Begin-] %s ...\n", __FUNCTION__);
109 switch (cycle_type) {
131 printf(
"### WARNING: AMG setup failed!\n");
132 printf(
"### WARNING: Use a backup solver instead!\n");
147 printf(
"### DEBUG: [--End--] %s ...\n", __FUNCTION__);
void fasp_cputime(const char *message, const REAL cputime)
Print CPU walltime.
void fasp_gettime(REAL *time)
Get system time.
dvector fasp_dvec_create(const INT m)
Create dvector data space of REAL type.
void fasp_dvec_cp(const dvector *x, dvector *y)
Copy dvector x to dvector y.
dCSRmat fasp_dcsr_create(const INT m, const INT n, const INT nnz)
Create CSR sparse matrix data memory space.
void fasp_dcsr_cp(const dCSRmat *A, dCSRmat *B)
copy a dCSRmat to a new one B=A
void fasp_check_dCSRmat(const dCSRmat *A)
Check whether an dCSRmat matrix is supported or not.
INT fasp_solver_dcsr_spgmres(const dCSRmat *A, const dvector *b, dvector *x, precond *pc, const REAL tol, const INT MaxIt, SHORT restart, const SHORT StopType, const SHORT PrtLvl)
Preconditioned GMRES method for solving Au=b with safe-guard.
SHORT fasp_amg_setup_rs(AMG_data *mgl, AMG_param *param)
Setup phase of Ruge and Stuben's classic AMG.
SHORT fasp_amg_setup_sa(AMG_data *mgl, AMG_param *param)
Set up phase of smoothed aggregation AMG.
SHORT fasp_amg_setup_ua(AMG_data *mgl, AMG_param *param)
Set up phase of unsmoothed aggregation AMG.
AMG_data * fasp_amg_data_create(SHORT max_levels)
Create and initialize AMG_data for classical and SA AMG.
void fasp_amg_data_free(AMG_data *mgl, AMG_param *param)
Free AMG_data data memeory space.
INT fasp_amg_solve_amli(AMG_data *mgl, AMG_param *param)
AMLI – SOLVE phase.
INT fasp_amg_solve_namli(AMG_data *mgl, AMG_param *param)
Nonlinear AMLI – SOLVE phase.
INT fasp_amg_solve(AMG_data *mgl, AMG_param *param)
AMG – SOLVE phase.
INT fasp_solver_amg(dCSRmat *A, dvector *b, dvector *x, AMG_param *param)
Solve Ax = b by algebraic multigrid methods.
Main header file for the FASP project.
#define SHORT
FASP integer and floating point numbers.
#define FASP_SUCCESS
Definition of return status and error messages.
#define PRINT_NONE
Print level for all subroutines – not including DEBUG output.
dCSRmat A
pointer to the matrix at level level_num
dvector b
pointer to the right-hand side at level level_num
dvector x
pointer to the iterative solution at level level_num
Parameters for AMG methods.
SHORT print_level
print level for AMG
SHORT AMG_type
type of AMG method
REAL tol
stopping tolerance for AMG solver
SHORT cycle_type
type of AMG cycle
SHORT max_levels
max number of levels of AMG
INT maxit
max number of iterations of AMG
Sparse matrix of REAL type in CSR format.
INT col
column of matrix A, n
INT row
row number of matrix A, m
INT nnz
number of nonzero entries
Vector with n entries of REAL type.