📄 ilupack.h
字号:
/*! \file ilupack.h \brief main header for ILUPACK This header contains all definitions of functions as well as those of the constants*/#ifndef _ILU_PACK_H#define _ILU_PACK_H#include <stdlib.h>#include "long_integer.h"#include "namesilupack.h"#define LONG_INT integer#define MEDIUM_INT int/*! switch to indicate inverse-based dropping. It is used in AMGINIT AMGGETPARAMS and AMGSETPARAMS. The parameter "flag" is bitwise modified by flag|=DROP_INVERSE to set and flag&=~DROP_INVERSE to turn off inverse-based dropping. In AMGINIT, DROP_INVERSE is set by default */#define DROP_INVERSE 1/*! switch for not shifting away zero pivots. This switch is used in ILUC which does not have pivoting prevent small diagonal entries. The parameter "param" is bitwise modified by param|=NO_SHIFT to suppress shifts and param&=~NO_SHIFT to allow shifts. */#define NO_SHIFT 2/*! switch for using Tismenetsky update. */#define TISMENETSKY_SC 4/* switch for repeated ILU */#define REPEAT_FACT 8/* switch for enhanced estimate for the norm of the inverses */#define IMPROVED_ESTIMATE 16/* switch for using diagonal compensation */#define DIAGONAL_COMPENSATION 32/* switch for reducing the partial factorization to the non-coarse part */#define COARSE_REDUCE 64/* switch for using a different pivoting strategy, if the regular reordering fails and before we switch to ILUTP*/#define FINAL_PIVOTING 128/* enforce the positve definite property */#define ENSURE_SPD 256/* switch for the most simple Schur complement update */#define SIMPLE_SC 512#define PREPROCESS_INITIAL_SYSTEM 1024#define PREPROCESS_SUBSYSTEMS 2048#define MULTI_PILUC 4096#define RE_FACTOR 8192#define AGGRESSIVE_DROPPING 16384#define DISCARD_MATRIX 32768#define SYMMETRIC_STRUCTURE 65536/* 131072 262144 524288 1048576 2097152 4194304 8388608 16777216 33554432 67108864 134217728 268435456 536870912 1073741824 2147483648*/#define _D_REAL_MAX_ 1.7e+308#define _S_REAL_MAX_ 1.7e+38/* ***************************************************** *//* ****** Definitions for preconditioners ***** */typedef struct { integer nr; integer nc; integer *ia; integer *ja; doubleprecision *a;} Dmat;typedef struct { integer nr; integer nc; integer *ia; integer *ja; real *a;} Smat;typedef struct { integer nr; integer nc; integer *ia; integer *ja; doublecomplex *a;} Zmat;typedef struct { integer nr; integer nc; integer *ia; integer *ja; complex *a;} Cmat;#define ILUPACK_NIPAR 40#define ILUPACK_NFPAR 40typedef struct { integer ipar[ILUPACK_NIPAR]; doubleprecision fpar[ILUPACK_NFPAR]; integer type; integer *ibuff; integer *iaux; doubleprecision *dbuff; doubleprecision *daux; integer *ju; integer *jlu; doubleprecision *alu; size_t nibuff, ndbuff, nju,njlu,nalu, ndaux,niaux; doubleprecision elbow; doubleprecision *diag;} DILUPACKparam;typedef struct { integer ipar[ILUPACK_NIPAR]; real fpar[ILUPACK_NFPAR]; integer type; integer *ibuff; integer *iaux; real *dbuff; real *daux; integer *ju; integer *jlu; real *alu; size_t nibuff, ndbuff, nju,njlu,nalu, ndaux,niaux;} SILUPACKparam;typedef struct { integer ipar[ILUPACK_NIPAR]; doubleprecision fpar[ILUPACK_NFPAR]; integer type; integer *ibuff; integer *iaux; doublecomplex *dbuff; doublecomplex *daux; integer *ju; integer *jlu; doublecomplex *alu; size_t nibuff, ndbuff, nju,njlu,nalu, ndaux,niaux;} ZILUPACKparam;typedef struct { integer ipar[ILUPACK_NIPAR]; real fpar[ILUPACK_NFPAR]; integer type; integer *ibuff; integer *iaux; complex *dbuff; complex *daux; integer *ju; integer *jlu; complex *alu; size_t nibuff, ndbuff, nju,njlu,nalu, ndaux,niaux;} CILUPACKparam;typedef struct DAMGLM { integer n; integer nB; Dmat LU; integer *LUperm; Dmat E; Dmat F; integer *p; integer *invq; doubleprecision *rowscal; doubleprecision *colscal; doubleprecision *absdiag; struct DAMGLM *prev; struct DAMGLM *next;} DAMGlevelmat; typedef struct SAMGLM { integer n; integer nB; Smat LU; integer *LUperm; Smat E; Smat F; integer *p; integer *invq; real *rowscal; real *colscal; real *absdiag; struct SAMGLM *prev; struct SAMGLM *next;} SAMGlevelmat; typedef struct ZAMGLM { integer n; integer nB; Zmat LU; integer *LUperm; Zmat E; Zmat F; integer *p; integer *invq; doublecomplex *rowscal; doublecomplex *colscal; doublecomplex *absdiag; struct ZAMGLM *prev; struct ZAMGLM *next;} ZAMGlevelmat; typedef struct CAMGLM { integer n; integer nB; Cmat LU; integer *LUperm; Cmat E; Cmat F; integer *p; integer *invq; complex *rowscal; complex *colscal; complex *absdiag; struct CAMGLM *prev; struct CAMGLM *next;} CAMGlevelmat; void DGNLAMGsol(DAMGlevelmat, integer, DILUPACKparam *, doubleprecision *, doubleprecision *, doubleprecision *);void DGNLAMGdlsol(DAMGlevelmat, integer, DILUPACKparam *, doubleprecision *, doubleprecision *, doubleprecision *);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -