00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00024
00025
00026 #ifndef EIGHTNODEBRICK_CPP
00027 #define EIGHTNODEBRICK_CPP
00028
00029 #include <EightNodeBrick.h>
00030 #define FixedOrder 2
00031
00032
00033
00034
00035
00036
00037 EightNodeBrick::EightNodeBrick(int element_number,
00038 int node_numb_1, int node_numb_2, int node_numb_3, int node_numb_4,
00039 int node_numb_5, int node_numb_6, int node_numb_7, int node_numb_8,
00040 NDMaterial * Globalmmodel, double b1, double b2,double b3,
00041 double r, double p)
00042
00043
00044
00045
00046
00047 :Element(element_number, ELE_TAG_EightNodeBrick ),
00048 connectedExternalNodes(8), K(24, 24), C(24, 24), M(24, 24), P(24),Q(24), bf(3),
00049 rho(r), pressure(p)
00050 {
00051
00052 bf(0) = b1;
00053 bf(1) = b2;
00054 bf(2) = b3;
00055
00056 determinant_of_Jacobian = 0.0;
00057
00058
00059
00060
00061 r_integration_order = FixedOrder;
00062 s_integration_order = FixedOrder;
00063 t_integration_order = FixedOrder;
00064
00065
00066
00067
00068 int total_number_of_Gauss_points = r_integration_order*s_integration_order*t_integration_order;
00069
00070
00071
00072
00073
00074
00075 if ( total_number_of_Gauss_points != 0 )
00076 {
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086 matpoint = new MatPoint3D * [total_number_of_Gauss_points];
00087
00088 }
00089 else
00090 {
00091
00092 matpoint = 0;
00093 }
00095
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107 short where = 0;
00108
00109 for( short GP_c_r = 1 ; GP_c_r <= r_integration_order ; GP_c_r++ )
00110 {
00111 double r = get_Gauss_p_c( r_integration_order, GP_c_r );
00112 double rw = get_Gauss_p_w( r_integration_order, GP_c_r );
00113
00114 for( short GP_c_s = 1 ; GP_c_s <= s_integration_order ; GP_c_s++ )
00115 {
00116 double s = get_Gauss_p_c( s_integration_order, GP_c_s );
00117 double sw = get_Gauss_p_w( s_integration_order, GP_c_s );
00118
00119 for( short GP_c_t = 1 ; GP_c_t <= t_integration_order ; GP_c_t++ )
00120 {
00121 double t = get_Gauss_p_c( t_integration_order, GP_c_t );
00122 double tw = get_Gauss_p_w( t_integration_order, GP_c_t );
00123
00124
00125
00126 where =
00127 ((GP_c_r-1)*s_integration_order+GP_c_s-1)*t_integration_order+GP_c_t-1;
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159 matpoint[where] = new MatPoint3D(GP_c_r,
00160 GP_c_s,
00161 GP_c_t,
00162 r, s, t,
00163 rw, sw, tw,
00164
00165 Globalmmodel);
00166
00167
00168
00169
00170 }
00171 }
00172 }
00173
00174
00175 connectedExternalNodes(0) = node_numb_1;
00176 connectedExternalNodes(1) = node_numb_2;
00177 connectedExternalNodes(2) = node_numb_3;
00178 connectedExternalNodes(3) = node_numb_4;
00179 connectedExternalNodes(4) = node_numb_5;
00180 connectedExternalNodes(5) = node_numb_6;
00181 connectedExternalNodes(6) = node_numb_7;
00182 connectedExternalNodes(7) = node_numb_8;
00183
00184 nodes_in_brick = 8;
00185
00186 }
00187
00188
00189 EightNodeBrick::EightNodeBrick ():Element(0, ELE_TAG_EightNodeBrick ),
00190 connectedExternalNodes(8), K(24, 24), C(24, 24), M(24, 24), P(24),Q(24), bf(3), rho(0.0), pressure(0.0), mmodel(0)
00191 {
00192 matpoint = 0;
00193 }
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260
00261
00262
00263
00264
00265
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295
00296
00297
00298
00299
00300
00301
00302
00303
00304
00305
00306
00307
00308
00309
00310
00311
00312
00313
00314
00315
00316
00317
00318
00319
00320
00321
00322
00323
00324
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 EightNodeBrick::~EightNodeBrick ()
00390 {
00391
00392 int total_number_of_Gauss_points = r_integration_order*s_integration_order*t_integration_order;
00393
00394 for (int i = 0; i < total_number_of_Gauss_points; i++)
00395 {
00396
00397 if (matpoint[i])
00398 delete matpoint[i];
00399 }
00400
00401
00402 if (matpoint)
00403 delete [] matpoint;
00404
00405 }
00406
00407
00408 void EightNodeBrick::incremental_Update()
00409 {
00410 double r = 0.0;
00411
00412 double s = 0.0;
00413
00414 double t = 0.0;
00415
00416
00417 short where = 0;
00418
00419
00420
00421
00422 int dh_dim[] = {8,3};
00423 tensor dh(2, dh_dim, 0.0);
00424
00425
00426
00427
00428
00429 static int disp_dim[] = {8,3};
00430 tensor incremental_displacements(2,disp_dim,0.0);
00431
00432 straintensor incremental_strain;
00433
00434
00435 tensor Jacobian;
00436 tensor JacobianINV;
00437 tensor dhGlobal;
00438
00439
00440
00441
00442
00443
00444
00446
00447 incremental_displacements = incr_disp();
00448
00449 for( short GP_c_r = 1 ; GP_c_r <= r_integration_order ; GP_c_r++ )
00450 {
00451 r = get_Gauss_p_c( r_integration_order, GP_c_r );
00452
00453 for( short GP_c_s = 1 ; GP_c_s <= s_integration_order ; GP_c_s++ )
00454 {
00455 s = get_Gauss_p_c( s_integration_order, GP_c_s );
00456
00457 for( short GP_c_t = 1 ; GP_c_t <= t_integration_order ; GP_c_t++ )
00458 {
00459 t = get_Gauss_p_c( t_integration_order, GP_c_t );
00460
00461
00462
00463 where =
00464 ((GP_c_r-1)*s_integration_order+GP_c_s-1)*t_integration_order+GP_c_t-1;
00465
00466 dh = dh_drst_at(r,s,t);
00467
00468 Jacobian = Jacobian_3D(dh);
00469
00470
00471 JacobianINV = Jacobian_3Dinv(dh);
00472
00473
00474
00475
00476
00477 dhGlobal = dh("ij") * JacobianINV("jk");
00478
00479
00480
00481
00482
00483
00484
00485
00486
00487
00488
00489
00490
00491 incremental_strain =
00492 (dhGlobal("ib")*incremental_displacements("ia")).symmetrize11();
00493 incremental_strain.null_indices();
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 if ( ! ( (matpoint[where]->matmodel)->setTrialStrainIncr( incremental_strain)) )
00534 g3ErrorHandler->warning("EightNodeBrick::incremental_Update (tag: %d), not converged",
00535 this->getTag());
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
00577
00578
00579
00581
00583
00585
00586
00588
00589
00590
00591
00593
00595
00596
00597
00598
00599
00600
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
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
00707 tensor EightNodeBrick::H_3D(double r1, double r2, double r3)
00708 {
00709
00710 int dimension[] = {24,3};
00711
00712 tensor H(2, dimension, 0.0);
00713
00714
00715
00716
00717
00718
00719
00720
00721
00722
00723
00724
00725
00726
00727
00728
00729
00730
00731
00732
00733
00734
00735
00736
00737
00738
00739
00740
00741
00742
00743
00744
00745
00746
00747
00748
00749
00750
00751
00752
00753
00754
00755
00756
00757
00758
00759
00760
00761
00762
00763
00764
00765
00766
00767
00768
00769
00770
00771
00772 H.val(22,1)=(1.0+r1)*(1.0-r2)*(1.0-r3)/8.0;
00773 H.val(23,2)=(1.0+r1)*(1.0-r2)*(1.0-r3)/8.0;
00774 H.val(24,3)=(1.0+r1)*(1.0-r2)*(1.0-r3)/8.0;
00775
00776 H.val(19,1)=(1.0-r1)*(1.0-r2)*(1.0-r3)/8.0;
00777 H.val(20,2)=(1.0-r1)*(1.0-r2)*(1.0-r3)/8.0;
00778 H.val(21,3)=(1.0-r1)*(1.0-r2)*(1.0-r3)/8.0;
00779
00780 H.val(16,1)=(1.0-r1)*(1.0+r2)*(1.0-r3)/8.0 ;
00781 H.val(17,2)=(1.0-r1)*(1.0+r2)*(1.0-r3)/8.0 ;
00782 H.val(18,3)=(1.0-r1)*(1.0+r2)*(1.0-r3)/8.0 ;
00783
00784 H.val(13,1)=(1.0+r1)*(1.0+r2)*(1.0-r3)/8.0 ;
00785 H.val(14,2)=(1.0+r1)*(1.0+r2)*(1.0-r3)/8.0 ;
00786 H.val(15,3)=(1.0+r1)*(1.0+r2)*(1.0-r3)/8.0 ;
00787
00788
00789 H.val(10,1)=(1.0+r1)*(1.0-r2)*(1.0+r3)/8.0 ;
00790 H.val(11,2)=(1.0+r1)*(1.0-r2)*(1.0+r3)/8.0 ;
00791 H.val(12,3)=(1.0+r1)*(1.0-r2)*(1.0+r3)/8.0 ;
00792
00793 H.val(7,1)=(1.0-r1)*(1.0-r2)*(1.0+r3)/8.0 ;
00794 H.val(8,2)=(1.0-r1)*(1.0-r2)*(1.0+r3)/8.0 ;
00795 H.val(9,3)=(1.0-r1)*(1.0-r2)*(1.0+r3)/8.0 ;
00796
00797 H.val(4,1)=(1.0-r1)*(1.0+r2)*(1.0+r3)/8.0 ;
00798 H.val(5,2)=(1.0-r1)*(1.0+r2)*(1.0+r3)/8.0 ;
00799 H.val(6,3)=(1.0-r1)*(1.0+r2)*(1.0+r3)/8.0 ;
00800
00801 H.val(1,1)=(1.0+r1)*(1.0+r2)*(1.0+r3)/8.0 ;
00802 H.val(2,2)=(1.0+r1)*(1.0+r2)*(1.0+r3)/8.0 ;
00803 H.val(3,3)=(1.0+r1)*(1.0+r2)*(1.0+r3)/8.0 ;
00804
00805
00806
00807
00808
00809
00810
00811
00812
00813
00814
00815
00816
00817
00818
00819
00820
00821
00822
00823
00824 return H;
00825 }
00826
00827
00828
00829 tensor EightNodeBrick::interp_poli_at(double r1, double r2, double r3)
00830 {
00831
00832 int dimension[] = {8};
00833 tensor h(1, dimension, 0.0);
00834
00835
00836
00837
00838
00839
00840
00841
00842
00843
00844
00845
00846
00847
00848
00849
00850
00851
00852
00853
00854
00855
00856
00857
00858
00859
00860
00861
00862
00863
00864
00865
00866 h.val(8)=(1.0+r1)*(1.0-r2)*(1.0-r3)/8.0;
00867
00868 h.val(7)=(1.0-r1)*(1.0-r2)*(1.0-r3)/8.0;
00869
00870 h.val(6)=(1.0-r1)*(1.0+r2)*(1.0-r3)/8.0;
00871
00872 h.val(5)=(1.0+r1)*(1.0+r2)*(1.0-r3)/8.0;
00873
00874
00875 h.val(4)=(1.0+r1)*(1.0-r2)*(1.0+r3)/8.0;
00876
00877 h.val(3)=(1.0-r1)*(1.0-r2)*(1.0+r3)/8.0;
00878
00879 h.val(2)=(1.0-r1)*(1.0+r2)*(1.0+r3)/8.0;
00880
00881 h.val(1)=(1.0+r1)*(1.0+r2)*(1.0+r3)/8.0;
00882
00883
00884
00885
00886
00887
00888 return h;
00889 }
00890
00891
00892
00893 tensor EightNodeBrick::dh_drst_at(double r1, double r2, double r3)
00894 {
00895
00896 int dimensions[] = {8,3};
00897 tensor dh(2, dimensions, 0.0);
00898
00899
00900
00901
00902
00903
00904
00905
00906
00907
00908
00909
00910
00911
00912
00913
00914
00915
00916
00917
00918
00919
00920
00921
00922
00923
00924
00925
00926
00927
00928
00929
00930
00931
00932
00933
00934
00935
00936
00937
00938
00939
00940
00941
00942
00943
00944
00945
00946
00947
00948
00949
00950
00951
00952
00953
00954 dh.val(8,1)= (1.0-r2)*(1.0-r3)/8.0;
00955 dh.val(8,2)=-(1.0+r1)*(1.0-r3)/8.0;
00956 dh.val(8,3)=-(1.0+r1)*(1.0-r2)/8.0;
00957
00958 dh.val(7,1)=-(1.0-r2)*(1.0-r3)/8.0;
00959 dh.val(7,2)=-(1.0-r1)*(1.0-r3)/8.0;
00960 dh.val(7,3)=-(1.0-r1)*(1.0-r2)/8.0;
00961
00962 dh.val(6,1)=-(1.0+r2)*(1.0-r3)/8.0;
00963 dh.val(6,2)= (1.0-r1)*(1.0-r3)/8.0;
00964 dh.val(6,3)=-(1.0-r1)*(1.0+r2)/8.0;
00965
00966 dh.val(5,1)= (1.0+r2)*(1.0-r3)/8.0;
00967 dh.val(5,2)= (1.0+r1)*(1.0-r3)/8.0;
00968 dh.val(5,3)=-(1.0+r1)*(1.0+r2)/8.0;
00969
00970
00971 dh.val(4,1)= (1.0-r2)*(1.0+r3)/8.0;
00972 dh.val(4,2)=-(1.0+r1)*(1.0+r3)/8.0;
00973 dh.val(4,3)= (1.0+r1)*(1.0-r2)/8.0;
00974
00975 dh.val(3,1)=-(1.0-r2)*(1.0+r3)/8.0;
00976 dh.val(3,2)=-(1.0-r1)*(1.0+r3)/8.0;
00977 dh.val(3,3)= (1.0-r1)*(1.0-r2)/8.0;
00978
00979 dh.val(2,1)=-(1.0+r2)*(1.0+r3)/8.0;
00980 dh.val(2,2)= (1.0-r1)*(1.0+r3)/8.0;
00981 dh.val(2,3)= (1.0-r1)*(1.0+r2)/8.0;
00982
00983 dh.val(1,1)= (1.0+r2)*(1.0+r3)/8.0;
00984 dh.val(1,2)= (1.0+r1)*(1.0+r3)/8.0;
00985 dh.val(1,3)= (1.0+r1)*(1.0+r2)/8.0;
00986
00987 return dh;
00988 }
00989
00990
00991
00992
00994
00995
00996
00997
00998
00999
01000
01001
01002
01003
01004
01005
01006
01008 EightNodeBrick & EightNodeBrick::operator[](int subscript)
01009 {
01010 return ( *(this+subscript) );
01011 }
01012
01013
01014
01015
01016
01017
01018
01019
01020
01021
01022
01023
01025 tensor EightNodeBrick::getStiffnessTensor(void)
01026 {
01027 int K_dim[] = {8,3,3,8};
01028
01029 tensor Kk(4,K_dim,0.0);
01030
01031
01032
01033
01034 double r = 0.0;
01035 double rw = 0.0;
01036 double s = 0.0;
01037 double sw = 0.0;
01038 double t = 0.0;
01039 double tw = 0.0;
01040
01041 short where = 0;
01042 double weight = 0.0;
01043
01044 int dh_dim[] = {8,3};
01045 tensor dh(2, dh_dim, 0.0);
01046
01047
01048 tensor Constitutive;
01049
01050 double det_of_Jacobian = 0.0;
01051
01052 static int disp_dim[] = {8,3};
01053 tensor incremental_displacements(2,disp_dim,0.0);
01054
01055 straintensor incremental_strain;
01056
01057
01058 tensor Jacobian;
01059 tensor JacobianINV;
01060 tensor JacobianINVtemp;
01061 tensor dhGlobal;
01062
01063
01064
01065
01066
01067
01068
01069
01070
01071
01072
01073
01074
01075
01076
01077 for( short GP_c_r = 1 ; GP_c_r <= r_integration_order ; GP_c_r++ )
01078 {
01079 r = get_Gauss_p_c( r_integration_order, GP_c_r );
01080 rw = get_Gauss_p_w( r_integration_order, GP_c_r );
01081 for( short GP_c_s = 1 ; GP_c_s <= s_integration_order ; GP_c_s++ )
01082 {
01083 s = get_Gauss_p_c( s_integration_order, GP_c_s );
01084 sw = get_Gauss_p_w( s_integration_order, GP_c_s );
01085 for( short GP_c_t = 1 ; GP_c_t <= t_integration_order ; GP_c_t++ )
01086 {
01087 t = get_Gauss_p_c( t_integration_order, GP_c_t );
01088 tw = get_Gauss_p_w( t_integration_order, GP_c_t );
01089
01090
01091 where =
01092 ((GP_c_r-1)*s_integration_order+GP_c_s-1)*t_integration_order+GP_c_t-1;
01093
01094 dh = dh_drst_at(r,s,t);
01095
01096
01097 Jacobian = Jacobian_3D(dh);
01098
01099 JacobianINV = Jacobian_3Dinv(dh);
01100 JacobianINVtemp = Jacobian.inverse();
01101
01102 det_of_Jacobian = Jacobian.determinant();
01103
01104 dhGlobal = dh("ij") * JacobianINV("jk");
01105
01106
01107
01108 weight = rw * sw * tw * det_of_Jacobian;
01109
01110
01111
01112
01113
01114
01115
01116
01117
01118
01119
01120
01121
01122
01123
01124
01125
01126
01127 incremental_strain =
01128 (dhGlobal("ib")*incremental_displacements("ia")).symmetrize11();
01129
01130
01131
01132
01133
01134
01135
01136
01137
01138
01139
01140
01141
01142
01143
01144
01145
01146
01147
01148
01149
01150
01151
01152
01153
01154
01155
01156
01157
01158
01159
01160
01161
01162
01163
01164
01165
01166
01167
01168
01169
01170
01171
01172
01173
01174
01175
01176
01177
01178
01179
01180
01181
01182
01183
01184
01185
01186
01187
01188
01189
01190
01191
01192
01193 Constitutive = (matpoint[where]->matmodel)->getTangentTensor();
01194
01195
01196
01197
01198
01199
01200
01201
01202
01203
01204
01205
01206
01207
01208
01209
01210
01211
01212
01213
01214
01215
01216
01217
01218
01219 Kk = Kk + dhGlobal("ib")*Constitutive("abcd")*dhGlobal("jd")*weight;
01220
01221
01222
01223
01224
01225
01226
01227
01228
01229 }
01230 }
01231 }
01232
01233
01234 return Kk;
01235 }
01236
01237
01238
01239
01240 void EightNodeBrick::set_strain_stress_tensor(FILE *fp, double * u)
01241 {
01242 int dh_dim[] = {8,3};
01243 tensor dh(2, dh_dim, 0.0);
01244
01245
01246 tensor Constitutive;
01247 double r = 0.0;
01248 double s = 0.0;
01249 double t = 0.0;
01250 int where = 0;
01251
01252 double det_of_Jacobian;
01253
01254 straintensor strain;
01255 stresstensor stress;
01256
01257 tensor Jacobian;
01258 tensor JacobianINV;
01259 tensor dhGlobal;
01260
01261
01262 static int disp_dim[] = {8,3};
01263 tensor total_displacements(2,disp_dim,0.0);
01264
01265 total_displacements = total_disp(fp, u);
01266
01267 ::printf("\n displacement(x-y-z) at GAUSS pt %d \n\n", where+1);
01268 for (int ii=1; ii<=8;ii++)
01269 {
01270 ::printf("Global# %d Local#%d %+0.5e %+0.5e %+0.5e\n",
01271
01272 connectedExternalNodes(ii-1),
01273 ii,total_displacements.val(ii,1),
01274 total_displacements.val(ii,2),
01275 total_displacements.val(ii,3));
01276 }
01277 for( short GP_c_r = 1 ; GP_c_r <= r_integration_order ; GP_c_r++ )
01278 {
01279 r = get_Gauss_p_c( r_integration_order, GP_c_r );
01280 for( short GP_c_s = 1 ; GP_c_s <= s_integration_order ; GP_c_s++ )
01281 {
01282 s = get_Gauss_p_c( s_integration_order, GP_c_s );
01283 for( short GP_c_t = 1 ; GP_c_t <= t_integration_order ; GP_c_t++ )
01284 {
01285 t = get_Gauss_p_c( t_integration_order, GP_c_t );
01286
01287
01288 where =
01289 ((GP_c_r-1)*s_integration_order+GP_c_s-1)*t_integration_order+GP_c_t-1;
01290
01291 dh = dh_drst_at(r,s,t);
01292
01293 Jacobian = Jacobian_3D(dh);
01294
01295 JacobianINV = Jacobian_3Dinv(dh);
01296
01297 det_of_Jacobian = Jacobian.determinant();
01298
01299 dhGlobal = dh("ij") * JacobianINV("jk");
01300
01301
01302 strain = (dhGlobal("ib")*total_displacements("ia")).symmetrize11();
01303 strain.null_indices();
01304
01305
01306
01307
01308
01309
01310 Constitutive = ( matpoint[where]->matmodel)->getTangentTensor();
01311
01312 stress = Constitutive("ijkl") * strain("kl");
01313 stress.null_indices();
01314
01315 ::printf("\n strain tensor at GAUSS point %d \n", where+1);
01316 strain.reportshort("");
01317 ::printf("\n stress tensor at GAUSS point %d \n", where+1);
01318 stress.reportshort("");
01319
01320
01321 }
01322 }
01323 }
01324 }
01325
01326
01328
01329 tensor EightNodeBrick::getMassTensor(void)
01330 {
01331
01332 int M_dim[] = {24,24};
01333 tensor Mm(2,M_dim,0.0);
01334
01335 double r = 0.0;
01336 double rw = 0.0;
01337 double s = 0.0;
01338 double sw = 0.0;
01339 double t = 0.0;
01340 double tw = 0.0;
01341
01342 short where = 0;
01343 double weight = 0.0;
01344
01345 int dh_dim[] = {8,3};
01346
01347 tensor dh(2, dh_dim, 0.0);
01348
01349 int h_dim[] = {24,3};
01350
01351
01352 tensor H(2, h_dim, 0.0);
01353
01354 double det_of_Jacobian = 0.0;
01355
01356 tensor Jacobian;
01357
01358 double RHO;
01359 RHO= rho;
01360
01361 for( short GP_c_r = 1 ; GP_c_r <= r_integration_order ; GP_c_r++ )
01362 {
01363 r = get_Gauss_p_c( r_integration_order, GP_c_r );
01364 rw = get_Gauss_p_w( r_integration_order, GP_c_r );
01365 for( short GP_c_s = 1 ; GP_c_s <= s_integration_order ; GP_c_s++ )
01366 {
01367 s = get_Gauss_p_c( s_integration_order, GP_c_s );
01368 sw = get_Gauss_p_w( s_integration_order, GP_c_s );
01369 for( short GP_c_t = 1 ; GP_c_t <= t_integration_order ; GP_c_t++ )
01370 {
01371 t = get_Gauss_p_c( t_integration_order, GP_c_t );
01372 tw = get_Gauss_p_w( t_integration_order, GP_c_t );
01373
01374
01375 where =
01376 ((GP_c_r-1)*s_integration_order+GP_c_s-1)*t_integration_order+GP_c_t-1;
01377
01378 dh = dh_drst_at(r,s,t);
01379
01380 Jacobian = Jacobian_3D(dh);
01381
01382
01383
01384
01385 det_of_Jacobian = Jacobian.determinant();
01386
01387
01388
01389
01390
01391
01392
01393
01394
01395
01396
01397 H = H_3D(r,s,t);
01398
01399
01400
01401
01402
01403
01404
01405
01406
01407
01408
01409
01410
01411
01412
01413
01414
01415
01416
01417
01418
01419
01420
01421
01422
01423
01424
01425 weight = rw * sw * tw * RHO * det_of_Jacobian;
01426
01427
01428
01429
01430
01431
01432
01433 Mm = Mm + H("ib")*H("kb")*weight;
01434
01435
01436 }
01437 }
01438 }
01439
01440
01441 return Mm;
01442 }
01443
01444
01445
01446
01447
01448
01449
01450
01451
01452
01453
01454
01455
01456
01457
01458
01459
01460
01461
01462
01463
01464
01465
01466
01467
01468
01469
01470
01471
01472
01473
01474
01475
01476
01477
01478
01479
01480
01481
01482
01483
01484
01485
01486
01487
01488
01489
01490
01491
01492
01493
01494
01495
01496
01497
01498
01499
01500
01501
01502
01503
01504
01505
01506
01507
01508
01509
01510
01511
01512
01513
01514
01515
01516
01517
01518
01519
01520
01521
01522
01523
01524
01525
01526
01527
01528
01529
01530
01531
01532
01533
01534
01535
01536
01537
01538
01539
01540
01541
01542
01543
01544
01546
01547 tensor EightNodeBrick::stiffness_matrix(const tensor & K)
01548 {
01549
01550
01551 matrix Kmatrix(24,24,0.0);
01552
01553 int Ki=0;
01554 int Kj=0;
01555
01556 for ( int i=1 ; i<=8 ; i++ )
01557 {
01558 for ( int j=1 ; j<=8 ; j++ )
01559 {
01560 for ( int k=1 ; k<=3 ; k++ )
01561 {
01562 for ( int l=1 ; l<=3 ; l++ )
01563 {
01564 Ki = k+3*(i-1);
01565 Kj = l+3*(j-1);
01566
01567
01568 Kmatrix.val( Ki , Kj ) = K.cval(i,k,l,j);
01569 }
01570 }
01571 }
01572 }
01573 return Kmatrix;
01574 }
01575
01576
01577
01579
01580 tensor EightNodeBrick::mass_matrix(const tensor & M)
01581 {
01582
01583
01584 matrix Mmatrix(24,24,0.0);
01585
01586 for ( int i=1 ; i<=24 ; i++ )
01587 {
01588 for ( int j=1 ; j<=24 ; j++ )
01589 {
01590 Mmatrix.val( i , j ) = M.cval(i,j);
01591
01592 }
01593 }
01594 return Mmatrix;
01595 }
01597
01599 tensor EightNodeBrick::Jacobian_3D(tensor dh)
01600 {
01601
01602 tensor N_C = Nodal_Coordinates();
01603 tensor Jacobian_3D = dh("ij") * N_C("ik");
01604 return Jacobian_3D;
01605 }
01606
01607
01608 tensor EightNodeBrick::Jacobian_3Dinv(tensor dh)
01609 {
01610
01611 tensor N_C = Nodal_Coordinates();
01612 tensor Jacobian_3Dinv = (dh("ij") * N_C("ik")).inverse();
01613 return Jacobian_3Dinv;
01614 }
01615
01616
01618 tensor EightNodeBrick::Nodal_Coordinates(void)
01619 {
01620 const int dimensions[] = {8,3};
01621 tensor N_coord(2, dimensions, 0.0);
01622
01623
01624
01625
01626
01627
01628
01629
01630
01631
01632
01633
01634
01635
01636
01637 const Vector &nd1Crds = nd1Ptr->getCrds();
01638 const Vector &nd2Crds = nd2Ptr->getCrds();
01639 const Vector &nd3Crds = nd3Ptr->getCrds();
01640 const Vector &nd4Crds = nd4Ptr->getCrds();
01641 const Vector &nd5Crds = nd5Ptr->getCrds();
01642 const Vector &nd6Crds = nd6Ptr->getCrds();
01643 const Vector &nd7Crds = nd7Ptr->getCrds();
01644 const Vector &nd8Crds = nd8Ptr->getCrds();
01645
01646 N_coord.val(1,1)=nd1Crds(0); N_coord.val(1,2)=nd1Crds(1); N_coord.val(1,3)=nd1Crds(2);
01647 N_coord.val(2,1)=nd2Crds(0); N_coord.val(2,2)=nd2Crds(1); N_coord.val(2,3)=nd2Crds(2);
01648 N_coord.val(3,1)=nd3Crds(0); N_coord.val(3,2)=nd3Crds(1); N_coord.val(3,3)=nd3Crds(2);
01649 N_coord.val(4,1)=nd4Crds(0); N_coord.val(4,2)=nd4Crds(1); N_coord.val(4,3)=nd4Crds(2);
01650 N_coord.val(5,1)=nd5Crds(0); N_coord.val(5,2)=nd5Crds(1); N_coord.val(5,3)=nd5Crds(2);
01651 N_coord.val(6,1)=nd6Crds(0); N_coord.val(6,2)=nd6Crds(1); N_coord.val(6,3)=nd6Crds(2);
01652 N_coord.val(7,1)=nd7Crds(0); N_coord.val(7,2)=nd7Crds(1); N_coord.val(7,3)=nd7Crds(2);
01653 N_coord.val(8,1)=nd8Crds(0); N_coord.val(8,2)=nd8Crds(1); N_coord.val(8,3)=nd8Crds(2);
01654
01655 return N_coord;
01656 }
01657
01659 tensor EightNodeBrick::incr_disp(void)
01660 {
01661 const int dimensions[] = {8,3};
01662 tensor increment_disp(2, dimensions, 0.0);
01663
01664
01665
01666
01667
01668
01669
01670
01671
01672
01673
01674
01675
01676
01677
01678
01679
01680
01681
01682
01683 const Vector &IncrDis1 = nd1Ptr->getIncrDeltaDisp();
01684 const Vector &IncrDis2 = nd2Ptr->getIncrDeltaDisp();
01685 const Vector &IncrDis3 = nd3Ptr->getIncrDeltaDisp();
01686 const Vector &IncrDis4 = nd4Ptr->getIncrDeltaDisp();
01687 const Vector &IncrDis5 = nd5Ptr->getIncrDeltaDisp();
01688 const Vector &IncrDis6 = nd6Ptr->getIncrDeltaDisp();
01689 const Vector &IncrDis7 = nd7Ptr->getIncrDeltaDisp();
01690 const Vector &IncrDis8 = nd8Ptr->getIncrDeltaDisp();
01691
01692
01693
01694
01695
01696
01697
01698
01699
01700
01701
01702
01703
01704
01705
01706
01707
01708
01709
01710
01711
01712
01713 increment_disp.val(1,1)=IncrDis1(0); increment_disp.val(1,2)=IncrDis1(1);increment_disp.val(1,3)=IncrDis1(2);
01714 increment_disp.val(2,1)=IncrDis2(0); increment_disp.val(2,2)=IncrDis2(1);increment_disp.val(2,3)=IncrDis2(2);
01715 increment_disp.val(3,1)=IncrDis3(0); increment_disp.val(3,2)=IncrDis3(1);increment_disp.val(3,3)=IncrDis3(2);
01716 increment_disp.val(4,1)=IncrDis4(0); increment_disp.val(4,2)=IncrDis4(1);increment_disp.val(4,3)=IncrDis4(2);
01717 increment_disp.val(5,1)=IncrDis5(0); increment_disp.val(5,2)=IncrDis5(1);increment_disp.val(5,3)=IncrDis5(2);
01718 increment_disp.val(6,1)=IncrDis6(0); increment_disp.val(6,2)=IncrDis6(1);increment_disp.val(6,3)=IncrDis6(2);
01719 increment_disp.val(7,1)=IncrDis7(0); increment_disp.val(7,2)=IncrDis7(1);increment_disp.val(7,3)=IncrDis7(2);
01720 increment_disp.val(8,1)=IncrDis8(0); increment_disp.val(8,2)=IncrDis8(1);increment_disp.val(8,3)=IncrDis8(2);
01721
01722 return increment_disp;
01723 }
01724
01726 tensor EightNodeBrick::total_disp(void)
01727 {
01728 const int dimensions[] = {8,3};
01729 tensor total_disp(2, dimensions, 0.0);
01730
01731
01732 const Vector &TotDis1 = nd1Ptr->getTrialDisp();
01733 cout<<"\ntot node " << nd1Ptr->getTag() <<" x "<< TotDis1(0) <<" y "<< TotDis1(1) << " z "<< TotDis1(2) << endln;
01734 const Vector &TotDis2 = nd2Ptr->getTrialDisp();
01735 cout << "tot node " << nd2Ptr->getTag() << " x " << TotDis2(0) <<" y "<< TotDis2(1) << " z "<< TotDis2(2) << endln;
01736 const Vector &TotDis3 = nd3Ptr->getTrialDisp();
01737 cout << "tot node " << nd3Ptr->getTag() << " x " << TotDis3(0) <<" y "<< TotDis3(1) << " z "<< TotDis3(2) << endln;
01738 const Vector &TotDis4 = nd4Ptr->getTrialDisp();
01739 cout << "tot node " << nd4Ptr->getTag() << " x " << TotDis4(0) <<" y "<< TotDis4(1) << " z "<< TotDis4(2) << endln;
01740 const Vector &TotDis5 = nd5Ptr->getTrialDisp();
01741 cout << "tot node " << nd5Ptr->getTag() << " x " << TotDis5(0) <<" y "<< TotDis5(1) << " z "<< TotDis5(2) << endln;
01742 const Vector &TotDis6 = nd6Ptr->getTrialDisp();
01743 cout << "tot node " << nd6Ptr->getTag() << " x " << TotDis6(0) <<" y "<< TotDis6(1) << " z "<< TotDis6(2) << endln;
01744 const Vector &TotDis7 = nd7Ptr->getTrialDisp();
01745 cout << "tot node " << nd7Ptr->getTag() << " x " << TotDis7(0) <<" y "<< TotDis7(1) << " z "<< TotDis7(2) << endln;
01746 const Vector &TotDis8 = nd8Ptr->getTrialDisp();
01747 cout << "tot node " << nd8Ptr->getTag() << " x " << TotDis8(0) <<" y "<< TotDis8(1) << " z "<< TotDis8(2) << endln;
01748
01749 total_disp.val(1,1)=TotDis1(0); total_disp.val(1,2)=TotDis1(1);total_disp.val(1,3)=TotDis1(2);
01750 total_disp.val(2,1)=TotDis2(0); total_disp.val(2,2)=TotDis2(1);total_disp.val(2,3)=TotDis2(2);
01751 total_disp.val(3,1)=TotDis3(0); total_disp.val(3,2)=TotDis3(1);total_disp.val(3,3)=TotDis3(2);
01752 total_disp.val(4,1)=TotDis4(0); total_disp.val(4,2)=TotDis4(1);total_disp.val(4,3)=TotDis4(2);
01753 total_disp.val(5,1)=TotDis5(0); total_disp.val(5,2)=TotDis5(1);total_disp.val(5,3)=TotDis5(2);
01754 total_disp.val(6,1)=TotDis6(0); total_disp.val(6,2)=TotDis6(1);total_disp.val(6,3)=TotDis6(2);
01755 total_disp.val(7,1)=TotDis7(0); total_disp.val(7,2)=TotDis7(1);total_disp.val(7,3)=TotDis7(2);
01756 total_disp.val(8,1)=TotDis8(0); total_disp.val(8,2)=TotDis8(1);total_disp.val(8,3)=TotDis8(2);
01757
01758 return total_disp;
01759 }
01760
01761
01763 tensor EightNodeBrick::total_disp(FILE *fp, double * u)
01764 {
01765 const int dimensions[] = {8,3};
01766 tensor total_disp(2, dimensions, 0.0);
01767
01768
01769
01770
01771
01772
01773
01774
01775
01776
01777
01778
01779
01780
01781
01782
01783
01784
01785
01786
01787
01788 const Vector &TotDis1 = nd1Ptr->getTrialDisp();
01789 const Vector &TotDis2 = nd2Ptr->getTrialDisp();
01790 const Vector &TotDis3 = nd3Ptr->getTrialDisp();
01791 const Vector &TotDis4 = nd4Ptr->getTrialDisp();
01792 const Vector &TotDis5 = nd5Ptr->getTrialDisp();
01793 const Vector &TotDis6 = nd6Ptr->getTrialDisp();
01794 const Vector &TotDis7 = nd7Ptr->getTrialDisp();
01795 const Vector &TotDis8 = nd8Ptr->getTrialDisp();
01796
01797 total_disp.val(1,1)=TotDis1(0); total_disp.val(1,2)=TotDis1(1);total_disp.val(1,3)=TotDis1(2);
01798 total_disp.val(2,1)=TotDis2(0); total_disp.val(2,2)=TotDis2(1);total_disp.val(2,3)=TotDis2(2);
01799 total_disp.val(3,1)=TotDis3(0); total_disp.val(3,2)=TotDis3(1);total_disp.val(3,3)=TotDis3(2);
01800 total_disp.val(4,1)=TotDis4(0); total_disp.val(4,2)=TotDis4(1);total_disp.val(4,3)=TotDis4(2);
01801 total_disp.val(5,1)=TotDis5(0); total_disp.val(5,2)=TotDis5(1);total_disp.val(5,3)=TotDis5(2);
01802 total_disp.val(6,1)=TotDis6(0); total_disp.val(6,2)=TotDis6(1);total_disp.val(6,3)=TotDis6(2);
01803 total_disp.val(7,1)=TotDis7(0); total_disp.val(7,2)=TotDis7(1);total_disp.val(7,3)=TotDis7(2);
01804 total_disp.val(8,1)=TotDis8(0); total_disp.val(8,2)=TotDis8(1);total_disp.val(8,3)=TotDis8(2);
01805
01806 return total_disp;
01807 }
01808
01809
01811 int EightNodeBrick::get_global_number_of_node(int local_node_number)
01812 {
01813
01814 return connectedExternalNodes(local_node_number);
01815 }
01816
01818 int EightNodeBrick::get_Brick_Number(void)
01819 {
01820
01821 return this->getTag();
01822 }
01823
01825 int * EightNodeBrick::get_LM(void)
01826 {
01827 return LM;
01828 }
01829
01830
01831
01833
01834
01839
01840
01842
01843
01844
01845
01846
01847
01848
01849
01855
01856
01857
01858
01860
01861 tensor EightNodeBrick::nodal_forces(void)
01862 {
01863 int force_dim[] = {8,3};
01864
01865 tensor nodal_forces(2,force_dim,0.0);
01866
01867 double r = 0.0;
01868 double rw = 0.0;
01869 double s = 0.0;
01870 double sw = 0.0;
01871 double t = 0.0;
01872 double tw = 0.0;
01873
01874 short where = 0;
01875 double weight = 0.0;
01876
01877 int dh_dim[] = {8,3};
01878
01879 tensor dh(2, dh_dim, 0.0);
01880
01881 stresstensor stress_at_GP(0.0);
01882
01883 double det_of_Jacobian = 0.0;
01884
01885 straintensor incremental_strain;
01886
01887 static int disp_dim[] = {8,3};
01888 tensor incremental_displacements(2,disp_dim,0.0);
01889
01890 incremental_displacements = incr_disp();
01891
01892 tensor Jacobian;
01893 tensor JacobianINV;
01894 tensor dhGlobal;
01895
01896 for( short GP_c_r = 1 ; GP_c_r <= r_integration_order ; GP_c_r++ )
01897 {
01898 r = get_Gauss_p_c( r_integration_order, GP_c_r );
01899 rw = get_Gauss_p_w( r_integration_order, GP_c_r );
01900
01901 for( short GP_c_s = 1 ; GP_c_s <= s_integration_order ; GP_c_s++ )
01902 {
01903 s = get_Gauss_p_c( s_integration_order, GP_c_s );
01904 sw = get_Gauss_p_w( s_integration_order, GP_c_s );
01905
01906 for( short GP_c_t = 1 ; GP_c_t <= t_integration_order ; GP_c_t++ )
01907 {
01908 t = get_Gauss_p_c( t_integration_order, GP_c_t );
01909 tw = get_Gauss_p_w( t_integration_order, GP_c_t );
01910
01911
01912
01913 where =
01914 ((GP_c_r-1)*s_integration_order+GP_c_s-1)*t_integration_order+GP_c_t-1;
01915
01916
01917 dh = dh_drst_at(r,s,t);
01918
01919
01920 Jacobian = Jacobian_3D(dh);
01921
01922
01923
01924 JacobianINV = Jacobian_3Dinv(dh);
01925
01926
01927
01928 det_of_Jacobian = Jacobian.determinant();
01929
01930
01931
01932 dhGlobal = dh("ij") * JacobianINV("jk");
01933
01934
01935 weight = rw * sw * tw * det_of_Jacobian;
01936
01937
01938
01939
01940
01941
01942
01943
01944
01945
01946
01948
01949
01951
01952
01953
01954
01956
01959
01960
01961
01962
01963
01964
01965
01966
01967
01968
01969
01970
01971
01972
01973
01974
01975
01976
01977
01978
01979
01980
01981
01982
01983
01984
01985
01986
01987
01988
01989
01990
01991
01992
01993 incremental_strain =
01994 (dhGlobal("ib")*incremental_displacements("ia")).symmetrize11();
01995
01996
01998
01999 int err = ( matpoint[where]->matmodel )->setTrialStrainIncr( incremental_strain);
02000 if ( err)
02001 g3ErrorHandler->warning("EightNodeBrick::getStiffnessTensor (tag: %d), not converged",
02002 this->getTag());
02003
02004
02005
02006
02007
02008
02009 stress_at_GP = matpoint[where]->getStressTensor();
02010
02011
02012
02013
02014
02015
02016
02017
02018
02019
02020
02021
02022
02023
02024
02025
02026
02027
02028
02029
02030
02031
02032
02033
02034
02035
02036
02037
02038
02039
02040
02041
02042
02043 nodal_forces =
02044 nodal_forces + dhGlobal("ib")*stress_at_GP("ab")*weight;
02045
02046
02047 }
02048 }
02049 }
02050
02051
02052
02053 return nodal_forces;
02054
02055 }
02056
02058
02059 tensor EightNodeBrick::iterative_nodal_forces(void)
02060 {
02061 int force_dim[] = {8,3};
02062
02063 tensor nodal_forces(2,force_dim,0.0);
02064
02065 double r = 0.0;
02066 double rw = 0.0;
02067 double s = 0.0;
02068 double sw = 0.0;
02069 double t = 0.0;
02070 double tw = 0.0;
02071
02072 short where = 0;
02073 double weight = 0.0;
02074
02075 int dh_dim[] = {8,3};
02076
02077 tensor dh(2, dh_dim, 0.0);
02078
02079 stresstensor stress_at_GP(0.0);
02080
02081 double det_of_Jacobian = 0.0;
02082
02083 tensor Jacobian;
02084 tensor JacobianINV;
02085 tensor dhGlobal;
02086
02087 for( short GP_c_r = 1 ; GP_c_r <= r_integration_order ; GP_c_r++ )
02088 {
02089 r = get_Gauss_p_c( r_integration_order, GP_c_r );
02090 rw = get_Gauss_p_w( r_integration_order, GP_c_r );
02091
02092 for( short GP_c_s = 1 ; GP_c_s <= s_integration_order ; GP_c_s++ )
02093 {
02094 s = get_Gauss_p_c( s_integration_order, GP_c_s );
02095 sw = get_Gauss_p_w( s_integration_order, GP_c_s );
02096
02097 for( short GP_c_t = 1 ; GP_c_t <= t_integration_order ; GP_c_t++ )
02098 {
02099 t = get_Gauss_p_c( t_integration_order, GP_c_t );
02100 tw = get_Gauss_p_w( t_integration_order, GP_c_t );
02101
02102
02103
02104 where =
02105 ((GP_c_r-1)*s_integration_order+GP_c_s-1)*t_integration_order+GP_c_t-1;
02106
02107
02108
02109
02110
02111
02112 dh = dh_drst_at(r,s,t);
02113
02114
02115 Jacobian = Jacobian_3D(dh);
02116
02117
02118
02119 JacobianINV = Jacobian_3Dinv(dh);
02120
02121
02122
02123 det_of_Jacobian = Jacobian.determinant();
02124
02125
02126
02127 dhGlobal = dh("ij") * JacobianINV("jk");
02128
02129
02130 weight = rw * sw * tw * det_of_Jacobian;
02131
02132
02133
02134
02135
02136 stress_at_GP = matpoint[where]->getStressTensor();
02137 stress_at_GP.reportshortpqtheta("\n iterative_stress at GAUSS point in iterative_nodal_force\n");
02138
02139
02140 nodal_forces =
02141 nodal_forces + dhGlobal("ib")*stress_at_GP("ab")*weight;
02142
02143
02144 }
02145 }
02146 }
02147
02148
02149 return nodal_forces;
02150
02151 }
02152
02154
02155 tensor EightNodeBrick::nodal_forces_from_stress(stresstensor & stress)
02156 {
02157 int force_dim[] = {8,3};
02158
02159 tensor nodal_forces(2,force_dim,0.0);
02160
02161 double r = 0.0;
02162 double rw = 0.0;
02163 double s = 0.0;
02164 double sw = 0.0;
02165 double t = 0.0;
02166 double tw = 0.0;
02167
02168 double weight = 0.0;
02169
02170 int dh_dim[] = {8,3};
02171
02172 tensor dh(2, dh_dim, 0.0);
02173
02174 double det_of_Jacobian = 0.0;
02175
02176 tensor Jacobian;
02177 tensor JacobianINV;
02178 tensor dhGlobal;
02179
02180 for( short GP_c_r = 1 ; GP_c_r <= r_integration_order ; GP_c_r++ )
02181 {
02182 r = get_Gauss_p_c( r_integration_order, GP_c_r );
02183 rw = get_Gauss_p_w( r_integration_order, GP_c_r );
02184
02185 for( short GP_c_s = 1 ; GP_c_s <= s_integration_order ; GP_c_s++ )
02186 {
02187 s = get_Gauss_p_c( s_integration_order, GP_c_s );
02188 sw = get_Gauss_p_w( s_integration_order, GP_c_s );
02189
02190 for( short GP_c_t = 1 ; GP_c_t <= t_integration_order ; GP_c_t++ )
02191 {
02192 t = get_Gauss_p_c( t_integration_order, GP_c_t );
02193 tw = get_Gauss_p_w( t_integration_order, GP_c_t );
02194
02195
02196
02197
02198
02199
02200
02201
02202
02203
02204
02205 dh = dh_drst_at(r,s,t);
02206
02207
02208 Jacobian = Jacobian_3D(dh);
02209
02210
02211
02212 JacobianINV = Jacobian_3Dinv(dh);
02213
02214
02215
02216 det_of_Jacobian = Jacobian.determinant();
02217
02218
02219
02220 dhGlobal = dh("ij") * JacobianINV("jk");
02221
02222
02223 weight = rw * sw * tw * det_of_Jacobian;
02224
02225
02226
02227
02228
02229
02230 nodal_forces =
02231 nodal_forces + dhGlobal("ib")*stress("ab")*weight;
02232
02233
02234 }
02235 }
02236 }
02237
02238 return nodal_forces;
02239
02240 }
02241
02242
02244
02245
02246 tensor EightNodeBrick::linearized_nodal_forces(void)
02247 {
02248 int force_dim[] = {8,3};
02249
02250 tensor linearized_nodal_forces(2,force_dim,0.0);
02251
02252 double r = 0.0;
02253 double rw = 0.0;
02254 double s = 0.0;
02255 double sw = 0.0;
02256 double t = 0.0;
02257 double tw = 0.0;
02258
02259 short where = 0;
02260 double weight = 0.0;
02261
02262 int dh_dim[] = {8,3};
02263
02264 tensor dh(2, dh_dim, 0.0);
02265
02266 tensor Constitutive( 4, def_dim_4, 0.0);
02267
02268 double det_of_Jacobian = 0.0;
02269
02270 static int disp_dim[] = {8,3};
02271
02272 tensor incremental_displacements(2,disp_dim,0.0);
02273
02274 straintensor incremental_strain;
02275
02276 tensor Jacobian;
02277 tensor JacobianINV;
02278 tensor dhGlobal;
02279
02280 stresstensor final_linearized_stress;
02281
02282
02283 incremental_displacements = incr_disp();
02284
02285
02286 for( short GP_c_r = 1 ; GP_c_r <= r_integration_order ; GP_c_r++ )
02287 {
02288 r = get_Gauss_p_c( r_integration_order, GP_c_r );
02289 rw = get_Gauss_p_w( r_integration_order, GP_c_r );
02290
02291 for( short GP_c_s = 1 ; GP_c_s <= s_integration_order ; GP_c_s++ )
02292 {
02293 s = get_Gauss_p_c( s_integration_order, GP_c_s );
02294 sw = get_Gauss_p_w( s_integration_order, GP_c_s );
02295
02296 for( short GP_c_t = 1 ; GP_c_t <= t_integration_order ; GP_c_t++ )
02297 {
02298 t = get_Gauss_p_c( t_integration_order, GP_c_t );
02299 tw = get_Gauss_p_w( t_integration_order, GP_c_t );
02300
02301
02302
02303 where =
02304 ((GP_c_r-1)*s_integration_order+GP_c_s-1)*t_integration_order+GP_c_t-1;
02305
02306
02307 dh = dh_drst_at(r,s,t);
02308
02309
02310 Jacobian = Jacobian_3D(dh);
02311
02312
02313
02314 JacobianINV = Jacobian_3Dinv(dh);
02315
02316
02317
02318 det_of_Jacobian = Jacobian.determinant();
02319
02320
02321
02322 dhGlobal = dh("ij") * JacobianINV("jk");
02323
02324
02325 weight = rw * sw * tw * det_of_Jacobian;
02326
02327
02328
02329
02330
02331
02332
02333
02334 incremental_strain =
02335 (dhGlobal("ib")*incremental_displacements("ia")).symmetrize11();
02336 incremental_strain.null_indices();
02337
02338
02339
02340
02341
02342
02343
02344
02345
02346 if ( ! (matpoint[where]->matmodel)->setTrialStrainIncr( incremental_strain) )
02347 g3ErrorHandler->warning("EightNodeBrick::linearized_nodal_forces (tag: %d), not converged",
02348 this->getTag());
02349 Constitutive = (matpoint[where]->matmodel)->getTangentTensor();
02350
02351
02352
02353
02354
02355
02356
02357
02358
02359
02360
02361
02362
02363
02364 final_linearized_stress =
02365 Constitutive("ijkl") * incremental_strain("kl");
02366
02367
02368 linearized_nodal_forces = linearized_nodal_forces +
02369 dhGlobal("ib")*final_linearized_stress("ab")*weight;
02370
02371
02372 }
02373 }
02374 }
02375
02376
02377 return linearized_nodal_forces;
02378
02379 }
02380
02381
02382
02383
02384
02385
02386
02387
02388
02389
02390
02391
02392
02393
02394
02395
02396
02397
02398
02399
02400
02401
02402
02403
02404
02405
02406
02407
02408
02409
02410
02411
02412
02413
02414
02415
02416
02417
02418
02419
02420
02421
02422
02423
02424
02425
02426
02427
02428
02429
02430
02431
02432
02433
02434
02435
02436
02437
02438
02439
02440
02441
02442
02443
02444
02445
02446
02447
02448
02449
02450
02451
02452
02453
02454
02455
02456
02457
02458
02459
02460
02461
02462
02463
02464
02465
02466
02467
02468
02469
02470
02471
02472
02473
02474
02475
02476
02477
02478
02479
02480
02481
02482
02483
02484
02487
02488
02489
02490
02491
02492
02493
02495
02496
02497
02498
02499
02500
02501
02502
02503
02504
02505 void EightNodeBrick::report(char * msg)
02506 {
02507 if ( msg ) ::printf("** %s",msg);
02508 ::printf("\n Element Number = %d\n", this->getTag() );
02509 ::printf("\n Number of nodes in a EightNodebrick = %d\n",
02510 nodes_in_brick);
02511 ::printf("\n Determinant of Jacobian (! ==0 before comp.) = %f\n",
02512 determinant_of_Jacobian);
02513
02514 ::printf("Node numbers \n");
02515 ::printf(
02516 ".....1.....2.....3.....4.....5.....6.....7.....8.....9.....0.....1.....2\n");
02517 for ( int i=0 ; i<8 ; i++ )
02518
02519 ::printf("%6d",connectedExternalNodes(i));
02520 ::printf("\n");
02521
02522
02523 ::printf("\n\n");
02524
02525
02526
02527
02528
02529
02530
02531 int total_number_of_Gauss_points = r_integration_order*
02532 s_integration_order*
02533 t_integration_order;
02534 if ( total_number_of_Gauss_points != 0 )
02535 {
02536
02537
02538
02539
02540
02541
02542 nd1Ptr->Print(cout);
02543 nd2Ptr->Print(cout);
02544 nd3Ptr->Print(cout);
02545 nd4Ptr->Print(cout);
02546 nd5Ptr->Print(cout);
02547 nd6Ptr->Print(cout);
02548 nd7Ptr->Print(cout);
02549 nd8Ptr->Print(cout);
02550
02551
02552
02553
02554 }
02555
02556 ::printf("\n\nGauss-Legendre integration order\n");
02557 ::printf("Integration order in r direction = %d\n",r_integration_order);
02558 ::printf("Integration order in s direction = %d\n",s_integration_order);
02559 ::printf("Integration order in t direction = %d\n\n",t_integration_order);
02560
02561
02562
02563 for( int GP_c_r = 1 ; GP_c_r <= r_integration_order ; GP_c_r++ )
02564 {
02565 for( int GP_c_s = 1 ; GP_c_s <= s_integration_order ; GP_c_s++ )
02566 {
02567 for( int GP_c_t = 1 ; GP_c_t <= t_integration_order ; GP_c_t++ )
02568 {
02569
02570
02571 short where =
02572 ((GP_c_r-1)*s_integration_order+GP_c_s-1)*t_integration_order+GP_c_t-1;
02573
02574 ::printf("\n\n----------------**************** where = %d \n", where);
02575 ::printf(" GP_c_r = %d, GP_c_s = %d, GP_c_t = %d\n",
02576 GP_c_r,GP_c_s,GP_c_t);
02577 matpoint[where]->report("Material Point\n");
02578
02579
02580
02581 }
02582 }
02583 }
02584
02585 }
02586
02587
02588
02589 void EightNodeBrick::reportshort(char * msg)
02590 {
02591 if ( msg ) ::printf("** %s",msg);
02592 ::printf("\n Element Number = %d\n", this->getTag() );
02593 ::printf("\n Number of nodes in a EightNodeBrick = %d\n",
02594 nodes_in_brick);
02595 ::printf("\n Determinant of Jacobian (! ==0 before comp.) = %f\n",
02596 determinant_of_Jacobian);
02597
02598 ::printf("Node numbers \n");
02599 ::printf(
02600 ".....1.....2.....3.....4.....5.....6.....7.....8.....9.....0.....1.....2\n");
02601 for ( int i=0 ; i<8 ; i++ )
02602
02603 ::printf( "%6d",connectedExternalNodes(i) );
02604
02605 ::printf("\n");
02606
02607
02608 ::printf("\n\n");
02609
02610
02611
02612
02613 ::printf("\n\n");
02614
02615 }
02616
02617
02618
02619
02620
02621 void EightNodeBrick::reportPAK(char * msg)
02622 {
02623 if ( msg ) ::printf("%s",msg);
02624 ::printf("%10d ", this->getTag());
02625 for ( int i=0 ; i<8 ; i++ )
02626 ::printf( "%6d",connectedExternalNodes(i) );
02627
02628
02629 printf("\n");
02630 }
02631
02632
02633
02634 void EightNodeBrick::reportpqtheta(int GP_numb)
02635 {
02636 short where = GP_numb-1;
02637 matpoint[where]->reportpqtheta("");
02638 }
02639
02640
02641 void EightNodeBrick::reportLM(char * msg)
02642 {
02643 if ( msg ) ::printf("%s",msg);
02644 ::printf("Element # %d, LM->", this->get_Brick_Number());
02645 for (int count = 0 ; count < 24 ; count++)
02646 {
02647 ::printf(" %d", LM[count]);
02648 }
02649 ::printf("\n");
02650
02651 }
02652
02653
02654 void EightNodeBrick::reportTensor(char * msg)
02655 {
02656
02657
02658
02659
02660 double r = 0.0;
02661 double s = 0.0;
02662 double t = 0.0;
02663
02664 short where = 0;
02665
02666
02667 static const int dim[] = {3, 8};
02668 tensor NodalCoord(2, dim, 0.0);
02669 tensor matpointCoord(2, dim, 0.0);
02670 int h_dim[] = {24,3};
02671 tensor H(2, h_dim, 0.0);
02672
02673
02675
02676
02677
02678
02679
02680
02681
02682
02683
02684
02685
02686
02687
02688
02689
02690
02691
02692
02693
02694
02695 const Vector &nd1Crds = nd1Ptr->getCrds();
02696 const Vector &nd2Crds = nd2Ptr->getCrds();
02697 const Vector &nd3Crds = nd3Ptr->getCrds();
02698 const Vector &nd4Crds = nd4Ptr->getCrds();
02699 const Vector &nd5Crds = nd5Ptr->getCrds();
02700 const Vector &nd6Crds = nd6Ptr->getCrds();
02701 const Vector &nd7Crds = nd7Ptr->getCrds();
02702 const Vector &nd8Crds = nd8Ptr->getCrds();
02703
02704 NodalCoord.val(1,1)=nd1Crds(0); NodalCoord.val(2,1)=nd1Crds(1); NodalCoord.val(3,1)=nd1Crds(2);
02705 NodalCoord.val(1,2)=nd2Crds(0); NodalCoord.val(2,2)=nd2Crds(1); NodalCoord.val(3,2)=nd2Crds(2);
02706 NodalCoord.val(1,3)=nd3Crds(0); NodalCoord.val(2,3)=nd3Crds(1); NodalCoord.val(3,3)=nd3Crds(2);
02707 NodalCoord.val(1,4)=nd4Crds(0); NodalCoord.val(2,4)=nd4Crds(1); NodalCoord.val(3,4)=nd4Crds(2);
02708 NodalCoord.val(1,5)=nd5Crds(0); NodalCoord.val(2,5)=nd5Crds(1); NodalCoord.val(3,5)=nd5Crds(2);
02709 NodalCoord.val(1,6)=nd6Crds(0); NodalCoord.val(2,6)=nd6Crds(1); NodalCoord.val(3,6)=nd6Crds(2);
02710 NodalCoord.val(1,7)=nd7Crds(0); NodalCoord.val(2,7)=nd7Crds(1); NodalCoord.val(3,7)=nd7Crds(2);
02711 NodalCoord.val(1,8)=nd8Crds(0); NodalCoord.val(2,8)=nd8Crds(1); NodalCoord.val(3,8)=nd8Crds(2);
02712
02713
02714 for( short GP_c_r = 1 ; GP_c_r <= r_integration_order ; GP_c_r++ )
02715 {
02716 r = get_Gauss_p_c( r_integration_order, GP_c_r );
02717 for( short GP_c_s = 1 ; GP_c_s <= s_integration_order ; GP_c_s++ )
02718 {
02719 s = get_Gauss_p_c( s_integration_order, GP_c_s );
02720 for( short GP_c_t = 1 ; GP_c_t <= t_integration_order ; GP_c_t++ )
02721 {
02722 t = get_Gauss_p_c( t_integration_order, GP_c_t );
02723
02724
02725 where =
02726 ((GP_c_r-1)*s_integration_order+GP_c_s-1)*t_integration_order+GP_c_t-1;
02727
02728
02729 H = H_3D(r,s,t);
02730
02731 for (int encount=1 ; encount <= 8 ; encount++ )
02732
02733 {
02734
02735
02736
02737 matpointCoord.val(1,where+1) +=NodalCoord.val(1,encount) * H.val(encount*3-2,1);
02738
02739 matpointCoord.val(2,where+1) +=NodalCoord.val(2,encount) * H.val(encount*3-1,2);
02740 matpointCoord.val(3,where+1) +=NodalCoord.val(3,encount) * H.val(encount*3-0,3);
02741
02742 }
02743
02744 ::printf("gauss point# %d %+.6e %+.6e %+.6e \n", where+1,
02745 matpointCoord.val(1,where+1),
02746 matpointCoord.val(2,where+1),
02747 matpointCoord.val(3,where+1));
02748
02749
02750
02751
02752 }
02753 }
02754 }
02755
02756 }
02757
02758
02760
02761
02762
02763
02764
02765 void EightNodeBrick::reportTensorF(FILE * fp)
02766 {
02767
02768
02769
02770
02771 double r = 0.0;
02772 double s = 0.0;
02773 double t = 0.0;
02774
02775 short where = 0;
02776
02777
02778 static const int dim[] = {3, 8};
02779 tensor NodalCoord(2, dim, 0.0);
02780 tensor matpointCoord(2, dim, 0.0);
02781 int h_dim[] = {24,3};
02782
02783 tensor H(2, h_dim, 0.0);
02784
02785
02786
02787
02788
02789
02790
02791
02792
02793
02794
02795
02796
02797
02798
02799
02800
02801
02802
02803
02804
02805
02806 const Vector &nd1Crds = nd1Ptr->getCrds();
02807 const Vector &nd2Crds = nd2Ptr->getCrds();
02808 const Vector &nd3Crds = nd3Ptr->getCrds();
02809 const Vector &nd4Crds = nd4Ptr->getCrds();
02810 const Vector &nd5Crds = nd5Ptr->getCrds();
02811 const Vector &nd6Crds = nd6Ptr->getCrds();
02812 const Vector &nd7Crds = nd7Ptr->getCrds();
02813 const Vector &nd8Crds = nd8Ptr->getCrds();
02814
02815 NodalCoord.val(1,1)=nd1Crds(0); NodalCoord.val(2,1)=nd1Crds(1); NodalCoord.val(3,1)=nd1Crds(2);
02816 NodalCoord.val(1,2)=nd2Crds(0); NodalCoord.val(2,2)=nd2Crds(1); NodalCoord.val(3,2)=nd2Crds(2);
02817 NodalCoord.val(1,3)=nd3Crds(0); NodalCoord.val(2,3)=nd3Crds(1); NodalCoord.val(3,3)=nd3Crds(2);
02818 NodalCoord.val(1,4)=nd4Crds(0); NodalCoord.val(2,4)=nd4Crds(1); NodalCoord.val(3,4)=nd4Crds(2);
02819 NodalCoord.val(1,5)=nd5Crds(0); NodalCoord.val(2,5)=nd5Crds(1); NodalCoord.val(3,5)=nd5Crds(2);
02820 NodalCoord.val(1,6)=nd6Crds(0); NodalCoord.val(2,6)=nd6Crds(1); NodalCoord.val(3,6)=nd6Crds(2);
02821 NodalCoord.val(1,7)=nd7Crds(0); NodalCoord.val(2,7)=nd7Crds(1); NodalCoord.val(3,7)=nd7Crds(2);
02822 NodalCoord.val(1,8)=nd8Crds(0); NodalCoord.val(2,8)=nd8Crds(1); NodalCoord.val(3,8)=nd8Crds(2);
02823
02824 for( short GP_c_r = 1 ; GP_c_r <= r_integration_order ; GP_c_r++ )
02825 {
02826 r = get_Gauss_p_c( r_integration_order, GP_c_r );
02827 for( short GP_c_s = 1 ; GP_c_s <= s_integration_order ; GP_c_s++ )
02828 {
02829 s = get_Gauss_p_c( s_integration_order, GP_c_s );
02830 for( short GP_c_t = 1 ; GP_c_t <= t_integration_order ; GP_c_t++ )
02831 {
02832 t = get_Gauss_p_c( t_integration_order, GP_c_t );
02833
02834
02835 where =
02836 ((GP_c_r-1)*s_integration_order+GP_c_s-1)*t_integration_order+GP_c_t-1;
02837
02838
02839 H = H_3D(r,s,t);
02840
02841 for (int encount=1 ; encount <= 8 ; encount++ )
02842
02843 {
02844
02845
02846
02847 matpointCoord.val(1,where+1) +=NodalCoord.val(1,encount) * H.val(encount*3-2,1);
02848
02849 matpointCoord.val(2,where+1) +=NodalCoord.val(2,encount) * H.val(encount*3-1,2);
02850 matpointCoord.val(3,where+1) +=NodalCoord.val(3,encount) * H.val(encount*3-0,3);
02851
02852 }
02853
02854 fprintf(fp, "gauss point# %d %+.6e %+.6e %+.6e \n", where+1,
02855 matpointCoord.val(1,where+1),
02856 matpointCoord.val(2,where+1),
02857 matpointCoord.val(3,where+1));
02858
02859
02860
02861
02862 }
02863 }
02864 }
02865
02866 }
02867
02868
02869
02870
02871
02872
02873
02874
02875
02876 int EightNodeBrick::getNumExternalNodes () const
02877 {
02878 return 8;
02879 }
02880
02881
02882
02883 const ID& EightNodeBrick::getExternalNodes ()
02884 {
02885 return connectedExternalNodes;
02886 }
02887
02888
02889 int EightNodeBrick::getNumDOF ()
02890 {
02891 return 24;
02892 }
02893
02894
02895 void EightNodeBrick::setDomain (Domain *theDomain)
02896 {
02897
02898 if (theDomain == 0) {
02899 nd1Ptr = 0;
02900 nd2Ptr = 0;
02901 nd3Ptr = 0;
02902 nd4Ptr = 0;
02903
02904 nd5Ptr = 0;
02905 nd6Ptr = 0;
02906 nd7Ptr = 0;
02907 nd8Ptr = 0;
02908 }
02909
02910 int Nd1 = connectedExternalNodes(0);
02911 int Nd2 = connectedExternalNodes(1);
02912 int Nd3 = connectedExternalNodes(2);
02913 int Nd4 = connectedExternalNodes(3);
02914
02915
02916 int Nd5 = connectedExternalNodes(4);
02917 int Nd6 = connectedExternalNodes(5);
02918 int Nd7 = connectedExternalNodes(6);
02919 int Nd8 = connectedExternalNodes(7);
02920
02921 nd1Ptr = theDomain->getNode(Nd1);
02922 nd2Ptr = theDomain->getNode(Nd2);
02923 nd3Ptr = theDomain->getNode(Nd3);
02924 nd4Ptr = theDomain->getNode(Nd4);
02925
02926
02927 nd5Ptr = theDomain->getNode(Nd5);
02928 nd6Ptr = theDomain->getNode(Nd6);
02929 nd7Ptr = theDomain->getNode(Nd7);
02930 nd8Ptr = theDomain->getNode(Nd8);
02931
02932 if (nd1Ptr == 0 || nd2Ptr == 0 || nd3Ptr == 0 || nd4Ptr == 0||
02933 nd5Ptr == 0 || nd6Ptr == 0 || nd7Ptr == 0 || nd8Ptr == 0 ) {
02934
02935
02936 g3ErrorHandler->fatal("FATAL ERROR EightNodeBrick (tag: %d), node not found in domain",
02937 this->getTag());
02938
02939 return;
02940 }
02941
02942 int dofNd1 = nd1Ptr->getNumberDOF();
02943 int dofNd2 = nd2Ptr->getNumberDOF();
02944 int dofNd3 = nd3Ptr->getNumberDOF();
02945 int dofNd4 = nd4Ptr->getNumberDOF();
02946
02947
02948 int dofNd5 = nd5Ptr->getNumberDOF();
02949 int dofNd6 = nd6Ptr->getNumberDOF();
02950 int dofNd7 = nd7Ptr->getNumberDOF();
02951 int dofNd8 = nd8Ptr->getNumberDOF();
02952
02953 if (dofNd1 != 3 || dofNd2 != 3 || dofNd3 != 3 || dofNd4 != 3 ||
02954 dofNd5 != 3 || dofNd6 != 3 || dofNd7 != 3 || dofNd8 != 3 ) {
02955 g3ErrorHandler->fatal("FATAL ERROR EightNodeBrick (tag: %d), has differing number of DOFs at its nodes",
02956 this->getTag());
02957
02958 return;
02959 }
02960 this->DomainComponent::setDomain(theDomain);
02961 }
02962
02963
02964 int EightNodeBrick::commitState ()
02965 {
02966
02967
02968 int i;
02969
02970 int retVal = 0;
02971
02972
02973 int count = r_integration_order* s_integration_order * t_integration_order;
02974
02975
02976
02977
02978
02979
02980 Vector pp = getResistingForce();
02981
02982
02983
02984 for (i = 0; i < count; i++)
02985 {
02986 retVal += matpoint[i]->commitState();
02987
02988 stresstensor st;
02989 stresstensor prin;
02990
02991
02992
02993 st = matpoint[i]->getStressTensor();
02994
02995
02996
02997
02998
02999
03000
03001
03002
03003
03004
03005
03006
03007
03008
03009
03010
03011
03012
03013
03014
03015
03016
03017
03018
03019
03020
03021
03022
03023
03024
03025
03026
03027
03028
03029
03030
03031
03032
03033
03034
03035
03036
03037
03038 }
03039
03040
03041
03042
03043 return retVal;
03044 }
03045
03046
03047 int EightNodeBrick::revertToLastCommit ()
03048 {
03049
03050 int i;
03051
03052 int retVal = 0;
03053
03054
03055 int count = r_integration_order* s_integration_order * t_integration_order;
03056
03057
03058
03059
03060
03061
03062 for (i = 0; i < count; i++)
03063 retVal += matpoint[i]->revertToLastCommit();
03064
03065
03066 return retVal;
03067 }
03068
03069
03070 int EightNodeBrick::revertToStart ()
03071 {
03072 int i;
03073 int retVal = 0;
03074
03075
03076
03077
03078
03079
03080
03081
03082 int count = r_integration_order* s_integration_order * t_integration_order;
03083
03084 for (i = 0; i < count; i++)
03085 retVal += matpoint[i]->revertToStart();
03086
03087
03088 return retVal;
03089
03090
03091 }
03092
03093
03094
03095 const Matrix &EightNodeBrick::getTangentStiff ()
03096 {
03097 tensor stifftensor = getStiffnessTensor();
03098 int Ki=0;
03099 int Kj=0;
03100
03101 for ( int i=1 ; i<=8 ; i++ )
03102 {
03103 for ( int j=1 ; j<=8 ; j++ )
03104 {
03105 for ( int k=1 ; k<=3 ; k++ )
03106 {
03107 for ( int l=1 ; l<=3 ; l++ )
03108 {
03109 Ki = k+3*(i-1);
03110 Kj = l+3*(j-1);
03111 K( Ki-1 , Kj-1 ) = stifftensor.cval(i,k,l,j);
03112 }
03113 }
03114 }
03115 }
03116
03117
03118
03119 return K;
03120 }
03121
03122
03123 const Matrix &EightNodeBrick::getSecantStiff ()
03124 {
03125 return K;
03126 }
03127
03128
03129 const Matrix &EightNodeBrick::getDamp ()
03130 {
03131 return C;
03132 }
03133
03134
03135
03136 const Matrix &EightNodeBrick::getMass ()
03137 {
03138 tensor masstensor = getMassTensor();
03139
03140
03141
03142
03143
03144 double column_mass;
03145
03146 for ( int i=1 ; i<=24 ; i++ )
03147 {
03148 column_mass = 0.0;
03149 for ( int j=1 ; j<=24 ; j++ )
03150 {
03151
03152
03153
03154 column_mass += masstensor.cval(i,j);
03155 M( i-1 , j-1 ) = 0;
03156
03157
03158
03159 }
03160 M( i-1 , i-1 ) = column_mass;
03161
03162 }
03163
03164
03165
03166
03167
03168 return M;
03169 }
03170
03171
03172
03173 const Matrix &EightNodeBrick::getConsMass ()
03174 {
03175 tensor masstensor = getMassTensor();
03176
03177
03178
03179
03180
03181
03182
03183 for ( int i=1 ; i<=24 ; i++ )
03184 {
03185
03186 for ( int j=1 ; j<=24 ; j++ )
03187 {
03188 M( i-1 , j-1 ) = masstensor.cval(i,j);
03189
03190
03191
03192
03193
03194
03195 }
03196
03197
03198 }
03199
03200
03201
03202
03203
03204 return M;
03205 }
03206
03207
03208 void EightNodeBrick::zeroLoad(void)
03209 {
03210 Q.Zero();
03211 }
03212
03213
03214
03215 int EightNodeBrick::addLoad(const Vector &addLoad)
03216 {
03217 if (addLoad.Size() != 24) {
03218 g3ErrorHandler->warning("EightNodeBrick::addLoad %s\n",
03219 "Vector not of correct size");
03220 return -1;
03221 }
03222
03223
03224 Q += addLoad;
03225
03226 return 0;
03227 }
03228
03229
03230 int EightNodeBrick::addInertiaLoadToUnbalance(const Vector &accel)
03231 {
03232
03233 if (rho == 0.0)
03234 return 0;
03235
03236
03237 const Vector &Raccel1 = nd1Ptr->getRV(accel);
03238 const Vector &Raccel2 = nd2Ptr->getRV(accel);
03239 const Vector &Raccel3 = nd3Ptr->getRV(accel);
03240 const Vector &Raccel4 = nd4Ptr->getRV(accel);
03241
03242 const Vector &Raccel5 = nd5Ptr->getRV(accel);
03243 const Vector &Raccel6 = nd6Ptr->getRV(accel);
03244 const Vector &Raccel7 = nd7Ptr->getRV(accel);
03245 const Vector &Raccel8 = nd8Ptr->getRV(accel);
03246
03247 if (3 != Raccel1.Size() || 3 != Raccel2.Size() || 3 != Raccel3.Size() ||
03248 3 != Raccel4.Size() || 3 != Raccel5.Size() || 3 != Raccel6.Size() ||
03249 3 != Raccel7.Size() || 3 != Raccel8.Size() ){
03250
03251 g3ErrorHandler->warning("EightNodeBrick::addInertiaLoadToUnbalance %s\n",
03252 "matrix and vector sizes are incompatable");
03253 return -1;
03254 }
03255
03256 static Vector ra(24);
03257
03258 ra(0) = Raccel1(0);
03259 ra(1) = Raccel1(1);
03260 ra(2) = Raccel1(2);
03261 ra(3) = Raccel2(0);
03262 ra(4) = Raccel2(1);
03263 ra(5) = Raccel2(2);
03264 ra(6) = Raccel3(0);
03265 ra(7) = Raccel3(1);
03266 ra(8) = Raccel3(2);
03267 ra(9) = Raccel4(0);
03268 ra(10) = Raccel4(1);
03269 ra(11) = Raccel4(2);
03270
03271 ra(12) = Raccel5(0);
03272 ra(13) = Raccel5(1);
03273 ra(14) = Raccel5(2);
03274 ra(15) = Raccel6(0);
03275 ra(16) = Raccel6(1);
03276 ra(17) = Raccel6(2);
03277 ra(18) = Raccel7(0);
03278 ra(19) = Raccel7(1);
03279 ra(20) = Raccel7(2);
03280 ra(21) = Raccel8(0);
03281 ra(22) = Raccel8(1);
03282 ra(23) = Raccel8(2);
03283
03284
03285
03286
03287
03288
03289
03290
03291
03292
03293
03294
03295
03296 for (int i = 0; i < 24; i++)
03297 Q(i) += -M(i,i)*ra(i);
03298
03299 return 0;
03300 }
03301
03302
03303 const Vector EightNodeBrick::FormEquiBodyForce(void)
03304 {
03305 Vector bforce(24);
03306
03307
03308
03309 if (rho == 0.0)
03310 return bforce;
03311
03312 Vector ba(24);
03313
03314 ba(0) = bf(0);
03315 ba(1) = bf(1);
03316 ba(2) = bf(2);
03317 ba(3) = bf(0);
03318 ba(4) = bf(1);
03319 ba(5) = bf(2);
03320 ba(6) = bf(0);
03321 ba(7) = bf(1);
03322 ba(8) = bf(2);
03323 ba(9) = bf(0);
03324 ba(10) = bf(1);
03325 ba(11) = bf(2);
03326 ba(12) = bf(0);
03327 ba(13) = bf(1);
03328 ba(14) = bf(2);
03329 ba(15) = bf(0);
03330 ba(16) = bf(1);
03331 ba(17) = bf(2);
03332 ba(18) = bf(0);
03333 ba(19) = bf(1);
03334 ba(20) = bf(2);
03335 ba(21) = bf(0);
03336 ba(22) = bf(1);
03337 ba(23) = bf(2);
03338
03339
03340 bforce.addMatrixVector(0.0, M, ba, 1.0);
03341
03342
03343
03344
03345
03346 return bforce;
03347 }
03348
03349
03350
03351
03352
03353
03354
03355
03356
03357
03358
03359
03360
03361
03362
03363
03364
03365
03366
03367
03368
03369
03370
03371
03372
03373
03374
03375
03376
03377
03378
03379
03380
03381
03382
03383
03384
03385
03386
03387
03388
03389
03390
03391
03392
03393
03394
03395
03396
03397
03398 const Vector &EightNodeBrick::getResistingForce ()
03399 {
03400 int force_dim[] = {8,3};
03401 tensor nodalforces(2,force_dim,0.0);
03402
03403 nodalforces = nodal_forces();
03404
03405
03406 for (int i = 0; i< 8; i++)
03407 for (int j = 0; j < 3; j++)
03408 P(i *3 + j) = nodalforces.cval(i+1, j+1);
03409
03410
03411
03412
03413 P = P - Q;
03414
03415
03416 return P;
03417 }
03418
03419
03420 const Vector &EightNodeBrick::getResistingForceIncInertia ()
03421 {
03422
03423 if (rho == 0.0)
03424 return this->getResistingForce();
03425
03426
03427
03428 const Vector &accel1 = nd1Ptr->getTrialAccel();
03429
03430
03431 const Vector &accel2 = nd2Ptr->getTrialAccel();
03432
03433
03434 const Vector &accel3 = nd3Ptr->getTrialAccel();
03435
03436
03437 const Vector &accel4 = nd4Ptr->getTrialAccel();
03438
03439
03440
03441 const Vector &accel5 = nd5Ptr->getTrialAccel();
03442
03443
03444 const Vector &accel6 = nd6Ptr->getTrialAccel();
03445
03446
03447 const Vector &accel7 = nd7Ptr->getTrialAccel();
03448
03449
03450 const Vector &accel8 = nd8Ptr->getTrialAccel();
03451
03452
03453 static Vector a(24);
03454
03455 a(0) = accel1(0);
03456 a(1) = accel1(1);
03457 a(2) = accel1(2);
03458 a(3) = accel2(0);
03459 a(4) = accel2(1);
03460 a(5) = accel2(2);
03461 a(6) = accel3(0);
03462 a(7) = accel3(1);
03463 a(8) = accel3(2);
03464 a(9) = accel4(0);
03465 a(10) = accel4(1);
03466 a(11) = accel4(2);
03467
03468 a(12) = accel5(0);
03469 a(13) = accel5(1);
03470 a(14) = accel5(2);
03471 a(15) = accel6(0);
03472 a(16) = accel6(1);
03473 a(17) = accel6(2);
03474 a(18) = accel7(0);
03475 a(19) = accel7(1);
03476 a(20) = accel7(2);
03477 a(21) = accel8(0);
03478 a(22) = accel8(1);
03479 a(23) = accel8(2);
03480
03481
03482 this->getResistingForce();
03483
03484
03485
03486
03487
03488
03489
03490
03491
03492
03493 for (int i = 0; i < 24; i++)
03494 {
03495 P(i) += M(i,i)*a(i);
03496
03497 }
03498
03499
03500 return P;
03501 }
03502
03503
03504 int EightNodeBrick::sendSelf (int commitTag, Channel &theChannel)
03505 {
03506
03507 return 0;
03508 }
03509
03510
03511 int EightNodeBrick::recvSelf (int commitTag, Channel &theChannel, FEM_ObjectBroker &theBroker)
03512 {
03513
03514 return 0;
03515 }
03516
03517
03518
03519 int EightNodeBrick::displaySelf (Renderer &theViewer, int displayMode, float fact)
03520 {
03521
03522
03523
03524 const Vector &end1Crd = nd1Ptr->getCrds();
03525 const Vector &end2Crd = nd2Ptr->getCrds();
03526 const Vector &end3Crd = nd3Ptr->getCrds();
03527 const Vector &end4Crd = nd4Ptr->getCrds();
03528 const Vector &end5Crd = nd5Ptr->getCrds();
03529 const Vector &end6Crd = nd6Ptr->getCrds();
03530 const Vector &end7Crd = nd7Ptr->getCrds();
03531 const Vector &end8Crd = nd8Ptr->getCrds();
03532
03533 const Vector &end1Disp = nd1Ptr->getDisp();
03534 const Vector &end2Disp = nd2Ptr->getDisp();
03535 const Vector &end3Disp = nd3Ptr->getDisp();
03536 const Vector &end4Disp = nd4Ptr->getDisp();
03537 const Vector &end5Disp = nd5Ptr->getDisp();
03538 const Vector &end6Disp = nd6Ptr->getDisp();
03539 const Vector &end7Disp = nd7Ptr->getDisp();
03540 const Vector &end8Disp = nd8Ptr->getDisp();
03541
03542 static Vector v1(3);
03543 static Vector v2(3);
03544 static Vector v3(3);
03545 static Vector v4(3);
03546 static Vector v5(3);
03547 static Vector v6(3);
03548 static Vector v7(3);
03549 static Vector v8(3);
03550
03551 for (int i = 0; i < 2; i++)
03552 {
03553 v1(i) = end1Crd(i) + end1Disp(i)*fact;
03554 v2(i) = end2Crd(i) + end2Disp(i)*fact;
03555 v3(i) = end3Crd(i) + end3Disp(i)*fact;
03556 v4(i) = end4Crd(i) + end4Disp(i)*fact;
03557 v5(i) = end5Crd(i) + end5Disp(i)*fact;
03558 v6(i) = end6Crd(i) + end6Disp(i)*fact;
03559 v7(i) = end7Crd(i) + end7Disp(i)*fact;
03560 v8(i) = end8Crd(i) + end8Disp(i)*fact;
03561 }
03562
03563 int error = 0;
03564
03565 error += theViewer.drawLine (v1, v2, 1.0, 1.0);
03566 error += theViewer.drawLine (v2, v3, 1.0, 1.0);
03567 error += theViewer.drawLine (v3, v4, 1.0, 1.0);
03568 error += theViewer.drawLine (v4, v1, 1.0, 1.0);
03569
03570 error += theViewer.drawLine (v5, v6, 1.0, 1.0);
03571 error += theViewer.drawLine (v6, v7, 1.0, 1.0);
03572 error += theViewer.drawLine (v7, v8, 1.0, 1.0);
03573 error += theViewer.drawLine (v8, v5, 1.0, 1.0);
03574
03575 error += theViewer.drawLine (v1, v5, 1.0, 1.0);
03576 error += theViewer.drawLine (v2, v6, 1.0, 1.0);
03577 error += theViewer.drawLine (v3, v7, 1.0, 1.0);
03578 error += theViewer.drawLine (v4, v8, 1.0, 1.0);
03579
03580 return error;
03581
03582 }
03583
03584
03585 void EightNodeBrick::Print(ostream &s, int flag)
03586 {
03587
03588 s << "EightNodeBrick, element id: " << this->getTag() << endl;
03589 s << "Connected external nodes: " << connectedExternalNodes;
03590
03591 int total_number_of_Gauss_points = r_integration_order*
03592 s_integration_order*
03593 t_integration_order;
03594 if ( total_number_of_Gauss_points != 0 )
03595 {
03596 nd1Ptr->Print(cout);
03597 nd2Ptr->Print(cout);
03598 nd3Ptr->Print(cout);
03599 nd4Ptr->Print(cout);
03600 nd5Ptr->Print(cout);
03601 nd6Ptr->Print(cout);
03602 nd7Ptr->Print(cout);
03603 nd8Ptr->Print(cout);
03604 }
03605 s << "Element mass density: " << rho << endl << endl;
03606 s << "Material model: " << endl;
03607
03608 for( int GP_c_r = 1 ; GP_c_r <= r_integration_order ; GP_c_r++ )
03609 {
03610 for( int GP_c_s = 1 ; GP_c_s <= s_integration_order ; GP_c_s++ )
03611 {
03612 for( int GP_c_t = 1 ; GP_c_t <= t_integration_order ; GP_c_t++ )
03613 {
03614
03615
03616 short where =
03617 ((GP_c_r-1)*s_integration_order+GP_c_s-1)*t_integration_order+GP_c_t-1;
03618
03619 s << "\n where = " << where << endln;
03620 s << " GP_c_r= " << GP_c_r << "GP_c_s = " << GP_c_s << " GP_c_t = " << GP_c_t << endln;
03621 matpoint[where]->report("Material Point\n");
03622
03623
03624
03625 }
03626 }
03627 }
03628
03629 }
03630
03631
03632 Response * EightNodeBrick::setResponse (char **argv, int argc, Information &eleInformation)
03633 {
03634 return 0;
03635 }
03636
03637
03638 int EightNodeBrick::getResponse (int responseID, Information &eleInformation)
03639 {
03640 return 0;
03641 }
03642
03643
03644
03645
03646
03647
03648
03649
03650
03651
03652
03653
03654
03655
03656
03657
03658
03659
03660
03661
03662
03663
03664
03665
03666
03667
03668
03669
03670
03671
03672
03673
03674
03675
03676
03677
03678
03679
03680
03681
03682
03683
03684
03685
03686
03687
03688
03689
03690
03691
03692
03693
03694
03695
03696
03697
03698
03699
03700
03701
03702
03703
03704
03705
03706
03707
03708
03709
03710
03711
03712
03713
03714
03715
03716
03717
03718
03719
03720
03721
03722
03723
03724
03725
03726
03727
03728
03729
03730
03731
03732
03733
03734
03735
03736
03737
03738
03739
03740
03741
03742
03743
03744
03745
03746
03747
03748
03749
03750
03751
03752
03753
03754
03755
03756
03757
03758
03759
03760
03761
03762
03763
03764
03765
03766
03767
03768
03769
03770
03771
03772
03773
03774
03775
03776
03777
03778
03779
03780
03781
03782
03783
03784
03785
03786
03787
03788
03789
03790
03791
03792
03793
03794
03795
03796
03797
03798
03799
03800
03801
03802
03803
03804
03805
03806
03807
03808
03809
03810
03811
03812
03813
03814
03815
03816
03817
03818
03819
03820
03821
03822
03823
03824
03825
03826
03827
03828
03829
03830
03831
03832
03833
03834
03835
03836
03837
03838
03839
03840
03841
03842
03843
03844
03845
03846
03847
03848
03849
03850
03851
03852
03853
03854
03855
03856
03857
03858
03859
03860
03861
03862
03863
03864
03865
03866
03867
03868
03869
03870
03871
03872
03873
03874
03875
03876
03877
03878
03879
03880
03881
03882
03883
03884
03885
03886
03887
03888
03889
03890
03891
03892
03893
03894
03895
03896
03897
03898
03899
03900
03901
03902
03903
03905
03906
03907
03908
03909
03910
03911
03912
03913
03914
03915
03916
03917
03918
03919
03920
03921
03922
03923
03924
03925
03926
03927
03928
03929
03930
03931
03932
03933
03934
03935
03936
03937
03938
03939
03940
03941
03942
03943
03944
03945
03946
03947
03948
03949
03950
03951
03952
03953
03954
03955
03956
03958
03959
03960
03965
03967
03968
03969
03970
03971
03972
03973
03974
03975
03976
03977
03978
03979
03981
03982
03983
03984
03985
03986
03987
03988
03989
03990
03991
03995
03996
03997
03998
03999
04000
04001
04002
04003
04004
04005
04006
04007
04008
04009
04010
04011
04012
04013
04014
04015
04016
04017
04018
04019
04020
04021
04022
04023
04024
04025
04026
04027
04028
04029
04030
04031
04032
04033
04034
04035
04036
04037
04038
04039
04040
04041
04042
04043
04044
04045
04046
04047
04048
04049
04050
04051
04052
04053
04054
04055
04056
04057
04058
04059
04060
04061
04062
04063
04064
04065
04066
04067
04068
04069
04070
04071
04072
04073
04074
04075
04076
04077
04078
04080
04081
04082
04083
04084
04085
04086
04087
04088
04089
04090
04091
04092
04093
04094
04095
04096
04097
04098
04099
04100
04101
04102
04103
04104
04105
04106
04107
04108
04109
04110
04111
04112
04113
04114
04115
04116
04119
04120
04121
04122
04123
04124
04125
04126
04127
04128
04129
04130
04131
04132
04133
04134
04135
04136
04137
04138
04139
04140
04141
04142
04143
04144
04145
04146
04147
04148
04149
04150
04152
04153
04154
04155
04156
04157
04158
04159
04160
04161
04162
04163
04164
04165
04166
04167
04168
04169
04170
04171
04172
04173
04174
04175
04176
04177
04178
04179
04180
04181
04182
04183
04184
04185
04186
04187
04188
04189
04190
04191
04192
04193
04194
04195
04196
04197
04198
04199
04200
04201
04202
04203
04204
04205
04206
04207
04208
04209
04210
04211
04212
04213
04214
04215
04216
04217
04218
04219
04220
04221
04222
04223
04224
04225
04226
04227
04228
04229
04230
04231
04232
04233
04234
04235
04236
04237
04238
04239
04240
04241
04242
04243
04244
04245 double EightNodeBrick::get_Gauss_p_c(short order, short point_numb)
04246 {
04247
04248
04249 static double Gauss_coordinates[7][7];
04250
04251 Gauss_coordinates[1][1] = 0.0 ;
04252 Gauss_coordinates[2][1] = -0.577350269189626;
04253 Gauss_coordinates[2][2] = -Gauss_coordinates[2][1];
04254 Gauss_coordinates[3][1] = -0.774596669241483;
04255 Gauss_coordinates[3][2] = 0.0;
04256 Gauss_coordinates[3][3] = -Gauss_coordinates[3][1];
04257 Gauss_coordinates[4][1] = -0.861136311594053;
04258 Gauss_coordinates[4][2] = -0.339981043584856;
04259 Gauss_coordinates[4][3] = -Gauss_coordinates[4][2];
04260 Gauss_coordinates[4][4] = -Gauss_coordinates[4][1];
04261 Gauss_coordinates[5][1] = -0.906179845938664;
04262 Gauss_coordinates[5][2] = -0.538469310105683;
04263 Gauss_coordinates[5][3] = 0.0;
04264 Gauss_coordinates[5][4] = -Gauss_coordinates[5][2];
04265 Gauss_coordinates[5][5] = -Gauss_coordinates[5][1];
04266 Gauss_coordinates[6][1] = -0.932469514203152;
04267 Gauss_coordinates[6][2] = -0.661209386466265;
04268 Gauss_coordinates[6][3] = -0.238619186083197;
04269 Gauss_coordinates[6][4] = -Gauss_coordinates[6][3];
04270 Gauss_coordinates[6][5] = -Gauss_coordinates[6][2];
04271 Gauss_coordinates[6][6] = -Gauss_coordinates[6][1];
04272
04273 return Gauss_coordinates[order][point_numb];
04274 }
04275
04276 double EightNodeBrick::get_Gauss_p_w(short order, short point_numb)
04277 {
04278
04279
04280 static double Gauss_weights[7][7];
04281
04282 Gauss_weights[1][1] = 2.0;
04283 Gauss_weights[2][1] = 1.0;
04284 Gauss_weights[2][2] = 1.0;
04285 Gauss_weights[3][1] = 0.555555555555556;
04286 Gauss_weights[3][2] = 0.888888888888889;
04287 Gauss_weights[3][3] = Gauss_weights[3][1];
04288 Gauss_weights[4][1] = 0.347854845137454;
04289 Gauss_weights[4][2] = 0.652145154862546;
04290 Gauss_weights[4][3] = Gauss_weights[4][2];
04291 Gauss_weights[4][4] = Gauss_weights[4][1];
04292 Gauss_weights[5][1] = 0.236926885056189;
04293 Gauss_weights[5][2] = 0.478628670499366;
04294 Gauss_weights[5][3] = 0.568888888888889;
04295 Gauss_weights[5][4] = Gauss_weights[5][2];
04296 Gauss_weights[5][5] = Gauss_weights[5][1];
04297 Gauss_weights[6][1] = 0.171324492379170;
04298 Gauss_weights[6][2] = 0.360761573048139;
04299 Gauss_weights[6][3] = 0.467913934572691;
04300 Gauss_weights[6][4] = Gauss_weights[6][3];
04301 Gauss_weights[6][5] = Gauss_weights[6][2];
04302 Gauss_weights[6][6] = Gauss_weights[6][1];
04303
04304 return Gauss_weights[order][point_numb];
04305 }
04306
04307
04308 #endif