17#include "fasp_functs.h"
66 max_levels =
MAX(1, max_levels);
71 for ( i=0; i<max_levels; ++i ) {
78 mgl[i].GS_Theta = 0.0E-2;
104 const INT max_levels =
MAX(1,mgl[0].num_levels);
115 &mgl[max_levels-1].x, &mgl[max_levels-1].mumps);
131 fasp_pardiso_free_internal_mem(&mgl[max_levels-1].pdata);
140 for ( i=0; i<max_levels; ++i ) {
143 if ( max_levels > 1 ) {
161 if ( param == NULL )
return;
183 max_levels =
MAX(1, max_levels);
188 for (i=0; i<max_levels; ++i) {
215 const INT max_levels =
MAX(1,mgl[0].num_levels);
219 for ( i = 0; i < max_levels; ++i ) {
223 if ( max_levels > 1 ) {
270 printf(
"### DEBUG: [-Begin-] %s ...\n", __FUNCTION__);
271 printf(
"### DEBUG: iwk=%d, nwork=%d \n", iwk, nwork);
282 printf(
"### DEBUG: %s ...... %d [End]\n", __FUNCTION__,__LINE__);
302 if ( iludata == NULL )
return;
314 if ( iludata->
A != NULL ) {
317 const INT nnz = iludata->
A->
nnz;
319 for ( k = 0; k < nnz; k++ ) {
321 iludata->
A->
JA[k] = iperm[ iludata->
A->
JA[k] ] -1;
329 iludata->nb = iludata->
nlevL = iludata->
nlevU = 0;
345 if ( swzdata == NULL )
return;
364 if ( swzdata->
mumps == NULL )
return;
366 for ( i=0; i<swzdata->
nblk; ++i ) fasp_mumps_free (&((swzdata->
mumps)[i]));
void fasp_mem_free(void *mem)
Free up previous allocated memory body and set pointer to NULL.
void * fasp_mem_calloc(const unsigned int size, const unsigned int type)
Allocate, initiate, and check memory.
void fasp_dvec_free(dvector *u)
Free vector data space of REAL type.
void fasp_ivec_free(ivector *u)
Free vector data space of INT type.
void fasp_dbsr_free(dBSRmat *A)
Free memory space for BSR format sparse matrix.
void fasp_dcsr_free(dCSRmat *A)
Free CSR sparse matrix data memory space.
void fasp_precond_data_init(precond_data *pcdata)
Initialize precond_data.
void fasp_swz_data_free(SWZ_data *swzdata)
Free SWZ_data data memeory space.
void fasp_ilu_data_create(const INT iwk, const INT nwork, ILU_data *iludata)
Allocate workspace for ILU factorization.
AMG_data * fasp_amg_data_create(SHORT max_levels)
Create and initialize AMG_data for classical and SA AMG.
AMG_data_bsr * fasp_amg_data_bsr_create(SHORT max_levels)
Create and initialize AMG_data data sturcture for AMG/SAMG (BSR format)
void fasp_amg_data_free(AMG_data *mgl, AMG_param *param)
Free AMG_data data memeory space.
void fasp_ilu_data_free(ILU_data *iludata)
Create ILU_data sturcture.
void fasp_amg_data_bsr_free(AMG_data_bsr *mgl)
Free AMG_data_bsr data memeory space.
int fasp_solver_mumps_steps(dCSRmat *ptrA, dvector *b, dvector *u, Mumps_data *mumps)
Solve Ax=b by MUMPS in three steps.
Main header file for the FASP project.
#define SHORT
FASP integer and floating point numbers.
#define MAX(a, b)
Definition of max, min, abs.
#define V_CYCLE
Definition of cycle types.
#define CLASSIC_AMG
Definition of AMG types.
#define ON
Definition of switch.
#define PRINT_NONE
Print level for all subroutines – not including DEBUG output.
Data for multigrid levels in dBSRmat format.
INT near_kernel_dim
dimension of the near kernel for SAMG
REAL * pw
pointer to the auxiliary vectors for pressure block
dCSRmat * A_nk
Matrix data for near kernal.
REAL ** near_kernel_basis
basis of near kernel space for SAMG
INT num_levels
number of levels in use <= max_levels
dCSRmat * R_nk
Resriction for near kernal.
INT max_levels
max number of levels
dCSRmat * P_nk
Prolongation for near kernal.
REAL * sw
pointer to the auxiliary vectors for saturation block
INT near_kernel_dim
dimension of the near kernel for SAMG
Mumps_data mumps
data for MUMPS
REAL ** near_kernel_basis
basis of near kernel space for SAMG
void * Numeric
pointer to the numerical factorization from UMFPACK
SHORT max_levels
max number of levels
SHORT num_levels
number of levels in use <= max_levels
Parameters for AMG methods.
REAL * amli_coef
coefficients of the polynomial used by AMLI cycle
SHORT coarse_solver
coarse solver type
SHORT cycle_type
type of AMG cycle
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 row
row number of matrix LU, m
INT nlevL
number of colors for lower triangle
INT * iperm
permutation arrays for ILUtp
INT nzlu
number of nonzero entries
INT * jlevL
mapping from row to color for lower triangle
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
Data for Schwarz methods.
INT memt
working space size
dCSRmat A
pointer to the original coefficient matrix
dvector rhsloc1
local right hand side
dvector xloc1
local solution
dCSRmat * blk_data
matrix for each partition
INT * jblock
column index of blocks
Mumps_data * mumps
param for MUMPS
INT * iblock
row index of blocks
INT nnz
number of nonzero entries
INT * JA
integer array of column indexes, the size is nnz
Data for preconditioners.
SHORT print_level
print level in AMG preconditioner
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
SHORT AMG_type
type of AMG method
REAL tol
tolerance for AMG preconditioner
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
SHORT postsmooth_iter
number of postsmoothing
SHORT max_levels
max number of AMG levels
SHORT presmooth_iter
number of presmoothing
INT maxit
max number of iterations of AMG preconditioner
SHORT smooth_order
AMG smoother ordering.