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