00001 #ifndef PARTOP_H 00002 #define PARTOP_H 00003 00004 #include <stdio.h> 00005 #include "mpi.h" 00006 #include "../GEFEL/gtopology.h" 00007 #include "../GEFEL/gmatrix.h" 00008 #include "pgalias.h" 00009 #include "../GEFEL/galias.h" 00010 00011 /** 00012 class deals with topology in parallel computations 00013 it is superior class to the class gtopology which is used 00014 for particular subdomains 00015 the class partop manages several classes gtopology 00016 00017 00018 notation: 00019 00020 node multiplicity - number of subdomains which share the node 00021 00022 internal node - node with multiplicity 1, (node inside a subdomain, 00023 node not lying on inter-subdomain boundary) 00024 00025 boundary node - node with multiplicity at least 2, (node lying 00026 on inter-subdomain boundary) 00027 00028 coarse node - artificial node defined on master which collects appropriate 00029 boundary nodes 00030 00031 00032 global ordering - node ordering before mesh partitioning 00033 global node numbers - node numbers used in undecomposed mesh 00034 (node numbers used before decomposition/partitioning) 00035 00036 local ordering - ordering of subdomains (without respect to remaining subdomains) 00037 local node numbers - node numbers used in decomposed mesh 00038 (node numbers used after decomposition/partitioning) 00039 00040 coarse ordering - ordering of boundary (interface) nodes only 00041 coarse node number - node numbers of boundary nodes only, ordering 00042 of all boundary nodes in coarse problem 00043 00044 group ordering - ordering of selected nodes only 00045 group node number - only selected nodes are ordered on the whole problem, it is similar to 00046 the coarse ordering 00047 00048 00049 mesh description: 00050 md = 1 - all nodes have their global node number 00051 md = 2 - only boundary nodes have coarse number, internal nodes are denoted by -1 00052 md = 3 - all nodes have their global node number, boundary nodes have their global number multiplied by -1 00053 00054 JK 00055 */ 00056 class partop 00057 { 00058 public: 00059 partop(int np,int mr,long nd,meshdescription meshd); 00060 ~partop (); 00061 void initiation (gtopology *top,long *ltg); 00062 00063 // function collects numbers of all nodes on subdomains 00064 void numbers_of_all_nodes_on_subdomains (long *domproc,FILE *out); 00065 // maxnn is established 00066 // nnsd is assembled 00067 00068 00069 // function collects numbers of all degrees of freedom on subdomains 00070 // supports and constraints are not taken into account 00071 void numbers_of_all_dofs_on_subdomains (gtopology *top,long *domproc,FILE *out); 00072 // maxndof is established 00073 // nalldof is assembled 00074 00075 00076 // function computes nodal multiplicity 00077 void compute_multiplicity (long *ltg,long *domproc,FILE *out); 00078 // tnnp is established 00079 // multip is assmebled 00080 // nodmultip is assembled 00081 // allnodes is assembled 00082 00083 00084 void dof_multiplicity (gtopology *top,FILE *out); 00085 // dofmultip is assembled 00086 00087 00088 void rewrite_ltg (long *ltg); 00089 00090 00091 void find_boundary_nodes (long *ltg,long *domproc,FILE *out); 00092 // tnbn is established 00093 // nbnd is assmebled 00094 // maxnbn is established 00095 // nbn is established 00096 // lnbn is assembled 00097 // lnin is assembled 00098 // nin is established 00099 00100 00101 void boundary_nodes_on_master (gtopology *top,long *domproc,FILE *out); 00102 // cnbn is assembled 00103 00104 00105 void coarse_local_nodes (); 00106 void sort_nodes (FILE *out); 00107 00108 00109 void number_of_bdofs_on_nodes (gtopology *top,long *domproc,FILE *out); 00110 // nbdofnd is assembled 00111 00112 00113 void code_numbers_on_master (gtopology *top,long *domproc,FILE *out); 00114 // maxnbdof is established 00115 // lbcn is assembled 00116 long give_whole_dim(gtopology *top); 00117 long give_whole_elemtype(gtopology *top); 00118 void identification_node(gtopology *top,long *ltg,long *domproc, FILE *out); 00119 void identification_node_2d (gtopology *top,long *ltg,long *domproc, FILE *out); 00120 void identification_node_3d (gtopology *top,long *ltg,long *domproc, FILE *out); 00121 void identification_node_hexa (gtopology *top,long *ltg,long *domproc, FILE *out); 00122 void identification_node_tetra (gtopology *top, long *domproc, FILE *out); 00123 void corner_detection(gtopology *top, long *domproc, long *ltg, FILE *out); 00124 void control_numbers_of_vertices (gtopology *top,FILE *out); 00125 void control_vertices_on_master(gtopology *top, long *domproc, FILE *out); 00126 00127 00128 void assemble_gnn(gtopology *top,long *domproc,FILE *out); 00129 // gnn is assembled 00130 00131 void assemble_pgcn(gtopology *top,long *domproc,FILE *out); 00132 // pgcn is assembled 00133 00134 void assemble_gcnd(gtopology *top,long *domproc,FILE *out); 00135 // gcnd is assembled 00136 00137 00138 00139 // ******************************************* 00140 // ******************************************* 00141 00142 void nodesplit_allnodes (gtopology *top,long *domproc); 00143 void nodesplit_bnodes (gtopology *top,long *domproc,FILE *out); 00144 void gcnprep (gtopology *top,long *domproc); 00145 void corner_nodes (gtopology *top, FILE *out); 00146 00147 void dof_incidence (gtopology *top,long nbdof); 00148 void corner_nodes2d (gtopology *top,FILE *out); 00149 void corner_nodes3d (gtopology *top,FILE *out); 00150 00151 00152 00153 00154 00155 00156 // ************************************************* 00157 // VARIABLES AND ARRAYS DEFINED ON ALL PROCESSORS 00158 // ************************************************* 00159 00160 /// number of processors 00161 int nproc; 00162 /// rank of processor 00163 int myrank; 00164 /// number of domain attached to the processor 00165 long ndom; 00166 /// number of nodes on subdomain 00167 long nn; 00168 /// number of elements on subdomain 00169 long ne; 00170 00171 /// maximum number of nodes on one subdomain 00172 /// variables is defined in function numbers_of_all_nodes_on_subdomains 00173 long maxnn; 00174 00175 /// number of DOFs on subdomain 00176 long ndof; 00177 00178 /// maximum number of all DOFs on one subdomain 00179 /// variables is defined in function numbers_of_all_dofs_on_subdomains 00180 long maxndof; 00181 00182 /// number of boundary nodes on subdomain 00183 /// variable is defined in function find_boundary_nodes 00184 long nbn; 00185 00186 /// maximum number of boundary nodes on one subdomain 00187 /// variable is defined in function find_boundary_nodes 00188 long maxnbn; 00189 00190 /// maximum number of boundary DOFs on one subdomain 00191 /// variable is defined in function code_numbers_on_master 00192 long maxnbdof; 00193 00194 /// number of internal nodes 00195 /// variable is defined in function find_boundary_nodes 00196 long nin; 00197 00198 /// mesh description 00199 meshdescription md; 00200 00201 00202 00203 00204 /// array containing number of subdomains which share the nodes 00205 /// it contains nn components 00206 /// nodmultip[i]=j - the i-th node belong to j subdomains 00207 /// array is allocated in function compute_multiplicity 00208 long *nodmultip; 00209 00210 /// array containing number of subdomains which share the degree of freedom 00211 /// it contains ndof components 00212 /// nodmultip[i]=j - the i-th dof belongs to j subdomains 00213 /// array is allocated in function dof_multiplicity 00214 long *dofmultip; 00215 00216 /// array containing numbers of boundary nodes 00217 /// it contains nbn components 00218 /// lnbn[i]=j - the i-th boundary node has local number j 00219 /// array is allocated in function find_boundary_nodes 00220 long *lnbn; 00221 00222 /// array containing numbers of internal nodes 00223 /// it contains nin components 00224 /// lnin[i]=j - the i-th internal node has local number j 00225 /// array is allocated in function find_boundary_nodes 00226 long *lnin; 00227 00228 /// array containing list of global numbers of boundary nodes 00229 /// lgnbn[i]=j - the i-th boundary node has global number k 00230 long *lgnbn; 00231 00232 00233 00234 00235 // array contaiting node identification on subdomain 00236 // it contains nn components 00237 // nodeidentif[i] = j for the i-th node on subdomain 00238 // j = 1 - internal node 00239 // j = 2 - edge node 00240 // j = 3 - vertex node 00241 long *nodeidentif; 00242 00243 00244 00245 00246 // ******************************************************** 00247 // VARIABLES AND ARRAYS DEFINED ONLY ON MASTER PROCESSOR 00248 // ******************************************************** 00249 00250 /// total number of nodes in the whole problem 00251 /// variable is defined in function compute_multiplicity 00252 long tnnp; 00253 00254 /// total number of DOFs in the whole problem 00255 long tndof; 00256 00257 /// total number of boundary nodes 00258 /// variable is defined in function find_boundary_nodes 00259 long tnbn; 00260 00261 /// number of DOFs in coarse (reduced) problem 00262 long ndofcp; 00263 00264 00265 /// array containing number of nodes on subdomain 00266 /// it contains nproc components 00267 /// nnsd[i]=j - j nodes are defined on the i-th subdomain 00268 /// array is allocated in function numbers_of_all_nodes_on_subdomains 00269 long *nnsd; 00270 00271 /// array containing numbers of all degrees of freedom on subdomains 00272 /// nalldof[i]=j - the i-th subdomain contains j number of degrees of freedom 00273 /// array is allocated in function numbers_of_all_dofs_on_subdomains 00274 long *nalldof; 00275 00276 /// array containing number of subdomains which each boundary node belongs to 00277 /// it contains tnnp components 00278 /// multip[i]=j - the i-th node belongs to j subdomains 00279 /// array is allocated in function compute_multiplicity 00280 long *multip; 00281 00282 /// array containing global node numbers 00283 /// it contains nproc rows and nn[i] columns 00284 /// allnodes[i][j]=k - the j-th node on the i-th subdomain has global number k 00285 /// array is allocated in function compute_multiplicity 00286 long **allnodes; 00287 00288 /// array containing list of numbers of boundary nodes on subdomains 00289 /// it contains nproc components 00290 /// nbnd[i]=j - the i-th domain contains j boundary nodes 00291 /// array is allocated in function find_boundary_nodes 00292 long *nbnd; 00293 00294 /// array containing correspondence between global and coarse node numbers 00295 /// it contains tnnp components 00296 /// gcnbn[i]=j - the i-th node is the j-th boundary node, j=-1 for internal nodes 00297 /// array is allocated and deallocated in function boundary_nodes_on_master 00298 long *gcnbn; 00299 00300 /// array containing coarse node numbers of boundary nodes 00301 /// it contains nproc rows and nbnd[i] columns 00302 /// cnbn[i][j]=k - the j-th boundary node on the i-th subdomain has coarse node number k 00303 /// array is allocated in function boundary_nodes_on_master 00304 long **cnbn; 00305 00306 /// array containing numbers of DOFs on boundary nodes 00307 /// it contains nproc rows and nbnd[i] columns 00308 /// nbdofnd[i][j]=k - the j-th boundary node on the i-th subdomain contains k degrees of freedom 00309 /// array is allocated in function number_of_bdofs_on_nodes 00310 long **nbdofnd; 00311 00312 00313 00314 /// array containing numbers of boundary DOFs on subdomains 00315 /// it contains nproc components 00316 /// ndofd[i]=j - the i-th domain contains j degrees of freedom on boundary 00317 /// array is allocated in function code_numbers_on_master 00318 long *nbdofd; 00319 00320 /// array containing local boundary code numbers 00321 /// lbcn[i][j][k]=m - the k-th DOF on the j-th boundary node on the i-th subdomain has number m 00322 /// array is allocated in function code_numbers_on_master 00323 long ***lbcn; 00324 00325 /// array containing multiplicity of boundary nodes 00326 /// it is different array from array multip which is defined for all nodes in problem 00327 /// it contains tnbn components 00328 /// bnmultip[i]=j - the i-th boundary node has multiplicity j 00329 /// the i-th boundary node is shared by j subdomains 00330 /// array is allocated in function coarse_local_nodes 00331 long *bnmultip; 00332 00333 /// array containing local numbers of boundary nodes belonging to coarse nodes 00334 /// it contains tnbn rows and bnmultip[i] columns 00335 /// llnbn[i][j]=k - the j-th node belonging to the i-th coarse node has number k 00336 /// array is allocated in function 00337 long **llnbn; 00338 00339 /// array containing numbers of subdomain to which coarse nodes belong to 00340 /// it contains tnbn rows and bnmultip[i] columns 00341 /// ldn[i][j]=k - the j-th node belonging to the i-th coarse node belongs to the k-th domain 00342 /// array is allocated in function 00343 long **ldn; 00344 00345 /// array containing numbers of DOFs at coarse nodes 00346 /// it contains tnbn components 00347 /// ndofncn[i]=j - the i-th coarse node contains j DOFs 00348 /// array is allocated in function schurordering 00349 //long *ndofncn; 00350 00351 /// array containing code numbers at coarse nodes 00352 /// it contains tnbn rows and ndofncn[i] columns 00353 /// cncn[i][j]=k - the j-th unknown at the i-th coarse node has number k 00354 /// array is allocated in function schurordering 00355 //long **cncn; 00356 00357 00358 /// global numbers of boundary nodes on subdomains 00359 /// it contains nbn components 00360 long *gnbn; 00361 00362 00363 00364 00365 /// gnn[i]=j - unknows of the i-th node in the problem are located from the j-th position in tha array pgcn 00366 /// gnn contains nn components, where nn is the number of all nodes in the problem 00367 long *gnn; 00368 00369 /// pgcn[gnn[i]+k]=j - the k-th unknown at the i-th node has number j 00370 /// pgcn contains gndof components, where gndof is the sum of all possible DOFs, it means that 00371 /// constraints are not taken into account 00372 long *pgcn; 00373 00374 00375 /// nud[i]=j - the i-th domain contains j unknowns (degrees of freedom) 00376 long *nud; 00377 00378 /// gcnd[i][j]=k - the j-th unknown on the i-th subdomain has global number k 00379 /// gcnd[i] is a pointer to array with code numbers of the i-th subdomain 00380 /// it is similar to arrays cn on elements, the subdomain plays a role of a superelement 00381 long **gcnd; 00382 00383 00384 00385 // ZBYTKY 00386 00387 00388 00389 00390 /// array containing global code numbers 00391 /// gcn[i][j]=k - the j-th component of the i-th boundary node (the i is the global number of node) is equal to the k 00392 long **gcn; 00393 00394 00395 00396 00397 00398 // ******************************************************************************* 00399 // ******************************************************************************* 00400 // ctvrtek 30.6.2005 00401 // ******************************************************************************* 00402 // ******************************************************************************* 00403 00404 }; 00405 00406 #endif