00001 #include "hexahedc.h"
00002 #include "global.h"
00003 #include "globalt.h"
00004 #include "globalc.h"
00005 #include "linhex.h"
00006 #include "quadhex.h"
00007 #include "linhext.h"
00008 #include "quadhext.h"
00009 #include "genfile.h"
00010 #include "globmatt.h"
00011 #include "globmatc.h"
00012 #include "globmat.h"
00013 #include "node.h"
00014 #include "element.h"
00015 #include "intpoints.h"
00016
00017 hexahedc::hexahedc (void)
00018 {
00019 long i,j;
00020
00021 if (Cp->lbb==lin_lin){
00022
00023 mnb=Lhex->nb;
00024
00025 mndofe=Lhex->ndofe;
00026
00027 nnemp = Lhex->nne;
00028
00029 tnmcomp=Lhex->tncomp;
00030
00031 mncomp=Lhex->ncomp;
00032
00033 nnetp = Lht->nne;
00034
00035 tndofe = Lht->ndofe;
00036 }
00037
00038 if (Cp->lbb==quad_lin){
00039
00040 mnb=Qhex->nb;
00041
00042 mndofe=Qhex->ndofe;
00043
00044 nnemp = Qhex->nne;
00045
00046 tnmcomp=Qhex->tncomp;
00047
00048 mncomp=Qhex->ncomp;
00049
00050 nnetp = Lht->nne;
00051
00052 tndofe = Lht->ndofe;
00053 }
00054
00055 if (Cp->lbb==quad_quad){
00056
00057 mnb=Qhex->nb;
00058
00059 mndofe=Qhex->ndofe;
00060
00061 nnemp = Qhex->nne;
00062
00063 tnmcomp=Qhex->tncomp;
00064
00065 mncomp=Qhex->ncomp;
00066
00067 nnetp = Qht->nne;
00068
00069 tndofe = Qht->ndofe;
00070 }
00071
00072
00073
00074 ntm=Tp->ntm;
00075
00076
00077
00078 intordvum=NULL; intordvlm=NULL;
00079 nipu=NULL; nipl=NULL;
00080
00081
00082 dofe = new long [ntm];
00083
00084 nipu = new long* [mnb];
00085
00086 nipl = new long* [ntm];
00087
00088 intordvum = new long* [mnb];
00089
00090 intordvlm = new long* [ntm];
00091
00092 for (i=0;i<mnb;i++){
00093 nipu[i] = new long [ntm];
00094 intordvum[i] = new long [ntm];
00095 }
00096 for (i=0;i<ntm;i++){
00097 nipl[i] = new long [mnb];
00098 intordvlm[i] = new long [mnb];
00099 }
00100
00101
00102 mordering = new long [mndofe];
00103
00104 for (i=0;i<mndofe;i++){
00105 mordering[i]=i+1;
00106 }
00107
00108
00109 if (Cp->lbb==lin_lin){
00110 switch (Tp->tmatt){
00111 case onemedium:{
00112 intordvum[0][0]=2; intordvlm[0][0]=2;
00113 nipu[0][0]=8; nipl[0][0]=8;
00114 dofe[0]=nnetp;
00115 break;
00116 }
00117 case twomediacoup:{
00118 intordvum[0][0]=2; intordvum[0][1]=2;
00119 intordvlm[0][0]=2; intordvlm[1][0]=2;
00120
00121 if (Cp->savemode==0){
00122 nipu[0][0]=8; nipu[0][1]=8;
00123 nipl[0][0]=8; nipl[1][0]=8;
00124 }
00125 if (Cp->savemode==1){
00126 nipu[0][0]=8; nipu[0][1]=0;
00127 nipl[0][0]=8; nipl[1][0]=0;
00128 }
00129
00130 dofe[0]=nnetp; dofe[1]=nnetp;
00131 break;
00132 }
00133 case threemediacoup:{
00134 intordvum[0][0]=2; intordvum[0][1]=2; intordvum[0][2]=2;
00135 intordvlm[0][0]=2; intordvlm[1][0]=2; intordvlm[2][0]=2;
00136
00137 if (Cp->savemode==0){
00138 nipu[0][0]=8; nipu[0][1]=8; nipu[0][2]=8;
00139 nipl[0][0]=8; nipl[1][0]=8; nipl[2][0]=8;
00140 }
00141 if (Cp->savemode==1){
00142 nipu[0][0]=8; nipu[0][1]=0; nipu[0][2]=0;
00143 nipl[0][0]=8; nipl[1][0]=0; nipl[2][0]=0;
00144 }
00145
00146 dofe[0]=nnetp; dofe[1]=nnetp; dofe[2]=nnetp;
00147 break;
00148 }
00149 default:{
00150 fprintf (stderr,"\n\n unknown type of transported matter is required");
00151 fprintf (stderr,"\n in function hexahedc::hexahedc (file %s, line %d).\n",__FILE__,__LINE__);
00152 }
00153 }
00154 }
00155
00156 if (Cp->lbb==quad_lin){
00157 switch (Tp->tmatt){
00158 case onemedium:{
00159 intordvum[0][0]=2; intordvlm[0][0]=2;
00160 nipu[0][0]=8; nipl[0][0]=8;
00161 dofe[0]=nnetp;
00162 break;
00163 }
00164 case twomediacoup:{
00165 intordvum[0][0]=2; intordvum[0][1]=2;
00166 intordvlm[0][0]=2; intordvlm[1][0]=2;
00167
00168 if (Cp->savemode==0){
00169 nipu[0][0]=8; nipu[0][1]=8;
00170 nipl[0][0]=8; nipl[1][0]=8;
00171 }
00172 if (Cp->savemode==1){
00173 nipu[0][0]=8; nipu[0][1]=0;
00174 nipl[0][0]=8; nipl[1][0]=0;
00175 }
00176
00177 dofe[0]=nnetp; dofe[1]=nnetp;
00178 break;
00179 }
00180 case threemediacoup:{
00181 intordvum[0][0]=2; intordvum[0][1]=2; intordvum[0][2]=2;
00182 intordvlm[0][0]=2; intordvlm[1][0]=2; intordvlm[2][0]=2;
00183
00184 if (Cp->savemode==0){
00185 nipu[0][0]=8; nipu[0][1]=8; nipu[0][2]=8;
00186 nipl[0][0]=8; nipl[1][0]=8; nipl[2][0]=8;
00187 }
00188 if (Cp->savemode==1){
00189 nipu[0][0]=8; nipu[0][1]=0; nipu[0][2]=0;
00190 nipl[0][0]=8; nipl[1][0]=0; nipl[2][0]=0;
00191 }
00192
00193 dofe[0]=nnetp; dofe[1]=nnetp; dofe[2]=nnetp;
00194 break;
00195 }
00196 default:{
00197 fprintf (stderr,"\n\n unknown type of transported matter is required");
00198 fprintf (stderr,"\n in function hexahedc::hexahedc (file %s, line %d).\n",__FILE__,__LINE__);
00199 }
00200 }
00201 }
00202
00203 if (Cp->lbb==quad_quad){
00204 switch (Tp->tmatt){
00205 case onemedium:{
00206 intordvum[0][0]=3; intordvlm[0][0]=3;
00207 nipu[0][0]=27; nipl[0][0]=27;
00208 dofe[0]=nnetp;
00209 break;
00210 }
00211 case twomediacoup:{
00212 intordvum[0][0]=3; intordvum[0][1]=3;
00213 intordvlm[0][0]=3; intordvlm[1][0]=3;
00214
00215 if (Cp->savemode==0){
00216 nipu[0][0]=27; nipu[0][1]=27;
00217 nipl[0][0]=27; nipl[1][0]=27;
00218 }
00219 if (Cp->savemode==1){
00220 nipu[0][0]=27; nipu[0][1]=0;
00221 nipl[0][0]=27; nipl[1][0]=0;
00222 }
00223
00224 dofe[0]=nnetp; dofe[1]=nnetp;
00225 break;
00226 }
00227 case threemediacoup:{
00228 intordvum[0][0]=3; intordvum[0][1]=3; intordvum[0][2]=3;
00229 intordvlm[0][0]=3; intordvlm[1][0]=3; intordvlm[2][0]=3;
00230
00231 if (Cp->savemode==0){
00232 nipu[0][0]=27; nipu[0][1]=27; nipu[0][2]=27;
00233 nipl[0][0]=27; nipl[1][0]=27; nipl[2][0]=27;
00234 }
00235 if (Cp->savemode==1){
00236 nipu[0][0]=27; nipu[0][1]=0; nipu[0][2]=0;
00237 nipl[0][0]=27; nipl[1][0]=0; nipl[2][0]=0;
00238 }
00239
00240 dofe[0]=nnetp; dofe[1]=nnetp; dofe[2]=nnetp;
00241 break;
00242 }
00243 default:{
00244 fprintf (stderr,"\n\n unknown type of transported matter is required");
00245 fprintf (stderr,"\n in function hexahedc::hexahedc (file %s, line %d).\n",__FILE__,__LINE__);
00246 }
00247 }
00248 }
00249
00250
00251 tnipu=0;
00252 for (i=0;i<mnb;i++){
00253 for (j=0;j<ntm;j++)
00254 tnipu+=nipu[i][j];
00255 }
00256 tnipl=0;
00257 for (i=0;i<mnb;i++){
00258 for (j=0;j<ntm;j++)
00259 tnipl+=nipl[i][j];
00260 }
00261
00262 }
00263
00264 hexahedc::~hexahedc (void)
00265 {
00266 long i;
00267
00268 for (i=0;i<ntm;i++){
00269 delete [] nipl[i];
00270 delete [] intordvlm[i];
00271 }
00272 for (i=0;i<mnb;i++){
00273 delete [] nipu[i];
00274 delete [] intordvum[i];
00275 }
00276 delete [] nipu;
00277 delete [] nipl;
00278 delete [] intordvum;
00279 delete [] intordvlm;
00280 delete [] dofe;
00281 delete [] mordering;
00282 }
00283
00284
00285
00286
00287
00288
00289
00290 void hexahedc::eleminit (long eid)
00291 {
00292 long ii,jj;
00293
00294 Ct->elements[eid].intordvum = new long* [mnb];
00295 Ct->elements[eid].intordvlm = new long* [ntm];
00296 Ct->elements[eid].nipu = new long* [mnb];
00297 Ct->elements[eid].nipl = new long* [ntm];
00298
00299 for (ii=0;ii<mnb;ii++){
00300 Ct->elements[eid].intordvum[ii] = new long [ntm];
00301 Ct->elements[eid].nipu[ii] = new long [ntm];
00302 for (jj=0;jj<ntm;jj++){
00303 Ct->elements[eid].intordvum[ii][jj]=intordvum[ii][jj];
00304 Ct->elements[eid].nipu[ii][jj]=nipu[ii][jj];
00305 }
00306 }
00307 for (ii=0;ii<ntm;ii++){
00308 Ct->elements[eid].intordvlm[ii] = new long [mnb];
00309 Ct->elements[eid].nipl[ii] = new long [mnb];
00310 for (jj=0;jj<mnb;jj++){
00311 Ct->elements[eid].intordvlm[ii][jj]=intordvlm[ii][jj];
00312 Ct->elements[eid].nipl[ii][jj]=nipl[ii][jj];
00313 }
00314 }
00315 }
00316
00317
00318
00319
00320
00321
00322
00323
00324 void hexahedc::intpointval (long eid)
00325 {
00326
00327
00328
00329
00330
00331
00332
00333
00334
00335
00336
00337
00338
00339
00340
00341
00342
00343
00344
00345
00346
00347
00348
00349
00350
00351
00352
00353
00354
00355
00356
00357
00358
00359
00360
00361
00362
00363
00364
00365
00366
00367
00368
00369
00370
00371
00372
00373
00374
00375
00376
00377
00378
00379
00380
00381
00382
00383
00384
00385
00386
00387
00388
00389
00390
00391
00392
00393
00394
00395
00396
00397
00398
00399
00400
00401
00402
00403
00404
00405
00406
00407
00408
00409
00410
00411
00412
00413
00414
00415
00416
00417
00418
00419
00420
00421
00422
00423
00424
00425
00426
00427
00428
00429
00430
00431
00432
00433
00434
00435
00436
00437
00438
00439
00440
00441
00442
00443 }
00444
00445
00446
00447
00448
00449
00450
00451
00452
00453
00454 void hexahedc::intpointgrad (long eid)
00455 {
00456
00457
00458
00459
00460
00461
00462
00463
00464
00465
00466
00467
00468
00469
00470
00471
00472
00473
00474
00475
00476
00477
00478
00479
00480
00481
00482
00483
00484
00485
00486
00487
00488
00489
00490
00491
00492
00493
00494
00495
00496
00497
00498
00499
00500
00501
00502
00503
00504
00505
00506
00507
00508
00509
00510
00511
00512
00513
00514
00515
00516
00517
00518
00519
00520
00521
00522
00523
00524
00525
00526
00527
00528
00529
00530
00531
00532
00533
00534
00535
00536
00537
00538
00539
00540
00541
00542
00543
00544
00545
00546
00547
00548
00549
00550
00551
00552
00553
00554
00555
00556
00557
00558
00559
00560
00561
00562
00563
00564
00565
00566
00567
00568
00569
00570
00571
00572
00573
00574
00575
00576
00577
00578
00579
00580
00581
00582
00583
00584
00585
00586
00587 }
00588
00589
00590
00591
00592
00593
00594
00595
00596
00597
00598 void hexahedc::mainip_strains (long eid,vector &r)
00599 {
00600
00601
00602
00603
00604
00605
00606
00607
00608
00609
00610
00611
00612
00613
00614
00615
00616
00617
00618
00619
00620
00621
00622
00623
00624
00625
00626
00627
00628
00629
00630
00631
00632
00633
00634
00635
00636
00637
00638
00639
00640
00641
00642
00643
00644
00645
00646
00647
00648
00649
00650 }
00651
00652
00653
00654
00655
00656
00657
00658
00659 void hexahedc::res_mainip_strains (long eid)
00660 {
00661
00662
00663
00664
00665
00666
00667
00668
00669
00670
00671
00672
00673
00674
00675
00676
00677
00678
00679
00680
00681
00682
00683
00684
00685
00686
00687
00688
00689 }
00690
00691
00692
00693
00694
00695
00696
00697
00698
00699
00700
00701
00702
00703
00704
00705
00706 void hexahedc::upper_cond_coup_matrix (long eid,long ri,long ci,matrix &vm)
00707 {
00708 long i,j,k,ipp;
00709 double xi,eta,zeta,jac;
00710 vector x(nnemp),y(nnemp),z(nnemp),w(intordvum[ri][ci]),gp(intordvum[ri][ci]);
00711 matrix gm(mncomp[ri],mndofe),d(mncomp[ri],1),n(1,dofe[ci]);
00712
00713
00714 gauss_points (gp.a,w.a,intordvum[ri][ci]);
00715
00716 fillm (0.0,vm);
00717
00718
00719 Mt->give_node_coord3d (x,y,z,eid);
00720
00721
00722 if (Cp->savemode==0){
00723 ipp=Ct->elements[eid].ippu[ri][ci];
00724 }
00725 if (Cp->savemode==1){
00726 ipp=Ct->elements[eid].ippu[0][0];
00727 }
00728
00729 for (i=0;i<intordvum[ri][ci];i++){
00730 xi=gp[i];
00731 for (j=0;j<intordvum[ri][ci];j++){
00732 eta=gp[j];
00733 for (k=0;k<intordvum[ri][ci];k++){
00734 zeta=gp[k];
00735
00736
00737 if (Cp->lbb==lin_lin){
00738
00739 Lhex->geom_matrix (gm,x,y,z,xi,eta,zeta,jac);
00740
00741
00742 Lht->bf_matrix (n,xi,eta,zeta);
00743 }
00744 if (Cp->lbb==quad_lin){
00745
00746 Qhex->geom_matrix (gm,x,y,z,xi,eta,zeta,jac);
00747
00748
00749 Lht->bf_matrix (n,xi,eta,zeta);
00750 }
00751 if (Cp->lbb==quad_quad){
00752
00753 Qhex->geom_matrix (gm,x,y,z,xi,eta,zeta,jac);
00754
00755
00756 Qht->bf_matrix (n,xi,eta,zeta);
00757 }
00758
00759
00760 Cmu->matcond (d,ipp,ri,ci);
00761
00762 jac*=w[i]*w[j]*w[k];
00763
00764
00765 bdbjac (vm,gm,d,n,jac);
00766
00767 ipp++;
00768 }
00769 }
00770 }
00771
00772 }
00773
00774
00775
00776
00777
00778
00779
00780
00781
00782
00783
00784 void hexahedc::lower_cond_coup_matrix (long eid,long ri,long ci,matrix &vm)
00785 {
00786 long i,j,k,ipp;
00787 double xi,eta,zeta,jac;
00788 vector x(nnemp),y(nnemp),z(nnemp),w(intordvlm[ri][ci]),gp(intordvlm[ri][ci]);
00789 matrix gm(mncomp[ci],mndofe),d(1,mncomp[ci]),n(1,dofe[ri]);
00790
00791
00792 gauss_points (gp.a,w.a,intordvlm[ri][ci]);
00793
00794 fillm (0.0,vm);
00795
00796
00797 Mt->give_node_coord3d (x,y,z,eid);
00798
00799
00800 if (Cp->savemode==0){
00801 ipp=Ct->elements[eid].ippl[ri][ci];
00802 }
00803 if (Cp->savemode==1){
00804 ipp=Ct->elements[eid].ippl[0][0];
00805 }
00806
00807 for (i=0;i<intordvlm[ri][ci];i++){
00808 xi=gp[i];
00809 for (j=0;j<intordvlm[ri][ci];j++){
00810 eta=gp[j];
00811 for (k=0;k<intordvlm[ri][ci];k++){
00812 zeta=gp[k];
00813
00814 if (Cp->lbb==lin_lin){
00815
00816 Lhex->geom_matrix (gm,x,y,z,xi,eta,zeta,jac);
00817
00818
00819 Lht->bf_matrix (n,xi,eta,zeta);
00820 }
00821 if (Cp->lbb==quad_lin){
00822
00823 Qhex->geom_matrix (gm,x,y,z,xi,eta,zeta,jac);
00824
00825
00826 Lht->bf_matrix (n,xi,eta,zeta);
00827 }
00828 if (Cp->lbb==quad_quad){
00829
00830 Qhex->geom_matrix (gm,x,y,z,xi,eta,zeta,jac);
00831
00832
00833 Qht->bf_matrix (n,xi,eta,zeta);
00834 }
00835
00836
00837 Cml->matcond (d,ipp,ri,ci);
00838
00839 jac*=w[i]*w[j]*w[k];
00840
00841
00842 bdbjac (vm,n,d,gm,jac);
00843
00844 ipp++;
00845 }
00846 }
00847 }
00848
00849 }
00850
00851
00852
00853
00854
00855
00856
00857
00858
00859
00860 void hexahedc::upper_cap_coup_matrix (long eid,long ri,long ci,matrix &vm)
00861 {
00862 long i,j,k,ipp;
00863 double xi,eta,zeta,jac;
00864 vector x(nnemp),y(nnemp),z(nnemp),w(intordvum[ri][ci]),gp(intordvum[ri][ci]);
00865 matrix gm(mncomp[ri],mndofe),d(mncomp[ri],1),n(1,dofe[ci]);
00866
00867
00868 gauss_points (gp.a,w.a,intordvum[ri][ci]);
00869
00870 fillm (0.0,vm);
00871
00872
00873 Mt->give_node_coord3d (x,y,z,eid);
00874
00875
00876 if (Cp->savemode==0){
00877 ipp=Ct->elements[eid].ippu[ri][ci];
00878 }
00879 if (Cp->savemode==1){
00880 ipp=Ct->elements[eid].ippu[0][0];
00881 }
00882
00883 for (i=0;i<intordvum[ri][ci];i++){
00884 xi=gp[i];
00885 for (j=0;j<intordvum[ri][ci];j++){
00886 eta=gp[j];
00887 for (k=0;k<intordvum[ri][ci];k++){
00888 zeta=gp[k];
00889
00890
00891 if (Cp->lbb==lin_lin){
00892
00893 Lhex->geom_matrix (gm,x,y,z,xi,eta,zeta,jac);
00894
00895
00896 Lht->bf_matrix (n,xi,eta,zeta);
00897 }
00898 if (Cp->lbb==quad_lin){
00899
00900 Qhex->geom_matrix (gm,x,y,z,xi,eta,zeta,jac);
00901
00902
00903 Lht->bf_matrix (n,xi,eta,zeta);
00904 }
00905 if (Cp->lbb==quad_quad){
00906
00907 Qhex->geom_matrix (gm,x,y,z,xi,eta,zeta,jac);
00908
00909
00910 Qht->bf_matrix (n,xi,eta,zeta);
00911 }
00912
00913
00914
00915 Cmu->matcap (d,ipp,ri,ci);
00916
00917 jac*=w[i]*w[j]*w[k];
00918
00919
00920 bdbjac (vm,gm,d,n,jac);
00921
00922 ipp++;
00923 }
00924 }
00925 }
00926
00927 }
00928
00929
00930
00931
00932
00933
00934
00935
00936
00937
00938
00939 void hexahedc::lower_cap_coup_matrix (long eid,long ri,long ci,matrix &vm)
00940 {
00941 long i,j,k,ipp;
00942 double xi,eta,zeta,jac;
00943 vector x(nnemp),y(nnemp),z(nnemp),w(intordvlm[ri][ci]),gp(intordvlm[ri][ci]);
00944 matrix gm(mncomp[ci],mndofe),d(1,mncomp[ci]),n(1,dofe[ri]);
00945
00946
00947 gauss_points (gp.a,w.a,intordvlm[ri][ci]);
00948
00949 fillm (0.0,vm);
00950
00951
00952 Mt->give_node_coord3d (x,y,z,eid);
00953
00954
00955 if (Cp->savemode==0){
00956 ipp=Ct->elements[eid].ippl[ri][ci];
00957 }
00958 if (Cp->savemode==1){
00959 ipp=Ct->elements[eid].ippl[0][0];
00960 }
00961
00962
00963 for (i=0;i<intordvlm[ri][ci];i++){
00964 xi=gp[i];
00965 for (j=0;j<intordvlm[ri][ci];j++){
00966 eta=gp[j];
00967 for (k=0;k<intordvlm[ri][ci];k++){
00968 zeta=gp[k];
00969
00970 if (Cp->lbb==lin_lin){
00971
00972 Lhex->geom_matrix (gm,x,y,z,xi,eta,zeta,jac);
00973
00974
00975 Lht->bf_matrix (n,xi,eta,zeta);
00976 }
00977 if (Cp->lbb==quad_lin){
00978
00979 Qhex->geom_matrix (gm,x,y,z,xi,eta,zeta,jac);
00980
00981
00982 Lht->bf_matrix (n,xi,eta,zeta);
00983 }
00984 if (Cp->lbb==quad_quad){
00985
00986 Qhex->geom_matrix (gm,x,y,z,xi,eta,zeta,jac);
00987
00988
00989 Qht->bf_matrix (n,xi,eta,zeta);
00990 }
00991
00992
00993
00994 Cml->matcap (d,ipp,ri,ci);
00995
00996 jac*=w[i]*w[j]*w[k];
00997
00998
00999 bdbjac (vm,n,d,gm,jac);
01000
01001 ipp++;
01002 }
01003 }
01004 }
01005
01006 }
01007
01008
01009
01010
01011
01012
01013
01014
01015
01016
01017
01018
01019
01020 void hexahedc::res_upper_cond_coup_matrix (long eid,matrix &vm)
01021 {
01022 long ii,jj,*ccn;
01023 matrix lvm;
01024
01025 fillm(0.0,vm);
01026
01027 for (ii=0;ii<ntm;ii++){
01028
01029 ccn = new long [dofe[ii]];
01030
01031 allocm (mndofe,dofe[ii],lvm);
01032
01033
01034 if (Cp->lbb==lin_lin || Cp->lbb==quad_lin)
01035 Lht->codnum (ccn,ii);
01036 if (Cp->lbb==quad_quad)
01037 Qht->codnum (ccn,ii);
01038
01039 for (jj=0;jj<mnb;jj++){
01040
01041 upper_cond_coup_matrix (eid,jj,ii,lvm);
01042
01043 mat_localize (vm,lvm,mordering,ccn);
01044 }
01045
01046 delete [] ccn;
01047 destrm (lvm);
01048 }
01049 }
01050
01051
01052
01053
01054
01055
01056
01057
01058
01059 void hexahedc::res_lower_cond_coup_matrix (long eid,matrix &vm)
01060 {
01061 long ii,jj,*rcn;
01062 matrix lvm;
01063
01064
01065 fillm(0.0,vm);
01066
01067 for (ii=0;ii<ntm;ii++){
01068
01069 rcn = new long [dofe[ii]];
01070
01071 allocm (dofe[ii],mndofe,lvm);
01072
01073
01074 if (Cp->lbb==lin_lin || Cp->lbb==quad_lin)
01075 Lht->codnum (rcn,ii);
01076 if (Cp->lbb==quad_quad)
01077 Qht->codnum (rcn,ii);
01078
01079 for (jj=0;jj<mnb;jj++){
01080
01081 lower_cond_coup_matrix (eid,ii,jj,lvm);
01082
01083 mat_localize (vm,lvm,rcn,mordering);
01084 }
01085
01086 destrm (lvm);
01087 delete [] rcn;
01088 }
01089 }
01090
01091
01092
01093
01094
01095
01096
01097
01098
01099
01100 void hexahedc::res_upper_cap_coup_matrix (long eid,matrix &vm)
01101 {
01102 long ii,jj,*ccn;
01103 matrix lvm;
01104
01105 fillm(0.0,vm);
01106
01107 for (ii=0;ii<ntm;ii++){
01108
01109 allocm (mndofe,dofe[ii],lvm);
01110
01111 ccn = new long [dofe[ii]];
01112
01113
01114 if (Cp->lbb==lin_lin || Cp->lbb==quad_lin)
01115 Lht->codnum (ccn,ii);
01116 if (Cp->lbb==quad_quad)
01117 Qht->codnum (ccn,ii);
01118
01119 for (jj=0;jj<mnb;jj++){
01120
01121 upper_cap_coup_matrix (eid,jj,ii,lvm);
01122
01123 mat_localize (vm,lvm,mordering,ccn);
01124 }
01125
01126 destrm (lvm);
01127 delete [] ccn;
01128 }
01129 }
01130
01131
01132
01133
01134
01135
01136
01137
01138
01139 void hexahedc::res_lower_cap_coup_matrix (long eid,matrix &vm)
01140 {
01141 long ii,jj,*rcn;
01142 matrix lvm;
01143
01144 fillm(0.0,vm);
01145
01146 for (ii=0;ii<ntm;ii++){
01147
01148 allocm (dofe[ii],mndofe,lvm);
01149
01150 rcn = new long [dofe[ii]];
01151
01152
01153 if (Cp->lbb==lin_lin || Cp->lbb==quad_lin)
01154 Lht->codnum (rcn,ii);
01155 if (Cp->lbb==quad_quad)
01156 Qht->codnum (rcn,ii);
01157
01158 for (jj=0;jj<mnb;jj++){
01159
01160 lower_cap_coup_matrix (eid,ii,jj,lvm);
01161
01162 mat_localize (vm,lvm,rcn,mordering);
01163 }
01164
01165 destrm (lvm);
01166 delete [] rcn;
01167 }
01168 }
01169
01170
01171
01172
01173
01174
01175
01176
01177
01178
01179
01180
01181 void hexahedc::upper_cond_coup_vector (vector &tvm,vector &nodval,long eid,long ri,long ci)
01182 {
01183 long i,j,k,ipp;
01184 double xi,eta,zeta,jac;
01185 vector x(nnemp),y(nnemp),z(nnemp),w(intordvum[ri][ci]),gp(intordvum[ri][ci]),av(mndofe);
01186 matrix gm(mncomp[ri],mndofe),d(mncomp[ri],1),n(1,dofe[ci]),vm(mndofe,dofe[ci]);
01187
01188
01189 gauss_points (gp.a,w.a,intordvum[ri][ci]);
01190
01191 fillm (0.0,vm);
01192
01193
01194 Mt->give_node_coord3d (x,y,z,eid);
01195
01196
01197 if (Cp->savemode==0){
01198 ipp=Ct->elements[eid].ippu[ri][ci];
01199 }
01200 if (Cp->savemode==1){
01201 ipp=Ct->elements[eid].ippu[0][0];
01202 }
01203
01204 for (i=0;i<intordvum[ri][ci];i++){
01205 xi=gp[i];
01206 for (j=0;j<intordvum[ri][ci];j++){
01207 eta=gp[j];
01208 for (k=0;k<intordvum[ri][ci];k++){
01209 zeta=gp[k];
01210
01211
01212 if (Cp->lbb==lin_lin){
01213
01214 Lhex->geom_matrix (gm,x,y,z,xi,eta,zeta,jac);
01215
01216
01217 Lht->bf_matrix (n,xi,eta,zeta);
01218 }
01219 if (Cp->lbb==quad_lin){
01220
01221 Qhex->geom_matrix (gm,x,y,z,xi,eta,zeta,jac);
01222
01223
01224 Lht->bf_matrix (n,xi,eta,zeta);
01225 }
01226 if (Cp->lbb==quad_quad){
01227
01228 Qhex->geom_matrix (gm,x,y,z,xi,eta,zeta,jac);
01229
01230
01231 Qht->bf_matrix (n,xi,eta,zeta);
01232 }
01233
01234
01235 Cmu->volume_rhs1 (d,ipp,ri,ci);
01236
01237 jac*=w[i]*w[j]*w[k];
01238
01239
01240 bdbjac (vm,gm,d,n,jac);
01241
01242 ipp++;
01243 }
01244 }
01245 }
01246
01247 mxv (vm,nodval,av);
01248 addv (av,tvm,tvm);
01249
01250 }
01251
01252
01253
01254
01255
01256
01257
01258
01259
01260
01261
01262
01263 void hexahedc::res_upper_cond_coup_vector (vector &f,long eid)
01264 {
01265 long ii,jj;
01266 long *cn,*lcn;
01267 double *r;
01268 vector lr;
01269
01270 cn = new long [tndofe];
01271 r = new double [tndofe];
01272
01273
01274 Tt->give_code_numbers (eid,cn);
01275
01276
01277 initialvalues (r,cn,tndofe);
01278
01279 fillv (0.0,f);
01280
01281 for (ii=0;ii<ntm;ii++){
01282
01283 lcn = new long [dofe[ii]];
01284
01285 allocv (dofe[ii],lr);
01286
01287
01288 if (Cp->lbb==lin_lin || Cp->lbb==quad_lin)
01289 Lht->codnum (lcn,ii);
01290 else
01291 Qht->codnum (lcn,ii);
01292
01293
01294 globloc (r,lr.a,lcn,dofe[ii]);
01295
01296 for (jj=0;jj<mnb;jj++){
01297
01298 upper_cond_coup_vector (f,lr,eid,jj,ii);
01299 }
01300 delete [] lcn;
01301 destrv (lr);
01302 }
01303
01304 delete [] cn;
01305 delete [] r;
01306 }
01307
01308
01309
01310
01311
01312
01313
01314
01315
01316
01317
01318
01319
01320
01321
01322
01323
01324
01325
01326
01327
01328
01329
01330
01331
01332
01333
01334
01335
01336
01337
01338
01339
01340
01341
01342
01343
01344
01345
01346
01347
01348
01349
01350
01351
01352
01353
01354
01355
01356
01357
01358
01359
01360
01361
01362
01363
01364
01365
01366
01367
01368
01369
01370
01371
01372
01373
01374
01375
01376
01377
01378
01379
01380
01381
01382
01383
01384
01385
01386
01387
01388
01389
01390
01391 void hexahedc::mefel_metr (long eid)
01392 {
01393 long i,j,ippm,ippcu,ippcl;
01394
01395
01396
01397
01398 if (Cp->savemode==1){
01399
01400
01401 ippm = Mt->elements[eid].ipp[0][0];
01402
01403
01404
01405 ippcu = Ct->elements[eid].ippu[0][0];
01406
01407
01408
01409 ippcl = Ct->elements[eid].ippl[0][0];
01410
01411 for (j=0;j<nipu[0][0];j++){
01412 for (i=0;i<tnmcomp;i++){
01413 Cmu->ip[ippcu].strains[i] = Mm->ip[ippm].strain[i];
01414 Cmu->ip[ippcu].stresses[i] = Mm->ip[ippm].stress[i];
01415 }
01416 ippm++; ippcu++;
01417 }
01418
01419
01420
01421 ippm = Mt->elements[eid].ipp[0][0];
01422 for (j=0;j<nipl[0][0];j++){
01423 for (i=0;i<tnmcomp;i++){
01424 Cml->ip[ippcl].strains[i] = Mm->ip[ippm].strain[i];
01425 Cml->ip[ippcl].stresses[i] = Mm->ip[ippm].stress[i];
01426 }
01427 ippm++; ippcl++;
01428 }
01429 }
01430
01431
01432
01433
01434
01435
01436 if (Cp->savemode==0){
01437 fprintf (stderr,"\n\n not implemented at this moment (file %s, line %d).\n",__FILE__,__LINE__);
01438 }
01439
01440 }
01441
01442
01443
01444
01445
01446
01447
01448
01449
01450 void hexahedc::trfel_metr (long eid)
01451 {
01452 long i,j,ippt,ippcu,ippcl;
01453
01454
01455
01456
01457 if (Cp->savemode==1){
01458
01459 ippt = Tt->elements[eid].ipp[0][0];
01460
01461
01462
01463 ippcu = Ct->elements[eid].ippu[0][0];
01464
01465
01466
01467 ippcl = Ct->elements[eid].ippl[0][0];
01468
01469 for (j=0;j<nipu[0][0];j++){
01470 for (i=0;i<ntm;i++){
01471 Cmu->ip[ippcu].av[i] = Tm->ip[ippt].av[i];
01472
01473 }
01474 ippt++; ippcu++;
01475 }
01476
01477
01478 ippt = Mt->elements[eid].ipp[0][0];
01479 for (j=0;j<nipl[0][0];j++){
01480 for (i=0;i<ntm;i++){
01481 Cml->ip[ippcl].av[i] = Tm->ip[ippt].av[i];
01482
01483 }
01484 ippt++; ippcl++;
01485 }
01486 }
01487
01488
01489
01490
01491
01492
01493 if (Cp->savemode==0){
01494 fprintf (stderr,"\n\n not implemented at this moment (file %s, line %d).\n",__FILE__,__LINE__);
01495 }
01496
01497 }