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 g_matrixsize (FILE *out); 00055 void g_matrix (FILE *out); 00056 00057 void inverse_matrix_GG (FILE *out); 00058 00059 void assemble_ff (double *rhs); 00060 void evector (FILE *out); 00061 00062 00063 void qvector (double *q,double **ff); 00064 00065 void feti_projection (double *v); 00066 00067 00068 //void get_jumps (double *jump); 00069 00070 00071 void scaling(double *invect,double *outvector,long n,FILE *out); 00072 void lscaling(double *invect,double *outvect,long ndom,FILE *out); 00073 00074 void lumpedprec (long nd,double *dd,double *pp); 00075 void dirichletprec (long nd,double *dd,double *pp); 00076 00077 void mpcg (FILE *out); 00078 void mpcg_old (gtopology *top,gmatrix *gm,double *w,double **ff,double *q,double *h,double *h1,FILE *out); 00079 void mprcg (gtopology *top,gmatrix *gm, 00080 double *lambda,double **ff,double *e,double *g,double *g1,FILE *out); 00081 00082 void nodalunknowns (double *lhs,FILE *out); 00083 00084 void lagrmultdispl (FILE *out); 00085 00086 void solve_system (gtopology *top,gmatrix *gm, 00087 double *lhs,double *rhs,FILE *out); 00088 00089 00090 00091 00092 /// type of FETI implementation 00093 /// fetiimpl=no_impl=0 - no implementation is defined 00094 /// fetiimpl=boolean_matrices=1 - Boolean %matrix is assembled, it is used for tests only, it is not efficient implementation 00095 /// fetiimpl=nonredundant=2 - nonredundant constraints are defined, %matrix B has linearly independent rows 00096 /// fetiimpl=redundant=3 - redundant constraints are defined, %matrix B has linearly dependent rows 00097 fetiimplem fetiimpl; 00098 00099 /// type of storage of subdomain matrices 00100 /// see galias.h 00101 storagetype smst; 00102 00103 /// the number of subdomains 00104 long ns; 00105 00106 /// estimated number of rigid body modes (estimated dimension of the kernel) 00107 long ense; 00108 00109 /// threshold for kernel detection 00110 double thresh; 00111 00112 /// the maximum number of iterations in conjugate gradient method 00113 long nicg; 00114 /// the number of performed iterations in conjugate gradient method 00115 long anicg; 00116 00117 /// required error 00118 double errcg; 00119 /// attained error 00120 double aerrcg; 00121 00122 /// computer zero 00123 double zero; 00124 00125 /// type of preconditioner 00126 precondtype prec; 00127 00128 00129 /// size of matrix G 00130 /// it is determined in the function g_matrixsize 00131 long gsize; 00132 00133 /// the maximum number of degrees of freedom on one subdomain 00134 /// it is determined in the function det_ndofmax 00135 long ndofmax; 00136 00137 /// the number of DOFs (unknowns) in coarse problem 00138 /// it is defined in the function initiate 00139 /// it is equal to the variable selnodfeti->tndofsn 00140 long ndofcp; 00141 00142 /// the numbers of DOFs on subdomains 00143 /// it contains ns components 00144 /// ndofmas[i]=j - the i-th subdomain contains j DOFs 00145 /// array is assembled in the function assemble_subdom_unknowns 00146 long *ndofmas; 00147 00148 /// node-subdomain correspondence 00149 /// it contains ns components 00150 /// nsid[i]=j - the i-th node belongs to the j-th subdomain 00151 /// array is assembled in the function assemble_subdom_unknowns 00152 long *nsid; 00153 00154 /// list of DOFs on subdomains 00155 /// it is used in connection with preconditioning 00156 /// it contains ns, ndofmas[i] components 00157 /// cndom[i][j]=k - the j-th DOF on the i-th subdomain has global glued number k 00158 /// array is assembled in the function assemble_subdom_unknowns 00159 long **cndom; 00160 00161 /// array of numbers of unknowns (DOFs) contributing to the coarse problem 00162 /// ncdofd contains nproc components 00163 /// ncdofd[i]=j - the i-th subdomains contributes to coarse problem by j contributions 00164 /// ncdofd is a copy of selnodfeti->snndofmas 00165 /// array is assembled in the function initiate 00166 long *ncdofd; 00167 00168 /// array containing code numbers contributing to the coarse problem 00169 /// extracted values from subdomains to the coarse problem 00170 /// it contains ns, ncdofd[i] components 00171 /// edofs[i][j]=k - the j-th components contributing to the coarse problem from the i-th subdomains has number k 00172 /// array is assembled in the function initiate 00173 long **edofs; 00174 00175 00176 00177 /// array containing numbers of RBM on subdomains 00178 /// it contains ns components 00179 /// nrbmdom[i]=j - the i-th subdomain contains j rigid body modes 00180 /// array is assembled in the function kernel 00181 long *nrbmdom; 00182 00183 /// rigid body modes / kernel 00184 /// array is assembled in the function kernel 00185 double **rbmdom; 00186 00187 /// array containing addresses of first RBM in coarse matrix 00188 /// it contains ns+1 components 00189 /// rbmadr[i]=j - rigid body modes of the i-th subdomains start from the index j 00190 /// array is assembled in the function hmatrixsize 00191 long *rbmadr; 00192 00193 /// list of linearly dependent equations 00194 /// 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 00195 /// array is assembled in the function kernel 00196 long **se; 00197 00198 /// %matrix G 00199 /// rigid body modes are stored in columns of the %matrix G 00200 /// it contains ndofcp,gsize components 00201 /// array is assembled in the function gmatrix 00202 double *g; 00203 00204 00205 /// the number of contributions in the arrays booldatar, booldatac and booldata 00206 /// it contains ns components 00207 /// it is assembled in the function read_booldata 00208 long *ncbool; 00209 00210 /// array containing row indices for construction of the Boolean matrices 00211 /// it contains ns,ncbool[i] components 00212 /// booldatar[i][j] = k - the j-th interface unknown on the i-th subdomain contributes to the k-th row 00213 /// it is assembled in the function read_booldata 00214 long **booldatar; 00215 00216 /// array containing column indices for construction of the Boolean matrices 00217 /// it contains ns,ncbool[i] components 00218 /// booldatac[i][j] = k - the j-th interface unknown on the i-th subdomain contributes to the k-th column 00219 /// it is assembled in the function read_booldata 00220 long **booldatac; 00221 00222 /// array containing %matrix entries of the Boolean matrices 00223 /// it contains ns,ncbool[i] components 00224 /// booldata[i][j] = k - the j-th interface unknown on the i-th subdomain contributes to the Boolean matrix with the value k 00225 /// it is assembled in the function read_booldata 00226 double **booldata; 00227 00228 /// array of coarse code numbers 00229 /// it contains tnbn rows and ncdofd[i] columns 00230 /// ccn[i][j]=k - the j-th contribution from the i-th subdomain goes to the k-th coarse unknown 00231 long **ccn; 00232 00233 00234 /// array for the inverse %matrix to the %matrix G^T G 00235 /// it contains gsize rows and columns 00236 double *invgg; 00237 00238 /// array for the right hand sides 00239 /// it contains ns vectors, each vector contains ndofmas[i] entries 00240 /// ff[i][j] 00241 double **ff; 00242 00243 /// array for the e %vector 00244 /// it contains gsize entries 00245 double *e; 00246 00247 /// array of nodal variables on subdomains 00248 /// it contains ns vectors, the vectors contain ndofmas[i] entries 00249 double **d; 00250 00251 /// array of Lagrange multipliers 00252 double *lambda; 00253 00254 /// subdomain matrices stored in the %skyline storage 00255 skyline *smsky; 00256 /// subdomain matrices stored in the %dense format 00257 densemat *smdm; 00258 00259 00260 00261 00262 00263 00264 00265 00266 00267 00268 00269 // nize uvedene promenne nejsou zkontrolovany 00270 00271 00272 00273 //long ndof; 00274 00275 00276 00277 00278 00279 /// numbers of nodes on subdomains 00280 //long *nnsd; 00281 /// first node numbers on subdomains 00282 //long *fnnsd; 00283 00284 00285 00286 00287 00288 00289 00290 00291 00292 /// number of DOFs on subdomains used for preconditioning 00293 long *ndofprec; 00294 00295 /// code numbers for preconditioning 00296 /// cnprec[i][j]=k - the j-th DOF on the i-th subdomain has global glued number k 00297 long **cnprec; 00298 00299 /// cpreccn[i][j]=k - the j-th DOF on the i-th subdomain has local number k 00300 long **cpreccn; 00301 00302 double *wscalmat; 00303 long *nlwscalmat; 00304 double **lwscalmat; 00305 00306 00307 00308 00309 00310 00311 /// subdomain matrices stored in the %skyline storage used for precondition 00312 skyline *smskyprec; 00313 00314 00315 /// subdomain matrices for preconditioning 00316 /// %matrix in the compressed row storage scheme 00317 symcomprow *smscr; 00318 /// %matrix in the dense storage scheme (it contains Schur complements which are dense) 00319 densemat *psmdm; 00320 00321 /// array containing jumps 00322 double **jum; 00323 }; 00324 00325 #endif