00001 #ifndef SEQFETI_H 00002 #define SEQFETI_H 00003 00004 #include "skyline.h" 00005 #include "seqselnodes.h" 00006 #include "scr.h" 00007 #include "densemat.h" 00008 00009 class gtopology; 00010 class gmatrix; 00011 00012 /** 00013 class feti deals with the FETI method 00014 (Finite Element Tearing and Interconnecting method) 00015 this is single-processor implementation, it is different 00016 from feti1 in PARGEF which is multi-processor implementation 00017 00018 this class contains three different implementation of the FETI method 00019 1. implementation based on the Boolean matrices, the matrices 00020 define ordering of unknowns and multipliers 00021 2. implementation without the Boolean matrices with nonredundant conditions 00022 correspondence among nodes is used for deinition of unknowns 00023 3. implementation without the Boolean matrices with redundant conditions 00024 correspondence among nodes is used for deinition of unknowns 00025 00026 00027 JK, 21.8.2007 00028 */ 00029 class seqfeti 00030 { 00031 public: 00032 seqfeti (); 00033 ~seqfeti (); 00034 00035 void read (gtopology *top,XFILE *in); 00036 void print (FILE *out); 00037 00038 void read_booldata (XFILE *in); 00039 void initiate (seqselnodes *selnodfeti,gtopology *top,FILE *out); 00040 00041 void det_ndofmax (); 00042 00043 void assemble_subdom_unknowns (gtopology *top,FILE *out); 00044 void subdomain_matrices (gmatrix *gm,FILE *out); 00045 00046 00047 void boolean_matrix (long sdid,double *a); 00048 void local_coarse (long nd,double *lv,double *cv); 00049 void coarse_local (long nd,double *lv,double *cv); 00050 00051 void kernel (FILE *out); 00052 00053 00054 void hmatrixsize (FILE *out); 00055 void hmatrix (double *h); 00056 00057 00058 void qvector (double *q,double **ff); 00059 00060 void feti_projection (double *v,double *h,double *h1); 00061 00062 00063 //void get_jumps (double *jump); 00064 00065 00066 void scaling(double *invect,double *outvector,long n,FILE *out); 00067 void lscaling(double *invect,double *outvect,long ndom,FILE *out); 00068 00069 void lumpedprec (long nd,double *dd,double *pp); 00070 void dirichletprec (long nd,double *dd,double *pp); 00071 00072 void mpcg (gtopology *top,gmatrix *gm, 00073 double *w,double **ff,double *q,double *h,double *h1,FILE *out); 00074 void mprcg (gtopology *top,gmatrix *gm, 00075 double *lambda,double **ff,double *e,double *g,double *g1,FILE *out); 00076 00077 00078 void lagrmultdispl (gtopology *top,gmatrix *gm, 00079 double *w,double **d,double **ff, 00080 double *h,double *h1,FILE *out); 00081 00082 void solve_system (gtopology *top,gmatrix *gm, 00083 double *lhs,double *rhs,FILE *out); 00084 00085 00086 00087 00088 /// type of FETI implementation 00089 /// fetiimpl=no_impl=0 - no implementation is defined 00090 /// fetiimpl=boolean_matrices=1 - Boolean %matrix is assembled, it is used for tests only, it is not efficient implementation 00091 /// fetiimpl=nonredundant=2 - nonredundant constraints are defined, %matrix B has linearly independent rows 00092 /// fetiimpl=redundant=3 - redundant constraints are defined, %matrix B has linearly dependent rows 00093 fetiimplem fetiimpl; 00094 00095 /// type of storage of subdomain matrices 00096 /// see galias.h 00097 storagetype smst; 00098 00099 /// the number of subdomains 00100 long ns; 00101 00102 /// estimated number of rigid body modes (estimated dimension of the kernel) 00103 long ense; 00104 00105 /// threshold for kernel detection 00106 double thresh; 00107 00108 /// the maximum number of iterations in conjugate gradient method 00109 long nicg; 00110 /// the number of performed iterations in conjugate gradient method 00111 long anicg; 00112 00113 /// required error 00114 double errcg; 00115 /// attained error 00116 double aerrcg; 00117 00118 /// computer zero 00119 double zero; 00120 00121 /// type of preconditioner 00122 precondtype prec; 00123 00124 00125 /// size of matrix H 00126 /// it is determined in the function hmatrixsize 00127 long hsize; 00128 00129 /// the maximum number of degrees of freedom on one subdomain 00130 /// it is determined in the function det_ndofmax 00131 long ndofmax; 00132 00133 /// the number of DOFs (unknowns) in coarse problem 00134 /// it is defined in the function initiate 00135 /// it is equal to the variable selnodfeti->tndofsn 00136 long ndofcp; 00137 00138 /// the numbers of DOFs on subdomains 00139 /// it contains ns components 00140 /// ndofmas[i]=j - the i-th subdomain contains j DOFs 00141 /// array is assembled in the function assemble_subdom_unknowns 00142 long *ndofmas; 00143 00144 /// node-subdomain correspondence 00145 /// it contains ns components 00146 /// nsid[i]=j - the i-th node belongs to the j-th subdomain 00147 /// array is assembled in the function assemble_subdom_unknowns 00148 long *nsid; 00149 00150 /// list of DOFs on subdomains 00151 /// it is used in connection with preconditioning 00152 /// it contains ns, ndofmas[i] components 00153 /// cndom[i][j]=k - the j-th DOF on the i-th subdomain has global glued number k 00154 /// array is assembled in the function assemble_subdom_unknowns 00155 long **cndom; 00156 00157 /// array of numbers of unknowns (DOFs) contributing to the coarse problem 00158 /// ncdofd contains nproc components 00159 /// ncdofd[i]=j - the i-th subdomains contributes to coarse problem by j contributions 00160 /// ncdofd is a copy of selnodfeti->snndofmas 00161 /// array is assembled in the function initiate 00162 long *ncdofd; 00163 00164 /// array containing code numbers contributing to the coarse problem 00165 /// extracted values from subdomains to the coarse problem 00166 /// it contains ns, ncdofd[i] components 00167 /// edofs[i][j]=k - the j-th components contributing to the coarse problem from the i-th subdomains has number k 00168 /// array is assembled in the function initiate 00169 long **edofs; 00170 00171 00172 00173 /// array containing numbers of RBM on subdomains 00174 /// it contains ns components 00175 /// nrbmdom[i]=j - the i-th subdomain contains j rigid body modes 00176 /// array is assembled in the function kernel 00177 long *nrbmdom; 00178 00179 /// rigid body modes / kernel 00180 /// array is assembled in the function kernel 00181 double **rbmdom; 00182 00183 /// array containing addresses of first RBM in coarse matrix 00184 /// it contains ns+1 components 00185 /// rbmadr[i]=j - rigid body modes of the i-th subdomains start from the index j 00186 /// array is assembled in the function hmatrixsize 00187 long *rbmadr; 00188 00189 /// list of linearly dependent equations 00190 /// se[i][j]=k - the j-th base %vector of the kernel of the i-th subdomain creates the k-th column of the %matrix 00191 /// array is assembled in the function kernel 00192 long **se; 00193 00194 /// %matrix H 00195 /// rigid body modes are stored in columns of the %matrix H 00196 /// it contains ndofcp,hsize components 00197 /// array is assembled in the function hmatrix 00198 double *h; 00199 00200 00201 /// number of contributions in the arrays booldatar, booldatac and booldata 00202 /// it contains ns components 00203 /// it is assembled in the function read_booldata 00204 long *ncbool; 00205 00206 /// array containing row indices for construction of the Boolean matrices 00207 /// it contains ns,ncbool[i] components 00208 /// booldatar[i][j] = k - the j-th interface unknown on the i-th subdomain contributes to the k-th row 00209 /// it is assembled in the function read_booldata 00210 long **booldatar; 00211 00212 /// array containing column indices for construction of the Boolean matrices 00213 /// it contains ns,ncbool[i] components 00214 /// booldatac[i][j] = k - the j-th interface unknown on the i-th subdomain contributes to the k-th column 00215 /// it is assembled in the function read_booldata 00216 long **booldatac; 00217 00218 /// array containing %matrix entries of the Boolean matrices 00219 /// it contains ns,ncbool[i] components 00220 /// booldata[i][j] = k - the j-th interface unknown on the i-th subdomain contributes to the Boolean matrix with the value k 00221 /// it is assembled in the function read_booldata 00222 double **booldata; 00223 00224 /// array of coarse code numbers 00225 /// it contains tnbn rows and ncdofd[i] columns 00226 /// ccn[i][j]=k - the j-th contribution from the i-th subdomain goes to the k-th coarse unknown 00227 long **ccn; 00228 00229 00230 00231 00232 00233 /// subdomain matrices stored in the %skyline storage 00234 skyline *smsky; 00235 /// subdomain matrices stored in the %dense format 00236 densemat *smdm; 00237 00238 00239 00240 00241 00242 00243 00244 00245 00246 00247 00248 // nize uvedene promenne nejsou zkontrolovany 00249 00250 00251 00252 //long ndof; 00253 00254 00255 00256 00257 00258 /// numbers of nodes on subdomains 00259 //long *nnsd; 00260 /// first node numbers on subdomains 00261 //long *fnnsd; 00262 00263 00264 00265 00266 00267 00268 00269 00270 00271 /// number of DOFs on subdomains used for preconditioning 00272 long *ndofprec; 00273 00274 /// code numbers for preconditioning 00275 /// cnprec[i][j]=k - the j-th DOF on the i-th subdomain has global glued number k 00276 long **cnprec; 00277 00278 /// cpreccn[i][j]=k - the j-th DOF on the i-th subdomain has local number k 00279 long **cpreccn; 00280 00281 double *wscalmat; 00282 long *nlwscalmat; 00283 double **lwscalmat; 00284 00285 00286 00287 00288 00289 00290 /// subdomain matrices stored in the %skyline storage used for precondition 00291 skyline *smskyprec; 00292 00293 00294 /// subdomain matrices for preconditioning 00295 /// %matrix in the compressed row storage scheme 00296 symcomprow *smscr; 00297 /// %matrix in the dense storage scheme (it contains Schur complements which are dense) 00298 densemat *psmdm; 00299 00300 /// array containing jumps 00301 double **jum; 00302 }; 00303 00304 #endif