26#include "mkl_pardiso.h"
30#ifndef __FASP_HEADER__
31#define __FASP_HEADER__
40#define FASP_VERSION 2.0
43#define MULTI_COLOR_ORDER \
47#define MULTI_COLOR_ORDER \
66#define DIAGONAL_PREF OFF
74#define LONGLONG long long
76#define LONGREAL long double
82#define MAX(a, b) (((a) > (b)) ? (a) : (b))
83#define MIN(a, b) (((a) < (b)) ? (a) : (b))
84#define ABS(a) (((a) >= 0.0) ? (a) : -(a))
89#define GT(a, b) (((a) > (b)) ? (TRUE) : (FALSE))
90#define GE(a, b) (((a) >= (b)) ? (TRUE) : (FALSE))
91#define LS(a, b) (((a) < (b)) ? (TRUE) : (FALSE))
92#define LE(a, b) (((a) <= (b)) ? (TRUE) : (FALSE))
93#define ISNAN(a) (((a) != (a)) ? (TRUE) : (FALSE))
98#define PUT_INT(A) printf("### DEBUG: %s = %d\n", #A, (A))
99#define PUT_REAL(A) printf("### DEBUG: %s = %e\n", #A, (A))
1208#define ILU_MC_OMP OFF
1217extern REAL total_linear_time;
1218extern REAL total_start_time;
1219extern REAL total_setup_time;
1220extern INT total_iter;
1221extern INT fasp_called_times;
1226extern double PreSmoother_time_zl;
1227extern double PostSmoother_time_zl;
1228extern double Krylov_time_zl;
1229extern double Coarsen_time_zl;
1230extern double AMLI_cycle_time_zl;
#define SHORT
FASP integer and floating point numbers.
Definition of FASP constants, including messages, solver types, etc.
INT near_kernel_dim
dimension of the near kernel for SAMG
dCSRmat A
pointer to the matrix at level level_num
Pardiso_data pdata
data for Intel MKL PARDISO
Mumps_data mumps
data for MUMPS
dCSRmat R
restriction operator at level level_num
dCSRmat P
prolongation operator at level level_num
INT colors
number of colors
SWZ_data Schwarz
data of Schwarz smoother
dvector b
pointer to the right-hand side at level level_num
REAL ** near_kernel_basis
basis of near kernel space for SAMG
void * Numeric
pointer to the numerical factorization from UMFPACK
INT ILU_levels
number of levels use ILU smoother
INT * ic
indices for different colors
INT SWZ_levels
number of levels use Schwarz smoother
dvector x
pointer to the iterative solution at level level_num
INT * icmap
mapping from vertex to color
SHORT max_levels
max number of levels
SHORT num_levels
number of levels in use <= max_levels
dvector w
temporary work space
ivector cfmark
pointer to the CF marker at level level_num
REAL weight
weight for smoother
ILU_data LU
ILU matrix for ILU smoother.
Parameters for AMG methods.
SHORT aggregation_norm_type
aggregation norm type
INT ILU_lfil
level of fill-in for ILUs and ILUk
INT aggressive_level
number of levels use aggressive coarsening
REAL ILU_relax
relaxation for ILUs
REAL strong_threshold
strong connection threshold for coarsening
INT SWZ_mmsize
maximal block size
INT aggressive_path
number of paths use to determine strongly coupled C points
SHORT interpolation_type
interpolation type
SHORT print_level
print level for AMG
SHORT polynomial_degree
degree of the polynomial smoother
INT SWZ_maxlvl
maximal levels
SHORT aggregation_type
aggregation type
SHORT coarsening_type
coarsening type
SHORT nl_amli_krylov_type
type of Krylov method used by Nonlinear AMLI cycle
SHORT coarse_scaling
switch of scaling of the coarse grid correction
SHORT smooth_filter
switch for filtered matrix used for smoothing the tentative prolongation
REAL * amli_coef
coefficients of the polynomial used by AMLI cycle
SHORT ILU_levels
number of levels use ILU smoother
SHORT AMG_type
type of AMG method
REAL tol
stopping tolerance for AMG solver
SHORT coarse_solver
coarse solver type
REAL strong_coupled
strong coupled threshold for aggregate
REAL theta
theta for reduction-based amg
REAL relaxation
relaxation parameter for Jacobi and SOR smoother
SHORT smoother
smoother type
SHORT cycle_type
type of AMG cycle
SHORT amli_degree
degree of the polynomial used by AMLI cycle
SHORT ILU_type
ILU type for smoothing.
INT SWZ_blksolver
type of Schwarz block solver
INT SWZ_type
type of Schwarz method
REAL quality_bound
quality threshold for pairwise aggregation
INT coarse_dof
max number of coarsest level DOF
REAL ILU_droptol
drop tolerance for ILUt
REAL tentative_smooth
relaxation parameter for smoothing the tentative prolongation
SHORT postsmooth_iter
number of postsmoothers
INT SWZ_levels
number of levels use Schwarz smoother
INT pair_number
number of pairwise matchings
SHORT max_levels
max number of levels of AMG
SHORT presmooth_iter
number of presmoothers
REAL truncation_threshold
truncation threshold
INT max_aggregation
max size of each aggregate
REAL ILU_permtol
permuted if permtol*|a(i,j)| > |a(i,i)|
REAL max_row_sum
maximal row sum parameter
INT maxit
max number of iterations of AMG
SHORT smooth_restriction
smooth the restriction for SA methods or not
SHORT smooth_order
smoother order
INT * ijlu
integer array of row pointers and column indexes, the size is nzlu
REAL * luval
nonzero entries of LU
INT col
column of matrix LU, n
INT * jlevU
mapping from row to color for upper triangle
INT nlevU
number of colors for upper triangle
INT ncolors
number of colors for multi-threading
INT nb
block size for BSR type only
INT row
row number of matrix LU, m
INT nlevL
number of colors for lower triangle
INT * ic
indices for different colors
INT * icmap
mapping from vertex to color
INT * iperm
permutation arrays for ILUtp
INT nzlu
number of nonzero entries
INT * jlevL
mapping from row to color for lower triangle
INT * uptr
temporary work space
INT * ilevL
number of vertices in each color for lower triangle
dCSRmat * A
pointer to the original coefficient matrix
INT * ilevU
number of vertices in each color for upper triangle
INT ILU_lfil
level of fill-in for ILUk
REAL ILU_relax
add the sum of dropped elements to diagonal element in proportion relax
SHORT print_level
print level
SHORT ILU_type
ILU type for decomposition.
REAL ILU_droptol
drop tolerance for ILUt
REAL ILU_permtol
permuted if permtol*|a(i,j)| > |a(i,i)|
Parameters for iterative solvers.
Data for MUMPS interface.
Data for Intel MKL PARDISO interface.
Data for Schwarz methods.
INT memt
working space size
INT maxbs
maximal block size
REAL * al
LU decomposition: the L block.
dCSRmat A
pointer to the original coefficient matrix
dvector rhsloc1
local right hand side
dvector xloc1
local solution
SWZ_param * swzparam
param for Schwarz
REAL * au
LU decomposition: the U block.
dCSRmat * blk_data
matrix for each partition
INT SWZ_type
Schwarz method type.
INT blk_solver
Schwarz block solver.
INT * jblock
column index of blocks
Mumps_data * mumps
param for MUMPS
REAL * rhsloc
temp work space ???
INT * iblock
row index of blocks
Parameters for Schwarz method.
INT SWZ_mmsize
maximal size of blocks
SHORT print_level
print leve
INT SWZ_maxlvl
maximal level for constructing the blocks
INT SWZ_blksolver
type of Schwarz block solver
SHORT SWZ_type
type for Schwarz method
Sparse matrix of REAL type in COO (IJ) format.
INT * colind
integer array of column indices, the size is nnz
INT col
column of matrix A, n
INT * rowind
integer array of row indices, the size is nnz
REAL * val
nonzero entries of A
INT row
row number of matrix A, m
INT nnz
number of nonzero entries
Sparse matrix of REAL type in CSRL format.
REAL * val
values of all the nonzero entries
INT * start
j in {start[i],...,start[i+1]-1} means nz_diff[i] nnz in index[j]-row
INT nnz
number of nonzero entries
INT * index
row index of the matrix (length-grouped): rows with same nnz are together
INT * nz_diff
nz_diff[i]: the i-th different value in 'nzrow'
INT dif
number of different values in i-th row, i=0:nrows-1
INT * ja
column indices of all the nonzeros
Sparse matrix of REAL type in CSR format.
INT col
column of matrix A, n
REAL * val
nonzero entries of A
INT row
row number of matrix A, m
INT * IA
integer array of row pointers, the size is m+1
INT nnz
number of nonzero entries
INT * JA
integer array of column indexes, the size is nnz
Structure matrix of REAL type.
INT * offsets
offsets of the off-diagonals (length is nband)
INT nx
number of grids in x direction
INT nxy
number of grids on x-y plane
INT ny
number of grids in y direction
INT nband
number of off-diag bands
REAL * diag
diagonal entries (length is ngrid*(nc^2))
INT nc
size of each block (number of components)
INT nz
number of grids in z direction
REAL ** offdiag
off-diagonal entries (dimension is nband * [(ngrid-|offsets|) * nc^2])
Dense matrix of REAL type.
REAL ** val
actual matrix entries
Vector with n entries of REAL type.
REAL * val
actual vector entries
Sparse matrix of INT type in COO (IJ) format.
INT * I
integer array of row indices, the size is nnz
INT * J
integer array of column indices, the size is nnz
INT col
column of matrix A, n
INT row
row number of matrix A, m
INT nnz
number of nonzero entries
INT * val
nonzero entries of A
Sparse matrix of INT type in CSR format.
INT col
column of matrix A, n
INT row
row number of matrix A, m
INT * IA
integer array of row pointers, the size is m+1
INT nnz
number of nonzero entries
INT * JA
integer array of column indexes, the size is nnz
INT * val
nonzero entries of A
Dense matrix of INT type.
INT ** val
actual matrix entries
Vector with n entries of INT type.
INT * val
actual vector entries
Matrix-vector multiplication, replace the actual matrix.
void * data
data for MxV, can be a Matrix or something else
Data for preconditioners in dSTRmat format.
ivector * neigh
array to store neighbor information
ivector * pivot
the pivot for the GS/block GS smoother (whole reservoir matrix)
SHORT print_level
print level in AMG preconditioner
SHORT coarsening_type
coarsening type
SHORT coarse_scaling
switch of scaling of the coarse grid correction
AMG_data * mgl_data
AMG preconditioner data.
SHORT scaled
whether the matrix are scaled or not
REAL * w
temporary work space for other usage
ILU_data * LU
ILU preconditioner data (needed for CPR type preconditioner)
dSTRmat * A_str
store the whole reservoir block in STR format
SHORT AMG_type
type of AMG method
REAL tol
tolerance for AMG preconditioner
ivector * order
order for smoothing
REAL relaxation
relaxation parameter for SOR smoother
SHORT smoother
AMG smoother type.
SHORT cycle_type
AMG cycle type.
SHORT postsmooth_iter
number of postsmoothing
SHORT max_levels
max number of AMG levels
SHORT presmooth_iter
number of presmoothing
ivector * pivotS
the pivot for the GS/block GS smoother (saturation block)
dvector * diaginv
the inverse of the diagonals for GS/block GS smoother (whole reservoir matrix)
dvector * diaginvS
the inverse of the diagonals for GS/block GS smoother (saturation block)
INT maxit
max number of iterations of AMG preconditioner
dSTRmat * SS_str
store Saturation block in STR format
dCSRmat * A
the original CSR matrix
dvector r
temporary dvector used to store and restore the residual
Data for preconditioners.
SHORT print_level
print level in AMG preconditioner
SHORT polynomial_degree
degree of the polynomial smoother
SHORT coarsening_type
switch of scaling of the coarse grid correction
SHORT nl_amli_krylov_type
type of Krylov method used by Nonlinear AMLI cycle
SHORT coarse_scaling
switch of scaling of the coarse grid correction
AMG_data * mgl_data
AMG preconditioner data.
dCSRmat * A_nk
Matrix data for near kernel.
REAL * amli_coef
coefficients of the polynomial used by AMLI cycle
REAL * w
temporary work space for other usage
ILU_data * LU
ILU preconditioner data (needed for CPR type preconditioner)
SHORT AMG_type
type of AMG method
REAL tol
tolerance for AMG preconditioner
SHORT coarse_solver
coarse solver type for AMG
REAL relaxation
relaxation parameter for SOR smoother
SHORT smoother
AMG smoother type.
SHORT cycle_type
AMG cycle type.
SHORT amli_degree
degree of the polynomial used by AMLI cycle
REAL tentative_smooth
smooth factor for smoothing the tentative prolongation
SHORT postsmooth_iter
number of postsmoothing
dCSRmat * R_nk
Restriction for near kernel.
SHORT max_levels
max number of AMG levels
dCSRmat * P_nk
Prolongation for near kernel.
SHORT presmooth_iter
number of presmoothing
INT maxit
max number of iterations of AMG preconditioner
dvector r
temporary dvector used to store and restore the residual
SHORT smooth_order
AMG smoother ordering.
Data for diagonal preconditioners in dSTRmat format.
INT nc
number of components
dvector diag
diagonal elements
Preconditioner data and action.
void * data
data for preconditioner, void pointer