00001 #ifndef FETI1_H 00002 #define FETI1_H 00003 00004 #include <stdio.h> 00005 #include <mpi.h> 00006 #include "../GEFEL/gtopology.h" 00007 #include "../GEFEL/gmatrix.h" 00008 #include "partop.h" 00009 #include "selnodes.h" 00010 00011 /** 00012 00013 ************************************************* 00014 FINITE ELEMENT TEARING AND INTERCONNECTING METHOD 00015 ************************************************* 00016 nproc, myrank, ndom 00017 number of processors, myrank and number of domain are established 00018 after constructor execution 00019 00020 ndof 00021 total number of local unknowns is established after execution 00022 of function schurordering 00023 00024 nbndom (M) 00025 array of numbers of boundary nodes on subdomains is established after 00026 execution of function globcnnum_feti 00027 00028 maxnbn, totmaxndofn 00029 maximum number of boundary nodes and maximum number of degrees of freedom 00030 on node are established after execution of globcnnum_feti 00031 00032 maxinc 00033 maximum number of incidencies is established after execution of globcnnum_feti 00034 00035 ngdof (M) 00036 total number of global unknowns is established after execution of 00037 function globcnnum_feti 00038 00039 nodnum 00040 array of legth nbn containing global node numbers; components correspond 00041 only to boundary nodes, internal nodes are excluded 00042 array is established after execution of function globcnnum_feti 00043 00044 inc, lcngcn 00045 array of numbers of incidencies of nodes to subdomains and 00046 global code numbers in FETI method are established after execution 00047 of function globcnnum_feti 00048 00049 00050 */ 00051 class feti1 00052 { 00053 public: 00054 feti1 (int np,int mr,long nd); 00055 ~feti1(); 00056 00057 void initiate (selnodes *selnodfeti,FILE *out); 00058 00059 void coarse_dofs (partop *ptop,FILE *out); 00060 void number_contributing_nodes_dofs (gtopology *top,partop *ptop,long *domproc,FILE *out); 00061 void contributing_nodes_dofs (gtopology *top,partop *ptop,long *domproc,FILE *out); 00062 void coarse_problem_ordering (gtopology *top,partop *ptop,long *domproc,FILE *out); 00063 void subdomain_ordering (gtopology *top,long *ltg,FILE *out); 00064 00065 void local_buff (double *lv,double *buff); 00066 void buff_coarse (double *cv,double *buff,long nd); 00067 void coarse_buff (double *cv,double *buff,long nd); 00068 void buff_local (double *lv,double *buff); 00069 00070 00071 //void globcnnum_feti (gtopology *top,long *ltg,long *domproc,FILE *out); 00072 //void locbuff (double *buff,double *lv); 00073 //void buffloc (double *buff,double *lv); 00074 //void globbuff (double *buff,double *gv,long nd); 00075 //void buffglob (double *buff,double *gv,long nd); 00076 00077 void hmatrixsize (double *rbm,long *domproc,FILE *out); 00078 void hmatrix (double *h,double *rbm,long *domproc); 00079 void qvector (double *q,double *rbm,double *f,long *domproc); 00080 00081 void feti_projection (double *v,double *h,double *h1); 00082 void mpcg (gtopology *top,gmatrix *gm,long *domproc, 00083 double *w,double *rhs,double *q,double *h,double *h1,long *rbmi,FILE *out); 00084 void lagrmultdispl (gtopology *top,gmatrix *gm,long *domproc, 00085 double *w,double *d,double *f,double *rbm,long *rbmi, 00086 double *h,double *h1,FILE *out); 00087 void subdomain_matrix (gmatrix *gm,long *domproc,FILE *out); 00088 void scaling(double *invect,double *outvect,long n,FILE *out); 00089 void locscaling (double *invect,double *outvect,FILE *out); 00090 void lumpedprec (gmatrix *gm,double *dd,double *pp,FILE *out); 00091 void dirichletprec (double *dd,double *pp,FILE *out); 00092 00093 00094 void solve_system (gtopology *top,gmatrix *gm, 00095 long *domproc,double *lhs,double *rhs,FILE *out); 00096 00097 00098 /// number of processors 00099 int nproc; 00100 /// rank of processor 00101 int myrank; 00102 /// number of subdomain 00103 long ndom; 00104 00105 00106 00107 00108 // maximum number of components in local-global arrays 00109 long maxlggl; 00110 // number of components in local-global arrays 00111 long nclggl; 00112 00113 00114 // array containing local code numbers of boundary unknonws 00115 long *lcn; 00116 00117 00118 // estimate of number of rigid body motions 00119 long enrbm; 00120 // threshold for linear dependence 00121 double lithr; 00122 00123 // maximum number of iterations in conjugate gradient method 00124 long nicg; 00125 // number of performed iterations in conjugate gradient method 00126 long anicg; 00127 // required error 00128 double errcg; 00129 // attained error 00130 double aerrcg; 00131 // computer zero 00132 double zero; 00133 // type of preconditioner of FETI method 00134 long fetiprecond; 00135 00136 // ******************************************** 00137 // VARIABLES DEFINED ONLY ON MASTER PROCESSOR 00138 // 00139 00140 00141 00142 00143 00144 // 00145 long *lggl; 00146 // 00147 long **glcor; 00148 00149 // array containing numbers of RBM on subdomains 00150 long *nrbmdom; 00151 // array containing addresses of first RBM in coarse matrix 00152 long *rbmadr; 00153 00154 00155 00156 00157 // *************************** 00158 // sobota 30.7.2005 00159 // ************************* 00160 00161 00162 00163 /// M 00164 00165 00166 00167 00168 00169 // ********************************** 00170 // ********************************** 00171 // ********************************** 00172 // ********************************** 00173 // ********************************** 00174 // nedele 31.7.2005 00175 00176 /// number of degrees of freedom on subdomain 00177 long ndof; 00178 00179 /// M 00180 /// number of DOFs (unknowns) in coarse problem = total number of boundary DOFs 00181 long ndofcp; 00182 00183 /// maximum number of nodes contributing to the coarse problem 00184 long maxncnd; 00185 00186 /// maximum number of DOFs contributing to the coarse problem 00187 long maxncdofd; 00188 00189 /// number of nodes contributing to the coarse problem 00190 long ncn; 00191 00192 /// number of contributions (unknowns) from particular subdomains to the coarse problem 00193 long ncdof; 00194 00195 /// number of rigid body motions (RBM) 00196 long nrbm; 00197 00198 /// maximum number of rigid body motions (RBM) 00199 long maxnrbm; 00200 00201 /// M 00202 /// size of matrix H 00203 long hsize; 00204 00205 /// M 00206 /// array containing numbers of DOFs at corner nodes 00207 /// it contains tnbn rows and bnmultip[i] columns 00208 /// ndofncn[i][j]=k - the j-th node shared by the i-th coarse node contains k DOFs 00209 /// array is allocated in function coarse_dofs 00210 long **ndofncn; 00211 00212 /// M 00213 /// array of code numbers at coarse nodes 00214 /// it contains tnbn components, each contains bnmultip[i] subcomponents and each subcomponents contains ndofncn[i][j] subsubcomponents 00215 /// cncn[i][j][k]=m - the k-th DOF at the j-th node shared by the i-th coarse node has number m 00216 /// array is allocated in function coarse_dofs 00217 long ***cncn; 00218 00219 /// M 00220 /// array of numbers of nodes contributing to coarse problem 00221 /// ncnd contains nproc components 00222 /// ncnd[i]=j - the i-th subdomains contributes to coarse problem by j nodes 00223 /// defined on the master processor, array is allocated in function number_contributing_nodes_dofs 00224 long *ncnd; 00225 00226 /// M 00227 /// array of numbers of unknowns (DOFs) contributing to the coarse problem 00228 /// ncdofd contains nproc components 00229 /// ncdofd[i]=j - the i-th subdomains contributes to coarse problem by j contributions 00230 /// defined on the master processor, array is allocated in function number_contributing_nodes_dofs 00231 long *ncdofd; 00232 00233 /// array containing code numbers contributing to the coarse problem 00234 /// extracted values from subdomains to the coarse problem 00235 /// edofs[i]=j - the i-th components contributing to the coarse problem has number j 00236 /// array is allocated in function contributing_nodes_dofs 00237 long *edofs; 00238 00239 /// M 00240 /// array of coarse code numbers 00241 /// it contains tnbn rows and ncdofd[i] columns 00242 /// ccn[i][j]=k - the j-th contribution from the i-th subdomain goes to the k-th coarse unknown 00243 /// array is allocated in function contributing_nodes_dofs 00244 long **ccn; 00245 00246 /// M 00247 double *wscalmat; 00248 00249 // each processor 00250 double *lwscalmat; 00251 00252 /// each processor 00253 /// subdomain matrix for preconditioning 00254 skyline *smsky; 00255 /// %matrix in the dense storage scheme (it contains Schur complements which are dense) 00256 densemat *smdm; 00257 // 00258 long ndofprec; 00259 00260 // 00261 long *cnprec; 00262 00263 // 00264 long *cpreccn; 00265 00266 00267 00268 00269 00270 00271 // ********************** 00272 // REVISION 16.10.2011 00273 // ********************** 00274 00275 /// type of FETI implementation 00276 /// fetiimpl=no_impl=0 - no implementation is defined 00277 /// fetiimpl=boolean_matrices=1 - Boolean %matrix is assembled, it is used for tests only, it is not efficient implementation 00278 /// fetiimpl=nonredundant=2 - nonredundant constraints are defined, %matrix B has linearly independent rows 00279 /// fetiimpl=redundant=3 - redundant constraints are defined, %matrix B has linearly dependent rows 00280 fetiimplem fetiimpl; 00281 00282 }; 00283 00284 00285 #endif