00001 #ifndef SELNODES_H 00002 #define SELNODES_H 00003 00004 #include <stdio.h> 00005 #include <mpi.h> 00006 #include "pgalias.h" 00007 #include "../GEFEL/galias.h" 00008 #include "../GEFEL/gtopology.h" 00009 00010 /** 00011 class deals with selected nodes on subdomains 00012 nodes could be selected for Schur complement method, 00013 FETI method, etc. 00014 00015 */ 00016 class selnodes 00017 { 00018 public: 00019 selnodes (int np,int mr,long nd,long kk,long *j,meshdescription d,FILE *out,long mespr); 00020 ~selnodes (); 00021 00022 // 00023 void number_of_selected_nodes (long *domproc,FILE *out); 00024 // maxnsn is obtained 00025 // nsndom is assembled 00026 00027 void nodes_on_master (long *domproc,FILE *out); 00028 00029 void node_multiplicity (FILE *out); 00030 void dof_multiplicity (FILE *out); 00031 00032 00033 // ***************** 00034 // SCHUR ORDERING 00035 // ***************** 00036 //void schur_ordering (gtopology *top,FILE *out); 00037 00038 00039 // **************** 00040 // FETI ORDERING 00041 // **************** 00042 void group_local_nodes (FILE *out); 00043 // ljn is assmebled 00044 // lsn is assembled 00045 00046 00047 void dof_feti (FILE *out); 00048 // doffeti is assembled 00049 00050 void number_contrib (long *domproc,FILE *out); 00051 void contrib_dofs (gtopology *top,long *domproc,FILE *out); 00052 00053 00054 // ************************************************* 00055 // VARIABLES AND ARRAYS DEFINED ON ALL PROCESSORS 00056 // ************************************************* 00057 00058 /// number of domain attached to the processor 00059 long ndom; 00060 00061 00062 long ndof; 00063 00064 00065 /// number of nodes which contribute to coarse problem in the FETI method 00066 /// there are some nodes in the FETI method, which have to be used several times 00067 /// because they are connected with more than one additional node 00068 /// therefore, ncn is generally not equal to nsn 00069 long ncn; 00070 00071 /// maximum number of contributing nodes on subdomain in the FETI method 00072 /// there are some nodes in the FETI method, which have to be used several times 00073 /// because they are connected with more than one additional node 00074 /// therefore, maxncn is generally not equal to maxnsn 00075 long maxncn; 00076 00077 00078 00079 /// list of selected nodes - global numbers 00080 /// lsng[i]=j - the i-th selected node has global/coarse number j 00081 /// lsng contains nsn components, where nsn is the number of selected nodes on subdomain 00082 long *lsng; 00083 00084 00085 /// list of code numbers which contribute to the coarse problem 00086 long *ldof; 00087 00088 long *ldofmultip; 00089 long nldofmultip; 00090 00091 // ******************************************************** 00092 // VARIABLES AND ARRAYS DEFINED ONLY ON MASTER PROCESSOR 00093 // ******************************************************** 00094 00095 /// total number of DOFs 00096 long tndof; 00097 00098 /// the maximum number of selected DOFs on subdomain 00099 long maxndof; 00100 00101 00102 /// group node numbers (see partop.h) 00103 /// gnn[i][j]=k - the j-th selected node on the i-th subdomain has group number k 00104 long **gnn; 00105 00106 /// node multiplicity 00107 /// nodmultip[i]=j - the i-th selected node is shared by j subdomains 00108 /// it contains tnsn components 00109 long *nodmultip; 00110 00111 /// dof multiplicity 00112 /// dofmultip[i]=j - the i-th selected dof is shared by j subdomains 00113 /// it contains components 00114 long *dofmultip; 00115 00116 00117 /// array of numbers of DOFs on subdomains 00118 /// it contains prescribed values before code number generation 00119 /// after code number generation, only unknown (unconstrained DOFs) are taken into account 00120 /// array is rewritten in the function schur_ordering 00121 /// ndofdom[i]=j - the i-th subdomain contains j DOFs 00122 long *ndofdom; 00123 00124 00125 // SCHUR ORDERING 00126 00127 /// code numbers at selected nodes on master 00128 /// cnm[i][j]=k - the j-th DOF at the i-th selected node has code number / indicator k 00129 long **cnm; 00130 00131 /// code numbers on master 00132 /// cndom[i][j]=k - the j-th DOF on the i-th subdomain has group code number k 00133 long **cndom; 00134 00135 00136 // FETI ORDERING 00137 00138 /// list of joint nodes to selected nodes assumed as coarse nodes 00139 /// ljn[i][j]=k - the j-th node connected to the i-th coarse node has local number k 00140 /// ljn contains tnsn rows and nodmultip columns 00141 long **ljn; 00142 00143 /// list of subdomain numbers which contain connected nodes to coarse nodes 00144 /// lsn[i][j]=k - the j-th node connected to the i-th coarse node belongs to the k-th subdomain 00145 /// lsn contains tnsn rows and nodmultip columns 00146 long **lsn; 00147 00148 /// code numbers / indicators for FETI method 00149 /// doffeti[i][j][k]=l - the k-th DOF on the j-th connected node to the i-th coarse node has code number / indicator l 00150 long ***doffeti; 00151 00152 /// number of contributing nodes in the FETI method 00153 /// ncndom[i]=j - the i-th subdomain contributes to the coarse problem by j nodes 00154 long *ncndom; 00155 00156 00157 00158 00159 00160 00161 00162 00163 00164 00165 00166 00167 00168 00169 00170 00171 00172 00173 00174 00175 00176 00177 00178 00179 00180 00181 00182 00183 00184 00185 00186 00187 00188 00189 00190 00191 00192 00193 00194 00195 00196 00197 00198 00199 00200 00201 00202 00203 00204 00205 00206 00207 00208 00209 00210 00211 00212 /* 00213 ZACATEK ROZSAHLYCH UPRAV 00214 27.7.2009 00215 */ 00216 00217 // constructor 00218 selnodes(int nd,int mr,meshdescription d,long *domproc,long *nnsd,long *jj, 00219 long itnbn,long *iicmultip,long *nodmultip,long *icnbn,long *gnbndom, 00220 long **ignbncn,long **isid, 00221 FILE *out,char *proc_name,long mespr); 00222 00223 // function collects coarse numbers of nodes on the master 00224 void node_coarse_numbers (FILE *out); 00225 // tnsn is determined 00226 // snicmultip is allocated and assembled 00227 00228 // function searches for all possible DOFs in selected nodes 00229 void number_all_dofs (gtopology *top,long *domproc,FILE *out); 00230 // snndof is determined 00231 // maxsnndof is determined 00232 // snndofdom is allocated and assembled 00233 00234 // function collects numbers of DOFs on selected nodes 00235 void ndofn_on_master (gtopology *top,long *domproc,FILE *out); 00236 // snndofnmas is allocated and assembled 00237 00238 00239 // function assembles DOFs indicators on master 00240 void dof_indicators (gtopology *top,long *domproc,FILE *out); 00241 // sndofmas is allocated and assembled 00242 00243 // function generates ordering of selected nodes with respect 00244 // to the Schur complement method 00245 void schur_ordering (gtopology *top,long **dofind,FILE *out); 00246 void schur_ordering (gtopology *top,FILE *out); 00247 00248 00249 00250 /// the number of processors 00251 int nproc; 00252 /// rank of processor 00253 int myrank; 00254 /// type of mesh description 00255 meshdescription md; 00256 00257 /// the number of nodes on subdomain 00258 long nn; 00259 00260 /// the number of selected nodes 00261 long nsn; 00262 00263 /// the maximum nuber of selected nodes on subdomain 00264 long maxnsn; 00265 00266 /// the total number of boundary/interafce nodes inthe problem 00267 long tnbn; 00268 00269 /// the total number of selected nodes 00270 long tnsn; 00271 00272 /// the number of all selected DOFs including prescribed DOFs on one subdomain 00273 long snndof; 00274 00275 /// the maximum number of selected DOFs on subdomain 00276 long maxsnndof; 00277 00278 00279 /// number of multiplicity of all boundary/interface nodes 00280 /// it contains tnbn components 00281 /// icmultip[i]=j - the i-th boundary/interface node shares j nodes (it belongs to j subdomains) 00282 /// array is allocated in the constructor 00283 long *icmultip; 00284 00285 /// array containing the numbers of selected nodes on subdomains 00286 /// it contains nproc components 00287 /// nsnmas[i]=j - j nodes are selected on the i-th subdomain 00288 /// array is allocated and assembled in the constructor 00289 long *nsnmas; 00290 00291 /// local numbers of selected nodes 00292 /// it contains nsn components 00293 /// lnsn[i]=j - the i-th selected node has local number j 00294 /// array is allocated in the constructor 00295 long *lnsn; 00296 00297 /// coarse numbers of selected nodes on one subdomain 00298 /// cnsn contains nsn components 00299 /// cnsn[i]=j - the i-th selected node has coarse number j 00300 /// array is allocated in the constructor 00301 long *cnsn; 00302 00303 // master 00304 /// coarse numbers of selected nodes on the master 00305 /// it contains nproc,nsn components 00306 /// cnsnmas[i][j]=k - the j-th selected node on the i-th subdomain has coarse number k 00307 /// array is allocated in the constructor 00308 long **cnsnmas; 00309 00310 /// global numbers of selected nodes on one subdomain 00311 /// it contains nsn components 00312 /// gnsn[i]=j - the i-th selected node has global number j 00313 /// array is allocated in the constructor 00314 long *gnsn; 00315 00316 // master 00317 /// global numbers of selected nodes on the master 00318 /// gnsnmas contains nproc, nsnmas[i] components 00319 /// gnsnmas[i][j]=k - the j-th selected node on the i-th subdomain has coarse number k 00320 /// array is allocated in the constructor 00321 long **gnsnmas; 00322 00323 // master 00324 /// number of multiplicity of selected boundary/interface nodes 00325 /// it contains tnsn components 00326 /// snicmultip[i]=j - the i-th selected boundary/interface node shares j nodes (it belongs to j subdomains) 00327 /// array is allocated in the function node_coarse_numbers 00328 long *snicmultip; 00329 00330 // master 00331 /// array of numbers of DOFs on subdomains at selected nodes 00332 /// it contains prescribed values before code number generation 00333 /// after code number generation, only unknown (unconstrained DOFs) are taken into account 00334 /// snndofmas[i]=j - selected nodes on the i-th subdomain contain j DOFs 00335 /// array is allocated in the function number_all_dofs 00336 long *snndofmas; 00337 00338 // master 00339 /// array of numbers of DOFs in selected nodes on the master 00340 /// it contains nproc, nsndom[i] components 00341 /// snndofnmas[i][j]=k - the j-th node on the i-th subdomain contains k DOFs 00342 /// array is allocated in the function ndofn_on_master 00343 long **snndofnmas; 00344 00345 // master 00346 /// array of DOFs or indicators at selected nodes 00347 /// it contains nproc, nsndom[i], snndofndom[i][j] components 00348 /// sndofmas[i][j][k]=l - the k-th DOF at the j-th selected node on the i-th subdomain has value l 00349 /// array is allocated in the function dof_indicators 00350 long ***sndofmas; 00351 00352 // master 00353 /// global numbers of boundary/interface nodes appropriate to all coarse nodes 00354 /// it contains local numbers of boundary/interafce nodes of each coarse node 00355 /// it contains tnbn rows and icmultip[i] columns 00356 /// gnbncn[i][j]=k - the j-th node shared by the i-th coarse node has global number k 00357 /// aray is allocated in the constructor 00358 long **gnbncn; 00359 00360 // master 00361 /// subdomain id of interface/boundary nodes appropriate to all coarse nodes 00362 /// it contains tnbn rows and icmultip[i] columns 00363 /// sid[i][j]=k - the j-th node shared by the i-th coarse node belongs to the k-th subdomain 00364 /// array is allocated in the constructor 00365 long **sid; 00366 00367 // master 00368 /// global numbers of selected boundary/interface nodes appropriate to coarse node 00369 /// it contains tnsn rows and snicmultip[i] columns 00370 /// sngnbncn[i][j]=k - the j-th node shared by the i-th coarse node has global number k 00371 /// aray is allocated in the function node_coarse_numbers 00372 long **sngnbncn; 00373 00374 // master 00375 /// subdomain id of selected interface/boundary nodes of the coarse node 00376 /// it contains tnsn rows and snicmultip[i] columns 00377 /// snsid[i][j]=k - the j-th node shared by the i-th coarse node belongs to the k-th subdomain 00378 /// array is allocated in the function node_coarse_numbers 00379 long **snsid; 00380 00381 00382 /// array of numbers of DOFs for selected nodes 00383 /// it contains tnsn components 00384 /// ndofnsn[i]=j - the i-th selected node (in group ordering) has j DOFs 00385 /// array is allocated in the function schur_ordering 00386 long *ndofnsn; 00387 00388 // master 00389 /// code numbers at selected nodes on master 00390 /// it contains tnsn,ndofnsn components 00391 /// codensn[i][j]=k - the j-th DOF at the i-th selected node has code number / indicator k 00392 /// array is allocated in the function schur_ordering 00393 long **codensn; 00394 00395 /// total number of DOFs on selected nodes 00396 /// defined in the function schur_ordering 00397 long tndofsn; 00398 00399 /// code numbers on master 00400 /// cnmas[i][j]=k - the j-th DOF on the i-th subdomain has coarse code number k 00401 long **cnmas; 00402 00403 }; 00404 00405 #endif