00001 #include "seqselnodes.h" 00002 #include <string.h> 00003 #include <stdlib.h> 00004 #include <math.h> 00005 #include <time.h> 00006 00007 /** 00008 constructor 00009 00010 @param nd - number of subdomains 00011 @param nnsd - number of all nodes on subdomains 00012 @param jj - array containing list of selected nodes 00013 it contains nd,innsd[i] components 00014 00015 @param nodmultip - array containing number of subdomains which share the nodes 00016 @param ggnbn - array containing global glued numbers of boundary/interface nodes 00017 @param icnbnmas - array containing coarse numbers of interface/boundary nodes 00018 it contains nd,nbnd[i] components 00019 00020 @param itnbn - total number of boundary/interface nodes 00021 @param iicmultip - array containing node multiplicity of boundary/interface nodes 00022 @param ilnbncn - local numbers of boundary/interface nodes appropriate to coarse node 00023 @param iggnbncn - global glued numbers of boundary/interface nodes appropriate to coarse node 00024 @param isid - subdomain id of interface/boundary nodes of the coarse node 00025 00026 @param d - type of mesh description 00027 @param out - output stream 00028 @param mespr - message printing indicator 00029 00030 jj[i][k]>-1 - the k-th node on the i-th subdomain is selected 00031 00032 00033 ns - number of subdomains is determined 00034 tnbn - total number of boundary nodes is determined 00035 md - mesh description is determined 00036 nsnmas - array of numbers of selected nodes on subdomains is assembled 00037 ggnsn - array of global glued numbers of selected nodes is assembled 00038 cnsnmas - array of coarse numbers of selected boundary/interface nodes is assembled 00039 icmultip - array of multiplicity of all boundary/interface nodes is assembled 00040 ggnbncn - local numbers of boundary/interface nodes appropriate to coarse node 00041 sid - subdomain id of interface/boundary nodes appropriate to coarse node 00042 00043 JK, 14.9.2007, 5.7.2009 00044 */ 00045 seqselnodes::seqselnodes(long nd,long *nnsd,long **jj, 00046 long **nodmultip,long **ggnbn,long **icnbnmas, 00047 long itnbn,long *iicmultip,long **ilnbncn,long **iggnbncn,long **isid, 00048 meshdescription d,FILE *out,long mespr) 00049 { 00050 long i,j,k,ii,kk; 00051 00052 // number of subdomains 00053 ns=nd; 00054 00055 // total number of boundary/interafce nodes 00056 tnbn=itnbn; 00057 00058 // mesh description 00059 md = d; 00060 00061 // total number of selected nodes 00062 tnsn=0; 00063 00064 // total number of DOFs on selected nodes 00065 tndofsn=0; 00066 00067 00068 // number of selected nodes 00069 nsnmas = new long [ns]; 00070 for (i=0;i<ns;i++){ 00071 nsnmas[i]=0; 00072 for (j=0;j<nnsd[i];j++){ 00073 if (jj[i][j]>-1) 00074 nsnmas[i]++; 00075 } 00076 } 00077 00078 for (i=0;i<ns;i++){ 00079 if (mespr>0) 00080 fprintf (stdout,"\n subdomain %4ld, number of selected nodes %ld",i,nsnmas[i]); 00081 if (nsnmas[i]==0){ 00082 fprintf (stderr,"\n\n wrong number of selected nodes in constructor (file %s, line %d)\n",__FILE__,__LINE__); 00083 //abort(); 00084 } 00085 } 00086 00087 // local numbers of selected nodes 00088 lnsn = new long* [ns]; 00089 for (i=0;i<ns;i++){ 00090 lnsn[i]=new long [nsnmas[i]]; 00091 } 00092 // global glued numbers of selected nodes 00093 ggnsn = new long* [ns]; 00094 for (i=0;i<ns;i++){ 00095 ggnsn[i]=new long [nsnmas[i]]; 00096 } 00097 // coarse numbers of selected nodes 00098 cnsnmas = new long* [ns]; 00099 for (i=0;i<ns;i++){ 00100 cnsnmas[i]=new long [nsnmas[i]]; 00101 } 00102 00103 // loop over the number of subdomain 00104 for (i=0;i<ns;i++){ 00105 // index of selected nodes 00106 // k=nsnmas[i] at the end 00107 k=0; 00108 // index of internal nodes 00109 // ii=nind[i] (number of internal nodes on subdomain) at the end 00110 ii=0; 00111 // index of boundary/interface nodes 00112 // kk=nbnd[i] (number of boundary/interface nodes on subdomain) at the end 00113 kk=0; 00114 00115 // loop over all nodes on the i-th subdomain 00116 for (j=0;j<nnsd[i];j++){ 00117 if (nodmultip[i][j]>1){ 00118 // boundary/interface node 00119 00120 if (jj[i][j]>-1){ 00121 // the node is selected 00122 00123 // local number of selected node 00124 lnsn[i][k]=j; 00125 // global glued number of selected node 00126 ggnsn[i][k]=ggnbn[i][kk]; 00127 // coarse numbers of selected nodes 00128 cnsnmas[i][k]=icnbnmas[i][kk]; 00129 k++; 00130 } 00131 kk++; 00132 } 00133 else{ 00134 // internal node 00135 00136 if (jj[i][j]>-1){ 00137 // the node is selected 00138 00139 print_err("internal node has been selected", __FILE__, __LINE__, __func__); 00140 00141 ii++; 00142 } 00143 } 00144 } 00145 } 00146 00147 00148 00149 // number of multiplicity of boundary/interface nodes 00150 icmultip = new long [tnbn]; 00151 for (i=0;i<tnbn;i++){ 00152 icmultip[i]=iicmultip[i]; 00153 } 00154 // local numbers of boundary/interface nodes appropriate to coarse node 00155 lnbncn = new long* [tnbn]; 00156 for (i=0;i<tnbn;i++){ 00157 lnbncn[i]=new long [icmultip[i]]; 00158 } 00159 // global glued numbers of boundary/interface nodes appropriate to coarse node 00160 ggnbncn = new long* [tnbn]; 00161 for (i=0;i<tnbn;i++){ 00162 ggnbncn[i]=new long [icmultip[i]]; 00163 } 00164 // subdomain id of interface/boundary nodes of the coarse node 00165 sid = new long* [tnbn]; 00166 for (i=0;i<tnbn;i++){ 00167 sid[i] = new long [icmultip[i]]; 00168 } 00169 00170 for (i=0;i<tnbn;i++){ 00171 icmultip[i]=iicmultip[i]; 00172 } 00173 for (i=0;i<tnbn;i++){ 00174 for (j=0;j<icmultip[i];j++){ 00175 lnbncn[i][j]=ilnbncn[i][j]; 00176 ggnbncn[i][j]=iggnbncn[i][j]; 00177 sid[i][j]=isid[i][j]; 00178 } 00179 } 00180 00181 00182 //fprintf (out,"\n\n\n list of local and global/group numbers of selected nodes (lsnl, sncnbn)\n"); 00183 fprintf (out,"\n\n\n list of global glued numbers of selected nodes (ggnsn)\n"); 00184 for (i=0;i<ns;i++){ 00185 fprintf (out,"\n subdomain %4ld, number of selected nodes is nsnmas %ld",i,nsnmas[i]); 00186 for (j=0;j<nsnmas[i];j++){ 00187 fprintf (out,"\n global glued node number %6ld",ggnsn[i][j]+1); 00188 //fprintf (out,"\n local node number %6ld global/group node number %6ld",lsnl[i][j],lsng[i][j]); 00189 } 00190 } 00191 00192 00193 // number of multiplicity of selected boundary/interface nodes 00194 snicmultip = NULL; 00195 00196 // local numbers of boundary/interface nodes appropriate to selected coarse node 00197 snlnbncn = NULL; 00198 00199 // global glued numbers of selected boundary/interface nodes appropriate to coarse node 00200 snggnbncn = NULL; 00201 00202 // subdomain id of selected interface/boundary nodes of the coarse node 00203 snsid = NULL; 00204 00205 // array of numbers of DOFs on subdomains at selected nodes 00206 snndofmas = NULL; 00207 00208 // array of numbers of DOF at selected nodes 00209 snndofnmas = NULL; 00210 00211 // array of DOFs or indicators at selected nodes 00212 sndofmas = NULL; 00213 00214 // array of numbers of DOFs for selected nodes 00215 ndofnsn = NULL; 00216 00217 // code numbers at selected nodes on master 00218 codensn = NULL; 00219 00220 // code numbers on master 00221 cndofmas=NULL; 00222 00223 // type of FETI implementation 00224 // this means no type is selected 00225 fetiimpl = no_impl; 00226 00227 doffeti=NULL; 00228 } 00229 00230 /** 00231 destructor 00232 00233 JK, 14.9.2007 00234 */ 00235 seqselnodes::~seqselnodes() 00236 { 00237 long i,j; 00238 00239 // global glued numbers of selected nodes 00240 if (ggnsn!=NULL){ 00241 for (i=0;i<ns;i++){ 00242 delete [] ggnsn[i]; 00243 } 00244 delete [] ggnsn; 00245 } 00246 00247 // coarse numbers of selected nodes 00248 if (cnsnmas!=NULL){ 00249 for (i=0;i<ns;i++){ 00250 delete [] cnsnmas[i]; 00251 } 00252 delete [] cnsnmas; 00253 } 00254 00255 // number of multiplicity of boundary/interface nodes 00256 if (icmultip!=NULL) 00257 delete [] icmultip; 00258 00259 // global glued numbers of boundary/interface nodes appropriate to coarse node 00260 if (ggnbncn!=NULL){ 00261 for (i=0;i<tnbn;i++){ 00262 delete [] ggnbncn[i]; 00263 } 00264 delete [] ggnbncn; 00265 } 00266 00267 // subdomain id of interface/boundary nodes of the coarse node 00268 if (sid!=NULL){ 00269 for (i=0;i<tnbn;i++){ 00270 delete [] sid[i]; 00271 } 00272 delete [] sid; 00273 } 00274 00275 // number of multiplicity of selected boundary/interface nodes 00276 if (snicmultip!=NULL) 00277 delete [] snicmultip; 00278 00279 // global glued numbers of boundary/interface nodes appropriate to selected coarse node 00280 if (snggnbncn!=NULL){ 00281 for (i=0;i<tnsn;i++){ 00282 delete [] snggnbncn[i]; 00283 } 00284 delete [] snggnbncn; 00285 } 00286 00287 // subdomain id of interface/boundary nodes appropriate to coarse node 00288 if (snsid!=NULL){ 00289 for (i=0;i<tnsn;i++){ 00290 delete [] snsid[i]; 00291 } 00292 delete [] snsid; 00293 } 00294 00295 // array of numbers of DOFs on subdomains at selected nodes 00296 if (snndofmas!=NULL) 00297 delete [] snndofmas; 00298 00299 00300 // array of numbers of DOF at selected nodes 00301 if (snndofnmas!=NULL){ 00302 for (i=0;i<ns;i++){ 00303 delete [] snndofnmas[i]; 00304 } 00305 delete [] snndofnmas; 00306 } 00307 00308 // array of DOFs or indicators at selected nodes 00309 if (sndofmas!=NULL){ 00310 for (i=0;i<ns;i++){ 00311 for (j=0;j<nsnmas[i];j++){ 00312 delete [] sndofmas[i][j]; 00313 } 00314 delete [] sndofmas[i]; 00315 } 00316 delete [] sndofmas; 00317 } 00318 00319 // array of code numbers of coarse nodes 00320 if (codensn!=NULL){ 00321 for (i=0;i<tnsn;i++){ 00322 delete [] codensn[i]; 00323 } 00324 delete [] codensn; 00325 } 00326 00327 // array of numbers of DOFs for selected nodes 00328 if (ndofnsn!=NULL){ 00329 delete [] ndofnsn; 00330 } 00331 00332 // code numbers on master 00333 if (cndofmas!=NULL){ 00334 for (i=0;i<ns;i++){ 00335 delete [] cndofmas[i]; 00336 } 00337 delete [] cndofmas; 00338 } 00339 00340 00341 // number of selected nodes on subdomains (array nsnmas) 00342 if (nsnmas!=NULL) 00343 delete [] nsnmas; 00344 00345 } 00346 00347 00348 00349 /** 00350 function collects node numbers on master 00351 00352 function assembles arrays: 00353 00354 snicmultip - number of multiplicity of selected boundary/interface nodes 00355 snggnbncn - global glued numbers of selected boundary/interface nodes appropriate to coarse node 00356 snsid - subdomain id of selected interface/boundary nodes of the coarse node 00357 00358 tnsn - total number of selected nodes 00359 00360 @param out - output file 00361 00362 5.7.2009, JK 00363 */ 00364 void seqselnodes::node_coarse_numbers (FILE *out) 00365 { 00366 long i,j,k; 00367 long *av; 00368 00369 00370 av = new long [tnbn]; 00371 for (i=0;i<tnbn;i++){ 00372 av[i]=0; 00373 } 00374 00375 // loop over the number of subdomains 00376 for (i=0;i<ns;i++){ 00377 // loop over the number of selected nodes 00378 for (j=0;j<nsnmas[i];j++){ 00379 av[cnsnmas[i][j]]++; 00380 } 00381 } 00382 00383 // total number of selected nodes 00384 tnsn=0; 00385 for (i=0;i<tnbn;i++){ 00386 if (av[i]>0) 00387 tnsn++; 00388 } 00389 00390 // number of multiplicity of selected boundary/interface nodes 00391 if (snicmultip!=NULL){ 00392 delete [] snicmultip; 00393 } 00394 snicmultip = new long [tnsn]; 00395 00396 k=0; 00397 for (i=0;i<tnbn;i++){ 00398 if (av[i]>0){ 00399 snicmultip[k]=icmultip[i]; 00400 k++; 00401 } 00402 } 00403 00404 // local numbers of boundary/interface nodes appropriate to selected coarse node 00405 if (snlnbncn!=NULL){ 00406 for (i=0;i<tnsn;i++){ 00407 delete [] snlnbncn[i]; 00408 } 00409 delete [] snlnbncn; 00410 } 00411 snlnbncn = new long* [tnsn]; 00412 for (i=0;i<tnsn;i++){ 00413 snlnbncn[i]=new long [snicmultip[i]]; 00414 } 00415 00416 // global glued numbers of boundary/interface nodes appropriate to selected coarse node 00417 if (snggnbncn!=NULL){ 00418 for (i=0;i<tnsn;i++){ 00419 delete [] snggnbncn[i]; 00420 } 00421 delete [] snggnbncn; 00422 } 00423 snggnbncn = new long* [tnsn]; 00424 for (i=0;i<tnsn;i++){ 00425 snggnbncn[i]=new long [snicmultip[i]]; 00426 } 00427 00428 // subdomain id of interface/boundary nodes appropriate to coarse node 00429 if (snsid!=NULL){ 00430 for (i=0;i<tnsn;i++){ 00431 delete [] snsid[i]; 00432 } 00433 delete [] snsid; 00434 } 00435 snsid = new long* [tnsn]; 00436 for (i=0;i<tnsn;i++){ 00437 snsid[i] = new long [snicmultip[i]]; 00438 } 00439 00440 // loop over the number of all boundary/interface nodes 00441 k=0; 00442 for (i=0;i<tnbn;i++){ 00443 if (av[i]>0){ 00444 snicmultip[k]=icmultip[i]; 00445 for (j=0;j<snicmultip[k];j++){ 00446 snlnbncn[k][j]=lnbncn[i][j]; 00447 snggnbncn[k][j]=ggnbncn[i][j]; 00448 snsid[k][j]=sid[i][j]; 00449 } 00450 k++; 00451 } 00452 } 00453 00454 /* 00455 // node sorting 00456 for (i=0;i<tnsn;i++){ 00457 for (j=0;j<nodmultip[i];j++){ 00458 min=ns; 00459 for (k=j;k<nodmultip[i];k++){ 00460 if (lsn[i][k]<min){ 00461 min=lsn[i][k]; 00462 m=k; 00463 } 00464 } 00465 n=lsn[i][j]; 00466 lsn[i][j]=lsn[i][m]; 00467 lsn[i][m]=n; 00468 00469 n=ljn[i][j]; 00470 ljn[i][j]=ljn[i][m]; 00471 ljn[i][m]=n; 00472 } 00473 } 00474 */ 00475 00476 00477 00478 00479 00480 for (i=0;i<tnbn;i++){ 00481 delete [] lnbncn[i]; 00482 } 00483 delete [] lnbncn; 00484 lnbncn = NULL; 00485 00486 for (i=0;i<tnbn;i++){ 00487 delete [] ggnbncn[i]; 00488 } 00489 delete [] ggnbncn; 00490 ggnbncn = NULL; 00491 00492 for (i=0;i<tnbn;i++){ 00493 delete [] sid[i]; 00494 } 00495 delete [] sid; 00496 sid = NULL; 00497 00498 delete [] icmultip; 00499 icmultip = NULL; 00500 00501 delete [] av; 00502 00503 00504 // ******************* 00505 // auxiliary output 00506 // ******************* 00507 fprintf (out,"\n\n\n total number of selected nodes (tnsn) %ld",tnsn); 00508 fprintf (out,"\n\n\n local numbers of boundary/interface nodes appropriate to selected coarse node (snlnbncn)\n"); 00509 fprintf (out,"\n global glued numbers of boundary/interface nodes appropriate to selected coarse node (snggnbncn)\n"); 00510 fprintf (out,"\n subdomain id of interface/boundary nodes appropriate to coarse node (snsid)\n"); 00511 for (i=0;i<tnsn;i++){ 00512 fprintf (out,"\n sel. n. %6ld snicmultip %6ld\n",i,snicmultip[i]); 00513 for (j=0;j<snicmultip[i];j++){ 00514 fprintf (out," %6ld %6ld %6ld\n",snlnbncn[i][j],snggnbncn[i][j],snsid[i][j]); 00515 } 00516 } 00517 00518 } 00519 00520 00521 /** 00522 function searches for all possible DOFs in selected nodes 00523 prescribed DOFs are included 00524 00525 function assembles the following array: 00526 snndofmas - array of numbers of DOFs on subdomains at selected nodes 00527 00528 @param top - pointer to the general topology 00529 @param out - output file 00530 00531 JK, 31.7.2007 00532 */ 00533 void seqselnodes::number_all_dofs (gtopology *top,FILE *out) 00534 { 00535 long i,j,k; 00536 00537 if (snndofmas!=NULL) 00538 delete [] snndofmas; 00539 snndofmas=new long [ns]; 00540 00541 // loop over the number of subdomains 00542 for (i=0;i<ns;i++){ 00543 snndofmas[i]=0; 00544 00545 // loop over the number of selected nodes 00546 for (j=0;j<nsnmas[i];j++){ 00547 k=ggnsn[i][j]; 00548 snndofmas[i]+=top->give_ndofn (k); 00549 } 00550 } 00551 00552 fprintf (out,"\n\n numbers of DOFs on subdomains (snndofmas)\n"); 00553 for (i=0;i<ns;i++){ 00554 fprintf (out,"\n subdomain number %6ld %ld",i+1,snndofmas[i]); 00555 } 00556 00557 } 00558 00559 00560 /** 00561 function collects numbers of DOFs on selected nodes 00562 numbers are stored on master in the array snndofnmas 00563 00564 array snndofnmas is assembled 00565 00566 @param top - pointer to the general topology 00567 @param out - output file 00568 00569 JK, 31.7.2007 00570 */ 00571 void seqselnodes::ndofn_on_master (gtopology *top,FILE *out) 00572 { 00573 long i,j,k; 00574 00575 // array of numbers of DOF at selected nodes 00576 if (snndofnmas!=NULL){ 00577 for (i=0;i<ns;i++){ 00578 delete [] snndofnmas[i]; 00579 } 00580 delete [] snndofnmas; 00581 } 00582 snndofnmas = new long* [ns]; 00583 for (i=0;i<ns;i++){ 00584 snndofnmas[i] = new long [nsnmas[i]]; 00585 } 00586 00587 // loop over the number of subdomains 00588 for (i=0;i<ns;i++){ 00589 00590 // loop over the number of selected nodes 00591 for (j=0;j<nsnmas[i];j++){ 00592 k=ggnsn[i][j]; 00593 snndofnmas[i][j]=top->give_ndofn (k); 00594 } 00595 } 00596 00597 fprintf (out,"\n\n numbers of DOFs on selected nodes (snndofnmas)\n"); 00598 for (i=0;i<ns;i++){ 00599 fprintf (out,"\n subdomain number %6ld",i+1); 00600 for (j=0;j<nsnmas[i];j++){ 00601 fprintf (out,"\n selected node %6ld %ld",j+1,snndofnmas[i][j]); 00602 } 00603 } 00604 00605 } 00606 00607 00608 /** 00609 function assembles DOFs indicators at selected nodes 00610 00611 function assembles the array 00612 sndofmas - array of DOFs or indicators at selected nodes 00613 00614 @param top - pointer to the general topology 00615 @param out - output file 00616 00617 JK, 14.9.2007 00618 */ 00619 void seqselnodes::dof_indicators (gtopology *top,FILE *out) 00620 { 00621 long i,j,k,l; 00622 00623 // array of DOFs or indicators at selected nodes 00624 if (sndofmas!=NULL){ 00625 for (i=0;i<ns;i++){ 00626 for (j=0;j<nsnmas[i];j++){ 00627 delete [] sndofmas[i][j]; 00628 } 00629 delete [] sndofmas[i]; 00630 } 00631 delete [] sndofmas; 00632 } 00633 sndofmas = new long** [ns]; 00634 for (i=0;i<ns;i++){ 00635 sndofmas[i] = new long* [nsnmas[i]]; 00636 for (j=0;j<nsnmas[i];j++){ 00637 sndofmas[i][j] = new long [snndofnmas[i][j]]; 00638 } 00639 } 00640 00641 // loop over the number of subdomains 00642 for (i=0;i<ns;i++){ 00643 // loop over the number of selected nodes 00644 for (j=0;j<nsnmas[i];j++){ 00645 // loop over the number of DOFs on nodes 00646 for (k=0;k<snndofnmas[i][j];k++){ 00647 // global glued number of the selected node 00648 l=ggnsn[i][j]; 00649 sndofmas[i][j][k]=top->give_dof (l,k); 00650 } 00651 } 00652 } 00653 00654 fprintf (out,"\n\n DOFs indicators on master (sndofmas)\n"); 00655 for (i=0;i<ns;i++){ 00656 fprintf (out,"\n subdomain number %6ld",i+1); 00657 for (j=0;j<nsnmas[i];j++){ 00658 fprintf (out,"\n selected node %6ld ",j+1); 00659 for (k=0;k<snndofnmas[i][j];k++){ 00660 fprintf (out," %ld",sndofmas[i][j][k]); 00661 } 00662 } 00663 } 00664 00665 } 00666 00667 00668 /** 00669 function generates the Schur complement ordering 00670 00671 array codensn and ndofnsn are assembled 00672 00673 @param out - output file 00674 00675 JK, 10.7.2009 00676 */ 00677 void seqselnodes::schur_ordering (long **dofind,FILE *out) 00678 { 00679 long i,j,k,l,m,ndofn,g; 00680 long *av,*aux; 00681 00682 // array of code numbers of coarse nodes 00683 if (codensn!=NULL){ 00684 for (i=0;i<tnsn;i++){ 00685 delete [] codensn[i]; 00686 } 00687 delete [] codensn; 00688 } 00689 codensn = new long* [tnsn]; 00690 for (i=0;i<tnsn;i++){ 00691 codensn[i] = NULL; 00692 } 00693 // array of numbers of DOFs for selected nodes 00694 if (ndofnsn!=NULL){ 00695 delete [] ndofnsn; 00696 } 00697 ndofnsn = new long [tnsn]; 00698 00699 // loop over the number of subdomains 00700 for (i=0;i<ns;i++){ 00701 // loop over the number of selected nodes 00702 for (j=0;j<nsnmas[i];j++){ 00703 // global glued number of selected node 00704 g=ggnsn[i][j]; 00705 // coarse number of the selected node 00706 l=cnsnmas[i][j]; 00707 // number of DOFs on the selected node 00708 ndofn=snndofnmas[i][j]; 00709 00710 if (codensn[l]==NULL){ 00711 codensn[l] = new long [ndofn]; 00712 ndofnsn[l]=ndofn; 00713 } 00714 // loop over the number of DOFs on node 00715 for (k=0;k<ndofn;k++){ 00716 if (dofind[g][k]==1){ 00717 // this DOF is boundary/interface DOF 00718 codensn[l][k]=sndofmas[i][j][k]; 00719 } 00720 else{ 00721 // this DOF is internal DOF 00722 codensn[l][k]=0; 00723 } 00724 } 00725 } 00726 } 00727 00728 fprintf (out,"\n\n pole codensn \n"); 00729 for (i=0;i<tnsn;i++){ 00730 fprintf (out,"\n %ld %ld",codensn[i][0],codensn[i][1]); 00731 } 00732 fprintf (out,"\n\n"); 00733 00734 // *************************************************** 00735 // generation of code numbers in the coarse problem 00736 // *************************************************** 00737 00738 // searching of maximum code number 00739 tndofsn=0; 00740 // loop over the number of selected nodes 00741 for (i=0;i<tnsn;i++){ 00742 // loop over the number of DOFs on selected node 00743 for (j=0;j<ndofnsn[i];j++){ 00744 if (tndofsn<codensn[i][j]) 00745 tndofsn=codensn[i][j]; 00746 } 00747 } 00748 tndofsn--; 00749 if (tndofsn<0) tndofsn=0; 00750 aux = new long [tndofsn]; 00751 for (i=0;i<tndofsn;i++){ 00752 aux[i]=-1; 00753 } 00754 00755 // total number of DOFs on selected nodes 00756 tndofsn=1; 00757 // loop over the number of selected nodes 00758 for (i=0;i<tnsn;i++){ 00759 // loop over the number of DOFs on selected node 00760 for (j=0;j<ndofnsn[i];j++){ 00761 k=codensn[i][j]; 00762 if (k==1){ 00763 codensn[i][j]=tndofsn; 00764 tndofsn++; 00765 } 00766 if (k>1){ 00767 if (aux[k-2]==-1){ 00768 codensn[i][j]=tndofsn; 00769 aux[k-2]=tndofsn; 00770 tndofsn++; 00771 } 00772 else{ 00773 codensn[i][j]=aux[k-2]; 00774 } 00775 00776 } 00777 } 00778 } 00779 tndofsn--; 00780 delete [] aux; 00781 00782 fprintf (out,"\n\n pole codensn \n"); 00783 for (i=0;i<tnsn;i++){ 00784 fprintf (out,"\n %ld %ld",codensn[i][0],codensn[i][1]); 00785 } 00786 fprintf (out,"\n\n"); 00787 // ********************************************************** 00788 // end of generation of code numbers in the coarse problem 00789 // ********************************************************** 00790 00791 aux = new long [tndofsn]; 00792 00793 // this array will be recalculated 00794 // at this moment, it contains number of all 00795 for (i=0;i<ns;i++){ 00796 snndofmas[i]=0; 00797 } 00798 // loop over the number of subdomains 00799 for (i=0;i<ns;i++){ 00800 for (j=0;j<tndofsn;j++){ 00801 aux[j]=0; 00802 } 00803 // loop over the number of selected nodes 00804 for (j=0;j<nsnmas[i];j++){ 00805 // coarse number of the selected node 00806 l=cnsnmas[i][j]; 00807 // number of DOFs on the selected node 00808 ndofn=snndofnmas[i][j]; 00809 // loop over the number of DOFs on node 00810 for (k=0;k<ndofn;k++){ 00811 if (codensn[l][k]>0){ 00812 if (aux[codensn[l][k]-1]==0){ 00813 snndofmas[i]++; 00814 aux[codensn[l][k]-1]=1; 00815 } 00816 } 00817 } 00818 00819 } 00820 } 00821 00822 00823 // code numbers on master 00824 if (cndofmas!=NULL){ 00825 for (i=0;i<ns;i++){ 00826 delete [] cndofmas[i]; 00827 } 00828 delete [] cndofmas; 00829 } 00830 cndofmas = new long* [ns]; 00831 for (i=0;i<ns;i++){ 00832 cndofmas[i] = new long [snndofmas[i]]; 00833 } 00834 00835 // auxiliary array 00836 av = new long [ns]; 00837 for (i=0;i<ns;i++){ 00838 av[i]=0; 00839 } 00840 // loop over the number of subdomains 00841 for (i=0;i<ns;i++){ 00842 for (j=0;j<tndofsn;j++){ 00843 aux[j]=0; 00844 } 00845 // loop over the number of selected nodes 00846 for (j=0;j<nsnmas[i];j++){ 00847 // coarse number of the selected node 00848 l=cnsnmas[i][j]; 00849 // number of DOFs on the selected node 00850 ndofn=snndofnmas[i][j]; 00851 // loop over the number of DOFs on node 00852 for (k=0;k<ndofn;k++){ 00853 m=codensn[l][k]; 00854 if (m>0){ 00855 if (aux[m-1]==0){ 00856 cndofmas[i][av[i]]=m; 00857 av[i]++; 00858 aux[m-1]=1; 00859 } 00860 } 00861 } 00862 00863 } 00864 } 00865 delete [] av; 00866 delete [] aux; 00867 00868 // ******************* 00869 // auxiliary output 00870 // ******************* 00871 fprintf (out,"\n\n\n tndofsn - total number of DOFs in selected nodes %ld",tndofsn); 00872 00873 fprintf (out,"\n\n code numbers of Schur ordering (cndofmas)\n"); 00874 for (i=0;i<ns;i++){ 00875 fprintf (out,"\n subdomain number %6ld",i+1); 00876 for (j=0;j<snndofmas[i];j++){ 00877 fprintf (out,"\n dof %6ld %ld",j+1,cndofmas[i][j]); 00878 } 00879 } 00880 00881 } 00882 00883 /** 00884 function generates the Schur complement ordering 00885 00886 array codensn and ndofnsn are assembled 00887 00888 @param out - output file 00889 00890 JK, 10.7.2009 00891 */ 00892 /* 00893 void seqselnodes::schur_ordering_old (long **dofind,FILE *out) 00894 { 00895 long i,j,k,l,m,ndofn,g; 00896 long *av,*aux; 00897 00898 // array of code numbers of coarse nodes 00899 if (codensn!=NULL){ 00900 for (i=0;i<tnsn;i++){ 00901 delete [] codensn[i]; 00902 } 00903 delete [] codensn; 00904 } 00905 codensn = new long* [tnsn]; 00906 for (i=0;i<tnsn;i++){ 00907 codensn[i] = NULL; 00908 } 00909 // array of numbers of DOFs for selected nodes 00910 if (ndofnsn!=NULL){ 00911 delete [] ndofnsn; 00912 } 00913 ndofnsn = new long [tnsn]; 00914 00915 // loop over the number of subdomains 00916 for (i=0;i<ns;i++){ 00917 // loop over the number of selected nodes 00918 for (j=0;j<nsnmas[i];j++){ 00919 // global glued number of selected node 00920 g=ggnsn[i][j]; 00921 // coarse number of the selected node 00922 l=cnsnmas[i][j]; 00923 // number of DOFs on the selected node 00924 ndofn=snndofnmas[i][j]; 00925 00926 if (codensn[l]==NULL){ 00927 codensn[l] = new long [ndofn]; 00928 ndofnsn[l]=ndofn; 00929 } 00930 // loo over the number of DOFs on node 00931 for (k=0;k<ndofn;k++){ 00932 if (dofind[g][k]==1){ 00933 // this DOF is boundary/interface DOF 00934 codensn[l][k]=sndofmas[i][j][k]; 00935 } 00936 else{ 00937 // this DOF is internal DOF 00938 codensn[l][k]=0; 00939 } 00940 } 00941 } 00942 } 00943 00944 fprintf (out,"\n\n pole codensn \n"); 00945 for (i=0;i<tnsn;i++){ 00946 fprintf (out,"\n %ld %ld",codensn[i][0],codensn[i][1]); 00947 } 00948 fprintf (out,"\n\n"); 00949 00950 // *************************************************** 00951 // generation of code numbers in the coarse problem 00952 // *************************************************** 00953 00954 // searching of maximum code number 00955 tndofsn=0; 00956 // loop over the number of selected nodes 00957 for (i=0;i<tnsn;i++){ 00958 // loop over the number of DOFs on selected node 00959 for (j=0;j<ndofnsn[i];j++){ 00960 if (tndofsn<codensn[i][j]) 00961 tndofsn=codensn[i][j]; 00962 } 00963 } 00964 tndofsn--; 00965 if (tndofsn<0) tndofsn=0; 00966 aux = new long [tndofsn]; 00967 for (i=0;i<tndofsn;i++){ 00968 aux[i]=-1; 00969 } 00970 00971 // total number of DOFs on selected nodes 00972 tndofsn=1; 00973 // loop over the number of selected nodes 00974 for (i=0;i<tnsn;i++){ 00975 // loop over the number of DOFs on selected node 00976 for (j=0;j<ndofnsn[i];j++){ 00977 k=codensn[i][j]; 00978 if (k==1){ 00979 codensn[i][j]=tndofsn; 00980 tndofsn++; 00981 } 00982 if (k>1){ 00983 if (aux[k-2]==-1){ 00984 codensn[i][j]=tndofsn; 00985 aux[k-2]=tndofsn; 00986 tndofsn++; 00987 } 00988 else{ 00989 codensn[i][j]=aux[k-2]; 00990 } 00991 00992 } 00993 } 00994 } 00995 tndofsn--; 00996 delete [] aux; 00997 00998 fprintf (out,"\n\n pole codensn \n"); 00999 for (i=0;i<tnsn;i++){ 01000 fprintf (out,"\n %ld %ld",codensn[i][0],codensn[i][1]); 01001 } 01002 fprintf (out,"\n\n"); 01003 // ********************************************************** 01004 // end of generation of code numbers in the coarse problem 01005 // ********************************************************** 01006 01007 01008 // this array will be recalculated 01009 // at this moment, it contains number of all 01010 for (i=0;i<ns;i++){ 01011 snndofmas[i]=0; 01012 } 01013 // loop over the number of subdomains 01014 for (i=0;i<ns;i++){ 01015 // loop over the number of selected nodes 01016 for (j=0;j<nsnmas[i];j++){ 01017 // coarse number of the selected node 01018 l=cnsnmas[i][j]; 01019 // number of DOFs on the selected node 01020 ndofn=snndofnmas[i][j]; 01021 // loop over the number of DOFs on node 01022 for (k=0;k<ndofn;k++){ 01023 if (codensn[l][k]>0) 01024 snndofmas[i]++; 01025 } 01026 01027 } 01028 } 01029 01030 01031 // code numbers on master 01032 if (cnmas!=NULL){ 01033 for (i=0;i<ns;i++){ 01034 delete [] cnmas[i]; 01035 } 01036 delete [] cnmas; 01037 } 01038 cnmas = new long* [ns]; 01039 for (i=0;i<ns;i++){ 01040 cnmas[i] = new long [snndofmas[i]]; 01041 } 01042 01043 // auxiliary array 01044 av = new long [ns]; 01045 for (i=0;i<ns;i++){ 01046 av[i]=0; 01047 } 01048 // loop over the number of subdomains 01049 for (i=0;i<ns;i++){ 01050 // loop over the number of selected nodes 01051 for (j=0;j<nsnmas[i];j++){ 01052 // coarse number of the selected node 01053 l=cnsnmas[i][j]; 01054 // number of DOFs on the selected node 01055 ndofn=snndofnmas[i][j]; 01056 // loop over the number of DOFs on node 01057 for (k=0;k<ndofn;k++){ 01058 m=codensn[l][k]; 01059 if (m>0){ 01060 cnmas[i][av[i]]=m; 01061 av[i]++; 01062 } 01063 } 01064 01065 } 01066 } 01067 delete [] av; 01068 01069 // ******************* 01070 // auxiliary output 01071 // ******************* 01072 fprintf (out,"\n\n\n tndofsn - total number of DOFs in selected nodes %ld",tndofsn); 01073 01074 fprintf (out,"\n\n code numbers of Schur ordering (cnmas)\n"); 01075 for (i=0;i<ns;i++){ 01076 fprintf (out,"\n subdomain number %6ld",i+1); 01077 for (j=0;j<snndofmas[i];j++){ 01078 fprintf (out,"\n dof %6ld %ld",j+1,cnmas[i][j]); 01079 } 01080 } 01081 01082 } 01083 */ 01084 01085 01086 01087 /** 01088 function generates the Schur complement ordering 01089 01090 array codensn and ndofnsn are assembled 01091 01092 @param out - output file 01093 01094 JK, 10.7.2009 01095 */ 01096 /* 01097 void seqselnodes::schur_ordering_old_old (FILE *out) 01098 { 01099 long i,j,k,l,ndofn; 01100 long *av; 01101 01102 // array of code numbers of coarse nodes 01103 if (codensn!=NULL){ 01104 for (i=0;i<tnsn;i++){ 01105 delete [] codensn[i]; 01106 } 01107 delete [] codensn; 01108 } 01109 codensn = new long* [tnsn]; 01110 for (i=0;i<tnsn;i++){ 01111 codensn[i] = NULL; 01112 } 01113 // array of numbers of DOFs for selected nodes 01114 if (ndofnsn!=NULL){ 01115 delete [] ndofnsn; 01116 } 01117 ndofnsn = new long [tnsn]; 01118 01119 // loop over the number of subdomains 01120 for (i=0;i<ns;i++){ 01121 // loop over the number of selected nodes 01122 for (j=0;j<nsnmas[i];j++){ 01123 // coarse number of the selected node 01124 l=cnsnmas[i][j]; 01125 // number of DOFs on the selected node 01126 ndofn=snndofnmas[i][j]; 01127 01128 if (codensn[l]==NULL){ 01129 codensn[l] = new long [ndofn]; 01130 ndofnsn[l]=ndofn; 01131 } 01132 // loo over the number of DOFs on node 01133 for (k=0;k<ndofn;k++){ 01134 codensn[l][k]=sndofmas[i][j][k]; 01135 } 01136 } 01137 } 01138 01139 // total number of DOFs on selected nodes 01140 tndofsn=1; 01141 // loop over the number of selected nodes 01142 for (i=0;i<tnsn;i++){ 01143 // loop over the number of DOFs on selected node 01144 for (j=0;j<ndofnsn[i];j++){ 01145 if (codensn[i][j]==1){ 01146 codensn[i][j]=tndofsn; 01147 tndofsn++; 01148 } 01149 } 01150 } 01151 tndofsn--; 01152 01153 01154 // code numbers on master 01155 if (cnmas!=NULL){ 01156 for (i=0;i<ns;i++){ 01157 delete [] cnmas[i]; 01158 } 01159 delete [] cnmas; 01160 } 01161 cnmas = new long* [ns]; 01162 for (i=0;i<ns;i++){ 01163 cnmas[i] = new long [snndofmas[i]]; 01164 } 01165 01166 // auxiliary array 01167 av = new long [ns]; 01168 for (i=0;i<ns;i++){ 01169 av[i]=0; 01170 } 01171 // loop over the number of subdomains 01172 for (i=0;i<ns;i++){ 01173 // loop over the number of selected nodes 01174 for (j=0;j<nsnmas[i];j++){ 01175 // coarse number of the selected node 01176 l=cnsnmas[i][j]; 01177 // number of DOFs on the selected node 01178 ndofn=snndofnmas[i][j]; 01179 // loo over the number of DOFs on node 01180 for (k=0;k<ndofn;k++){ 01181 cnmas[i][av[i]]=codensn[l][k]; 01182 av[i]++; 01183 } 01184 01185 } 01186 } 01187 delete [] av; 01188 01189 01190 fprintf (out,"\n\n code numbers of Schur ordering (cnmas)\n"); 01191 for (i=0;i<ns;i++){ 01192 fprintf (out,"\n subdomain number %6ld",i+1); 01193 for (j=0;j<snndofmas[i];j++){ 01194 fprintf (out,"\n dof %6ld %ld",j+1,cnmas[i][j]); 01195 } 01196 } 01197 01198 01199 // odsud to bylo zakomentovano 01200 01201 long i,j,k,l,m,ii,ndofn; 01202 long *aux; 01203 01204 // determination of numbers of DOFs at selected nodes 01205 if (ndofnsn!=NULL) 01206 delete [] ndofnsn; 01207 ndofnsn = new long [tnsn]; 01208 for (i=0;i<tnsn;i++){ 01209 ndofnsn[i]=0; 01210 } 01211 01212 for (i=0;i<ns;i++){ 01213 for (j=0;j<nsnmas[i];j++){ 01214 k=ndofnmas[i][j]; 01215 l=gnn[i][j]; 01216 if (ndofnsn[l]>0){ 01217 if (ndofnsn[l]!=k){ 01218 fprintf (stderr,"\n\n incompatible number of DOFs at selected node number %ld (file %s, line %d)\n",l,__FILE__,__LINE__); 01219 } 01220 } 01221 else{ 01222 ndofnsn[l]=k; 01223 } 01224 } 01225 } 01226 01227 //fprintf (out,"\n\n kontrola ndofnsn"); 01228 //for (i=0;i<tnsn;i++){ 01229 //fprintf (out,"\n %ld %ld",i+1,ndofnsn[i]); 01230 //} 01231 01232 01233 // code number indicators 01234 cnm = new long* [tnsn]; 01235 for (i=0;i<tnsn;i++){ 01236 cnm[i] = new long [ndofnsn[i]]; 01237 } 01238 01239 for (i=0;i<ns;i++){ 01240 for (j=0;j<nsnmas[i];j++){ 01241 l=gnn[i][j]; 01242 for (k=0;k<ndofnsn[l];k++){ 01243 cnm[l][k]=dofmas[i][j][k]; 01244 } 01245 } 01246 } 01247 01248 01249 01250 // added 4.5.2009 01251 // searching of maximum code number 01252 tndof=0; 01253 for (i=0;i<tnsn;i++){ 01254 for (j=0;j<ndofnsn[i];j++){ 01255 if (cnm[i][j]>tndof) 01256 tndof=cnm[i][j]; 01257 } 01258 } 01259 tndof--; 01260 if (tndof<0) tndof=0; 01261 aux = new long [tndof]; 01262 for (i=0;i<tndof;i++){ 01263 aux[i]=-1; 01264 } 01265 01266 01267 // code number generation 01268 tndof=1; 01269 for (i=0;i<tnsn;i++){ 01270 for (j=0;j<ndofnsn[i];j++){ 01271 k=cnm[i][j]; 01272 if (k<0) continue; 01273 if (k==0) continue; 01274 if (k==1){ 01275 cnm[i][j]=tndof; 01276 tndof++; 01277 } 01278 if (k>1){ 01279 if (aux[k-2]==-1){ 01280 cnm[i][j]=tndof; 01281 aux[k-2]=tndof; 01282 tndof++; 01283 } 01284 else{ 01285 cnm[i][j]=aux[k-2]; 01286 } 01287 } 01288 } 01289 } 01290 tndof--; 01291 01292 delete [] aux; 01293 01294 // computation of real number of DOFs on subdomains 01295 // supports are not included now 01296 for (i=0;i<ns;i++){ 01297 ndofdom[i]=0; 01298 for (j=0;j<nsnmas[i];j++){ 01299 l=gnn[i][j]; 01300 for (k=0;k<ndofnsn[l];k++){ 01301 if (cnm[l][k]>0) 01302 ndofdom[i]++; 01303 } 01304 } 01305 } 01306 01307 cnmas = new long *[ns]; 01308 for (i=0;i<ns;i++){ 01309 cnmas[i] = new long [ndofdom[i]]; 01310 } 01311 01312 for (i=0;i<ns;i++){ 01313 m=0; 01314 for (j=0;j<nsnmas[i];j++){ 01315 l=gnn[i][j]; 01316 for (k=0;k<ndofnsn[l];k++){ 01317 if (cnm[l][k]>0){ 01318 cnmas[i][m]=cnm[l][k]; 01319 m++; 01320 } 01321 } 01322 } 01323 } 01324 01325 01326 // zde by se dalo smazat pole cnm 01327 01328 01329 01330 01331 01332 // number of contributions to the coarse problem 01333 // number of DOFs which contribute to the coarse problem 01334 for (ii=0;ii<ns;ii++){ 01335 ndofdom[ii]=0; 01336 for (i=0;i<nsnmas[ii];i++){ 01337 l=lsngg[ii][i]; 01338 ndofn=top->give_ndofn (l); 01339 for (k=0;k<ndofn;k++){ 01340 if (top->give_dof (l,k)>0) 01341 ndofdom[ii]++; 01342 } 01343 } 01344 } 01345 01346 // list of code numbers which are extracted from domain in the FETI method 01347 // some code numbers are positive and some of them are negative 01348 // it depends on number of subdomain 01349 // these code numbers are used on subdomains, master processor contains corresponding array with coarse code numbers 01350 01351 if (ldof!=NULL){ 01352 for (i=0;i<ns;i++){ 01353 delete [] ldof[i]; 01354 } 01355 delete [] ldof; 01356 } 01357 ldof = new long* [ns]; 01358 for (i=0;i<ns;i++){ 01359 ldof[i] = new long [ndofdom[i]]; 01360 } 01361 01362 for (ii=0;ii<ns;ii++){ 01363 m=0; 01364 for (i=0;i<nsnmas[ii];i++){ 01365 l=lsngg[ii][i]; 01366 ndofn=top->give_ndofn (l); 01367 for (j=0;j<ndofn;j++){ 01368 k=top->give_dof (l,j); 01369 if (k>0){ 01370 ldof[ii][m]=k; 01371 m++; 01372 } 01373 } 01374 } 01375 } 01376 01377 01378 fprintf (out,"\n array ldof"); 01379 for (ii=0;ii<ns;ii++){ 01380 for (i=0;i<ndofdom[ii];i++){ 01381 fprintf (out,"\n %6ld %6ld %ld",ii+1,i+1,ldof[ii][i]); 01382 } 01383 } 01384 01385 fprintf (out,"\n\n actual numbers of DOFs on subdomains (ndofdom)\n"); 01386 for (i=0;i<ns;i++){ 01387 fprintf (out,"\n subdomain number %6ld %ld",i+1,ndofdom[i]); 01388 } 01389 01390 fprintf (out,"\n\n code numbers of Schur ordering (cnmas)\n"); 01391 for (i=0;i<ns;i++){ 01392 fprintf (out,"\n subdomain number %6ld",i+1); 01393 for (j=0;j<ndofdom[i];j++){ 01394 fprintf (out,"\n dof %6ld %ld",j+1,cnmas[i][j]); 01395 } 01396 } 01397 01398 01399 01400 } 01401 */ 01402 01403 /** 01404 function prepares all data for the Schur complement method 01405 01406 @param gt - pointer to the general topology 01407 @param out - output file 01408 01409 JK, 21.5.2009 01410 */ 01411 void seqselnodes::prepare_schur (gtopology *top,FILE *out) 01412 { 01413 node_coarse_numbers (out); 01414 number_all_dofs (top,out); 01415 ndofn_on_master (top,out); 01416 dof_indicators (top,out); 01417 schur_ordering (top->stop->dofind,out); 01418 } 01419 01420 01421 01422 01423 01424 01425 01426 01427 01428 01429 01430 01431 01432 01433 01434 01435 01436 01437 01438 01439 01440 01441 01442 01443 01444 01445 01446 01447 01448 01449 01450 /** 01451 function computes multiplicity of selected nodes 01452 01453 function assembles array nodmultip 01454 01455 JK, 14.9.2007 01456 */ 01457 /* 01458 void seqselnodes::node_multiplicity (FILE *out) 01459 { 01460 long i,j; 01461 01462 if (nodmultip!=NULL) 01463 delete [] nodmultip; 01464 nodmultip = new long [tnsn]; 01465 for (i=0;i<tnsn;i++){ 01466 nodmultip[i]=0; 01467 } 01468 01469 for (i=0;i<ns;i++){ 01470 for (j=0;j<nsnmas[i];j++){ 01471 nodmultip[gnn[i][j]]++; 01472 } 01473 } 01474 01475 fprintf (out,"\n\n node multiplicity (nodmultip)\n"); 01476 for (i=0;i<tnsn;i++){ 01477 fprintf (out,"\n selected node %6ld %ld",i+1,nodmultip[i]); 01478 } 01479 01480 } 01481 */ 01482 01483 01484 01485 /** 01486 function assembles lists of connected nodes to coarse nodes 01487 and numbers of subdomains which contain connected nodes 01488 01489 arrays ljn and lsn are assembled 01490 01491 JK, 14.9.2007 01492 */ 01493 /* 01494 void seqselnodes::group_local_nodes (FILE *out) 01495 { 01496 long i,j,k,m,n,min; 01497 01498 ljn = new long* [tnsn]; 01499 lsn = new long* [tnsn]; 01500 for (i=0;i<tnsn;i++){ 01501 ljn[i] = new long [nodmultip[i]]; 01502 lsn[i] = new long [nodmultip[i]]; 01503 nodmultip[i]=0; 01504 } 01505 01506 // list of local node numbers of connected nodes 01507 // list of numbers of subdomains which contains connected nodes 01508 for (i=0;i<ns;i++){ 01509 for (j=0;j<nsnmas[i];j++){ 01510 k=gnn[i][j]; 01511 ljn[k][nodmultip[k]]=j; 01512 lsn[k][nodmultip[k]]=i; 01513 nodmultip[k]++; 01514 } 01515 } 01516 01517 01518 // node sorting 01519 for (i=0;i<tnsn;i++){ 01520 for (j=0;j<nodmultip[i];j++){ 01521 min=ns; 01522 for (k=j;k<nodmultip[i];k++){ 01523 if (lsn[i][k]<min){ 01524 min=lsn[i][k]; 01525 m=k; 01526 } 01527 } 01528 n=lsn[i][j]; 01529 lsn[i][j]=lsn[i][m]; 01530 lsn[i][m]=n; 01531 01532 n=ljn[i][j]; 01533 ljn[i][j]=ljn[i][m]; 01534 ljn[i][m]=n; 01535 } 01536 } 01537 01538 fprintf (out,"\n\n list of local node numbers of connected nodes (ljn)\n"); 01539 fprintf (out,"\n\n list of numbers of subdomains which contains connected nodes (lsn)\n"); 01540 for (i=0;i<tnsn;i++){ 01541 fprintf (out,"\n coarse node %6ld multip %6ld ",i+1,nodmultip[i]); 01542 for (j=0;j<nodmultip[i];j++){ 01543 fprintf (out," %ld %ld",ljn[i][j],lsn[i][j]); 01544 } 01545 } 01546 01547 } 01548 */ 01549 01550 /** 01551 function assembles indicators of code numbers and then generates 01552 code numbers 01553 01554 JK, 14.9.2007 01555 */ 01556 /* 01557 void seqselnodes::dof_feti (FILE *out) 01558 { 01559 long i,j,k,l,m; 01560 01561 // determination of numbers of DOFs at selected nodes 01562 if (ndofnsn!=NULL) 01563 delete [] ndofnsn; 01564 ndofnsn = new long [tnsn]; 01565 for (i=0;i<tnsn;i++){ 01566 ndofnsn[i]=0; 01567 } 01568 01569 for (i=0;i<ns;i++){ 01570 for (j=0;j<nsnmas[i];j++){ 01571 k=ndofnmas[i][j]; 01572 l=gnn[i][j]; 01573 if (ndofnsn[l]>0){ 01574 if (ndofnsn[l]!=k){ 01575 fprintf (stderr,"\n\n incompatible number of DOFs at selected node number %ld (file %s, line %d)\n",l,__FILE__,__LINE__); 01576 } 01577 } 01578 else{ 01579 ndofnsn[l]=k; 01580 } 01581 } 01582 } 01583 01584 //fprintf (out,"\n\n kontrola ndofnsn"); 01585 //for (i=0;i<tnsn;i++){ 01586 //fprintf (out,"\n %ld %ld",i+1,ndofnsn[i]); 01587 //} 01588 01589 01590 // array allocation 01591 doffeti = new long** [tnsn]; 01592 for (i=0;i<tnsn;i++){ 01593 doffeti[i] = new long* [nodmultip[i]]; 01594 for (j=0;j<nodmultip[i];j++){ 01595 doffeti[i][j] = new long [ndofnsn[i]]; 01596 } 01597 } 01598 01599 // assembling of code numbers indicators 01600 for (i=0;i<tnsn;i++){ 01601 for (j=0;j<nodmultip[i];j++){ 01602 l=ljn[i][j]; 01603 m=lsn[i][j]; 01604 for (k=0;k<ndofnsn[i];k++){ 01605 doffeti[i][j][k]=dofmas[m][l][k]; 01606 } 01607 } 01608 } 01609 01610 // code numbers generation 01611 tndof=1; 01612 for (i=0;i<tnsn;i++){ 01613 for (j=0;j<nodmultip[i]-1;j++){ 01614 for (k=0;k<ndofnsn[i];k++){ 01615 if (doffeti[i][j][k]>0){ 01616 doffeti[i][j][k]=tndof; 01617 tndof++; 01618 } 01619 } 01620 } 01621 } 01622 tndof--; 01623 01624 fprintf (out,"\n\n code numbers for FETI method (doffeti)\n"); 01625 for (i=0;i<tnsn;i++){ 01626 fprintf (out,"\n coarse node %6ld",i+1); 01627 for (j=0;j<nodmultip[i]-1;j++){ 01628 fprintf (out," con.n. %6ld sub.n. %6ld ",ljn[i][j],lsn[i][j]); 01629 for (k=0;k<ndofnsn[i];k++){ 01630 fprintf (out," %ld",doffeti[i][j][k]); 01631 } 01632 } 01633 } 01634 01635 } 01636 */ 01637 01638 /** 01639 function determines the multiplicity of unknowns 01640 the multiplicity of unknown is obtained from the multiplicity of nodes 01641 01642 array dofmultip is allocated and assembled 01643 01644 @param out - output file 01645 01646 JB 01647 */ 01648 /* 01649 void seqselnodes::dof_multiplicity (FILE *out) 01650 { 01651 long i,j,k,n; 01652 long ndofn; 01653 long nm; 01654 01655 if(dofmultip != NULL){ 01656 delete []dofmultip; 01657 } 01658 01659 01660 dofmultip = new long[tndof]; 01661 n = 0; 01662 01663 for(i = 0; i < tnsn; i++){ 01664 nm = nodmultip[i]; 01665 for(j = 0; j < nm-1; j++){ 01666 ndofn = ndofnsn[i]; 01667 for(k = 0; k < ndofn; k++){ 01668 if(doffeti[i][j][k] > 0){ 01669 dofmultip[n] = nm; 01670 n++; 01671 } 01672 } 01673 } 01674 } 01675 01676 //fprintf (out,"\n\n\n Multiplicity of coarse DOF n = %ld\n\n",n); 01677 //for(i = 0; i < tndof; i++){ 01678 //fprintf (out,"coarse DOF %ld has multiplicity %ld\n",i+1,dofmultip[i]); 01679 //} 01680 01681 //ldofmultip = new long*[ns]; 01682 //for(i = 0; i < ns; i++){ 01683 //ldofmultip[i] = new long[ndofdom[i]]; 01684 //for(j = 0; j < ndofdom[i]; j++){ 01685 //ldofmultip[i][j] = dofmultip[cnmas[i][j]-1]; 01686 //} 01687 //} 01688 01689 //fprintf (out,"\n\n\n local multiplicity of coarse DOF\n\n"); 01690 //for(i = 0; i < ns; i++){ 01691 //fprintf (out,"domain %ld\n",i+1); 01692 //for(j = 0; j < ndofdom[i]; j++){ 01693 //fprintf (out,"%ld %ld %ld\n",j+1,cnmas[i][j],ldofmultip[i][j]); 01694 //} 01695 //} 01696 01697 01698 } 01699 */ 01700 01701 /** 01702 function determines number of contributions to coarse problem 01703 from particular subdomains 01704 01705 maxndof is rewritten 01706 ndofdom is rewritten 01707 01708 array ncn is assembled 01709 01710 JK, 14.9.2007 01711 */ 01712 /* 01713 void seqselnodes::number_contrib (FILE *out) 01714 { 01715 long i,j,k,l,m,ii; 01716 01717 if (ndofdom!=NULL) 01718 delete [] ndofdom; 01719 ndofdom = new long [ns]; 01720 for (i=0;i<ns;i++){ 01721 ndofdom[i]=0; 01722 } 01723 01724 if (ncnmas!=NULL) 01725 delete [] ncnmas; 01726 ncnmas = new long [ns]; 01727 for (i=0;i<ns;i++){ 01728 ncnmas[i]=0; 01729 } 01730 01731 // number of contributing DOFs from subdomains to coarse problem 01732 for (i=0;i<ns;i++){ 01733 for (j=0;j<nsnmas[i];j++){ 01734 ii=gnn[i][j]; 01735 for (k=0;k<nodmultip[ii];k++){ 01736 if (lsn[ii][k]==i){ 01737 if (k==0){ 01738 for (l=0;l<nodmultip[ii]-1;l++){ 01739 ncnmas[i]++; 01740 for (m=0;m<ndofnsn[ii];m++){ 01741 if (doffeti[ii][l][m]>0) 01742 ndofdom[i]++; 01743 } 01744 } 01745 } 01746 else{ 01747 ncnmas[i]++; 01748 for (m=0;m<ndofnsn[ii];m++){ 01749 if (doffeti[ii][k-1][m]>0) 01750 ndofdom[i]++; 01751 } 01752 } 01753 break; 01754 } 01755 } 01756 } 01757 } 01758 01759 fprintf (out,"\n\n number of contributing DOFs to coarse problem (ndofdom)\n"); 01760 for (i=0;i<ns;i++){ 01761 fprintf (out,"\n subdomain number %6ld %ld",i+1,ndofdom[i]); 01762 } 01763 fprintf (out,"\n\n number of nodes which contribute to coarse FETI problem (ncn)\n"); 01764 for (i=0;i<ns;i++){ 01765 fprintf (out,"\n domain %ld %ld",i,ncnmas[i]); 01766 } 01767 01768 } 01769 01770 */ 01771 01772 01773 /** 01774 function assmebles nodes contributing to the coarse proble in the FETI method 01775 01776 JK, 14.9.2007 01777 */ 01778 /* 01779 void seqselnodes::contrib_dofs (gtopology *top,FILE *out) 01780 { 01781 long i,j,k,l,m,ii,jj,kk,ndofn,min; 01782 long *buff; 01783 01784 //ndofdom = new long [ns]; 01785 ldof = new long* [ns]; 01786 01787 // array of local numbers of nodes contributing to the coarse problem 01788 for (i=0;i<ns;i++){ 01789 01790 buff = new long [ncnmas[i]]; 01791 for (j=0;j<ncnmas[i];j++){ 01792 buff[j]=0; 01793 } 01794 01795 m=0; 01796 for (j=0;j<tnsn;j++){ 01797 for (k=0;k<nodmultip[j];k++){ 01798 if (lsn[j][k]==i){ 01799 if (k==0){ 01800 for (l=0;l<nodmultip[j]-1;l++){ 01801 buff[m]=ljn[j][k]; 01802 buff[m]=0-buff[m]-1; 01803 m++; 01804 } 01805 } 01806 else{ 01807 buff[m]=ljn[j][k]; 01808 m++; 01809 } 01810 break; 01811 } 01812 } 01813 } 01814 01815 01816 for (ii=0;ii<ncnmas[i];ii++){ 01817 if (buff[ii]<0) 01818 min=0-buff[ii]-1; 01819 else 01820 min=buff[ii]; 01821 01822 l=ii; 01823 for (j=ii+1;j<ncnmas[i];j++){ 01824 if (buff[j]<0) 01825 k=0-buff[j]-1; 01826 else 01827 k=buff[j]; 01828 01829 if (min>k){ 01830 l=j; 01831 min=k; 01832 } 01833 } 01834 01835 01836 k=buff[ii]; 01837 buff[ii]=buff[l]; 01838 buff[l]=k; 01839 } 01840 01841 fprintf (out,"\n\n kontrola bufferu na vsech uzlech"); 01842 for (j=0;j<ncnmas[i];j++){ 01843 fprintf (out,"\n %ld %ld",j+1,buff[j]); 01844 } 01845 //fprintf (out,"\n konec kontroly\n"); 01846 //fprintf (out,"\n\n kontrola lsnl na vsech uzlech"); 01847 //for (i=0;i<nsn;i++){ 01848 //fprintf (out,"\n %ld %ld",i+1,lsnl[i]); 01849 //} 01850 //fprintf (out,"\n konec kontroly\n"); 01851 01852 01853 01854 // number of contributions to the coarse problem 01855 // number of DOFs which contribute to the coarse problem 01856 //ndofdom[i]=0; 01857 //for (ii=0;ii<ncnmas[i];ii++){ 01858 //j=buff[ii]; 01859 //if (j<0){ 01860 //j=0-j-1; 01861 //} 01862 //l=lsng[i][j]; 01863 //l=lsnl[i][j]; 01864 //ndofn=top->give_ndofn (l); 01865 //for (k=0;k<ndofn;k++){ 01866 //if (top->give_dof (l,k)>0) 01867 //ndofdom[i]++; 01868 //} 01869 //} 01870 01871 // list of code numbers which are extracted from domain in the FETI method 01872 // some code numbers are positive and some of them are negative 01873 // it depends on number of subdomain 01874 // these code numbers are used on subdomains, master processor contains corresponding array with coarse code numbers 01875 01876 ldof[i] = new long [ndofdom[i]]; 01877 01878 m=0; 01879 for (kk=0;kk<ncnmas[i];kk++){ 01880 ii=buff[kk]; 01881 if (ii<0){ 01882 ii=0-ii-1; 01883 //jj=lsng[i][ii]; 01884 jj=lsnl[i][ii]; 01885 ndofn=top->give_ndofn (jj); 01886 for (j=0;j<ndofn;j++){ 01887 l=top->give_dof (jj,j); 01888 if (l>0){ 01889 ldof[i][m]=0-l; 01890 m++; 01891 } 01892 } 01893 } 01894 else{ 01895 //jj=lsng[i][ii]; 01896 jj=lsnl[i][ii]; 01897 ndofn=top->give_ndofn (jj); 01898 for (j=0;j<ndofn;j++){ 01899 l=top->give_dof (jj,j); 01900 if (l>0){ 01901 ldof[i][m]=l; 01902 m++; 01903 } 01904 } 01905 } 01906 } 01907 01908 delete [] buff; 01909 } 01910 01911 01912 cnmas = new long* [ns]; 01913 for (i=0;i<ns;i++){ 01914 cnmas[i] = new long [ndofdom[i]]; 01915 } 01916 01917 for (i=0;i<ns;i++){ 01918 l=0; 01919 for (j=0;j<nsnmas[i];j++){ 01920 m=gnn[i][j]; 01921 for (k=0;k<nodmultip[m];k++){ 01922 if (lsn[m][k]==i){ 01923 if (k==0){ 01924 for (ii=0;ii<nodmultip[m]-1;ii++){ 01925 for (jj=0;jj<ndofnsn[m];jj++){ 01926 if (doffeti[m][ii][jj]>0){ 01927 cnmas[i][l]=doffeti[m][ii][jj]; 01928 l++; 01929 } 01930 } 01931 } 01932 } 01933 else{ 01934 for (jj=0;jj<ndofnsn[m];jj++){ 01935 if (doffeti[m][k-1][jj]>0){ 01936 cnmas[i][l]=doffeti[m][k-1][jj]; 01937 l++; 01938 } 01939 } 01940 } 01941 break; 01942 } 01943 } 01944 } 01945 } 01946 01947 fprintf (out,"\n array ldof"); 01948 for (i=0;i<ns;i++){ 01949 fprintf (out,"\n\n %ld number of DOFs which contribute to coarse FETI problem %ld",i,ndofdom[i]); 01950 for (j=0;j<ndofdom[i];j++){ 01951 fprintf (out,"\n %6ld %ld",j+1,ldof[i][j]); 01952 } 01953 } 01954 01955 fprintf (out,"\n\n code numbers on master (cnmas)\n"); 01956 for (i=0;i<ns;i++){ 01957 fprintf (out,"\n subdomain number %6ld (number of DOFs %ld)",i+1,ndofdom[i]); 01958 for (j=0;j<ndofdom[i];j++){ 01959 fprintf (out,"\n %6ld %ld",j+1,cnmas[i][j]); 01960 } 01961 } 01962 01963 } 01964 */ 01965 01966 01967 01968 01969 01970 01971 /** 01972 function defines type of implementation of the FETI method 01973 possible types can be found in the file galias.h 01974 01975 @param fi - type of the FETI implementation 01976 01977 JK, 29.9.2009 01978 */ 01979 void seqselnodes::define_feti_implementation (fetiimplem fi) 01980 { 01981 fetiimpl = fi; 01982 } 01983 01984 /** 01985 function searches for all possible contributing DOFs in selected nodes 01986 prescribed DOFs are included 01987 01988 if a node is shared by n subdomains, it may contribute n-1 times 01989 this strategy is used in the FETI method 01990 in the case of the Schur complement method, each node contributes only once 01991 01992 function assembles the following array: 01993 snndofmas - array of numbers of contributing DOFs on subdomains in selected nodes 01994 01995 @param top - pointer to the general topology 01996 @param out - output file 01997 01998 JK, 29.9.2009 01999 */ 02000 void seqselnodes::number_contrib_dofs (gtopology *top,FILE *out) 02001 { 02002 long i,j,k,sdid,ggn,ndofn,mult,cn; 02003 02004 if (snicmultip==NULL) 02005 print_err("array snicmultip has not been allocated", __FILE__, __LINE__, __func__); 02006 if (snsid==NULL) 02007 print_err("array snsid has not been allocated", __FILE__, __LINE__, __func__); 02008 if (snggnbncn==NULL) 02009 print_err("array snggnbncn has not been allocated", __FILE__, __LINE__, __func__); 02010 02011 02012 if (snndofmas!=NULL) 02013 delete [] snndofmas; 02014 snndofmas=new long [ns]; 02015 for (i=0;i<ns;i++){ 02016 snndofmas[i]=0; 02017 } 02018 02019 // **************************************************************** 02020 // number of contributing DOFs from subdomains to coarse problem 02021 // **************************************************************** 02022 switch (fetiimpl){ 02023 case boolean_matrices:{ 02024 break; 02025 } 02026 case nonredundant:{ 02027 02028 // loop over the number of all selected nodes 02029 for (i=0;i<tnsn;i++){ 02030 // loop over the node multiplicity 02031 for (j=0;j<snicmultip[i];j++){ 02032 // id of subdomain which shares the node belonging to the coarse node 02033 sdid=snsid[i][j]; 02034 // global glued number of node shared by the coarse node 02035 ggn=snggnbncn[i][j]; 02036 // number of DOFs in the selected node 02037 ndofn = top->give_ndofn (ggn); 02038 if (j==0){ 02039 // subdomain with the least number 02040 // master subdomain 02041 snndofmas[sdid]+=ndofn*(snicmultip[i]-1); 02042 } 02043 else{ 02044 // subdomain with the non-least number 02045 // slave subdomains 02046 snndofmas[sdid]+=ndofn; 02047 } 02048 } 02049 } 02050 02051 break; 02052 } 02053 case redundant:{ 02054 02055 // loop over the number of subdomains 02056 for (i=0;i<ns;i++){ 02057 snndofmas[i]=0; 02058 02059 // loop over the number of selected nodes 02060 for (j=0;j<nsnmas[i];j++){ 02061 // coarse number of selected node 02062 cn = cnsnmas[i][j]; 02063 // multiplicity of the selected node 02064 mult = snicmultip[cn]; 02065 // global glued number of the selected node 02066 ggn = ggnsn[i][j]; 02067 // number of DOFs in the selected node 02068 ndofn = top->give_ndofn (ggn); 02069 02070 // loop over the node multiplicity 02071 for (k=0;k<mult-1;k++){ 02072 snndofmas[i]+=ndofn; 02073 } 02074 } 02075 } 02076 02077 break; 02078 } 02079 default:{ 02080 print_err("unknown type of the FETI implementation is required", __FILE__, __LINE__, __func__); 02081 } 02082 } 02083 02084 02085 02086 02087 02088 // ******************* 02089 // auxiliary output 02090 // ******************* 02091 fprintf (out,"\n\n numbers of contributing DOFs on subdomains (snndofmas)\n"); 02092 for (i=0;i<ns;i++){ 02093 fprintf (out,"\n subdomain number %6ld %ld",i+1,snndofmas[i]); 02094 } 02095 02096 } 02097 02098 02099 /** 02100 function assembles indicators of code numbers and then generates 02101 code numbers 02102 02103 @param top - pointer to the general topology 02104 @param out - output file 02105 02106 JK, 14.9.2007, revised 29.9.2009 02107 */ 02108 void seqselnodes::dof_feti (gtopology *top,FILE *out) 02109 { 02110 long i,j,k,l,ggn,ggnj,ggnk,ndofn,dofj,dofk; 02111 02112 // determination of numbers of DOFs at selected nodes 02113 if (ndofnsn!=NULL) 02114 delete [] ndofnsn; 02115 ndofnsn = new long [tnsn]; 02116 for (i=0;i<tnsn;i++){ 02117 ndofnsn[i]=0; 02118 } 02119 02120 switch (fetiimpl){ 02121 case boolean_matrices:{ 02122 break; 02123 } 02124 case nonredundant:{ 02125 02126 // loop over the number of all selected nodes 02127 for (i=0;i<tnsn;i++){ 02128 // global glued number of node shared by the coarse node 02129 ggn=snggnbncn[i][0]; 02130 // number of DOFs in the selected node 02131 ndofn = top->give_ndofn (ggn); 02132 02133 //ndofnsn[i]=ndofn*(snicmultip[i]-1); 02134 ndofnsn[i]=ndofn; 02135 } 02136 02137 break; 02138 } 02139 case redundant:{ 02140 02141 // loop over the number of all selected nodes 02142 for (i=0;i<tnsn;i++){ 02143 // global glued number of node shared by the coarse node 02144 ggn=snggnbncn[i][0]; 02145 // number of DOFs in the selected node 02146 ndofn = top->give_ndofn (ggn); 02147 02148 //ndofnsn[i]=ndofn*snicmultip[i]*(snicmultip[i]-1)/2; 02149 ndofnsn[i]=ndofn; 02150 } 02151 02152 break; 02153 } 02154 default:{ 02155 print_err("unknown type of the FETI implementation is required", __FILE__, __LINE__, __func__); 02156 } 02157 } 02158 // array ndofnsn is assembled 02159 02160 02161 // array allocation 02162 doffeti = new long*** [tnsn]; 02163 for (i=0;i<tnsn;i++){ 02164 doffeti[i] = new long** [snicmultip[i]]; 02165 for (j=0;j<snicmultip[i];j++){ 02166 doffeti[i][j] = new long* [snicmultip[i]]; 02167 for (k=0;k<snicmultip[i];k++){ 02168 doffeti[i][j][k] = new long [ndofnsn[i]]; 02169 } 02170 } 02171 } 02172 02173 02174 // **************************************** 02175 // assembling of code numbers indicators 02176 // **************************************** 02177 02178 switch (fetiimpl){ 02179 case boolean_matrices:{ 02180 break; 02181 } 02182 case nonredundant:{ 02183 02184 // loop over the number of all selected nodes 02185 for (i=0;i<tnsn;i++){ 02186 // loop over the node multiplicity 02187 for (j=0;j<snicmultip[i];j++){ 02188 // global glued number of node shared by the coarse node 02189 ggnj=snggnbncn[i][j]; 02190 for (k=0;k<snicmultip[i];k++){ 02191 if (k==j){ 02192 // node has to be connected with different node 02193 02194 // loop over the number of DOFs in the selected node 02195 for (l=0;l<ndofnsn[i];l++){ 02196 doffeti[i][j][k][l]=0; 02197 } 02198 continue; 02199 } 02200 02201 // global glued number of node shared by the coarse node 02202 ggnk=snggnbncn[i][k]; 02203 02204 // loop over the number of DOFs in the selected node 02205 for (l=0;l<ndofnsn[i];l++){ 02206 // DOF in the j-th node connected to the coarse node 02207 dofj=top->give_dof (ggnj,l); 02208 // DOF in the k-th node connected to the coarse node 02209 dofk=top->give_dof (ggnk,l); 02210 02211 if (dofj!=dofk) 02212 print_err("incompatible DOFs in the j-th unknown type of the FETI implementation is required", __FILE__, __LINE__, __func__); 02213 02214 if (j==0 || k==0){ 02215 // only the first row and column are assembled 02216 doffeti[i][j][k][l]=dofj; 02217 }else{ 02218 // all remaining components are equal to zero 02219 doffeti[i][j][k][l]=0; 02220 } 02221 } 02222 } 02223 } 02224 } 02225 02226 break; 02227 } 02228 case redundant:{ 02229 02230 // loop over the number of all selected nodes 02231 for (i=0;i<tnsn;i++){ 02232 // loop over the node multiplicity 02233 for (j=0;j<snicmultip[i];j++){ 02234 // global glued number of node shared by the coarse node 02235 ggnj=snggnbncn[i][j]; 02236 02237 // loop over the node multiplicity 02238 for (k=0;k<snicmultip[i];k++){ 02239 if (k==j){ 02240 // the node has to be connected to different node 02241 02242 // loop over the number of DOFs in the selected node 02243 for (l=0;l<ndofnsn[i];l++){ 02244 doffeti[i][j][k][l]=0; 02245 } 02246 continue; 02247 } 02248 02249 // global glued number of node shared by the coarse node 02250 ggnk=snggnbncn[i][k]; 02251 02252 // loop over the number of DOFs in the selected node 02253 for (l=0;l<ndofnsn[i];l++){ 02254 // DOF in the j-th node connected to the coarse node 02255 dofj=top->give_dof (ggnj,l); 02256 // DOF in the k-th node connected to the coarse node 02257 dofk=top->give_dof (ggnk,l); 02258 02259 if (dofj!=dofk) 02260 print_err("incompatible DOFs in the j-th unknown type of the FETI implementation is required", __FILE__, __LINE__, __func__); 02261 02262 doffeti[i][j][k][l]=dofj; 02263 } 02264 } 02265 } 02266 } 02267 02268 break; 02269 } 02270 default:{ 02271 print_err("unknown type of the FETI implementation is required", __FILE__, __LINE__, __func__); 02272 } 02273 } 02274 // array doffeti is assembled 02275 02276 02277 // ************************** 02278 // code numbers generation 02279 // ************************** 02280 switch (fetiimpl){ 02281 case boolean_matrices:{ 02282 break; 02283 } 02284 case nonredundant:{ 02285 tndofsn=1; 02286 // loop over the number of selected nodes 02287 for (i=0;i<tnsn;i++){ 02288 j=0; 02289 // loop over the node multiplicity 02290 for (k=1;k<snicmultip[i];k++){ 02291 // loop over the number of DOFs in the node 02292 for (l=0;l<ndofnsn[i];l++){ 02293 if (doffeti[i][j][k][l]>0){ 02294 doffeti[i][j][k][l]=tndofsn; 02295 doffeti[i][k][j][l]=tndofsn; 02296 tndofsn++; 02297 } 02298 } 02299 } 02300 } 02301 tndofsn--; 02302 02303 break; 02304 } 02305 case redundant:{ 02306 tndofsn=1; 02307 // loop over the number of selected nodes 02308 for (i=0;i<tnsn;i++){ 02309 // loop over the node multiplicity 02310 for (j=0;j<snicmultip[i];j++){ 02311 // loop over the node multiplicity 02312 for (k=j+1;k<snicmultip[i];k++){ 02313 // loop over the number of DOFs in the node 02314 for (l=0;l<ndofnsn[i];l++){ 02315 if (doffeti[i][j][k][l]>0){ 02316 doffeti[i][j][k][l]=tndofsn; 02317 doffeti[i][k][j][l]=tndofsn; 02318 tndofsn++; 02319 } 02320 } 02321 } 02322 } 02323 } 02324 tndofsn--; 02325 02326 break; 02327 } 02328 default:{ 02329 print_err("unknown type of FETI implementation is required", __FILE__, __LINE__, __func__); 02330 } 02331 } 02332 02333 02334 // ******************* 02335 // auxiliary output 02336 // ******************* 02337 fprintf (out,"\n\n total number of DOFs in selected nodes (tndofsn) %ld",tndofsn); 02338 fprintf (out,"\n\n code numbers for FETI method (doffeti)\n"); 02339 for (i=0;i<tnsn;i++){ 02340 fprintf (out,"\n\n coarse node %6ld",i+1); 02341 for (j=0;j<snicmultip[i];j++){ 02342 fprintf (out,"\n "); 02343 for (k=0;k<snicmultip[i];k++){ 02344 fprintf (out," "); 02345 for (l=0;l<ndofnsn[i];l++){ 02346 fprintf (out," %5ld",doffeti[i][j][k][l]); 02347 } 02348 } 02349 } 02350 } 02351 02352 } 02353 02354 /** 02355 function assembles local number of DOFs contributing to the coarse problem in the FETI method 02356 02357 @param top - pointer to the topology 02358 @param out - output file 02359 02360 JK, 14.9.2007, revised 2.10.2009 02361 */ 02362 void seqselnodes::contrib_dofs_ln (gtopology *top,FILE *out) 02363 { 02364 long i,j,k,l,ndofn,sdid,ggnj,dofj,sdidk; 02365 02366 for (i=0;i<ns;i++){ 02367 snndofmas[i]=0; 02368 } 02369 02370 switch (fetiimpl){ 02371 case boolean_matrices:{ 02372 break; 02373 } 02374 case nonredundant:{ 02375 02376 // loop over the number of all selected nodes 02377 for (i=0;i<tnsn;i++){ 02378 // loop over the node multiplicity 02379 for (j=0;j<snicmultip[i];j++){ 02380 // id of subdomain which shares the node belonging to the coarse node 02381 sdid=snsid[i][j]; 02382 // global glued number of node shared by the coarse node 02383 ggnj=snggnbncn[i][j]; 02384 if (j==0){ 02385 // node belonging to the subdomain with the least number 02386 02387 // loop over the node multiplicity 02388 for (k=1;k<snicmultip[i];k++){ 02389 // loop over the number of DOFs in the selected node 02390 for (l=0;l<ndofnsn[i];l++){ 02391 if (doffeti[i][j][k][l]>0){ 02392 snndofmas[sdid]++; 02393 } 02394 } 02395 } 02396 } 02397 else{ 02398 // loop over the number of DOFs in the selected node 02399 for (l=0;l<ndofnsn[i];l++){ 02400 if (doffeti[i][j][0][l]>0){ 02401 snndofmas[sdid]++; 02402 } 02403 } 02404 } 02405 } 02406 } 02407 02408 break; 02409 } 02410 case redundant:{ 02411 02412 // loop over the number of all selected nodes 02413 for (i=0;i<tnsn;i++){ 02414 // loop over the node multiplicity 02415 for (j=0;j<snicmultip[i];j++){ 02416 // id of subdomain which shares the node belonging to the coarse node 02417 sdid=snsid[i][j]; 02418 // global glued number of node shared by the coarse node 02419 ggnj=snggnbncn[i][j]; 02420 // number of DOFs in the selected node 02421 ndofn = top->give_ndofn (ggnj); 02422 // loop over the node multiplicity 02423 for (k=0;k<snicmultip[i];k++){ 02424 if (k==j){ 02425 // node has to be connected with different node 02426 continue; 02427 } 02428 02429 // loop over the number of DOFs in the selected node 02430 for (l=0;l<ndofnsn[i];l++){ 02431 if (doffeti[i][j][k][l]>0){ 02432 snndofmas[sdid]++; 02433 } 02434 } 02435 } 02436 } 02437 } 02438 02439 break; 02440 } 02441 default:{ 02442 print_err("unknown type of the FETI implementation is required", __FILE__, __LINE__, __func__); 02443 } 02444 } 02445 02446 02447 02448 // list of local code numbers which contribute to the coarse problem 02449 lndofmas = new long* [ns]; 02450 for (i=0;i<ns;i++){ 02451 lndofmas[i] = new long [snndofmas[i]]; 02452 snndofmas[i]=0; 02453 } 02454 02455 02456 02457 switch (fetiimpl){ 02458 case boolean_matrices:{ 02459 break; 02460 } 02461 case nonredundant:{ 02462 02463 // loop over the number of all selected nodes 02464 for (i=0;i<tnsn;i++){ 02465 // loop over the node multiplicity 02466 for (j=0;j<snicmultip[i];j++){ 02467 // id of subdomain which shares the node belonging to the coarse node 02468 sdid=snsid[i][j]; 02469 // global glued number of node shared by the coarse node 02470 ggnj=snggnbncn[i][j]; 02471 // number of DOFs in the selected node 02472 ndofn = top->give_ndofn (ggnj); 02473 if (j==0){ 02474 // node belonging to the subdomain with the least number 02475 02476 // loop over the node multiplicity 02477 for (k=1;k<snicmultip[i];k++){ 02478 // loop over the number of DOFs in the selected node 02479 for (l=0;l<ndofnsn[i];l++){ 02480 if (doffeti[i][j][k][l]>0){ 02481 // DOF in the j-th node connected to the coarse node 02482 dofj=top->give_dof (ggnj,l); 02483 lndofmas[sdid][snndofmas[sdid]]=0-dofj; 02484 snndofmas[sdid]++; 02485 } 02486 } 02487 } 02488 } 02489 else{ 02490 // loop over the number of DOFs in the selected node 02491 for (l=0;l<ndofnsn[i];l++){ 02492 if (doffeti[i][j][0][l]>0){ 02493 // DOF in the j-th node connected to the coarse node 02494 dofj=top->give_dof (ggnj,l); 02495 lndofmas[sdid][snndofmas[sdid]]=dofj; 02496 snndofmas[sdid]++; 02497 } 02498 } 02499 } 02500 } 02501 } 02502 02503 break; 02504 } 02505 case redundant:{ 02506 02507 // loop over the number of all selected nodes 02508 for (i=0;i<tnsn;i++){ 02509 // loop over the node multiplicity 02510 for (j=0;j<snicmultip[i];j++){ 02511 // id of subdomain which shares the node belonging to the coarse node 02512 sdid=snsid[i][j]; 02513 // global glued number of node shared by the coarse node 02514 ggnj=snggnbncn[i][j]; 02515 // number of DOFs in the selected node 02516 ndofn = top->give_ndofn (ggnj); 02517 // loop over the node multiplicity 02518 for (k=0;k<snicmultip[i];k++){ 02519 if (k==j){ 02520 // node has to be connected with different node 02521 continue; 02522 } 02523 02524 // id of subdomain which shares the node belonging to the coarse node 02525 sdidk=snsid[i][k]; 02526 02527 // loop over the number of DOFs in the selected node 02528 for (l=0;l<ndofnsn[i];l++){ 02529 // DOF in the j-th node connected to the coarse node 02530 dofj=top->give_dof (ggnj,l); 02531 02532 if (doffeti[i][j][k][l]>0){ 02533 if (sdid<sdidk){ 02534 lndofmas[sdid][snndofmas[sdid]]=0-dofj; 02535 }else{ 02536 lndofmas[sdid][snndofmas[sdid]]=dofj; 02537 } 02538 snndofmas[sdid]++; 02539 } 02540 } 02541 } 02542 } 02543 } 02544 02545 break; 02546 } 02547 default:{ 02548 print_err("unknown type of the FETI implementation is required", __FILE__, __LINE__, __func__); 02549 } 02550 } 02551 02552 02553 // ******************* 02554 // auxiliary output 02555 // ******************* 02556 fprintf (out,"\n\n\n array of numbers of DOFs on subdomains at selected nodes (snndofmas)"); 02557 fprintf (out,"\n\n\n list of code numbers which contribute to the coarse problem (lndofmas)"); 02558 for (i=0;i<ns;i++){ 02559 fprintf (out,"\n subdomain %6ld snndofmas %6ld\n",i,snndofmas[i]); 02560 for (j=0;j<snndofmas[i];j++){ 02561 fprintf (out," %ld",lndofmas[i][j]); 02562 } 02563 } 02564 02565 } 02566 02567 /** 02568 function assembles coarse code numbers of DOFs contributing to the coarse proble in the FETI method 02569 02570 @param out - output file 02571 02572 JK, 14.9.2007, revised 5.10.2009 02573 */ 02574 void seqselnodes::contrib_dofs_cn (FILE *out) 02575 { 02576 long i,j,k,l,sdid; 02577 02578 // list of coarse code numbers which contribute to the coarse problem 02579 cndofmas = new long* [ns]; 02580 for (i=0;i<ns;i++){ 02581 cndofmas[i] = new long [snndofmas[i]]; 02582 snndofmas[i]=0; 02583 } 02584 02585 switch (fetiimpl){ 02586 case boolean_matrices:{ 02587 break; 02588 } 02589 case nonredundant:{ 02590 02591 // loop over the number of all selected nodes 02592 for (i=0;i<tnsn;i++){ 02593 // loop over the node multiplicity 02594 for (j=0;j<snicmultip[i];j++){ 02595 // id of subdomain which shares the node belonging to the coarse node 02596 sdid=snsid[i][j]; 02597 if (j==0){ 02598 // node belonging to the subdomain with the least number 02599 02600 // loop over the node multiplicity 02601 for (k=1;k<snicmultip[i];k++){ 02602 // loop over the number of DOFs in the selected node 02603 for (l=0;l<ndofnsn[i];l++){ 02604 if (doffeti[i][j][k][l]>0){ 02605 cndofmas[sdid][snndofmas[sdid]]=doffeti[i][j][k][l]; 02606 snndofmas[sdid]++; 02607 } 02608 } 02609 } 02610 } 02611 else{ 02612 // loop over the number of DOFs in the selected node 02613 for (l=0;l<ndofnsn[i];l++){ 02614 if (doffeti[i][j][0][l]>0){ 02615 cndofmas[sdid][snndofmas[sdid]]=doffeti[i][j][0][l]; 02616 snndofmas[sdid]++; 02617 } 02618 } 02619 } 02620 } 02621 } 02622 02623 break; 02624 } 02625 case redundant:{ 02626 02627 // loop over the number of all selected nodes 02628 for (i=0;i<tnsn;i++){ 02629 // loop over the node multiplicity 02630 for (j=0;j<snicmultip[i];j++){ 02631 // id of subdomain which shares the node belonging to the coarse node 02632 sdid=snsid[i][j]; 02633 // loop over the node multiplicity 02634 for (k=0;k<snicmultip[i];k++){ 02635 if (k==j){ 02636 // node has to be connected with different node 02637 continue; 02638 } 02639 02640 // loop over the number of DOFs in the selected node 02641 for (l=0;l<ndofnsn[i];l++){ 02642 02643 if (doffeti[i][j][k][l]>0){ 02644 cndofmas[sdid][snndofmas[sdid]]=doffeti[i][j][k][l]; 02645 snndofmas[sdid]++; 02646 } 02647 } 02648 } 02649 } 02650 } 02651 02652 break; 02653 } 02654 default:{ 02655 print_err("unknown type of the FETI implementation is required", __FILE__, __LINE__, __func__); 02656 } 02657 } 02658 02659 02660 // ******************* 02661 // auxiliary output 02662 // ******************* 02663 fprintf (out,"\n\n coarse code numbers on master (cndofmas)\n"); 02664 for (i=0;i<ns;i++){ 02665 fprintf (out,"\n subdomain number %6ld (number of DOFs %ld)",i,snndofmas[i]); 02666 for (j=0;j<snndofmas[i];j++){ 02667 fprintf (out,"\n %6ld %ld",j,cndofmas[i][j]); 02668 } 02669 } 02670 02671 } 02672 02673 02674 02675 02676 02677 02678 02679 02680 02681 /** 02682 function prepares all data for the FETI method 02683 02684 @param fi - type of FETI implementation, possibilities are in the file galias.h 02685 @param gt - pointer to the general topology 02686 @param out - output file 02687 02688 JK, 18.11.2007 02689 */ 02690 long seqselnodes::prepare_feti (fetiimplem fi,gtopology *top,FILE *out) 02691 { 02692 long ndof; 02693 02694 define_feti_implementation (fi); 02695 node_coarse_numbers (out); 02696 number_contrib_dofs (top,out); 02697 dof_feti (top,out); 02698 top->cngen=1; 02699 ndof = top->codenum_generation (out); 02700 contrib_dofs_ln (top,out); 02701 contrib_dofs_cn (out); 02702 02703 return ndof; 02704 02705 //contrib_dofs_ln (top,out); 02706 //contrib_dofs_cn (out); 02707 02708 /* 02709 //nodes_on_master (gt->nn,out); 02710 //node_multiplicity (out); 02711 number_all_dofs (gt,out); 02712 ndofn_on_master (gt,out); 02713 dof_indicators (gt,out); 02714 group_local_nodes (out); 02715 dof_feti (out); 02716 //dof_multiplicity (out); 02717 number_contrib (out); 02718 contrib_dofs (gt,out); 02719 dof_multiplicity (out); 02720 */ 02721 } 02722 02723 02724 02725 02726 02727 02728 02729 02730 02731 02732 02733 02734 02735 02736 02737 02738 02739 02740 02741 02742 02743 02744 02745 02746 02747 02748 02749 02750 02751 02752 02753 02754 02755 02756 02757 02758 02759 02760 02761 02762 02763 02764 02765 02766 02767 02768 02769 02770 02771 02772 02773 02774 02775 02776 02777 02778 02779 02780 02781 02782 02783 02784 02785 02786 02787 02788 02789 /** 02790 function assembles lists of connected nodes to coarse nodes 02791 and numbers of subdomains which contain connected nodes 02792 02793 arrays ljn and lsn are assembled 02794 02795 JK, 14.9.2007, revised 23.9.2009 02796 */ 02797 /* 02798 void seqselnodes::coarse_local_nodes (FILE *out) 02799 { 02800 long i,j,k,m,n,min; 02801 02802 ljn = new long* [tnsn]; 02803 lsn = new long* [tnsn]; 02804 for (i=0;i<tnsn;i++){ 02805 ljn[i] = new long [nodmultip[i]]; 02806 lsn[i] = new long [nodmultip[i]]; 02807 nodmultip[i]=0; 02808 } 02809 02810 // list of local node numbers of connected nodes 02811 // list of numbers of subdomains which contains connected nodes 02812 for (i=0;i<ns;i++){ 02813 for (j=0;j<nsndom[i];j++){ 02814 k=gnn[i][j]; 02815 ljn[k][nodmultip[k]]=j; 02816 lsn[k][nodmultip[k]]=i; 02817 nodmultip[k]++; 02818 } 02819 } 02820 02821 02822 // node sorting 02823 for (i=0;i<tnsn;i++){ 02824 for (j=0;j<nodmultip[i];j++){ 02825 min=ns; 02826 for (k=j;k<nodmultip[i];k++){ 02827 if (lsn[i][k]<min){ 02828 min=lsn[i][k]; 02829 m=k; 02830 } 02831 } 02832 n=lsn[i][j]; 02833 lsn[i][j]=lsn[i][m]; 02834 lsn[i][m]=n; 02835 02836 n=ljn[i][j]; 02837 ljn[i][j]=ljn[i][m]; 02838 ljn[i][m]=n; 02839 } 02840 } 02841 02842 fprintf (out,"\n\n list of local node numbers of connected nodes (ljn)\n"); 02843 fprintf (out,"\n\n list of numbers of subdomains which contains connected nodes (lsn)\n"); 02844 for (i=0;i<tnsn;i++){ 02845 fprintf (out,"\n coarse node %6ld multip %6ld ",i+1,nodmultip[i]); 02846 for (j=0;j<nodmultip[i];j++){ 02847 fprintf (out," %ld %ld",ljn[i][j],lsn[i][j]); 02848 } 02849 } 02850 02851 } 02852 */ 02853 02854 /** 02855 function assembles indicators of code numbers and then generates 02856 code numbers 02857 02858 @param out - output file 02859 02860 JK, 14.9.2007, revised 29.9.2009 02861 */ 02862 /* 02863 void seqselnodes::dof_feti (FILE *out) 02864 { 02865 long i,j,k,l,m; 02866 02867 // determination of numbers of DOFs at selected nodes 02868 if (ndofnsn!=NULL) 02869 delete [] ndofnsn; 02870 ndofnsn = new long [tnsn]; 02871 for (i=0;i<tnsn;i++){ 02872 ndofnsn[i]=0; 02873 } 02874 02875 // loop over the number of subdomains 02876 for (i=0;i<ns;i++){ 02877 // loop over the number of selected nodes 02878 for (j=0;j<nsnmas[i];j++){ 02879 // number of DOFs in the selected node 02880 k=ndofnmas[i][j]; 02881 // global glued number of the selected node 02882 l=ggnsn[i][j]; 02883 if (ndofnsn[l]>0){ 02884 if (ndofnsn[l]!=k){ 02885 fprintf (stderr,"\n\n incompatible number of DOFs at selected node number %ld (file %s, line %d)\n",l,__FILE__,__LINE__); 02886 } 02887 } 02888 else{ 02889 ndofnsn[l]=k; 02890 } 02891 } 02892 } 02893 // array ndofnsn is assembled 02894 02895 // array allocation 02896 doffeti = new long** [tnsn]; 02897 for (i=0;i<tnsn;i++){ 02898 doffeti[i] = new long* [snicmultip[i]]; 02899 for (j=0;j<snicmultip[i];j++){ 02900 doffeti[i][j] = new long [ndofnsn[i]]; 02901 } 02902 } 02903 02904 // assembling of code numbers indicators 02905 // loop over the number of all selected nodes 02906 for (i=0;i<tnsn;i++){ 02907 // loop over the node multiplicity 02908 for (j=0;j<snicmultip[i];j++){ 02909 // local number of node shared by the coarse node 02910 //l=ljn[i][j]; 02911 l=snlnbncn[i][j]; 02912 // id of subdomain which shares the node belonging to the coarse node 02913 //m=lsn[i][j]; 02914 m=snsid[i][j]; 02915 // loop over the number of DOFs in the selected node 02916 for (k=0;k<ndofnsn[i];k++){ 02917 doffeti[i][j][k]=dofmas[m][l][k]; 02918 } 02919 } 02920 } 02921 // array doffeti is assembled 02922 02923 // ************************** 02924 // code numbers generation 02925 // ************************** 02926 switch (fetiimpl){ 02927 case nonredundant:{ 02928 tndof=1; 02929 for (i=0;i<tnsn;i++){ 02930 for (j=0;j<nodmultip[i]-1;j++){ 02931 for (k=0;k<ndofnsn[i];k++){ 02932 if (doffeti[i][j][k]>0){ 02933 doffeti[i][j][k]=tndof; 02934 tndof++; 02935 } 02936 } 02937 } 02938 } 02939 tndof--; 02940 02941 break; 02942 } 02943 case redundant:{ 02944 tndof=1; 02945 for (i=0;i<tnsn;i++){ 02946 for (j=0;j<nodmultip[i]-1;j++){ 02947 for (k=0;k<ndofnsn[i];k++){ 02948 if (doffeti[i][j][k]>0){ 02949 doffeti[i][j][k]=tndof; 02950 tndof++; 02951 } 02952 } 02953 } 02954 } 02955 tndof--; 02956 02957 break; 02958 } 02959 default:{ 02960 print_err("unknown type of FETI implementation is required", __FILE__, __LINE__, __func__); 02961 } 02962 } 02963 02964 02965 fprintf (out,"\n\n code numbers for FETI method (doffeti)\n"); 02966 for (i=0;i<tnsn;i++){ 02967 fprintf (out,"\n coarse node %6ld",i+1); 02968 for (j=0;j<nodmultip[i]-1;j++){ 02969 fprintf (out," con.n. %6ld sub.n. %6ld ",ljn[i][j],lsn[i][j]); 02970 for (k=0;k<ndofnsn[i];k++){ 02971 fprintf (out," %ld",doffeti[i][j][k]); 02972 } 02973 } 02974 } 02975 02976 } 02977 02978 */ 02979 02980 02981 02982 02983 02984 02985 02986 /** 02987 function searches for all possible contributing DOFs in selected nodes 02988 prescribed DOFs are included 02989 02990 if a node is shared by n subdomains, it contributes n-1 times 02991 this strategy is used in the FETI method 02992 in the case of the Schur complement method, each node contributes only once 02993 02994 function assembles the following array: 02995 snndofmas - array of numbers of DOFs on subdomains at selected nodes 02996 02997 @param top - pointer to the general topology 02998 @param out - output file 02999 03000 JK, 22.9.2009 03001 */ 03002 /* 03003 void seqselnodes::number_contrib_dofs (gtopology *top,FILE *out) 03004 { 03005 long i,j,k; 03006 03007 if (snicmultip==NULL) 03008 print_err("array snicmultip has not been allocated", __FILE__, __LINE__, __func__); 03009 if (ndofnsn==NULL) 03010 print_err("array ndofnsn has not been allocated", __FILE__, __LINE__, __func__); 03011 if (snsid==NULL) 03012 print_err("array snsid has not been allocated", __FILE__, __LINE__, __func__); 03013 if (doffeti==NULL) 03014 print_err("array doffeti has not been allocated", __FILE__, __LINE__, __func__); 03015 03016 03017 if (snndofmas!=NULL) 03018 delete [] snndofmas; 03019 snndofmas=new long [ns]; 03020 03021 // loop over the number of subdomains 03022 for (i=0;i<ns;i++){ 03023 snndofmas[i]=0; 03024 03025 // loop over the number of selected nodes 03026 for (j=0;j<nsnmas[i];j++){ 03027 // coarse number of selected node 03028 cn = cnsnmas[i][j]; 03029 // multiplicity of the selected node 03030 mult = snicmultip[cn]; 03031 // global glued number of the selected node 03032 ggn = ggnsn[i][j]; 03033 // number of DOFs in the selected node 03034 ndofn = top->give_ndofn (ggn); 03035 03036 // loop over the node multiplicity 03037 for (k=0;k<mult-1;k++){ 03038 snndofmas[i]+=ndofn; 03039 } 03040 } 03041 } 03042 03043 03044 // number of contributing DOFs from subdomains to coarse problem 03045 // loop over the number of subdomains 03046 for (i=0;i<ns;i++){ 03047 // loop over the number of selected nodes on subdomains 03048 for (j=0;j<nsnmas[i];j++){ 03049 // global glued number of the selected node 03050 ii=ggnsn[i][j]; 03051 // coarse number of selected node 03052 cn = cnsnmas[i][j]; 03053 // loop over the multiplicity 03054 for (k=0;k<snicmultip[cn];k++){ 03055 if (snsid[cn][k]==i){ 03056 if (k==0){ 03057 for (l=0;l<snicmultip[cn]-1;l++){ 03058 ncnmas[i]++; 03059 for (m=0;m<ndofnsn[ii];m++){ 03060 if (doffeti[ii][l][m]>0) 03061 snndofmas[i]++; 03062 } 03063 } 03064 } 03065 else{ 03066 ncnmas[i]++; 03067 for (m=0;m<ndofnsn[ii];m++){ 03068 if (doffeti[ii][k-1][m]>0) 03069 snndofmas[i]++; 03070 } 03071 } 03072 break; 03073 } 03074 } 03075 } 03076 } 03077 03078 03079 03080 03081 03082 fprintf (out,"\n\n numbers of contributing DOFs on subdomains (snndofmas)\n"); 03083 for (i=0;i<ns;i++){ 03084 fprintf (out,"\n subdomain number %6ld %ld",i+1,snndofmas[i]); 03085 } 03086 03087 } 03088 */ 03089 03090 03091 03092 /** 03093 function assembles DOFs indicators on master 03094 03095 array dofmas is assembled 03096 03097 JK, 14.9.2007 03098 */ 03099 /* 03100 void seqselnodes::dof_indicators (gtopology *top,FILE *out) 03101 { 03102 long i,j,k,l; 03103 03104 dofmas = new long** [ns]; 03105 for (i=0;i<ns;i++){ 03106 dofmas[i] = new long* [nsndom[i]]; 03107 for (j=0;j<nsndom[i];j++){ 03108 dofmas[i][j] = new long [ndofnmas[i][j]]; 03109 } 03110 } 03111 03112 for (i=0;i<ns;i++){ 03113 for (j=0;j<nsndom[i];j++){ 03114 for (k=0;k<ndofnmas[i][j];k++){ 03115 //l=lsng[i][j]; 03116 l=lsnl[i][j]; 03117 dofmas[i][j][k]=top->give_dof (l,k); 03118 } 03119 } 03120 } 03121 03122 fprintf (out,"\n\n DOFs indicators on master (dofmas)\n"); 03123 for (i=0;i<ns;i++){ 03124 fprintf (out,"\n subdomain number %6ld",i+1); 03125 for (j=0;j<nsndom[i];j++){ 03126 fprintf (out,"\n selected node %6ld ",j+1); 03127 for (k=0;k<ndofnmas[i][j];k++){ 03128 fprintf (out," %ld",dofmas[i][j][k]); 03129 } 03130 } 03131 } 03132 03133 } 03134 03135 */