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 TWENTYNODEBRICK_CPP
00027 #define TWENTYNODEBRICK_CPP
00028
00029 #include <NDMaterial.h>
00030 #include <Matrix.h>
00031 #include <Vector.h>
00032 #include <ID.h>
00033 #include <Renderer.h>
00034 #include <Domain.h>
00035 #include <string.h>
00036 #include <Information.h>
00037 #include <Channel.h>
00038 #include <FEM_ObjectBroker.h>
00039 #include <ElementResponse.h>
00040
00041 #include <TwentyNodeBrick.h>
00042 #include <ElementalLoad.h>
00043 #define FixedOrder 3
00044
00045
00046 Matrix TwentyNodeBrick::K(60, 60);
00047 Matrix TwentyNodeBrick::C(60, 60);
00048 Matrix TwentyNodeBrick::M(60, 60);
00049 Vector TwentyNodeBrick::P(60);
00050 Vector Info(109+3);
00051 Vector InfoPt(FixedOrder*FixedOrder*FixedOrder*4+1);
00052 Vector InfoSt(FixedOrder*FixedOrder*FixedOrder*6+1);
00053 Vector Gsc(FixedOrder*FixedOrder*FixedOrder*3+1);
00054 Vector InfoSpq2(2);
00055
00056
00057
00058
00059 TwentyNodeBrick::TwentyNodeBrick(int element_number,
00060 int node_numb_1, int node_numb_2, int node_numb_3, int node_numb_4,
00061 int node_numb_5, int node_numb_6, int node_numb_7, int node_numb_8,
00062 int node_numb_9, int node_numb_10, int node_numb_11, int node_numb_12,
00063 int node_numb_13, int node_numb_14, int node_numb_15, int node_numb_16,
00064 int node_numb_17, int node_numb_18, int node_numb_19, int node_numb_20,
00065 NDMaterial * Globalmmodel, double b1, double b2,double b3,
00066 double r, double p)
00067
00068 :Element(element_number, ELE_TAG_TwentyNodeBrick ),
00069 connectedExternalNodes(20), Ki(0), Q(60), bf(3),
00070 rho(r), pressure(p)
00071 {
00072
00073 bf(0) = b1;
00074 bf(1) = b2;
00075 bf(2) = b3;
00076
00077 determinant_of_Jacobian = 0.0;
00078
00079
00080
00081
00082 r_integration_order = FixedOrder;
00083 s_integration_order = FixedOrder;
00084 t_integration_order = FixedOrder;
00085
00086
00087
00088
00089 int total_number_of_Gauss_points = r_integration_order*s_integration_order*t_integration_order;
00090
00091
00092 if ( total_number_of_Gauss_points != 0 )
00093 {
00094 matpoint = new MatPoint3D * [total_number_of_Gauss_points];
00095 }
00096 else
00097 {
00098 matpoint = 0;
00099 }
00101 short where = 0;
00102
00103 for( short GP_c_r = 1 ; GP_c_r <= r_integration_order ; GP_c_r++ )
00104 {
00105 double r = get_Gauss_p_c( r_integration_order, GP_c_r );
00106 double rw = get_Gauss_p_w( r_integration_order, GP_c_r );
00107
00108 for( short GP_c_s = 1 ; GP_c_s <= s_integration_order ; GP_c_s++ )
00109 {
00110 double s = get_Gauss_p_c( s_integration_order, GP_c_s );
00111 double sw = get_Gauss_p_w( s_integration_order, GP_c_s );
00112
00113 for( short GP_c_t = 1 ; GP_c_t <= t_integration_order ; GP_c_t++ )
00114 {
00115 double t = get_Gauss_p_c( t_integration_order, GP_c_t );
00116 double tw = get_Gauss_p_w( t_integration_order, GP_c_t );
00117
00118
00119
00120 where =
00121 ((GP_c_r-1)*s_integration_order+GP_c_s-1)*t_integration_order+GP_c_t-1;
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138 matpoint[where] = new MatPoint3D(GP_c_r,
00139 GP_c_s,
00140 GP_c_t,
00141 r, s, t,
00142 rw, sw, tw,
00143
00144 Globalmmodel);
00145
00146
00147
00148
00149 }
00150 }
00151 }
00152
00153
00154 connectedExternalNodes( 0) = node_numb_1;
00155 connectedExternalNodes( 1) = node_numb_2;
00156 connectedExternalNodes( 2) = node_numb_3;
00157 connectedExternalNodes( 3) = node_numb_4;
00158 connectedExternalNodes( 4) = node_numb_5;
00159 connectedExternalNodes( 5) = node_numb_6;
00160 connectedExternalNodes( 6) = node_numb_7;
00161 connectedExternalNodes( 7) = node_numb_8;
00162
00163 connectedExternalNodes( 8) = node_numb_9;
00164 connectedExternalNodes( 9) = node_numb_10;
00165 connectedExternalNodes(10) = node_numb_11;
00166 connectedExternalNodes(11) = node_numb_12;
00167
00168 connectedExternalNodes(12) = node_numb_13;
00169 connectedExternalNodes(13) = node_numb_14;
00170 connectedExternalNodes(14) = node_numb_15;
00171 connectedExternalNodes(15) = node_numb_16;
00172
00173 connectedExternalNodes(16) = node_numb_17;
00174 connectedExternalNodes(17) = node_numb_18;
00175 connectedExternalNodes(18) = node_numb_19;
00176 connectedExternalNodes(19) = node_numb_20;
00177
00178 for (int i=0; i<20; i++)
00179 theNodes[i] = 0;
00180
00181 nodes_in_brick = 20;
00182
00183 }
00184
00185
00186 TwentyNodeBrick::TwentyNodeBrick ():Element(0, ELE_TAG_TwentyNodeBrick ),
00187 connectedExternalNodes(20), Ki(0), Q(60), bf(3), rho(0.0), pressure(0.0), mmodel(0)
00188 {
00189 matpoint = 0;
00190
00191 for (int i=0; i<20; i++)
00192 theNodes[i] = 0;
00193 }
00194
00195
00196
00197
00198
00201 TwentyNodeBrick::~TwentyNodeBrick ()
00202 {
00203
00204 int total_number_of_Gauss_points = r_integration_order*s_integration_order*t_integration_order;
00205
00206 for (int i = 0; i < total_number_of_Gauss_points; i++)
00207 {
00208
00209 if (matpoint[i])
00210 delete matpoint[i];
00211 }
00212
00213
00214 if (matpoint)
00215 delete [] matpoint;
00216
00217 if (Ki != 0)
00218 delete Ki;
00219
00220 }
00221
00225 void TwentyNodeBrick::incremental_Update()
00226 {
00227 double r = 0.0;
00228
00229 double s = 0.0;
00230
00231 double t = 0.0;
00232
00233
00234 short where = 0;
00235
00236
00237
00238
00239 int dh_dim[] = {20,3};
00240 tensor dh(2, dh_dim, 0.0);
00241
00242
00243 static int disp_dim[] = {20,3};
00244 tensor incremental_displacements(2,disp_dim,0.0);
00245
00246 straintensor incremental_strain;
00247
00248 tensor Jacobian;
00249 tensor JacobianINV;
00250 tensor dhGlobal;
00251
00252 incremental_displacements = incr_disp();
00253
00254 for( short GP_c_r = 1 ; GP_c_r <= r_integration_order ; GP_c_r++ )
00255 {
00256 r = get_Gauss_p_c( r_integration_order, GP_c_r );
00257
00258 for( short GP_c_s = 1 ; GP_c_s <= s_integration_order ; GP_c_s++ )
00259 {
00260 s = get_Gauss_p_c( s_integration_order, GP_c_s );
00261
00262 for( short GP_c_t = 1 ; GP_c_t <= t_integration_order ; GP_c_t++ )
00263 {
00264 t = get_Gauss_p_c( t_integration_order, GP_c_t );
00265
00266
00267
00268 where =
00269 ((GP_c_r-1)*s_integration_order+GP_c_s-1)*t_integration_order+GP_c_t-1;
00270
00271 dh = dh_drst_at(r,s,t);
00272
00273 Jacobian = Jacobian_3D(dh);
00274
00275
00276 JacobianINV = Jacobian_3Dinv(dh);
00277
00278
00279
00280
00281
00282
00283 dhGlobal = dh("ij") * JacobianINV("kj");
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295
00296
00297 incremental_strain =
00298 (dhGlobal("ib")*incremental_displacements("ia")).symmetrize11();
00299 incremental_strain.null_indices();
00300
00301
00302
00303
00304
00305
00306 if ( ! ( (matpoint[where]->matmodel)->setTrialStrainIncr( incremental_strain)) )
00307 opserr << "TwentyNodeBrick::incremental_Update (tag: " << this->getTag() << "), not converged\n";
00308
00309 }
00310 }
00311 }
00312 }
00313
00314
00315
00316
00317
00318 tensor TwentyNodeBrick::H_3D(double r1, double r2, double r3)
00319 {
00320
00321 int dimension[] = {60,3};
00322
00323 tensor H(2, dimension, 0.0);
00324
00325
00326 H.val(58,1)=(1.0+r1)*(1.0-r2)*(1.0-r3*r3)*0.25;
00327 H.val(59,2)=H.val(58,1);
00328 H.val(60,3)=H.val(58,1);
00329
00330 H.val(55,1)=(1.0-r1)*(1.0-r2)*(1.0-r3*r3)*0.25;
00331 H.val(56,2)=H.val(55,1);
00332 H.val(57,3)=H.val(55,1);
00333
00334 H.val(52,1)=(1.0-r1)*(1.0+r2)*(1.0-r3*r3)*0.25;
00335 H.val(53,2)=H.val(52,1);
00336 H.val(54,3)=H.val(52,1);
00337
00338 H.val(49,1)=(1.0+r1)*(1.0+r2)*(1.0-r3*r3)*0.25;
00339 H.val(50,2)=H.val(49,1);
00340 H.val(51,3)=H.val(49,1);
00341
00342
00343 H.val(46,1)=(1.0+r1)*(1.0-r2*r2)*(1.0-r3)*0.25;
00344 H.val(47,2)=H.val(46,1);
00345 H.val(48,3)=H.val(46,1);
00346
00347 H.val(43,1)=(1.0-r1*r1)*(1.0-r2)*(1.0-r3)*0.25;
00348 H.val(44,2)=H.val(43,1);
00349 H.val(45,3)=H.val(43,1);
00350
00351 H.val(40,1)=(1.0-r1)*(1.0-r2*r2)*(1.0-r3)*0.25;
00352 H.val(41,2)=H.val(40,1);
00353 H.val(42,3)=H.val(40,1);
00354
00355 H.val(37,1)=(1.0-r1*r1)*(1.0+r2)*(1.0-r3)*0.25;
00356 H.val(38,2)=H.val(37,1);
00357 H.val(39,3)=H.val(37,1);
00358
00359
00360 H.val(34,1)=(1.0+r1)*(1.0-r2*r2)*(1.0+r3)*0.25;
00361 H.val(35,2)=H.val(34,1);
00362 H.val(36,3)=H.val(34,1);
00363
00364 H.val(31,1)=(1.0-r1*r1)*(1.0-r2)*(1.0+r3)*0.25;
00365 H.val(32,2)=H.val(31,1);
00366 H.val(33,3)=H.val(31,1);
00367
00368 H.val(28,1)=(1.0-r1)*(1.0-r2*r2)*(1.0+r3)*0.25;
00369 H.val(29,2)=H.val(28,1);
00370 H.val(30,3)=H.val(28,1);
00371
00372 H.val(25,1)=(1.0-r1*r1)*(1.0+r2)*(1.0+r3)*0.25;
00373 H.val(26,2)=H.val(25,1);
00374 H.val(27,3)=H.val(25,1);
00375
00376
00377
00378
00379
00380 H.val(22,1)=(1.0+r1)*(1.0-r2)*(1.0-r3)*0.125 - (H.val(43,1)+H.val(48,3)+H.val(60,3))*0.5;
00381 H.val(23,2)=H.val(22,1);
00382 H.val(24,3)=H.val(22,1);
00383
00384 H.val(19,1)=(1.0-r1)*(1.0-r2)*(1.0-r3)*0.125 - (H.val(42,3)+H.val(43,1)+H.val(57,3))*0.5;
00385 H.val(20,2)=H.val(19,1);
00386 H.val(21,3)=H.val(19,1);
00387
00388 H.val(16,1)=(1.0-r1)*(1.0+r2)*(1.0-r3)*0.125 - (H.val(39,3)+H.val(42,3)+H.val(54,3))*0.5;
00389 H.val(17,2)=H.val(16,1);
00390 H.val(18,3)=H.val(16,1);
00391
00392 H.val(13,1)=(1.0+r1)*(1.0+r2)*(1.0-r3)*0.125 - (H.val(39,3)+H.val(48,3)+H.val(51,3))*0.5;
00393 H.val(14,2)=H.val(13,1);
00394 H.val(15,3)=H.val(13,1);
00395
00396
00397 H.val(10,1)=(1.0+r1)*(1.0-r2)*(1.0+r3)*0.125 - (H.val(33,3)+H.val(36,3)+H.val(60,3))*0.5;
00398 H.val(11,2)=H.val(10,1);
00399 H.val(12,3)=H.val(10,1);
00400
00401 H.val(7,1) =(1.0-r1)*(1.0-r2)*(1.0+r3)*0.125 - (H.val(30,3)+H.val(33,3)+H.val(57,3))*0.5;
00402 H.val(8,2) =H.val(7,1);
00403 H.val(9,3) =H.val(7,1);
00404
00405 H.val(4,1) =(1.0-r1)*(1.0+r2)*(1.0+r3)*0.125 - (H.val(30,3)+H.val(54,3)+H.val(27,3))*0.5;
00406 H.val(5,2) =H.val(4,1);
00407 H.val(6,3) =H.val(4,1);
00408
00409 H.val(1,1) =(1.0+r1)*(1.0+r2)*(1.0+r3)*0.125 - (H.val(36,3)+H.val(51,3)+H.val(27,3))*0.5;
00410 H.val(2,2) =H.val(1,1);
00411 H.val(3,3) =H.val(1,1);
00412
00413
00414
00415
00416
00417
00418
00419
00420
00421
00422
00423
00424
00425
00426
00427
00428
00429
00430
00431 return H;
00432 }
00433
00434
00435
00436 tensor TwentyNodeBrick::interp_poli_at(double r1, double r2, double r3)
00437 {
00438
00439 int dimension[] = {20};
00440 tensor h(1, dimension, 0.0);
00441
00442
00443
00444
00445 h.val(20)=(1.0+r1)*(1.0-r2)*(1.0-r3*r3)*0.25;
00446
00447 h.val(19)=(1.0-r1)*(1.0-r2)*(1.0-r3*r3)*0.25;
00448
00449 h.val(18)=(1.0-r1)*(1.0+r2)*(1.0-r3*r3)*0.25;
00450
00451 h.val(17)=(1.0+r1)*(1.0+r2)*(1.0-r3*r3)*0.25;
00452
00453
00454 h.val(16)=(1.0+r1)*(1.0-r2*r2)*(1.0-r3)*0.25;
00455
00456 h.val(15)=(1.0-r1*r1)*(1.0-r2)*(1.0-r3)*0.25;
00457
00458 h.val(14)=(1.0-r1)*(1.0-r2*r2)*(1.0-r3)*0.25;
00459
00460 h.val(13)=(1.0-r1*r1)*(1.0+r2)*(1.0-r3)*0.25;
00461
00462
00463 h.val(12)=(1.0+r1)*(1.0-r2*r2)*(1.0+r3)*0.25;
00464
00465 h.val(11)=(1.0-r1*r1)*(1.0-r2)*(1.0+r3)*0.25;
00466
00467 h.val(10)=(1.0-r1)*(1.0-r2*r2)*(1.0+r3)*0.25;
00468
00469 h.val( 9)=(1.0-r1*r1)*(1.0+r2)*(1.0+r3)*0.25;
00470
00471
00472
00473 h.val(8)=(1.0+r1)*(1.0-r2)*(1.0-r3)*0.125 - (h.val(15)+h.val(16)+h.val(20))*0.5;
00474
00475 h.val(7)=(1.0-r1)*(1.0-r2)*(1.0-r3)*0.125 - (h.val(14)+h.val(15)+h.val(19))*0.5;
00476
00477 h.val(6)=(1.0-r1)*(1.0+r2)*(1.0-r3)*0.125 - (h.val(13)+h.val(14)+h.val(18))*0.5;
00478
00479 h.val(5)=(1.0+r1)*(1.0+r2)*(1.0-r3)*0.125 - (h.val(13)+h.val(16)+h.val(17))*0.5;
00480
00481
00482 h.val(4)=(1.0+r1)*(1.0-r2)*(1.0+r3)*0.125 - (h.val(11)+h.val(12)+h.val(20))*0.5;
00483
00484 h.val(3)=(1.0-r1)*(1.0-r2)*(1.0+r3)*0.125 - (h.val(10)+h.val(11)+h.val(19))*0.5;
00485
00486 h.val(2)=(1.0-r1)*(1.0+r2)*(1.0+r3)*0.125 - (h.val(10)+h.val(18)+h.val( 9))*0.5;
00487
00488 h.val(1)=(1.0+r1)*(1.0+r2)*(1.0+r3)*0.125 - (h.val(12)+h.val(17)+h.val( 9))*0.5;
00489
00490
00491
00492 return h;
00493 }
00494
00495
00496
00497 tensor TwentyNodeBrick::dh_drst_at(double r1, double r2, double r3)
00498 {
00499
00500 int dimensions[] = {20,3};
00501 tensor dh(2, dimensions, 0.0);
00502
00503
00504
00505 dh.val(20,1) = (1.0-r2)*(1.0-r3*r3)*0.25;
00506 dh.val(20,2) = - (1.0+r1)*(1.0-r3*r3)*0.25;
00507 dh.val(20,3) = - (1.0+r1)*(1.0-r2)*r3*0.50;
00508
00509 dh.val(19,1) = - (1.0-r2)*(1.0-r3*r3)*0.25;
00510 dh.val(19,2) = - (1.0-r1)*(1.0-r3*r3)*0.25;
00511 dh.val(19,3) = - (1.0-r1)*(1.0-r2)*r3*0.50;
00512
00513 dh.val(18,1) = - (1.0+r2)*(1.0-r3*r3)*0.25;
00514 dh.val(18,2) = (1.0-r1)*(1.0-r3*r3)*0.25;
00515 dh.val(18,3) = - (1.0-r1)*(1.0+r2)*r3*0.50;
00516
00517 dh.val(17,1) = (1.0+r2)*(1.0-r3*r3)*0.25;
00518 dh.val(17,2) = (1.0+r1)*(1.0-r3*r3)*0.25;
00519 dh.val(17,3) = - (1.0+r1)*(1.0+r2)*r3*0.50;
00520
00521
00522 dh.val(16,1) = (1.0-r2*r2)*(1.0-r3)*0.25;
00523 dh.val(16,2) = - (1.0+r1)*r2*(1.0-r3)*0.50;
00524 dh.val(16,3) = - (1.0+r1)*(1.0-r2*r2)*0.25;
00525
00526 dh.val(15,1) = - r1*(1.0-r2)*(1.0-r3)*0.50;
00527 dh.val(15,2) = - (1.0-r1*r1)*(1.0-r3)*0.25;
00528 dh.val(15,3) = - (1.0-r1*r1)*(1.0-r2)*0.25;
00529
00530 dh.val(14,1) = - (1.0-r2*r2)*(1.0-r3)*0.25;
00531 dh.val(14,2) = - (1.0-r1)*r2*(1.0-r3)*0.50;
00532 dh.val(14,3) = - (1.0-r1)*(1.0-r2*r2)*0.25;
00533
00534 dh.val(13,1) = - r1*(1.0+r2)*(1.0-r3)*0.50;
00535 dh.val(13,2) = (1.0-r1*r1)*(1.0-r3)*0.25;
00536 dh.val(13,3) = - (1.0-r1*r1)*(1.0+r2)*0.25;
00537
00538
00539 dh.val(12,1) = (1.0-r2*r2)*(1.0+r3)*0.25;
00540 dh.val(12,2) = - (1.0+r1)*r2*(1.0+r3)*0.50;
00541 dh.val(12,3) = (1.0+r1)*(1.0-r2*r2)*0.25;
00542
00543 dh.val(11,1) = - r1*(1.0-r2)*(1.0+r3)*0.50;
00544 dh.val(11,2) = - (1.0-r1*r1)*(1.0+r3)*0.25;
00545 dh.val(11,3) = (1.0-r1*r1)*(1.0-r2)*0.25;
00546
00547 dh.val(10,1) = - (1.0-r2*r2)*(1.0+r3)*0.25;
00548 dh.val(10,2) = - (1.0-r1)*r2*(1.0+r3)*0.50;
00549 dh.val(10,3) = (1.0-r1)*(1.0-r2*r2)*0.25;
00550
00551 dh.val(9,1) = - r1*(1.0+r2)*(1.0+r3)*0.50;
00552 dh.val(9,2) = (1.0-r1*r1)*(1.0+r3)*0.25;
00553 dh.val(9,3) = (1.0-r1*r1)*(1.0+r2)*0.25;
00554
00555
00556
00557 dh.val(8,1)= (1.0-r2)*(1.0-r3)*0.125 - (dh.val(15,1)+dh.val(16,1)+dh.val(20,1))*0.50;
00558 dh.val(8,2)=-(1.0+r1)*(1.0-r3)*0.125 - (dh.val(15,2)+dh.val(16,2)+dh.val(20,2))*0.50;
00559 dh.val(8,3)=-(1.0+r1)*(1.0-r2)*0.125 - (dh.val(15,3)+dh.val(16,3)+dh.val(20,3))*0.50;
00560
00561 dh.val(7,1)=-(1.0-r2)*(1.0-r3)*0.125 - (dh.val(14,1)+dh.val(15,1)+dh.val(19,1))*0.50;
00562 dh.val(7,2)=-(1.0-r1)*(1.0-r3)*0.125 - (dh.val(14,2)+dh.val(15,2)+dh.val(19,2))*0.50;
00563 dh.val(7,3)=-(1.0-r1)*(1.0-r2)*0.125 - (dh.val(14,3)+dh.val(15,3)+dh.val(19,3))*0.50;
00564
00565 dh.val(6,1)=-(1.0+r2)*(1.0-r3)*0.125 - (dh.val(13,1)+dh.val(14,1)+dh.val(18,1))*0.50;
00566 dh.val(6,2)= (1.0-r1)*(1.0-r3)*0.125 - (dh.val(13,2)+dh.val(14,2)+dh.val(18,2))*0.50;
00567 dh.val(6,3)=-(1.0-r1)*(1.0+r2)*0.125 - (dh.val(13,3)+dh.val(14,3)+dh.val(18,3))*0.50;
00568
00569 dh.val(5,1)= (1.0+r2)*(1.0-r3)*0.125 - (dh.val(13,1)+dh.val(16,1)+dh.val(17,1))*0.50;
00570 dh.val(5,2)= (1.0+r1)*(1.0-r3)*0.125 - (dh.val(13,2)+dh.val(16,2)+dh.val(17,2))*0.50;
00571 dh.val(5,3)=-(1.0+r1)*(1.0+r2)*0.125 - (dh.val(13,3)+dh.val(16,3)+dh.val(17,3))*0.50;
00572
00573
00574 dh.val(4,1)= (1.0-r2)*(1.0+r3)*0.125 - (dh.val(11,1)+dh.val(12,1)+dh.val(20,1))*0.50;
00575 dh.val(4,2)=-(1.0+r1)*(1.0+r3)*0.125 - (dh.val(11,2)+dh.val(12,2)+dh.val(20,2))*0.50;
00576 dh.val(4,3)= (1.0+r1)*(1.0-r2)*0.125 - (dh.val(11,3)+dh.val(12,3)+dh.val(20,3))*0.50;
00577
00578 dh.val(3,1)=-(1.0-r2)*(1.0+r3)*0.125 - (dh.val(10,1)+dh.val(11,1)+dh.val(19,1))*0.50;
00579 dh.val(3,2)=-(1.0-r1)*(1.0+r3)*0.125 - (dh.val(10,2)+dh.val(11,2)+dh.val(19,2))*0.50;
00580 dh.val(3,3)= (1.0-r1)*(1.0-r2)*0.125 - (dh.val(10,3)+dh.val(11,3)+dh.val(19,3))*0.50;
00581
00582 dh.val(2,1)=-(1.0+r2)*(1.0+r3)*0.125 - (dh.val(10,1)+dh.val(18,1)+dh.val( 9,1))*0.50;
00583 dh.val(2,2)= (1.0-r1)*(1.0+r3)*0.125 - (dh.val(10,2)+dh.val(18,2)+dh.val( 9,2))*0.50;
00584 dh.val(2,3)= (1.0-r1)*(1.0+r2)*0.125 - (dh.val(10,3)+dh.val(18,3)+dh.val( 9,3))*0.50;
00585
00586 dh.val(1,1)= (1.0+r2)*(1.0+r3)*0.125 - (dh.val(12,1)+dh.val(17,1)+dh.val( 9,1))*0.50;
00587 dh.val(1,2)= (1.0+r1)*(1.0+r3)*0.125 - (dh.val(12,2)+dh.val(17,2)+dh.val( 9,2))*0.50;
00588 dh.val(1,3)= (1.0+r1)*(1.0+r2)*0.125 - (dh.val(12,3)+dh.val(17,3)+dh.val( 9,3))*0.50;
00589
00590 return dh;
00591 }
00592
00593
00594
00596 TwentyNodeBrick & TwentyNodeBrick::operator[](int subscript)
00597 {
00598 return ( *(this+subscript) );
00599 }
00600
00601
00602
00603
00604
00605
00606
00607
00608
00609
00610
00611
00616 tensor TwentyNodeBrick::getStiffnessTensor(void)
00617 {
00618 int K_dim[] = {20,3,3,20};
00619 tensor Kk(4,K_dim,0.0);
00620 tensor Kkt(4,K_dim,0.0);
00621
00622
00623
00624
00625 double r = 0.0;
00626 double rw = 0.0;
00627 double s = 0.0;
00628 double sw = 0.0;
00629 double t = 0.0;
00630 double tw = 0.0;
00631
00632 short where = 0;
00633 double weight = 0.0;
00634
00635 int dh_dim[] = {20,3};
00636 tensor dh(2, dh_dim, 0.0);
00637
00638
00639 tensor Constitutive;
00640
00641 double det_of_Jacobian = 0.0;
00642
00643 static int disp_dim[] = {20,3};
00644 tensor incremental_displacements(2,disp_dim,0.0);
00645
00646 straintensor incremental_strain;
00647
00648
00649 tensor Jacobian;
00650 tensor JacobianINV;
00651 tensor JacobianINVtemp;
00652 tensor dhGlobal;
00653
00654 for( short GP_c_r = 1 ; GP_c_r <= r_integration_order ; GP_c_r++ )
00655 {
00656 r = get_Gauss_p_c( r_integration_order, GP_c_r );
00657 rw = get_Gauss_p_w( r_integration_order, GP_c_r );
00658 for( short GP_c_s = 1 ; GP_c_s <= s_integration_order ; GP_c_s++ )
00659 {
00660 s = get_Gauss_p_c( s_integration_order, GP_c_s );
00661 sw = get_Gauss_p_w( s_integration_order, GP_c_s );
00662 for( short GP_c_t = 1 ; GP_c_t <= t_integration_order ; GP_c_t++ )
00663 {
00664 t = get_Gauss_p_c( t_integration_order, GP_c_t );
00665 tw = get_Gauss_p_w( t_integration_order, GP_c_t );
00666
00667
00668 where =
00669 ((GP_c_r-1)*s_integration_order+GP_c_s-1)*t_integration_order+GP_c_t-1;
00670
00671 dh = dh_drst_at(r,s,t);
00672
00673
00674 Jacobian = Jacobian_3D(dh);
00675
00676 JacobianINV = Jacobian_3Dinv(dh);
00677
00678
00679 det_of_Jacobian = Jacobian.determinant();
00680
00682 dhGlobal = dh("ij") * JacobianINV("kj");
00683
00684
00685
00686 weight = rw * sw * tw * det_of_Jacobian;
00687
00688
00689
00690
00691
00692
00693
00694
00695
00696
00697
00698
00699
00700
00701
00702
00703
00704
00705
00706
00707
00708
00709
00710
00711
00712
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 Constitutive = (matpoint[where]->matmodel)->getTangentTensor();
00766
00767
00768
00769
00770
00771
00772
00773
00774
00775
00776
00777
00778
00779
00780
00781
00782
00783
00784
00785
00786
00787
00788
00789
00790
00791
00792 Kkt = dhGlobal("ib")*Constitutive("abcd");
00793 Kk = Kk + Kkt("aicd")*dhGlobal("jd")*weight;
00794
00795
00796
00797
00798
00799
00800
00801
00802
00803
00804
00805 }
00806 }
00807 }
00808
00809
00810 return Kk;
00811 }
00812
00813
00814
00815
00816 void TwentyNodeBrick::set_strain_stress_tensor(FILE *fp, double * u)
00817 {
00818 int dh_dim[] = {20,3};
00819 tensor dh(2, dh_dim, 0.0);
00820
00821
00822 tensor Constitutive;
00823 double r = 0.0;
00824 double s = 0.0;
00825 double t = 0.0;
00826 int where = 0;
00827
00828 double det_of_Jacobian;
00829
00830 straintensor strain;
00831 stresstensor stress;
00832
00833 tensor Jacobian;
00834 tensor JacobianINV;
00835 tensor dhGlobal;
00836
00837
00838 static int disp_dim[] = {20,3};
00839 tensor total_displacements(2,disp_dim,0.0);
00840
00841 total_displacements = total_disp(fp, u);
00842
00843 ::printf("\n displacement(x-y-z) at GAUSS pt %d \n\n", where+1);
00844 for (int ii=1; ii<=20;ii++)
00845 {
00846 ::printf("Global# %d Local#%d %+0.5e %+0.5e %+0.5e\n",
00847
00848 connectedExternalNodes(ii-1),
00849 ii,total_displacements.val(ii,1),
00850 total_displacements.val(ii,2),
00851 total_displacements.val(ii,3));
00852 }
00853
00854 for( short GP_c_r = 1 ; GP_c_r <= r_integration_order ; GP_c_r++ )
00855 {
00856 r = get_Gauss_p_c( r_integration_order, GP_c_r );
00857 for( short GP_c_s = 1 ; GP_c_s <= s_integration_order ; GP_c_s++ )
00858 {
00859 s = get_Gauss_p_c( s_integration_order, GP_c_s );
00860 for( short GP_c_t = 1 ; GP_c_t <= t_integration_order ; GP_c_t++ )
00861 {
00862 t = get_Gauss_p_c( t_integration_order, GP_c_t );
00863
00864
00865 where =
00866 ((GP_c_r-1)*s_integration_order+GP_c_s-1)*t_integration_order+GP_c_t-1;
00867
00868 dh = dh_drst_at(r,s,t);
00869
00870 Jacobian = Jacobian_3D(dh);
00871
00872 JacobianINV = Jacobian_3Dinv(dh);
00873
00874 det_of_Jacobian = Jacobian.determinant();
00875
00876
00877 dhGlobal = dh("ij") * JacobianINV("kj");
00878
00879
00880 strain = (dhGlobal("ib")*total_displacements("ia")).symmetrize11();
00881 strain.null_indices();
00882
00883
00884
00885
00886
00887
00888 Constitutive = ( matpoint[where]->matmodel)->getTangentTensor();
00889
00890 stress = Constitutive("ijkl") * strain("kl");
00891 stress.null_indices();
00892
00893 ::printf("\n strain tensor at GAUSS point %d \n", where+1);
00894 strain.reportshort("");
00895 ::printf("\n stress tensor at GAUSS point %d \n", where+1);
00896 stress.reportshort("");
00897
00898
00899 }
00900 }
00901 }
00902 }
00903
00904
00906
00907 tensor TwentyNodeBrick::getMassTensor(void)
00908 {
00909
00910 int M_dim[] = {60,60};
00911 tensor Mm(2,M_dim,0.0);
00912
00913 double r = 0.0;
00914 double rw = 0.0;
00915 double s = 0.0;
00916 double sw = 0.0;
00917 double t = 0.0;
00918 double tw = 0.0;
00919
00920 short where = 0;
00921 double weight = 0.0;
00922
00923 int dh_dim[] = {20,3};
00924
00925 tensor dh(2, dh_dim, 0.0);
00926
00927 int h_dim[] = {60,3};
00928 tensor H(2, h_dim, 0.0);
00929
00930 double det_of_Jacobian = 0.0;
00931
00932 tensor Jacobian;
00933
00934 double RHO;
00935 RHO= rho;
00936
00937 for( short GP_c_r = 1 ; GP_c_r <= r_integration_order ; GP_c_r++ )
00938 {
00939 r = get_Gauss_p_c( r_integration_order, GP_c_r );
00940 rw = get_Gauss_p_w( r_integration_order, GP_c_r );
00941 for( short GP_c_s = 1 ; GP_c_s <= s_integration_order ; GP_c_s++ )
00942 {
00943 s = get_Gauss_p_c( s_integration_order, GP_c_s );
00944 sw = get_Gauss_p_w( s_integration_order, GP_c_s );
00945 for( short GP_c_t = 1 ; GP_c_t <= t_integration_order ; GP_c_t++ )
00946 {
00947 t = get_Gauss_p_c( t_integration_order, GP_c_t );
00948 tw = get_Gauss_p_w( t_integration_order, GP_c_t );
00949
00950
00951 where =
00952 ((GP_c_r-1)*s_integration_order+GP_c_s-1)*t_integration_order+GP_c_t-1;
00953
00954 dh = dh_drst_at(r,s,t);
00955
00956 Jacobian = Jacobian_3D(dh);
00957
00958
00959
00960
00961 det_of_Jacobian = Jacobian.determinant();
00962
00963
00964
00965
00966
00967
00968
00969
00970
00971
00972
00973 H = H_3D(r,s,t);
00974
00975
00976
00977
00978
00979
00980
00981
00982
00983
00984
00985
00986
00987
00988
00989
00990
00991
00992
00993 weight = rw * sw * tw * RHO * det_of_Jacobian;
00994
00995 Mm = Mm + H("ib")*H("kb")*weight;
00996
00997
00998 }
00999 }
01000 }
01001
01002
01003 return Mm;
01004 }
01005
01006
01008
01009 tensor TwentyNodeBrick::stiffness_matrix(const tensor & K)
01010 {
01011
01012
01013 matrix Kmatrix(60,60,0.0);
01014
01015 int Ki=0;
01016 int Kj=0;
01017
01018 for ( int i=1 ; i<=20 ; i++ )
01019 {
01020 for ( int j=1 ; j<=20 ; j++ )
01021 {
01022 for ( int k=1 ; k<=3 ; k++ )
01023 {
01024 for ( int l=1 ; l<=3 ; l++ )
01025 {
01026 Ki = k+3*(i-1);
01027 Kj = l+3*(j-1);
01028
01029
01030 Kmatrix.val( Ki , Kj ) = K.cval(i,k,l,j);
01031 }
01032 }
01033 }
01034 }
01035 return Kmatrix;
01036 }
01037
01038
01039
01041 tensor TwentyNodeBrick::mass_matrix(const tensor & M)
01042 {
01043
01044
01045 matrix Mmatrix(60,60,0.0);
01046
01047 for ( int i=1 ; i<=60 ; i++ )
01048 {
01049 for ( int j=1 ; j<=60 ; j++ )
01050 {
01051 Mmatrix.val( i , j ) = M.cval(i,j);
01052
01053 }
01054 }
01055 return Mmatrix;
01056 }
01058
01060 tensor TwentyNodeBrick::Jacobian_3D(tensor dh)
01061 {
01062 tensor N_C = Nodal_Coordinates();
01063 tensor Jacobian_3D = dh("ij") * N_C("ik");
01064 return Jacobian_3D;
01065 }
01066
01067
01068 tensor TwentyNodeBrick::Jacobian_3Dinv(tensor dh)
01069 {
01070 tensor N_C = Nodal_Coordinates();
01071 tensor Jacobian_3Dinv = (dh("ij") * N_C("ik")).inverse();
01072 return Jacobian_3Dinv;
01073 }
01074
01075
01077 tensor TwentyNodeBrick::Nodal_Coordinates(void)
01078 {
01079 const int dimensions[] = {20,3};
01080 tensor N_coord(2, dimensions, 0.0);
01081
01082
01083 const Vector &nd1Crds = theNodes[0]->getCrds();
01084 const Vector &nd2Crds = theNodes[1]->getCrds();
01085 const Vector &nd3Crds = theNodes[2]->getCrds();
01086 const Vector &nd4Crds = theNodes[3]->getCrds();
01087 const Vector &nd5Crds = theNodes[4]->getCrds();
01088 const Vector &nd6Crds = theNodes[5]->getCrds();
01089 const Vector &nd7Crds = theNodes[6]->getCrds();
01090 const Vector &nd8Crds = theNodes[7]->getCrds();
01091
01092 const Vector &nd9Crds = theNodes[8]->getCrds();
01093 const Vector &nd10Crds = theNodes[9]->getCrds();
01094 const Vector &nd11Crds = theNodes[10]->getCrds();
01095 const Vector &nd12Crds = theNodes[11]->getCrds();
01096
01097 const Vector &nd13Crds = theNodes[12]->getCrds();
01098 const Vector &nd14Crds = theNodes[13]->getCrds();
01099 const Vector &nd15Crds = theNodes[14]->getCrds();
01100 const Vector &nd16Crds = theNodes[15]->getCrds();
01101
01102
01103 const Vector &nd17Crds = theNodes[16]->getCrds();
01104 const Vector &nd18Crds = theNodes[17]->getCrds();
01105 const Vector &nd19Crds = theNodes[18]->getCrds();
01106 const Vector &nd20Crds = theNodes[19]->getCrds();
01107
01108 N_coord.val(1,1)=nd1Crds(0); N_coord.val(1,2)=nd1Crds(1); N_coord.val(1,3)=nd1Crds(2);
01109 N_coord.val(2,1)=nd2Crds(0); N_coord.val(2,2)=nd2Crds(1); N_coord.val(2,3)=nd2Crds(2);
01110 N_coord.val(3,1)=nd3Crds(0); N_coord.val(3,2)=nd3Crds(1); N_coord.val(3,3)=nd3Crds(2);
01111 N_coord.val(4,1)=nd4Crds(0); N_coord.val(4,2)=nd4Crds(1); N_coord.val(4,3)=nd4Crds(2);
01112 N_coord.val(5,1)=nd5Crds(0); N_coord.val(5,2)=nd5Crds(1); N_coord.val(5,3)=nd5Crds(2);
01113 N_coord.val(6,1)=nd6Crds(0); N_coord.val(6,2)=nd6Crds(1); N_coord.val(6,3)=nd6Crds(2);
01114 N_coord.val(7,1)=nd7Crds(0); N_coord.val(7,2)=nd7Crds(1); N_coord.val(7,3)=nd7Crds(2);
01115 N_coord.val(8,1)=nd8Crds(0); N_coord.val(8,2)=nd8Crds(1); N_coord.val(8,3)=nd8Crds(2);
01116
01117 N_coord.val(9 ,1)=nd9Crds(0); N_coord.val(9 ,2)=nd9Crds(1); N_coord.val(9 ,3)=nd9Crds(2);
01118 N_coord.val(10,1)=nd10Crds(0); N_coord.val(10,2)=nd10Crds(1); N_coord.val(10,3)=nd10Crds(2);
01119 N_coord.val(11,1)=nd11Crds(0); N_coord.val(11,2)=nd11Crds(1); N_coord.val(11,3)=nd11Crds(2);
01120 N_coord.val(12,1)=nd12Crds(0); N_coord.val(12,2)=nd12Crds(1); N_coord.val(12,3)=nd12Crds(2);
01121
01122 N_coord.val(13,1)=nd13Crds(0); N_coord.val(13,2)=nd13Crds(1); N_coord.val(13,3)=nd13Crds(2);
01123 N_coord.val(14,1)=nd14Crds(0); N_coord.val(14,2)=nd14Crds(1); N_coord.val(14,3)=nd14Crds(2);
01124 N_coord.val(15,1)=nd15Crds(0); N_coord.val(15,2)=nd15Crds(1); N_coord.val(15,3)=nd15Crds(2);
01125 N_coord.val(16,1)=nd16Crds(0); N_coord.val(16,2)=nd16Crds(1); N_coord.val(16,3)=nd16Crds(2);
01126
01127 N_coord.val(17,1)=nd17Crds(0); N_coord.val(17,2)=nd17Crds(1); N_coord.val(17,3)=nd17Crds(2);
01128 N_coord.val(18,1)=nd18Crds(0); N_coord.val(18,2)=nd18Crds(1); N_coord.val(18,3)=nd18Crds(2);
01129 N_coord.val(19,1)=nd19Crds(0); N_coord.val(19,2)=nd19Crds(1); N_coord.val(19,3)=nd19Crds(2);
01130 N_coord.val(20,1)=nd20Crds(0); N_coord.val(20,2)=nd20Crds(1); N_coord.val(20,3)=nd20Crds(2);
01131
01132 return N_coord;
01133
01134 }
01135
01137 tensor TwentyNodeBrick::incr_disp(void)
01138 {
01139 const int dimensions[] = {20,3};
01140 tensor increment_disp(2, dimensions, 0.0);
01141
01142
01143
01144
01145
01146
01147
01148
01149
01150
01151
01152
01153
01154
01155
01156
01157
01158
01159 const Vector &IncrDis1 = theNodes[0]->getIncrDeltaDisp();
01160 const Vector &IncrDis2 = theNodes[1]->getIncrDeltaDisp();
01161 const Vector &IncrDis3 = theNodes[2]->getIncrDeltaDisp();
01162 const Vector &IncrDis4 = theNodes[3]->getIncrDeltaDisp();
01163 const Vector &IncrDis5 = theNodes[4]->getIncrDeltaDisp();
01164 const Vector &IncrDis6 = theNodes[5]->getIncrDeltaDisp();
01165 const Vector &IncrDis7 = theNodes[6]->getIncrDeltaDisp();
01166 const Vector &IncrDis8 = theNodes[7]->getIncrDeltaDisp();
01167
01168 const Vector &IncrDis9 = theNodes[8]->getIncrDeltaDisp();
01169 const Vector &IncrDis10 = theNodes[9]->getIncrDeltaDisp();
01170 const Vector &IncrDis11 = theNodes[10]->getIncrDeltaDisp();
01171 const Vector &IncrDis12 = theNodes[11]->getIncrDeltaDisp();
01172
01173 const Vector &IncrDis13 = theNodes[12]->getIncrDeltaDisp();
01174 const Vector &IncrDis14 = theNodes[13]->getIncrDeltaDisp();
01175 const Vector &IncrDis15 = theNodes[14]->getIncrDeltaDisp();
01176 const Vector &IncrDis16 = theNodes[15]->getIncrDeltaDisp();
01177
01178 const Vector &IncrDis17 = theNodes[16]->getIncrDeltaDisp();
01179 const Vector &IncrDis18 = theNodes[17]->getIncrDeltaDisp();
01180 const Vector &IncrDis19 = theNodes[18]->getIncrDeltaDisp();
01181 const Vector &IncrDis20 = theNodes[19]->getIncrDeltaDisp();
01182
01183 increment_disp.val(1,1)=IncrDis1(0); increment_disp.val(1,2)=IncrDis1(1);increment_disp.val(1,3)=IncrDis1(2);
01184 increment_disp.val(2,1)=IncrDis2(0); increment_disp.val(2,2)=IncrDis2(1);increment_disp.val(2,3)=IncrDis2(2);
01185 increment_disp.val(3,1)=IncrDis3(0); increment_disp.val(3,2)=IncrDis3(1);increment_disp.val(3,3)=IncrDis3(2);
01186 increment_disp.val(4,1)=IncrDis4(0); increment_disp.val(4,2)=IncrDis4(1);increment_disp.val(4,3)=IncrDis4(2);
01187 increment_disp.val(5,1)=IncrDis5(0); increment_disp.val(5,2)=IncrDis5(1);increment_disp.val(5,3)=IncrDis5(2);
01188 increment_disp.val(6,1)=IncrDis6(0); increment_disp.val(6,2)=IncrDis6(1);increment_disp.val(6,3)=IncrDis6(2);
01189 increment_disp.val(7,1)=IncrDis7(0); increment_disp.val(7,2)=IncrDis7(1);increment_disp.val(7,3)=IncrDis7(2);
01190 increment_disp.val(8,1)=IncrDis8(0); increment_disp.val(8,2)=IncrDis8(1);increment_disp.val(8,3)=IncrDis8(2);
01191
01192 increment_disp.val(9 ,1)=IncrDis9(0); increment_disp.val(9 ,2)=IncrDis9(1); increment_disp.val(9 ,3)=IncrDis9(2);
01193 increment_disp.val(10,1)=IncrDis10(0); increment_disp.val(10,2)=IncrDis10(1);increment_disp.val(10,3)=IncrDis10(2);
01194 increment_disp.val(11,1)=IncrDis11(0); increment_disp.val(11,2)=IncrDis11(1);increment_disp.val(11,3)=IncrDis11(2);
01195 increment_disp.val(12,1)=IncrDis12(0); increment_disp.val(12,2)=IncrDis12(1);increment_disp.val(12,3)=IncrDis12(2);
01196
01197 increment_disp.val(13,1)=IncrDis13(0); increment_disp.val(13,2)=IncrDis13(1);increment_disp.val(13,3)=IncrDis13(2);
01198 increment_disp.val(14,1)=IncrDis14(0); increment_disp.val(14,2)=IncrDis14(1);increment_disp.val(14,3)=IncrDis14(2);
01199 increment_disp.val(15,1)=IncrDis15(0); increment_disp.val(15,2)=IncrDis15(1);increment_disp.val(15,3)=IncrDis15(2);
01200 increment_disp.val(16,1)=IncrDis16(0); increment_disp.val(16,2)=IncrDis16(1);increment_disp.val(16,3)=IncrDis16(2);
01201
01202 increment_disp.val(17,1)=IncrDis17(0); increment_disp.val(17,2)=IncrDis17(1);increment_disp.val(17,3)=IncrDis17(2);
01203 increment_disp.val(18,1)=IncrDis18(0); increment_disp.val(18,2)=IncrDis18(1);increment_disp.val(18,3)=IncrDis18(2);
01204 increment_disp.val(19,1)=IncrDis19(0); increment_disp.val(19,2)=IncrDis19(1);increment_disp.val(19,3)=IncrDis19(2);
01205 increment_disp.val(20,1)=IncrDis20(0); increment_disp.val(20,2)=IncrDis20(1);increment_disp.val(20,3)=IncrDis20(2);
01206
01207
01208 return increment_disp;
01209 }
01210
01212 tensor TwentyNodeBrick::total_disp(void)
01213 {
01214 const int dimensions[] = {20,3};
01215 tensor total_disp(2, dimensions, 0.0);
01216
01217
01218 const Vector &TotDis1 = theNodes[0]->getTrialDisp();
01219 opserr<<"\ntot node " << theNodes[0]->getTag() <<" x "<< TotDis1(0) <<" y "<< TotDis1(1) << " z "<< TotDis1(2) << endln;
01220 const Vector &TotDis2 = theNodes[1]->getTrialDisp();
01221 opserr << "tot node " << theNodes[1]->getTag() << " x " << TotDis2(0) <<" y "<< TotDis2(1) << " z "<< TotDis2(2) << endln;
01222 const Vector &TotDis3 = theNodes[2]->getTrialDisp();
01223 opserr << "tot node " << theNodes[2]->getTag() << " x " << TotDis3(0) <<" y "<< TotDis3(1) << " z "<< TotDis3(2) << endln;
01224 const Vector &TotDis4 = theNodes[3]->getTrialDisp();
01225 opserr << "tot node " << theNodes[3]->getTag() << " x " << TotDis4(0) <<" y "<< TotDis4(1) << " z "<< TotDis4(2) << endln;
01226 const Vector &TotDis5 = theNodes[4]->getTrialDisp();
01227 opserr << "tot node " << theNodes[4]->getTag() << " x " << TotDis5(0) <<" y "<< TotDis5(1) << " z "<< TotDis5(2) << endln;
01228 const Vector &TotDis6 = theNodes[5]->getTrialDisp();
01229 opserr << "tot node " << theNodes[5]->getTag() << " x " << TotDis6(0) <<" y "<< TotDis6(1) << " z "<< TotDis6(2) << endln;
01230 const Vector &TotDis7 = theNodes[6]->getTrialDisp();
01231 opserr << "tot node " << theNodes[6]->getTag() << " x " << TotDis7(0) <<" y "<< TotDis7(1) << " z "<< TotDis7(2) << endln;
01232 const Vector &TotDis8 = theNodes[7]->getTrialDisp();
01233 opserr << "tot node " << theNodes[7]->getTag() << " x " << TotDis8(0) <<" y "<< TotDis8(1) << " z "<< TotDis8(2) << endln;
01234
01235 const Vector &TotDis9 = theNodes[8]->getTrialDisp();
01236 opserr << "tot node " << theNodes[8]->getTag() << " x " << TotDis9(0) <<" y "<< TotDis9(1) << " z "<< TotDis9(2) << endln;
01237 const Vector &TotDis10 = theNodes[9]->getTrialDisp();
01238 opserr << "tot node " << theNodes[9]->getTag() << " x " << TotDis10(0) <<" y "<< TotDis10(1) << " z "<< TotDis10(2) << endln;
01239 const Vector &TotDis11 = theNodes[10]->getTrialDisp();
01240 opserr << "tot node " << theNodes[10]->getTag() << " x " << TotDis11(0) <<" y "<< TotDis11(1) << " z "<< TotDis11(2) << endln;
01241 const Vector &TotDis12 = theNodes[11]->getTrialDisp();
01242 opserr << "tot node " << theNodes[11]->getTag() << " x " << TotDis12(0) <<" y "<< TotDis12(1) << " z "<< TotDis12(2) << endln;
01243
01244 const Vector &TotDis13 = theNodes[12]->getTrialDisp();
01245 opserr << "tot node " << theNodes[12]->getTag() << " x " << TotDis13(0) <<" y "<< TotDis13(1) << " z "<< TotDis13(2) << endln;
01246 const Vector &TotDis14 = theNodes[13]->getTrialDisp();
01247 opserr << "tot node " << theNodes[13]->getTag() << " x " << TotDis14(0) <<" y "<< TotDis14(1) << " z "<< TotDis14(2) << endln;
01248 const Vector &TotDis15 = theNodes[14]->getTrialDisp();
01249 opserr << "tot node " << theNodes[14]->getTag() << " x " << TotDis15(0) <<" y "<< TotDis15(1) << " z "<< TotDis15(2) << endln;
01250 const Vector &TotDis16 = theNodes[15]->getTrialDisp();
01251 opserr << "tot node " << theNodes[15]->getTag() << " x " << TotDis16(0) <<" y "<< TotDis16(1) << " z "<< TotDis16(2) << endln;
01252
01253 const Vector &TotDis17 = theNodes[16]->getTrialDisp();
01254 opserr << "tot node " << theNodes[16]->getTag() << " x " << TotDis17(0) <<" y "<< TotDis17(1) << " z "<< TotDis17(2) << endln;
01255 const Vector &TotDis18 = theNodes[17]->getTrialDisp();
01256 opserr << "tot node " << theNodes[17]->getTag() << " x " << TotDis18(0) <<" y "<< TotDis18(1) << " z "<< TotDis18(2) << endln;
01257 const Vector &TotDis19 = theNodes[18]->getTrialDisp();
01258 opserr << "tot node " << theNodes[18]->getTag() << " x " << TotDis19(0) <<" y "<< TotDis19(1) << " z "<< TotDis19(2) << endln;
01259 const Vector &TotDis20 = theNodes[19]->getTrialDisp();
01260 opserr << "tot node " << theNodes[19]->getTag() << " x " << TotDis20(0) <<" y "<< TotDis20(1) << " z "<< TotDis20(2) << endln;
01261
01262
01263
01264
01265 total_disp.val(1,1)=TotDis1(0); total_disp.val(1,2)=TotDis1(1);total_disp.val(1,3)=TotDis1(2);
01266 total_disp.val(2,1)=TotDis2(0); total_disp.val(2,2)=TotDis2(1);total_disp.val(2,3)=TotDis2(2);
01267 total_disp.val(3,1)=TotDis3(0); total_disp.val(3,2)=TotDis3(1);total_disp.val(3,3)=TotDis3(2);
01268 total_disp.val(4,1)=TotDis4(0); total_disp.val(4,2)=TotDis4(1);total_disp.val(4,3)=TotDis4(2);
01269 total_disp.val(5,1)=TotDis5(0); total_disp.val(5,2)=TotDis5(1);total_disp.val(5,3)=TotDis5(2);
01270 total_disp.val(6,1)=TotDis6(0); total_disp.val(6,2)=TotDis6(1);total_disp.val(6,3)=TotDis6(2);
01271 total_disp.val(7,1)=TotDis7(0); total_disp.val(7,2)=TotDis7(1);total_disp.val(7,3)=TotDis7(2);
01272 total_disp.val(8,1)=TotDis8(0); total_disp.val(8,2)=TotDis8(1);total_disp.val(8,3)=TotDis8(2);
01273
01274 total_disp.val(9,1)=TotDis9(0); total_disp.val(9,2)=TotDis9(1);total_disp.val(9,3)=TotDis9(2);
01275 total_disp.val(10,1)=TotDis10(0); total_disp.val(10,2)=TotDis10(1);total_disp.val(10,3)=TotDis10(2);
01276 total_disp.val(11,1)=TotDis11(0); total_disp.val(11,2)=TotDis11(1);total_disp.val(11,3)=TotDis11(2);
01277 total_disp.val(12,1)=TotDis12(0); total_disp.val(12,2)=TotDis12(1);total_disp.val(12,3)=TotDis12(2);
01278
01279 total_disp.val(13,1)=TotDis13(0); total_disp.val(13,2)=TotDis13(1);total_disp.val(13,3)=TotDis13(2);
01280 total_disp.val(14,1)=TotDis14(0); total_disp.val(14,2)=TotDis14(1);total_disp.val(14,3)=TotDis14(2);
01281 total_disp.val(15,1)=TotDis15(0); total_disp.val(15,2)=TotDis15(1);total_disp.val(15,3)=TotDis15(2);
01282 total_disp.val(16,1)=TotDis16(0); total_disp.val(16,2)=TotDis16(1);total_disp.val(16,3)=TotDis16(2);
01283
01284 total_disp.val(17,1)=TotDis17(0); total_disp.val(17,2)=TotDis17(1);total_disp.val(17,3)=TotDis17(2);
01285 total_disp.val(18,1)=TotDis18(0); total_disp.val(18,2)=TotDis18(1);total_disp.val(18,3)=TotDis18(2);
01286 total_disp.val(19,1)=TotDis19(0); total_disp.val(19,2)=TotDis19(1);total_disp.val(19,3)=TotDis19(2);
01287 total_disp.val(20,1)=TotDis20(0); total_disp.val(20,2)=TotDis20(1);total_disp.val(20,3)=TotDis20(2);
01288
01289 return total_disp;
01290 }
01291
01292
01294 tensor TwentyNodeBrick::total_disp(FILE *fp, double * u)
01295 {
01296 const int dimensions[] = {20,3};
01297 tensor total_disp(2, dimensions, 0.0);
01298
01299
01300
01301
01302
01303
01304
01305
01306
01307
01308
01309
01310
01311
01312
01313
01314
01315
01316
01317
01318
01319
01320 const Vector &TotDis1 = theNodes[0]->getTrialDisp();
01321 const Vector &TotDis2 = theNodes[1]->getTrialDisp();
01322 const Vector &TotDis3 = theNodes[2]->getTrialDisp();
01323 const Vector &TotDis4 = theNodes[3]->getTrialDisp();
01324 const Vector &TotDis5 = theNodes[4]->getTrialDisp();
01325 const Vector &TotDis6 = theNodes[5]->getTrialDisp();
01326 const Vector &TotDis7 = theNodes[6]->getTrialDisp();
01327 const Vector &TotDis8 = theNodes[7]->getTrialDisp();
01328
01329 total_disp.val(1,1)=TotDis1(0); total_disp.val(1,2)=TotDis1(1);total_disp.val(1,3)=TotDis1(2);
01330 total_disp.val(2,1)=TotDis2(0); total_disp.val(2,2)=TotDis2(1);total_disp.val(2,3)=TotDis2(2);
01331 total_disp.val(3,1)=TotDis3(0); total_disp.val(3,2)=TotDis3(1);total_disp.val(3,3)=TotDis3(2);
01332 total_disp.val(4,1)=TotDis4(0); total_disp.val(4,2)=TotDis4(1);total_disp.val(4,3)=TotDis4(2);
01333 total_disp.val(5,1)=TotDis5(0); total_disp.val(5,2)=TotDis5(1);total_disp.val(5,3)=TotDis5(2);
01334 total_disp.val(6,1)=TotDis6(0); total_disp.val(6,2)=TotDis6(1);total_disp.val(6,3)=TotDis6(2);
01335 total_disp.val(7,1)=TotDis7(0); total_disp.val(7,2)=TotDis7(1);total_disp.val(7,3)=TotDis7(2);
01336 total_disp.val(8,1)=TotDis8(0); total_disp.val(8,2)=TotDis8(1);total_disp.val(8,3)=TotDis8(2);
01337
01338 return total_disp;
01339 }
01340
01341
01343 int TwentyNodeBrick::get_global_number_of_node(int local_node_number)
01344 {
01345
01346 return connectedExternalNodes(local_node_number);
01347 }
01348
01350 int TwentyNodeBrick::get_Brick_Number(void)
01351 {
01352
01353 return this->getTag();
01354 }
01355
01357
01358
01359
01360
01361
01362
01363
01365
01366
01371
01372
01374
01375
01376
01377
01378
01379
01380
01381
01387
01388
01389
01390
01392
01393 tensor TwentyNodeBrick::nodal_forces(void)
01394 {
01395 int force_dim[] = {20,3};
01396
01397 tensor nodal_forces(2,force_dim,0.0);
01398
01399 double r = 0.0;
01400 double rw = 0.0;
01401 double s = 0.0;
01402 double sw = 0.0;
01403 double t = 0.0;
01404 double tw = 0.0;
01405
01406 short where = 0;
01407 double weight = 0.0;
01408
01409 int dh_dim[] = {20,3};
01410
01411 tensor dh(2, dh_dim, 0.0);
01412
01413 stresstensor stress_at_GP(0.0);
01414
01415 double det_of_Jacobian = 0.0;
01416
01417 straintensor incremental_strain;
01418
01419 static int disp_dim[] = {20,3};
01420 tensor incremental_displacements(2,disp_dim,0.0);
01421
01422 incremental_displacements = incr_disp();
01423
01424 tensor Jacobian;
01425 tensor JacobianINV;
01426 tensor dhGlobal;
01427
01428 for( short GP_c_r = 1 ; GP_c_r <= r_integration_order ; GP_c_r++ )
01429 {
01430 r = get_Gauss_p_c( r_integration_order, GP_c_r );
01431 rw = get_Gauss_p_w( r_integration_order, GP_c_r );
01432
01433 for( short GP_c_s = 1 ; GP_c_s <= s_integration_order ; GP_c_s++ )
01434 {
01435 s = get_Gauss_p_c( s_integration_order, GP_c_s );
01436 sw = get_Gauss_p_w( s_integration_order, GP_c_s );
01437
01438 for( short GP_c_t = 1 ; GP_c_t <= t_integration_order ; GP_c_t++ )
01439 {
01440 t = get_Gauss_p_c( t_integration_order, GP_c_t );
01441 tw = get_Gauss_p_w( t_integration_order, GP_c_t );
01442
01443
01444
01445 where =
01446 ((GP_c_r-1)*s_integration_order+GP_c_s-1)*t_integration_order+GP_c_t-1;
01447
01448
01449 dh = dh_drst_at(r,s,t);
01450
01451
01452 Jacobian = Jacobian_3D(dh);
01453
01454
01455
01456 JacobianINV = Jacobian_3Dinv(dh);
01457
01458
01459
01460 det_of_Jacobian = Jacobian.determinant();
01461
01462
01463
01464
01465 dhGlobal = dh("ij") * JacobianINV("kj");
01466
01467
01468 weight = rw * sw * tw * det_of_Jacobian;
01469
01470
01471
01472
01473
01474
01475
01476
01477
01478
01479
01481
01482
01484
01485
01486
01487
01489
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 stress_at_GP = matpoint[where]->getStressTensor();
01544
01545
01546
01547
01548
01549
01550
01551
01552
01553
01554
01555
01556
01557
01558
01559
01560
01561
01562
01563
01564
01565
01566
01567
01568
01569
01570
01571
01572
01573
01574
01575
01576
01577 nodal_forces =
01578 nodal_forces + dhGlobal("ib")*stress_at_GP("ab")*weight;
01579
01580
01581 }
01582 }
01583 }
01584
01585
01586
01587 return nodal_forces;
01588
01589 }
01590
01592
01593 tensor TwentyNodeBrick::iterative_nodal_forces(void)
01594 {
01595 int force_dim[] = {20,3};
01596
01597 tensor nodal_forces(2,force_dim,0.0);
01598
01599 double r = 0.0;
01600 double rw = 0.0;
01601 double s = 0.0;
01602 double sw = 0.0;
01603 double t = 0.0;
01604 double tw = 0.0;
01605
01606 short where = 0;
01607 double weight = 0.0;
01608
01609 int dh_dim[] = {20,3};
01610
01611 tensor dh(2, dh_dim, 0.0);
01612
01613 stresstensor stress_at_GP(0.0);
01614
01615 double det_of_Jacobian = 0.0;
01616
01617 tensor Jacobian;
01618 tensor JacobianINV;
01619 tensor dhGlobal;
01620
01621 for( short GP_c_r = 1 ; GP_c_r <= r_integration_order ; GP_c_r++ )
01622 {
01623 r = get_Gauss_p_c( r_integration_order, GP_c_r );
01624 rw = get_Gauss_p_w( r_integration_order, GP_c_r );
01625
01626 for( short GP_c_s = 1 ; GP_c_s <= s_integration_order ; GP_c_s++ )
01627 {
01628 s = get_Gauss_p_c( s_integration_order, GP_c_s );
01629 sw = get_Gauss_p_w( s_integration_order, GP_c_s );
01630
01631 for( short GP_c_t = 1 ; GP_c_t <= t_integration_order ; GP_c_t++ )
01632 {
01633 t = get_Gauss_p_c( t_integration_order, GP_c_t );
01634 tw = get_Gauss_p_w( t_integration_order, GP_c_t );
01635
01636
01637
01638 where =
01639 ((GP_c_r-1)*s_integration_order+GP_c_s-1)*t_integration_order+GP_c_t-1;
01640
01641
01642
01643
01644
01645
01646 dh = dh_drst_at(r,s,t);
01647
01648
01649 Jacobian = Jacobian_3D(dh);
01650
01651
01652
01653 JacobianINV = Jacobian_3Dinv(dh);
01654
01655
01656
01657 det_of_Jacobian = Jacobian.determinant();
01658
01659
01660
01661
01662 dhGlobal = dh("ij") * JacobianINV("kj");
01663
01664
01665 weight = rw * sw * tw * det_of_Jacobian;
01666
01667
01668
01669
01670
01671 stress_at_GP = matpoint[where]->getStressTensor();
01672 stress_at_GP.reportshortpqtheta("\n iterative_stress at GAUSS point in iterative_nodal_force\n");
01673
01674
01675 nodal_forces =
01676 nodal_forces + dhGlobal("ib")*stress_at_GP("ab")*weight;
01677
01678
01679 }
01680 }
01681 }
01682
01683
01684 return nodal_forces;
01685
01686 }
01687
01689
01690 tensor TwentyNodeBrick::nodal_forces_from_stress(stresstensor & stress)
01691 {
01692 int force_dim[] = {20,3};
01693
01694 tensor nodal_forces(2,force_dim,0.0);
01695
01696 double r = 0.0;
01697 double rw = 0.0;
01698 double s = 0.0;
01699 double sw = 0.0;
01700 double t = 0.0;
01701 double tw = 0.0;
01702
01703 double weight = 0.0;
01704
01705 int dh_dim[] = {20,3};
01706
01707 tensor dh(2, dh_dim, 0.0);
01708
01709 double det_of_Jacobian = 0.0;
01710
01711 tensor Jacobian;
01712 tensor JacobianINV;
01713 tensor dhGlobal;
01714
01715 for( short GP_c_r = 1 ; GP_c_r <= r_integration_order ; GP_c_r++ )
01716 {
01717 r = get_Gauss_p_c( r_integration_order, GP_c_r );
01718 rw = get_Gauss_p_w( r_integration_order, GP_c_r );
01719
01720 for( short GP_c_s = 1 ; GP_c_s <= s_integration_order ; GP_c_s++ )
01721 {
01722 s = get_Gauss_p_c( s_integration_order, GP_c_s );
01723 sw = get_Gauss_p_w( s_integration_order, GP_c_s );
01724
01725 for( short GP_c_t = 1 ; GP_c_t <= t_integration_order ; GP_c_t++ )
01726 {
01727 t = get_Gauss_p_c( t_integration_order, GP_c_t );
01728 tw = get_Gauss_p_w( t_integration_order, GP_c_t );
01729
01730
01731
01732
01733
01734
01735
01736
01737
01738
01739
01740 dh = dh_drst_at(r,s,t);
01741
01742
01743 Jacobian = Jacobian_3D(dh);
01744
01745
01746
01747 JacobianINV = Jacobian_3Dinv(dh);
01748
01749
01750
01751 det_of_Jacobian = Jacobian.determinant();
01752
01753
01754
01755
01756 dhGlobal = dh("ij") * JacobianINV("kj");
01757
01758
01759 weight = rw * sw * tw * det_of_Jacobian;
01760
01761
01762
01763
01764
01765
01766 nodal_forces =
01767 nodal_forces + dhGlobal("ib")*stress("ab")*weight;
01768
01769
01770 }
01771 }
01772 }
01773
01774 return nodal_forces;
01775
01776 }
01777
01778
01780
01781
01782 tensor TwentyNodeBrick::linearized_nodal_forces(void)
01783 {
01784 int force_dim[] = {20,3};
01785
01786 tensor linearized_nodal_forces(2,force_dim,0.0);
01787
01788 double r = 0.0;
01789 double rw = 0.0;
01790 double s = 0.0;
01791 double sw = 0.0;
01792 double t = 0.0;
01793 double tw = 0.0;
01794
01795 short where = 0;
01796 double weight = 0.0;
01797
01798 int dh_dim[] = {20,3};
01799
01800 tensor dh(2, dh_dim, 0.0);
01801
01802 tensor Constitutive( 4, def_dim_4, 0.0);
01803
01804 double det_of_Jacobian = 0.0;
01805
01806 static int disp_dim[] = {20,3};
01807
01808 tensor incremental_displacements(2,disp_dim,0.0);
01809
01810 straintensor incremental_strain;
01811
01812 tensor Jacobian;
01813 tensor JacobianINV;
01814 tensor dhGlobal;
01815
01816 stresstensor final_linearized_stress;
01817
01818
01819 incremental_displacements = incr_disp();
01820
01821
01822 for( short GP_c_r = 1 ; GP_c_r <= r_integration_order ; GP_c_r++ )
01823 {
01824 r = get_Gauss_p_c( r_integration_order, GP_c_r );
01825 rw = get_Gauss_p_w( r_integration_order, GP_c_r );
01826
01827 for( short GP_c_s = 1 ; GP_c_s <= s_integration_order ; GP_c_s++ )
01828 {
01829 s = get_Gauss_p_c( s_integration_order, GP_c_s );
01830 sw = get_Gauss_p_w( s_integration_order, GP_c_s );
01831
01832 for( short GP_c_t = 1 ; GP_c_t <= t_integration_order ; GP_c_t++ )
01833 {
01834 t = get_Gauss_p_c( t_integration_order, GP_c_t );
01835 tw = get_Gauss_p_w( t_integration_order, GP_c_t );
01836
01837
01838
01839 where =
01840 ((GP_c_r-1)*s_integration_order+GP_c_s-1)*t_integration_order+GP_c_t-1;
01841
01842
01843 dh = dh_drst_at(r,s,t);
01844
01845
01846 Jacobian = Jacobian_3D(dh);
01847
01848
01849
01850 JacobianINV = Jacobian_3Dinv(dh);
01851
01852
01853
01854 det_of_Jacobian = Jacobian.determinant();
01855
01856
01857
01858
01859 dhGlobal = dh("ij") * JacobianINV("kj");
01860
01861
01862 weight = rw * sw * tw * det_of_Jacobian;
01863
01864
01865
01866
01867
01868
01869
01870
01871 incremental_strain =
01872 (dhGlobal("ib")*incremental_displacements("ia")).symmetrize11();
01873 incremental_strain.null_indices();
01874
01875
01876
01877
01878
01879
01880
01881
01882
01883 if ( ! (matpoint[where]->matmodel)->setTrialStrainIncr( incremental_strain) )
01884 opserr << "TwentyNodeBrick::linearized_nodal_forces (tag: " << this->getTag() << "), not converged\n";
01885
01886 Constitutive = (matpoint[where]->matmodel)->getTangentTensor();
01887
01888
01889
01890
01891
01892
01893
01894
01895
01896
01897
01898
01899
01900
01901 final_linearized_stress =
01902 Constitutive("ijkl") * incremental_strain("kl");
01903
01904
01905 linearized_nodal_forces = linearized_nodal_forces +
01906 dhGlobal("ib")*final_linearized_stress("ab")*weight;
01907
01908
01909 }
01910 }
01911 }
01912
01913
01914 return linearized_nodal_forces;
01915
01916 }
01917
01918
01919
01920
01921
01922
01923
01924
01925
01926
01927
01928
01929
01930
01931
01932
01933
01934
01935
01936
01937
01938
01939
01940
01941
01942
01943
01944
01945
01946
01947
01948
01949
01950
01951
01952
01953
01954
01955
01956
01957
01958
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
01994
01995
01996
01997
01998
01999
02000
02001
02002
02003
02004
02005
02006
02007
02008
02009
02010
02011
02012
02013
02014
02015
02016
02017
02018
02019
02020
02021
02024
02025
02026
02027
02028
02029
02030
02032
02033
02034
02035
02036
02037
02038
02039
02040
02041
02042 void TwentyNodeBrick::report(char * msg)
02043 {
02044 if ( msg ) ::printf("** %s",msg);
02045 ::printf("\n Element Number = %d\n", this->getTag() );
02046 ::printf("\n Number of nodes in a TwentyNodebrick = %d\n",
02047 nodes_in_brick);
02048 ::printf("\n Determinant of Jacobian (! ==0 before comp.) = %f\n",
02049 determinant_of_Jacobian);
02050
02051 ::printf("Node numbers \n");
02052 ::printf(".....1.....2.....3.....4.....5.....6.....7.....8.....9.....0.....1.....2\n");
02053 for ( int i=0 ; i<20 ; i++ )
02054
02055 ::printf("%6d",connectedExternalNodes(i));
02056 ::printf("\n");
02057
02058
02059 ::printf("\n\n");
02060
02061
02062
02063
02064
02065
02066
02067 int total_number_of_Gauss_points = r_integration_order*
02068 s_integration_order*
02069 t_integration_order;
02070 if ( total_number_of_Gauss_points != 0 )
02071 {
02072
02073
02074
02075
02076
02077
02078 theNodes[0]->Print(opserr);
02079 theNodes[1]->Print(opserr);
02080 theNodes[2]->Print(opserr);
02081 theNodes[3]->Print(opserr);
02082 theNodes[4]->Print(opserr);
02083 theNodes[5]->Print(opserr);
02084 theNodes[6]->Print(opserr);
02085 theNodes[7]->Print(opserr);
02086 theNodes[8]->Print(opserr);
02087 theNodes[9]->Print(opserr);
02088 theNodes[10]->Print(opserr);
02089 theNodes[11]->Print(opserr);
02090 theNodes[12]->Print(opserr);
02091 theNodes[13]->Print(opserr);
02092 theNodes[14]->Print(opserr);
02093 theNodes[15]->Print(opserr);
02094 theNodes[16]->Print(opserr);
02095 theNodes[17]->Print(opserr);
02096 theNodes[18]->Print(opserr);
02097 theNodes[19]->Print(opserr);
02098
02099
02100
02101
02102 }
02103
02104 ::printf("\n\nGauss-Legendre integration order\n");
02105 ::printf("Integration order in r direction = %d\n",r_integration_order);
02106 ::printf("Integration order in s direction = %d\n",s_integration_order);
02107 ::printf("Integration order in t direction = %d\n\n",t_integration_order);
02108
02109
02110
02111 for( int GP_c_r = 1 ; GP_c_r <= r_integration_order ; GP_c_r++ )
02112 {
02113 for( int GP_c_s = 1 ; GP_c_s <= s_integration_order ; GP_c_s++ )
02114 {
02115 for( int GP_c_t = 1 ; GP_c_t <= t_integration_order ; GP_c_t++ )
02116 {
02117
02118
02119 short where =
02120 ((GP_c_r-1)*s_integration_order+GP_c_s-1)*t_integration_order+GP_c_t-1;
02121
02122 ::printf("\n\n----------------**************** where = %d \n", where);
02123 ::printf(" GP_c_r = %d, GP_c_s = %d, GP_c_t = %d\n",
02124 GP_c_r,GP_c_s,GP_c_t);
02125 matpoint[where]->report("Material Point\n");
02126
02127
02128
02129 }
02130 }
02131 }
02132
02133 }
02134
02135
02136
02137 void TwentyNodeBrick::reportshort(char * msg)
02138 {
02139 if ( msg ) ::printf("** %s",msg);
02140 ::printf("\n Element Number = %d\n", this->getTag() );
02141 ::printf("\n Number of nodes in a TwentyNodeBrick = %d\n",
02142 nodes_in_brick);
02143 ::printf("\n Determinant of Jacobian (! ==0 before comp.) = %f\n",
02144 determinant_of_Jacobian);
02145
02146 ::printf("Node numbers \n");
02147 ::printf(".....1.....2.....3.....4.....5.....6.....7.....8.....9.....0.....1.....2\n");
02148 for ( int i=0 ; i<nodes_in_brick ; i++ )
02149
02150 ::printf( "%6d",connectedExternalNodes(i) );
02151
02152 ::printf("\n");
02153
02154
02155 ::printf("\n\n");
02156
02157
02158
02159
02160 ::printf("\n\n");
02161
02162 }
02163
02164
02165
02166
02167
02168 void TwentyNodeBrick::reportPAK(char * msg)
02169 {
02170 if ( msg ) ::printf("%s",msg);
02171 ::printf("%10d ", this->getTag());
02172 for ( int i=0 ; i<nodes_in_brick ; i++ )
02173 ::printf( "%6d",connectedExternalNodes(i) );
02174
02175
02176 printf("\n");
02177 }
02178
02179
02180
02181 void TwentyNodeBrick::reportpqtheta(int GP_numb)
02182 {
02183 short where = GP_numb-1;
02184 matpoint[where]->reportpqtheta("");
02185 }
02186
02187
02188
02189
02190
02191
02192
02193
02194
02195
02196
02197
02198
02199
02200
02201
02202 void TwentyNodeBrick::computeGaussPoint(void)
02203 {
02204
02205
02206
02207
02208 int count;
02209 count = FixedOrder*FixedOrder*FixedOrder;
02210
02211 Gsc(0) = count;
02212
02213 double r = 0.0;
02214 double s = 0.0;
02215 double t = 0.0;
02216
02217 short where = 0;
02218
02219
02220 static const int dim[] = {3, 20};
02221 static const int dim27[] = {3, count};
02222 tensor NodalCoord(2, dim, 0.0);
02223 tensor matpointCoord(2, dim27, 0.0);
02224 int h_dim[] = {60,3};
02225 tensor H(2, h_dim, 0.0);
02226
02227
02229
02230
02231
02232
02233
02234
02235
02236
02237
02238
02239
02240
02241
02242
02243
02244
02245
02246
02247
02248
02249 const Vector &nd1Crds = theNodes[0]->getCrds();
02250 const Vector &nd2Crds = theNodes[1]->getCrds();
02251 const Vector &nd3Crds = theNodes[2]->getCrds();
02252 const Vector &nd4Crds = theNodes[3]->getCrds();
02253
02254 const Vector &nd5Crds = theNodes[4]->getCrds();
02255 const Vector &nd6Crds = theNodes[5]->getCrds();
02256 const Vector &nd7Crds = theNodes[6]->getCrds();
02257 const Vector &nd8Crds = theNodes[7]->getCrds();
02258
02259 const Vector &nd9Crds = theNodes[8]->getCrds();
02260 const Vector &nd10Crds = theNodes[9]->getCrds();
02261 const Vector &nd11Crds = theNodes[10]->getCrds();
02262 const Vector &nd12Crds = theNodes[11]->getCrds();
02263
02264 const Vector &nd13Crds = theNodes[12]->getCrds();
02265 const Vector &nd14Crds = theNodes[13]->getCrds();
02266 const Vector &nd15Crds = theNodes[14]->getCrds();
02267 const Vector &nd16Crds = theNodes[15]->getCrds();
02268
02269 const Vector &nd17Crds = theNodes[16]->getCrds();
02270 const Vector &nd18Crds = theNodes[17]->getCrds();
02271 const Vector &nd19Crds = theNodes[18]->getCrds();
02272 const Vector &nd20Crds = theNodes[19]->getCrds();
02273
02274 NodalCoord.val(1, 1)=nd1Crds( 0); NodalCoord.val(2, 1)=nd1Crds( 1); NodalCoord.val(3, 1)=nd1Crds( 2);
02275 NodalCoord.val(1, 2)=nd2Crds( 0); NodalCoord.val(2, 2)=nd2Crds( 1); NodalCoord.val(3, 2)=nd2Crds( 2);
02276 NodalCoord.val(1, 3)=nd3Crds( 0); NodalCoord.val(2, 3)=nd3Crds( 1); NodalCoord.val(3, 3)=nd3Crds( 2);
02277 NodalCoord.val(1, 4)=nd4Crds( 0); NodalCoord.val(2, 4)=nd4Crds( 1); NodalCoord.val(3, 4)=nd4Crds( 2);
02278 NodalCoord.val(1, 5)=nd5Crds( 0); NodalCoord.val(2, 5)=nd5Crds( 1); NodalCoord.val(3, 5)=nd5Crds( 2);
02279 NodalCoord.val(1, 6)=nd6Crds( 0); NodalCoord.val(2, 6)=nd6Crds( 1); NodalCoord.val(3, 6)=nd6Crds( 2);
02280 NodalCoord.val(1, 7)=nd7Crds( 0); NodalCoord.val(2, 7)=nd7Crds( 1); NodalCoord.val(3, 7)=nd7Crds( 2);
02281 NodalCoord.val(1, 8)=nd8Crds( 0); NodalCoord.val(2, 8)=nd8Crds( 1); NodalCoord.val(3, 8)=nd8Crds( 2);
02282 NodalCoord.val(1, 9)=nd9Crds( 0); NodalCoord.val(2, 9)=nd9Crds( 1); NodalCoord.val(3, 9)=nd9Crds( 2);
02283 NodalCoord.val(1,10)=nd10Crds(0); NodalCoord.val(2,10)=nd10Crds(1); NodalCoord.val(3,10)=nd10Crds(2);
02284 NodalCoord.val(1,11)=nd11Crds(0); NodalCoord.val(2,11)=nd11Crds(1); NodalCoord.val(3,11)=nd11Crds(2);
02285 NodalCoord.val(1,12)=nd12Crds(0); NodalCoord.val(2,12)=nd12Crds(1); NodalCoord.val(3,12)=nd12Crds(2);
02286 NodalCoord.val(1,13)=nd13Crds(0); NodalCoord.val(2,13)=nd13Crds(1); NodalCoord.val(3,13)=nd13Crds(2);
02287 NodalCoord.val(1,14)=nd14Crds(0); NodalCoord.val(2,14)=nd14Crds(1); NodalCoord.val(3,14)=nd14Crds(2);
02288 NodalCoord.val(1,15)=nd15Crds(0); NodalCoord.val(2,15)=nd15Crds(1); NodalCoord.val(3,15)=nd15Crds(2);
02289 NodalCoord.val(1,16)=nd16Crds(0); NodalCoord.val(2,16)=nd16Crds(1); NodalCoord.val(3,16)=nd16Crds(2);
02290 NodalCoord.val(1,17)=nd17Crds(0); NodalCoord.val(2,17)=nd17Crds(1); NodalCoord.val(3,17)=nd17Crds(2);
02291 NodalCoord.val(1,18)=nd18Crds(0); NodalCoord.val(2,18)=nd18Crds(1); NodalCoord.val(3,18)=nd18Crds(2);
02292 NodalCoord.val(1,19)=nd19Crds(0); NodalCoord.val(2,19)=nd19Crds(1); NodalCoord.val(3,19)=nd19Crds(2);
02293 NodalCoord.val(1,20)=nd20Crds(0); NodalCoord.val(2,20)=nd20Crds(1); NodalCoord.val(3,20)=nd20Crds(2);
02294
02295
02296
02297 for( short GP_c_r = 1 ; GP_c_r <= r_integration_order ; GP_c_r++ )
02298 {
02299 r = get_Gauss_p_c( r_integration_order, GP_c_r );
02300 for( short GP_c_s = 1 ; GP_c_s <= s_integration_order ; GP_c_s++ )
02301 {
02302 s = get_Gauss_p_c( s_integration_order, GP_c_s );
02303 for( short GP_c_t = 1 ; GP_c_t <= t_integration_order ; GP_c_t++ )
02304 {
02305 t = get_Gauss_p_c( t_integration_order, GP_c_t );
02306
02307
02308 where =
02309 ((GP_c_r-1)*s_integration_order+GP_c_s-1)*t_integration_order+GP_c_t-1;
02310
02311
02312 H = H_3D(r,s,t);
02313
02314
02315 for (int encount=1 ; encount <= nodes_in_brick; encount++ )
02316
02317 {
02318
02319
02320
02321 matpointCoord.val(1,where+1) +=NodalCoord.val(1,encount) * H.val(encount*3-2,1);
02322
02323 matpointCoord.val(2,where+1) +=NodalCoord.val(2,encount) * H.val(encount*3-1,2);
02324 matpointCoord.val(3,where+1) +=NodalCoord.val(3,encount) * H.val(encount*3-0,3);
02325 }
02326
02327
02328
02329
02330
02331
02332 Gsc(where*3+1) = matpointCoord.val(1,where+1);
02333 Gsc(where*3+2) = matpointCoord.val(2,where+1);
02334 Gsc(where*3+3) = matpointCoord.val(3,where+1);
02335
02336
02337 }
02338 }
02339 }
02340
02341
02342 }
02343
02344
02346
02347
02348
02349
02350
02351 void TwentyNodeBrick::reportTensorF(FILE * fp)
02352 {
02353
02354
02355
02356
02357 double r = 0.0;
02358 double s = 0.0;
02359 double t = 0.0;
02360
02361 short where = 0;
02362
02363
02364 static const int dim[] = {3, 20};
02365 tensor NodalCoord(2, dim, 0.0);
02366 tensor matpointCoord(2, dim, 0.0);
02367 int h_dim[] = {60,3};
02368
02369 tensor H(2, h_dim, 0.0);
02370
02371
02372
02373
02374
02375
02376
02377
02378
02379
02380
02381
02382
02383
02384
02385
02386
02387
02388
02389
02390
02391
02392 const Vector &nd1Crds = theNodes[0]->getCrds();
02393 const Vector &nd2Crds = theNodes[1]->getCrds();
02394 const Vector &nd3Crds = theNodes[2]->getCrds();
02395 const Vector &nd4Crds = theNodes[3]->getCrds();
02396 const Vector &nd5Crds = theNodes[4]->getCrds();
02397 const Vector &nd6Crds = theNodes[5]->getCrds();
02398 const Vector &nd7Crds = theNodes[6]->getCrds();
02399 const Vector &nd8Crds = theNodes[7]->getCrds();
02400 const Vector &nd9Crds = theNodes[8]->getCrds();
02401 const Vector &nd10Crds = theNodes[9]->getCrds();
02402 const Vector &nd11Crds = theNodes[10]->getCrds();
02403 const Vector &nd12Crds = theNodes[11]->getCrds();
02404 const Vector &nd13Crds = theNodes[12]->getCrds();
02405 const Vector &nd14Crds = theNodes[13]->getCrds();
02406 const Vector &nd15Crds = theNodes[14]->getCrds();
02407 const Vector &nd16Crds = theNodes[15]->getCrds();
02408 const Vector &nd17Crds = theNodes[16]->getCrds();
02409 const Vector &nd18Crds = theNodes[17]->getCrds();
02410 const Vector &nd19Crds = theNodes[18]->getCrds();
02411 const Vector &nd20Crds = theNodes[19]->getCrds();
02412
02413 NodalCoord.val(1,1)=nd1Crds(0); NodalCoord.val(2,1)=nd1Crds(1); NodalCoord.val(3,1)=nd1Crds(2);
02414 NodalCoord.val(1,2)=nd2Crds(0); NodalCoord.val(2,2)=nd2Crds(1); NodalCoord.val(3,2)=nd2Crds(2);
02415 NodalCoord.val(1,3)=nd3Crds(0); NodalCoord.val(2,3)=nd3Crds(1); NodalCoord.val(3,3)=nd3Crds(2);
02416 NodalCoord.val(1,4)=nd4Crds(0); NodalCoord.val(2,4)=nd4Crds(1); NodalCoord.val(3,4)=nd4Crds(2);
02417 NodalCoord.val(1,5)=nd5Crds(0); NodalCoord.val(2,5)=nd5Crds(1); NodalCoord.val(3,5)=nd5Crds(2);
02418 NodalCoord.val(1,6)=nd6Crds(0); NodalCoord.val(2,6)=nd6Crds(1); NodalCoord.val(3,6)=nd6Crds(2);
02419 NodalCoord.val(1,7)=nd7Crds(0); NodalCoord.val(2,7)=nd7Crds(1); NodalCoord.val(3,7)=nd7Crds(2);
02420 NodalCoord.val(1,8)=nd8Crds(0); NodalCoord.val(2,8)=nd8Crds(1); NodalCoord.val(3,8)=nd8Crds(2);
02421 NodalCoord.val(1,9)=nd9Crds(0); NodalCoord.val(2,9)=nd9Crds(1); NodalCoord.val(3,9)=nd9Crds(2);
02422 NodalCoord.val(1,10)=nd10Crds(0); NodalCoord.val(2,10)=nd10Crds(1); NodalCoord.val(3,10)=nd10Crds(2);
02423 NodalCoord.val(1,11)=nd11Crds(0); NodalCoord.val(2,11)=nd11Crds(1); NodalCoord.val(3,11)=nd11Crds(2);
02424 NodalCoord.val(1,12)=nd12Crds(0); NodalCoord.val(2,12)=nd12Crds(1); NodalCoord.val(3,12)=nd12Crds(2);
02425 NodalCoord.val(1,13)=nd13Crds(0); NodalCoord.val(2,13)=nd13Crds(1); NodalCoord.val(3,13)=nd13Crds(2);
02426 NodalCoord.val(1,14)=nd14Crds(0); NodalCoord.val(2,14)=nd14Crds(1); NodalCoord.val(3,14)=nd14Crds(2);
02427 NodalCoord.val(1,15)=nd15Crds(0); NodalCoord.val(2,15)=nd15Crds(1); NodalCoord.val(3,15)=nd15Crds(2);
02428 NodalCoord.val(1,16)=nd16Crds(0); NodalCoord.val(2,16)=nd16Crds(1); NodalCoord.val(3,16)=nd16Crds(2);
02429 NodalCoord.val(1,17)=nd17Crds(0); NodalCoord.val(2,17)=nd17Crds(1); NodalCoord.val(3,17)=nd17Crds(2);
02430 NodalCoord.val(1,18)=nd18Crds(0); NodalCoord.val(2,18)=nd18Crds(1); NodalCoord.val(3,18)=nd18Crds(2);
02431 NodalCoord.val(1,19)=nd19Crds(0); NodalCoord.val(2,19)=nd19Crds(1); NodalCoord.val(3,19)=nd19Crds(2);
02432 NodalCoord.val(1,20)=nd20Crds(0); NodalCoord.val(2,20)=nd20Crds(1); NodalCoord.val(3,20)=nd20Crds(2);
02433
02434 for( short GP_c_r = 1 ; GP_c_r <= r_integration_order ; GP_c_r++ )
02435 {
02436 r = get_Gauss_p_c( r_integration_order, GP_c_r );
02437 for( short GP_c_s = 1 ; GP_c_s <= s_integration_order ; GP_c_s++ )
02438 {
02439 s = get_Gauss_p_c( s_integration_order, GP_c_s );
02440 for( short GP_c_t = 1 ; GP_c_t <= t_integration_order ; GP_c_t++ )
02441 {
02442 t = get_Gauss_p_c( t_integration_order, GP_c_t );
02443
02444
02445 where =
02446 ((GP_c_r-1)*s_integration_order+GP_c_s-1)*t_integration_order+GP_c_t-1;
02447
02448
02449 H = H_3D(r,s,t);
02450
02451 for (int encount=1 ; encount <= nodes_in_brick ; encount++ )
02452
02453 {
02454
02455
02456
02457 matpointCoord.val(1,where+1) +=NodalCoord.val(1,encount) * H.val(encount*3-2,1);
02458
02459 matpointCoord.val(2,where+1) +=NodalCoord.val(2,encount) * H.val(encount*3-1,2);
02460 matpointCoord.val(3,where+1) +=NodalCoord.val(3,encount) * H.val(encount*3-0,3);
02461
02462 }
02463
02464 fprintf(fp, "gauss point# %d %+.6e %+.6e %+.6e \n", where+1,
02465 matpointCoord.val(1,where+1),
02466 matpointCoord.val(2,where+1),
02467 matpointCoord.val(3,where+1));
02468
02469
02470
02471
02472 }
02473 }
02474 }
02475
02476 }
02477
02478
02479
02480
02481
02482
02483
02484
02485
02486 int TwentyNodeBrick::getNumExternalNodes () const
02487 {
02488 return nodes_in_brick;
02489 }
02490
02491
02492
02493 const ID& TwentyNodeBrick::getExternalNodes ()
02494 {
02495 return connectedExternalNodes;
02496 }
02497
02498 Node **
02499 TwentyNodeBrick::getNodePtrs(void)
02500 {
02501 return theNodes;
02502 }
02503
02504
02505 int TwentyNodeBrick::getNumDOF ()
02506 {
02507 return 3*nodes_in_brick;
02508 }
02509
02510
02511 void TwentyNodeBrick::setDomain (Domain *theDomain)
02512 {
02513
02514 if (theDomain == 0) {
02515 theNodes[0] = 0;
02516 theNodes[1] = 0;
02517 theNodes[2] = 0;
02518 theNodes[3] = 0;
02519 theNodes[4] = 0;
02520 theNodes[5] = 0;
02521 theNodes[6] = 0;
02522 theNodes[7] = 0;
02523 theNodes[8] = 0;
02524 theNodes[9] = 0;
02525 theNodes[10] = 0;
02526 theNodes[11] = 0;
02527 theNodes[12] = 0;
02528 theNodes[13] = 0;
02529 theNodes[14] = 0;
02530 theNodes[15] = 0;
02531 theNodes[16] = 0;
02532 theNodes[17] = 0;
02533 theNodes[18] = 0;
02534 theNodes[19] = 0;
02535 }
02536
02537
02538 else {
02539 int Nd1 = connectedExternalNodes(0);
02540 int Nd2 = connectedExternalNodes(1);
02541 int Nd3 = connectedExternalNodes(2);
02542 int Nd4 = connectedExternalNodes(3);
02543
02544
02545 int Nd5 = connectedExternalNodes(4);
02546 int Nd6 = connectedExternalNodes(5);
02547 int Nd7 = connectedExternalNodes(6);
02548 int Nd8 = connectedExternalNodes(7);
02549 int Nd9 = connectedExternalNodes( 8);
02550 int Nd10 = connectedExternalNodes( 9);
02551 int Nd11 = connectedExternalNodes(10);
02552 int Nd12 = connectedExternalNodes(11);
02553 int Nd13 = connectedExternalNodes(12);
02554 int Nd14 = connectedExternalNodes(13);
02555 int Nd15 = connectedExternalNodes(14);
02556 int Nd16 = connectedExternalNodes(15);
02557 int Nd17 = connectedExternalNodes(16);
02558 int Nd18 = connectedExternalNodes(17);
02559 int Nd19 = connectedExternalNodes(18);
02560 int Nd20 = connectedExternalNodes(19);
02561
02562
02563 theNodes[0] = theDomain->getNode(Nd1);
02564 theNodes[1] = theDomain->getNode(Nd2);
02565 theNodes[2] = theDomain->getNode(Nd3);
02566 theNodes[3] = theDomain->getNode(Nd4);
02567 theNodes[4] = theDomain->getNode(Nd5);
02568 theNodes[5] = theDomain->getNode(Nd6);
02569 theNodes[6] = theDomain->getNode(Nd7);
02570 theNodes[7] = theDomain->getNode(Nd8);
02571 theNodes[8] = theDomain->getNode(Nd9);
02572 theNodes[9] = theDomain->getNode(Nd10);
02573 theNodes[10] = theDomain->getNode(Nd11);
02574 theNodes[11] = theDomain->getNode(Nd12);
02575 theNodes[12] = theDomain->getNode(Nd13);
02576 theNodes[13] = theDomain->getNode(Nd14);
02577 theNodes[14] = theDomain->getNode(Nd15);
02578 theNodes[15] = theDomain->getNode(Nd16);
02579 theNodes[16] = theDomain->getNode(Nd17);
02580 theNodes[17] = theDomain->getNode(Nd18);
02581 theNodes[18] = theDomain->getNode(Nd19);
02582 theNodes[19] = theDomain->getNode(Nd20);
02583
02584 if (theNodes[0] == 0 || theNodes[1] == 0 || theNodes[2] == 0 || theNodes[3] == 0 ||
02585 theNodes[4] == 0 || theNodes[5] == 0 || theNodes[6] == 0 || theNodes[7] == 0 ||
02586 theNodes[8] == 0 || theNodes[9] == 0 || theNodes[10] == 0 || theNodes[11] == 0 ||
02587 theNodes[12] == 0 || theNodes[13] == 0 || theNodes[14] == 0 || theNodes[15] == 0 ||
02588 theNodes[16] == 0 || theNodes[17] == 0 || theNodes[18] == 0 || theNodes[19] == 0 ) {
02589
02590 opserr << "FATAL ERROR TwentyNodeBrick (tag: " << this->getTag() << " ), node not found in domain\n";
02591 exit(-1);
02592 }
02593
02594 int dofNd1 = theNodes[0]->getNumberDOF();
02595 int dofNd2 = theNodes[1]->getNumberDOF();
02596 int dofNd3 = theNodes[2]->getNumberDOF();
02597 int dofNd4 = theNodes[3]->getNumberDOF();
02598 int dofNd5 = theNodes[4]->getNumberDOF();
02599 int dofNd6 = theNodes[5]->getNumberDOF();
02600 int dofNd7 = theNodes[6]->getNumberDOF();
02601 int dofNd8 = theNodes[7]->getNumberDOF();
02602 int dofNd9 = theNodes[8]->getNumberDOF();
02603 int dofNd10 = theNodes[9]->getNumberDOF();
02604 int dofNd11 = theNodes[10]->getNumberDOF();
02605 int dofNd12 = theNodes[11]->getNumberDOF();
02606 int dofNd13 = theNodes[12]->getNumberDOF();
02607 int dofNd14 = theNodes[13]->getNumberDOF();
02608 int dofNd15 = theNodes[14]->getNumberDOF();
02609 int dofNd16 = theNodes[15]->getNumberDOF();
02610 int dofNd17 = theNodes[16]->getNumberDOF();
02611 int dofNd18 = theNodes[17]->getNumberDOF();
02612 int dofNd19 = theNodes[18]->getNumberDOF();
02613 int dofNd20 = theNodes[19]->getNumberDOF();
02614
02615 if (dofNd1 != 3 || dofNd2 != 3 || dofNd3 != 3 || dofNd4 != 3 ||
02616 dofNd5 != 3 || dofNd6 != 3 || dofNd7 != 3 || dofNd8 != 3 ||
02617 dofNd9 != 3 || dofNd10 != 3 || dofNd11 != 3 || dofNd12 != 3 ||
02618 dofNd13 != 3 || dofNd14 != 3 || dofNd15 != 3 || dofNd16 != 3 ||
02619 dofNd17 != 3 || dofNd18 != 3 || dofNd19 != 3 || dofNd20 != 3 ) {
02620 opserr << "FATAL ERROR TwentyNodeBrick (tag: " << this->getTag() <<
02621 "), has differing number of DOFs at its nodes\n";
02622 exit(-1);
02623 }
02624 this->DomainComponent::setDomain(theDomain);
02625 }
02626 }
02627
02628
02629 int TwentyNodeBrick::commitState ()
02630 {
02631 int retVal = 0;
02632
02633
02634 if ((retVal = this->Element::commitState()) != 0) {
02635 opserr << "TwentyNodeBrick::commitState () - failed in base class";
02636 }
02637
02638
02639
02640 int i;
02641
02642
02643
02644 int count = r_integration_order* s_integration_order * t_integration_order;
02645
02646
02647
02648
02649
02650
02651 Vector pp = getResistingForce();
02652
02653
02654
02655 for (i = 0; i < count; i++)
02656
02657 {
02658 retVal += matpoint[i]->commitState();
02659
02660 stresstensor st;
02661 stresstensor prin;
02662 straintensor stn;
02663 straintensor stnprin;
02664
02665 st = matpoint[i]->getStressTensor();
02666 prin = st.principal();
02667 stn = matpoint[i]->getStrainTensor();
02668 stnprin = stn.principal();
02669
02670
02671
02672
02673
02674
02675
02676
02677
02678
02679 double p = -1*( prin.cval(1, 1)+ prin.cval(2, 2) +prin.cval(3, 3) )/3.0;
02680 double ev = -1*( stnprin.cval(1, 1)+ stnprin.cval(2, 2) + stnprin.cval(3, 3) )/3.0;
02681
02682
02683
02684
02685
02686
02687 double q;
02688
02689 if ( fabs(prin.cval(1, 1) - prin.cval(2, 2) ) <= 0.001 )
02690 {
02691 q = prin.cval(1, 1) - prin.cval(3, 3);
02692
02693 }
02694 else
02695 q = prin.cval(3, 3) - prin.cval(1, 1);
02696
02697
02698
02699
02701
02702
02703
02704
02705
02706
02707
02708
02709
02710
02711
02712
02713
02714
02715
02716
02717
02718
02719
02720
02721
02722
02723
02724
02725
02726
02727
02728
02729
02730
02731
02732
02733
02734
02735
02736
02737
02738
02739
02740
02741
02742
02743
02744
02745
02746 }
02747
02748
02749
02750
02751
02752
02753
02754
02755 return retVal;
02756 }
02757
02758
02759 int TwentyNodeBrick::revertToLastCommit ()
02760 {
02761
02762 int i;
02763
02764 int retVal = 0;
02765
02766
02767 int count = r_integration_order* s_integration_order * t_integration_order;
02768
02769
02770
02771
02772
02773
02774 for (i = 0; i < count; i++)
02775 retVal += matpoint[i]->revertToLastCommit();
02776
02777
02778 return retVal;
02779 }
02780
02781
02782 int TwentyNodeBrick::revertToStart ()
02783 {
02784 int i;
02785 int retVal = 0;
02786
02787
02788
02789
02790
02791
02792
02793
02794 int count = r_integration_order* s_integration_order * t_integration_order;
02795
02796 for (i = 0; i < count; i++)
02797 retVal += matpoint[i]->revertToStart();
02798
02799
02800 return retVal;
02801
02802
02803 }
02804
02805
02806
02807 const Matrix &TwentyNodeBrick::getTangentStiff ()
02808 {
02809 tensor stifftensor = getStiffnessTensor();
02810 int Ki=0;
02811 int Kj=0;
02812
02813 for ( int i=1 ; i<=nodes_in_brick ; i++ )
02814 {
02815 for ( int j=1 ; j<=nodes_in_brick ; j++ )
02816 {
02817 for ( int k=1 ; k<=3 ; k++ )
02818 {
02819 for ( int l=1 ; l<=3 ; l++ )
02820 {
02821 Ki = k+3*(i-1);
02822 Kj = l+3*(j-1);
02823 K( Ki-1 , Kj-1 ) = stifftensor.cval(i,k,l,j);
02824 }
02825 }
02826 }
02827 }
02828
02829
02830
02831 return K;
02832 }
02833
02834
02835 const Matrix &TwentyNodeBrick::getInitialStiff ()
02836 {
02837
02838 return this->getTangentStiff();
02839 }
02840
02841
02842
02843
02844 const Matrix &TwentyNodeBrick::getConsMass ()
02845 {
02846 tensor masstensor = getMassTensor();
02847
02848
02849
02850
02851
02852 double column_mass;
02853
02854 for ( int i=1 ; i<=nodes_in_brick*3 ; i++ )
02855 {
02856 column_mass = 0.0;
02857 for ( int j=1 ; j<=nodes_in_brick*3 ; j++ )
02858 {
02859
02860
02861
02862 column_mass += masstensor.cval(i,j);
02863 M( i-1 , j-1 ) = 0;
02864
02865
02866
02867 }
02868 M( i-1 , i-1 ) = column_mass;
02869
02870 }
02871
02872
02873
02874
02875
02876 return M;
02877 }
02878
02879
02880
02881
02882 const Matrix &TwentyNodeBrick::getMass ()
02883 {
02884 tensor masstensor = getMassTensor();
02885
02886
02887
02888
02889
02890
02891
02892 for ( int i=1 ; i<=nodes_in_brick*3 ; i++ )
02893 {
02894
02895 for ( int j=1 ; j<=nodes_in_brick*3 ; j++ )
02896 {
02897 M( i-1 , j-1 ) = masstensor.cval(i,j);
02898
02899
02900
02901
02902
02903
02904 }
02905
02906
02907 }
02908
02909
02910
02911
02912
02913 return M;
02914 }
02915
02916
02917 void TwentyNodeBrick::zeroLoad(void)
02918 {
02919 Q.Zero();
02920 }
02921
02922
02923
02924 int
02925 TwentyNodeBrick::addLoad(ElementalLoad *theLoad, double loadFactor)
02926 {
02927
02928
02929
02930 int type;
02931 const Vector &data = theLoad->getData(type, loadFactor);
02932 if (type == LOAD_TAG_BrickSelfWeight) {
02933
02934 Vector bforce(60);
02935
02936
02937 if (rho == 0.0)
02938 return 0;
02939
02940 Vector ba(60), bfx(3);
02941 bfx(0) = bf(0) * loadFactor;
02942 bfx(1) = bf(1) * loadFactor;
02943 bfx(2) = bf(2) * loadFactor;
02944
02945 ba( 0) = bfx(0);
02946 ba( 1) = bfx(1);
02947 ba( 2) = bfx(2);
02948 ba( 3) = bfx(0);
02949 ba( 4) = bfx(1);
02950 ba( 5) = bfx(2);
02951 ba( 6) = bfx(0);
02952 ba( 7) = bfx(1);
02953 ba( 8) = bfx(2);
02954 ba( 9) = bfx(0);
02955 ba(10) = bfx(1);
02956 ba(11) = bfx(2);
02957 ba(12) = bfx(0);
02958 ba(13) = bfx(1);
02959 ba(14) = bfx(2);
02960 ba(15) = bfx(0);
02961 ba(16) = bfx(1);
02962 ba(17) = bfx(2);
02963 ba(18) = bfx(0);
02964 ba(19) = bfx(1);
02965 ba(20) = bfx(2);
02966 ba(21) = bfx(0);
02967 ba(22) = bfx(1);
02968 ba(23) = bfx(2);
02969 ba(24) = bfx(0);
02970 ba(25) = bfx(1);
02971 ba(26) = bfx(2);
02972 ba(27) = bfx(0);
02973 ba(28) = bfx(1);
02974 ba(29) = bfx(2);
02975 ba(30) = bfx(0);
02976 ba(31) = bfx(1);
02977 ba(32) = bfx(2);
02978 ba(33) = bfx(0);
02979 ba(34) = bfx(1);
02980 ba(35) = bfx(2);
02981 ba(36) = bfx(0);
02982 ba(37) = bfx(1);
02983 ba(38) = bfx(2);
02984 ba(39) = bfx(0);
02985 ba(40) = bfx(1);
02986 ba(41) = bfx(2);
02987 ba(42) = bfx(0);
02988 ba(43) = bfx(1);
02989 ba(44) = bfx(2);
02990 ba(45) = bfx(0);
02991 ba(46) = bfx(1);
02992 ba(47) = bfx(2);
02993 ba(48) = bfx(0);
02994 ba(49) = bfx(1);
02995 ba(50) = bfx(2);
02996 ba(51) = bfx(0);
02997 ba(52) = bfx(1);
02998 ba(53) = bfx(2);
02999 ba(54) = bfx(0);
03000 ba(55) = bfx(1);
03001 ba(56) = bfx(2);
03002 ba(57) = bfx(0);
03003 ba(58) = bfx(1);
03004 ba(59) = bfx(2);
03005
03006
03007 this->getMass();
03008 bforce.addMatrixVector(0.0, M, ba, 1.0);
03009 Q.addVector(1.0, bforce, 1.0);
03010 } else {
03011 opserr << "TwentyNodeBrick::addLoad() - 20NodeBrick " << this->getTag() <<
03012 ",load type " << type << " unknown\n";
03013 return -1;
03014 }
03015
03016 return 0;
03017 }
03018
03019
03021
03022
03023
03024
03025
03026
03027
03028
03029
03030
03031
03032
03033
03034
03035
03036 int TwentyNodeBrick::addInertiaLoadToUnbalance(const Vector &accel)
03037 {
03038
03039 if (rho == 0.0)
03040 return 0;
03041
03042
03043 const Vector &Raccel1 = theNodes[0]->getRV(accel);
03044 const Vector &Raccel2 = theNodes[1]->getRV(accel);
03045 const Vector &Raccel3 = theNodes[2]->getRV(accel);
03046 const Vector &Raccel4 = theNodes[3]->getRV(accel);
03047 const Vector &Raccel5 = theNodes[4]->getRV(accel);
03048 const Vector &Raccel6 = theNodes[5]->getRV(accel);
03049 const Vector &Raccel7 = theNodes[6]->getRV(accel);
03050 const Vector &Raccel8 = theNodes[7]->getRV(accel);
03051 const Vector &Raccel9 = theNodes[8]->getRV(accel);
03052 const Vector &Raccel10 = theNodes[9]->getRV(accel);
03053 const Vector &Raccel11 = theNodes[10]->getRV(accel);
03054 const Vector &Raccel12 = theNodes[11]->getRV(accel);
03055 const Vector &Raccel13 = theNodes[12]->getRV(accel);
03056 const Vector &Raccel14 = theNodes[13]->getRV(accel);
03057 const Vector &Raccel15 = theNodes[14]->getRV(accel);
03058 const Vector &Raccel16 = theNodes[15]->getRV(accel);
03059 const Vector &Raccel17 = theNodes[16]->getRV(accel);
03060 const Vector &Raccel18 = theNodes[17]->getRV(accel);
03061 const Vector &Raccel19 = theNodes[18]->getRV(accel);
03062 const Vector &Raccel20 = theNodes[19]->getRV(accel);
03063
03064 if (3 != Raccel1.Size() || 3 != Raccel2.Size() || 3 != Raccel3.Size() || 3 != Raccel4.Size() ||
03065 3 != Raccel5.Size() || 3 != Raccel6.Size() || 3 != Raccel7.Size() || 3 != Raccel8.Size() ||
03066 3 != Raccel9.Size() || 3 != Raccel10.Size() || 3 != Raccel11.Size() || 3 != Raccel12.Size()||
03067 3 != Raccel13.Size() || 3 != Raccel14.Size() || 3 != Raccel15.Size() || 3 != Raccel16.Size()||
03068 3 != Raccel17.Size() || 3 != Raccel18.Size() || 3 != Raccel19.Size() || 3 != Raccel20.Size() ){
03069
03070 opserr << "TwentyNodeBrick::addInertiaLoadToUnbalance " <<
03071 "matrix and vector sizes are incompatable\n";
03072 return -1;
03073 }
03074
03075 static Vector ra(60);
03076
03077 ra( 0) = Raccel1(0);
03078 ra( 1) = Raccel1(1);
03079 ra( 2) = Raccel1(2);
03080 ra( 3) = Raccel2(0);
03081 ra( 4) = Raccel2(1);
03082 ra( 5) = Raccel2(2);
03083 ra( 6) = Raccel3(0);
03084 ra( 7) = Raccel3(1);
03085 ra( 8) = Raccel3(2);
03086 ra( 9) = Raccel4(0);
03087 ra(10) = Raccel4(1);
03088 ra(11) = Raccel4(2);
03089 ra(12) = Raccel5(0);
03090 ra(13) = Raccel5(1);
03091 ra(14) = Raccel5(2);
03092 ra(15) = Raccel6(0);
03093 ra(16) = Raccel6(1);
03094 ra(17) = Raccel6(2);
03095 ra(18) = Raccel7(0);
03096 ra(19) = Raccel7(1);
03097 ra(20) = Raccel7(2);
03098 ra(21) = Raccel8(0);
03099 ra(22) = Raccel8(1);
03100 ra(23) = Raccel8(2);
03101 ra(24) = Raccel9(0);
03102 ra(25) = Raccel9(1);
03103 ra(26) = Raccel9(2);
03104 ra(27) = Raccel10(0);
03105 ra(28) = Raccel10(1);
03106 ra(29) = Raccel10(2);
03107 ra(30) = Raccel11(0);
03108 ra(31) = Raccel11(1);
03109 ra(32) = Raccel11(2);
03110 ra(33) = Raccel12(0);
03111 ra(34) = Raccel12(1);
03112 ra(35) = Raccel12(2);
03113 ra(36) = Raccel13(0);
03114 ra(37) = Raccel13(1);
03115 ra(38) = Raccel13(2);
03116 ra(39) = Raccel14(0);
03117 ra(40) = Raccel14(1);
03118 ra(41) = Raccel14(2);
03119 ra(42) = Raccel15(0);
03120 ra(43) = Raccel15(1);
03121 ra(44) = Raccel15(2);
03122 ra(45) = Raccel16(0);
03123 ra(46) = Raccel16(1);
03124 ra(47) = Raccel16(2);
03125 ra(48) = Raccel17(0);
03126 ra(49) = Raccel17(1);
03127 ra(50) = Raccel17(2);
03128 ra(51) = Raccel18(0);
03129 ra(52) = Raccel18(1);
03130 ra(53) = Raccel18(2);
03131 ra(54) = Raccel19(0);
03132 ra(55) = Raccel19(1);
03133 ra(56) = Raccel19(2);
03134 ra(57) = Raccel20(0);
03135 ra(58) = Raccel20(1);
03136 ra(59) = Raccel20(2);
03137
03138
03139
03140
03141
03142
03143
03144
03145
03146
03147
03148
03149
03150
03151
03152 Q.addMatrixVector(1.0, M, ra, -1.0);
03153
03154 return 0;
03155 }
03156
03157
03158 const Vector TwentyNodeBrick::FormEquiBodyForce(void)
03159 {
03160 Vector bforce(60);
03161
03162
03163
03164 if (rho == 0.0)
03165 return bforce;
03166
03167 Vector ba(60);
03168
03169 ba( 0) = bf(0);
03170 ba( 1) = bf(1);
03171 ba( 2) = bf(2);
03172 ba( 3) = bf(0);
03173 ba( 4) = bf(1);
03174 ba( 5) = bf(2);
03175 ba( 6) = bf(0);
03176 ba( 7) = bf(1);
03177 ba( 8) = bf(2);
03178 ba( 9) = bf(0);
03179 ba(10) = bf(1);
03180 ba(11) = bf(2);
03181 ba(12) = bf(0);
03182 ba(13) = bf(1);
03183 ba(14) = bf(2);
03184 ba(15) = bf(0);
03185 ba(16) = bf(1);
03186 ba(17) = bf(2);
03187 ba(18) = bf(0);
03188 ba(19) = bf(1);
03189 ba(20) = bf(2);
03190 ba(21) = bf(0);
03191 ba(22) = bf(1);
03192 ba(23) = bf(2);
03193 ba(24) = bf(0);
03194 ba(25) = bf(1);
03195 ba(26) = bf(2);
03196 ba(27) = bf(0);
03197 ba(28) = bf(1);
03198 ba(29) = bf(2);
03199 ba(30) = bf(0);
03200 ba(31) = bf(1);
03201 ba(32) = bf(2);
03202 ba(33) = bf(0);
03203 ba(34) = bf(1);
03204 ba(35) = bf(2);
03205 ba(36) = bf(0);
03206 ba(37) = bf(1);
03207 ba(38) = bf(2);
03208 ba(39) = bf(0);
03209 ba(40) = bf(1);
03210 ba(41) = bf(2);
03211 ba(42) = bf(0);
03212 ba(43) = bf(1);
03213 ba(44) = bf(2);
03214 ba(45) = bf(0);
03215 ba(46) = bf(1);
03216 ba(47) = bf(2);
03217 ba(48) = bf(0);
03218 ba(49) = bf(1);
03219 ba(50) = bf(2);
03220 ba(51) = bf(0);
03221 ba(52) = bf(1);
03222 ba(53) = bf(2);
03223 ba(54) = bf(0);
03224 ba(55) = bf(1);
03225 ba(56) = bf(2);
03226 ba(57) = bf(0);
03227 ba(58) = bf(1);
03228 ba(59) = bf(2);
03229
03230
03231 bforce.addMatrixVector(0.0, M, ba, 1.0);
03232
03233
03234
03235
03236
03237 return bforce;
03238 }
03239
03240
03241
03242
03243
03244
03245
03246
03247
03248
03249
03250
03251
03252
03253
03254
03255
03256
03257
03258
03259
03260
03261
03262
03263
03264
03265
03266
03267
03268
03269
03270
03271
03272
03273
03274
03275
03276
03277
03278
03279
03280
03281
03282
03283
03284
03285
03286
03287
03288
03289 const Vector &TwentyNodeBrick::getResistingForce ()
03290 {
03291 int force_dim[] = {20,3};
03292 tensor nodalforces(2,force_dim,0.0);
03293
03294 nodalforces = nodal_forces();
03295
03296
03297 for (int i = 0; i< nodes_in_brick; i++)
03298 for (int j = 0; j < 3; j++)
03299 P(i *3 + j) = nodalforces.cval(i+1, j+1);
03300
03301
03302
03303
03304 P = P - Q;
03305
03306
03307 return P;
03308 }
03309
03310
03311 const Vector &TwentyNodeBrick::getResistingForceIncInertia ()
03312 {
03313
03314 this->getResistingForce();
03315
03316
03317
03318
03319
03320
03321 if (rho != 0.0) {
03322
03323
03324 this->getMass();
03325
03326 const Vector &accel1 = theNodes[0]->getTrialAccel();
03327 const Vector &accel2 = theNodes[1]->getTrialAccel();
03328 const Vector &accel3 = theNodes[2]->getTrialAccel();
03329 const Vector &accel4 = theNodes[3]->getTrialAccel();
03330 const Vector &accel5 = theNodes[4]->getTrialAccel();
03331 const Vector &accel6 = theNodes[5]->getTrialAccel();
03332 const Vector &accel7 = theNodes[6]->getTrialAccel();
03333 const Vector &accel8 = theNodes[7]->getTrialAccel();
03334 const Vector &accel9 = theNodes[8]->getTrialAccel();
03335 const Vector &accel10 = theNodes[9]->getTrialAccel();
03336 const Vector &accel11 = theNodes[10]->getTrialAccel();
03337 const Vector &accel12 = theNodes[11]->getTrialAccel();
03338 const Vector &accel13 = theNodes[12]->getTrialAccel();
03339 const Vector &accel14 = theNodes[13]->getTrialAccel();
03340 const Vector &accel15 = theNodes[14]->getTrialAccel();
03341 const Vector &accel16 = theNodes[15]->getTrialAccel();
03342 const Vector &accel17 = theNodes[16]->getTrialAccel();
03343 const Vector &accel18 = theNodes[17]->getTrialAccel();
03344 const Vector &accel19 = theNodes[18]->getTrialAccel();
03345 const Vector &accel20 = theNodes[19]->getTrialAccel();
03346
03347 static Vector a(60);
03348
03349 a( 0) = accel1(0);
03350 a( 1) = accel1(1);
03351 a( 2) = accel1(2);
03352 a( 3) = accel2(0);
03353 a( 4) = accel2(1);
03354 a( 5) = accel2(2);
03355 a( 6) = accel3(0);
03356 a( 7) = accel3(1);
03357 a( 8) = accel3(2);
03358 a( 9) = accel4(0);
03359 a(10) = accel4(1);
03360 a(11) = accel4(2);
03361 a(12) = accel5(0);
03362 a(13) = accel5(1);
03363 a(14) = accel5(2);
03364 a(15) = accel6(0);
03365 a(16) = accel6(1);
03366 a(17) = accel6(2);
03367 a(18) = accel7(0);
03368 a(19) = accel7(1);
03369 a(20) = accel7(2);
03370 a(21) = accel8(0);
03371 a(22) = accel8(1);
03372 a(23) = accel8(2);
03373 a(24) = accel9(0);
03374 a(25) = accel9(1);
03375 a(26) = accel9(2);
03376 a(27) = accel10(0);
03377 a(28) = accel10(1);
03378 a(29) = accel10(2);
03379 a(30) = accel11(0);
03380 a(31) = accel11(1);
03381 a(32) = accel11(2);
03382 a(33) = accel12(0);
03383 a(34) = accel12(1);
03384 a(35) = accel12(2);
03385 a(36) = accel13(0);
03386 a(37) = accel13(1);
03387 a(38) = accel13(2);
03388 a(39) = accel14(0);
03389 a(40) = accel14(1);
03390 a(41) = accel14(2);
03391 a(42) = accel15(0);
03392 a(43) = accel15(1);
03393 a(44) = accel15(2);
03394 a(45) = accel16(0);
03395 a(46) = accel16(1);
03396 a(47) = accel16(2);
03397 a(48) = accel17(0);
03398 a(49) = accel17(1);
03399 a(50) = accel17(2);
03400 a(51) = accel18(0);
03401 a(52) = accel18(1);
03402 a(53) = accel18(2);
03403 a(54) = accel19(0);
03404 a(55) = accel19(1);
03405 a(56) = accel19(2);
03406 a(57) = accel20(0);
03407 a(58) = accel20(1);
03408 a(59) = accel20(2);
03409
03410
03411 P.addMatrixVector(1.0, M, a, 1.0);
03412
03413
03414 if (alphaM != 0.0 || betaK != 0.0 || betaK0 != 0.0 || betaKc != 0.0)
03415 P += this->getRayleighDampingForces();
03416
03417 } else {
03418
03419
03420 if (betaK != 0.0 || betaK0 != 0.0 || betaKc != 0.0)
03421 P += this->getRayleighDampingForces();
03422
03423 }
03424
03425 return P;
03426 }
03427
03428
03429 int TwentyNodeBrick::sendSelf (int commitTag, Channel &theChannel)
03430 {
03431
03432 return 0;
03433 }
03434
03435
03436 int TwentyNodeBrick::recvSelf (int commitTag, Channel &theChannel, FEM_ObjectBroker &theBroker)
03437 {
03438
03439 return 0;
03440 }
03441
03442
03443
03444 int TwentyNodeBrick::displaySelf (Renderer &theViewer, int displayMode, float fact)
03445 {
03446
03447
03448
03449
03450
03451 const Vector &end1Crd = theNodes[0]->getCrds();
03452 const Vector &end2Crd = theNodes[1]->getCrds();
03453 const Vector &end3Crd = theNodes[2]->getCrds();
03454 const Vector &end4Crd = theNodes[3]->getCrds();
03455 const Vector &end5Crd = theNodes[4]->getCrds();
03456 const Vector &end6Crd = theNodes[5]->getCrds();
03457 const Vector &end7Crd = theNodes[6]->getCrds();
03458 const Vector &end8Crd = theNodes[7]->getCrds();
03459
03460 const Vector &end1Disp = theNodes[0]->getDisp();
03461 const Vector &end2Disp = theNodes[1]->getDisp();
03462 const Vector &end3Disp = theNodes[2]->getDisp();
03463 const Vector &end4Disp = theNodes[3]->getDisp();
03464 const Vector &end5Disp = theNodes[4]->getDisp();
03465 const Vector &end6Disp = theNodes[5]->getDisp();
03466 const Vector &end7Disp = theNodes[6]->getDisp();
03467 const Vector &end8Disp = theNodes[7]->getDisp();
03468
03469 static Vector v1(3);
03470 static Vector v2(3);
03471 static Vector v3(3);
03472 static Vector v4(3);
03473 static Vector v5(3);
03474 static Vector v6(3);
03475 static Vector v7(3);
03476 static Vector v8(3);
03477
03478 for (int i = 0; i < 2; i++)
03479 {
03480 v1(i) = end1Crd(i) + end1Disp(i)*fact;
03481 v2(i) = end2Crd(i) + end2Disp(i)*fact;
03482 v3(i) = end3Crd(i) + end3Disp(i)*fact;
03483 v4(i) = end4Crd(i) + end4Disp(i)*fact;
03484 v5(i) = end5Crd(i) + end5Disp(i)*fact;
03485 v6(i) = end6Crd(i) + end6Disp(i)*fact;
03486 v7(i) = end7Crd(i) + end7Disp(i)*fact;
03487 v8(i) = end8Crd(i) + end8Disp(i)*fact;
03488 }
03489
03490 int error = 0;
03491
03492 error += theViewer.drawLine (v1, v2, 1.0, 1.0);
03493 error += theViewer.drawLine (v2, v3, 1.0, 1.0);
03494 error += theViewer.drawLine (v3, v4, 1.0, 1.0);
03495 error += theViewer.drawLine (v4, v1, 1.0, 1.0);
03496
03497 error += theViewer.drawLine (v5, v6, 1.0, 1.0);
03498 error += theViewer.drawLine (v6, v7, 1.0, 1.0);
03499 error += theViewer.drawLine (v7, v8, 1.0, 1.0);
03500 error += theViewer.drawLine (v8, v5, 1.0, 1.0);
03501
03502 error += theViewer.drawLine (v1, v5, 1.0, 1.0);
03503 error += theViewer.drawLine (v2, v6, 1.0, 1.0);
03504 error += theViewer.drawLine (v3, v7, 1.0, 1.0);
03505 error += theViewer.drawLine (v4, v8, 1.0, 1.0);
03506
03507 return error;
03508
03509 }
03510
03511
03512 void TwentyNodeBrick::Print(OPS_Stream &s, int flag)
03513 {
03514
03515 s << "TwentyNodeBrick, element id: " << this->getTag() << endln;
03516 s << "Connected external nodes: " << connectedExternalNodes;
03517
03518 int total_number_of_Gauss_points = r_integration_order*
03519 s_integration_order*
03520 t_integration_order;
03521 if ( total_number_of_Gauss_points != 0 )
03522 {
03523 theNodes[0]->Print(opserr);
03524 theNodes[1]->Print(opserr);
03525 theNodes[2]->Print(opserr);
03526 theNodes[3]->Print(opserr);
03527 theNodes[4]->Print(opserr);
03528 theNodes[5]->Print(opserr);
03529 theNodes[6]->Print(opserr);
03530 theNodes[7]->Print(opserr);
03531 theNodes[8]->Print(opserr);
03532 theNodes[9]->Print(opserr);
03533 theNodes[10]->Print(opserr);
03534 theNodes[11]->Print(opserr);
03535 theNodes[12]->Print(opserr);
03536 theNodes[13]->Print(opserr);
03537 theNodes[14]->Print(opserr);
03538 theNodes[15]->Print(opserr);
03539 theNodes[16]->Print(opserr);
03540 theNodes[17]->Print(opserr);
03541 theNodes[18]->Print(opserr);
03542 theNodes[19]->Print(opserr);
03543
03544 }
03545 s << "Element mass density: " << rho << endln << endln;
03546 s << "Material model: " << endln;
03547
03548 for( int GP_c_r = 1 ; GP_c_r <= r_integration_order ; GP_c_r++ )
03549 {
03550 for( int GP_c_s = 1 ; GP_c_s <= s_integration_order ; GP_c_s++ )
03551 {
03552 for( int GP_c_t = 1 ; GP_c_t <= t_integration_order ; GP_c_t++ )
03553 {
03554
03555
03556 short where =
03557 ((GP_c_r-1)*s_integration_order+GP_c_s-1)*t_integration_order+GP_c_t-1;
03558
03559 s << "\n where = " << where << endln;
03560 s << " GP_c_r= " << GP_c_r << "GP_c_s = " << GP_c_s << " GP_c_t = " << GP_c_t << endln;
03561 matpoint[where]->report("Material Point\n");
03562
03563
03564
03565 }
03566 }
03567 }
03568
03569 }
03570
03571
03572 Response *
03573 TwentyNodeBrick::setResponse (const char **argv, int argc, Information &eleInformation, OPS_Stream &output)
03574 {
03575
03576 Response *theResponse = 0;
03577
03578 char outputData[32];
03579
03580 output.tag("ElementOutput");
03581 output.attr("eleType","TwentyNodeBrick");
03582 output.attr("eleTag",this->getTag());
03583 for (int i=1; i<=20; i++) {
03584 sprintf(outputData,"node%d",i);
03585 output.attr(outputData, connectedExternalNodes[i-1]);
03586 }
03587
03588
03589
03590 if (strcmp(argv[0],"force") == 0 || strcmp(argv[0],"forces") == 0) {
03591
03592 for (int i=1; i<=20; i++)
03593 for (int j=1; j<=3; j++) {
03594 sprintf(outputData,"P%d_%d",j,i);
03595 output.tag("ResponseType",outputData);
03596 }
03597
03598 theResponse = new ElementResponse(this, 1, P);
03599
03600 } else if (strcmp(argv[0],"plastic") == 0 || strcmp(argv[0],"plastified") == 0) {
03601
03603
03604
03605
03606
03607
03608
03609
03610
03611
03612
03613
03614
03615
03616
03617 for (int i=0; i<=InfoPt.Size(); i++)
03618 output.tag("ResponseType","Unknown");
03619
03620 theResponse = new ElementResponse(this, 2, InfoPt);
03621 }
03622
03623
03624 else if (strcmp(argv[0],"PileM") == 0 || strcmp(argv[0],"PileM") == 0)
03625 {
03626 for (int i=0; i<=InfoSt.Size(); i++)
03627 output.tag("ResponseType","Unknown");
03628
03629 theResponse = new ElementResponse(this, 3, InfoSt);
03630 }
03631
03632 else if (strcmp(argv[0],"stress") == 0 || strcmp(argv[0],"stresses") == 0)
03633 {
03634 for (int i=0; i<=InfoSt.Size(); i++)
03635 output.tag("ResponseType","Unknown");
03636
03637 theResponse = new ElementResponse(this, 4, InfoSt);
03638 }
03639
03640
03641 else if (strcmp(argv[0],"pq") == 0 || strcmp(argv[0],"PQ") == 0)
03642 {
03643 for (int i=0; i<=InfoSpq2.Size(); i++)
03644 output.tag("ResponseType","Unknown");
03645
03646 theResponse = new ElementResponse(this, 41, InfoSpq2);
03647 }
03648
03649
03650 else if (strcmp(argv[0],"GaussPoint") == 0 || strcmp(argv[0],"gausspoint") == 0)
03651 {
03652 for (int i=0; i<=Gsc.Size(); i++)
03653 output.tag("ResponseType","Unknown");
03654
03655 theResponse = new ElementResponse(this, 6, Gsc);
03656 }
03657
03658
03659
03660
03661
03662
03663
03664
03665 output.endTag();
03666 return theResponse;
03667 }
03668
03669
03670 int TwentyNodeBrick::getResponse (int responseID, Information &eleInfo)
03671 {
03672 switch (responseID) {
03673
03674 case 1:
03675 return eleInfo.setVector( this->getResistingForce() );
03676
03677 case 2:
03678 {
03679
03680 int count = r_integration_order* s_integration_order * t_integration_order;
03681
03682
03683
03684 this->computeGaussPoint();
03685
03686
03687 InfoPt(0) = Gsc(0);
03688
03689 straintensor pl_stn;
03690
03691 int plastify;
03692 for (int i = 0; i < count; i++) {
03693 plastify = 0;
03694 InfoPt(i*4+1) = Gsc(i*3+1);
03695 InfoPt(i*4+2) = Gsc(i*3+2);
03696 InfoPt(i*4+3) = Gsc(i*3+3);
03697 pl_stn = matpoint[i]->getPlasticStrainTensor();
03698
03699 double q_plastc = pl_stn.q_deviatoric();
03700
03701
03702
03703
03704
03705
03706
03707 InfoPt(i*4+4) = q_plastc;
03708
03709 }
03710 return eleInfo.setVector( InfoPt );
03711
03712
03713 }
03714 case 3:
03715 {
03716 int count = r_integration_order* s_integration_order * t_integration_order;
03717 stresstensor sts;
03718
03719 this->computeGaussPoint();
03720 Vector wt(9);
03721 int i, rs;
03722
03723
03724 Info(0) = Gsc(0);
03725 Vector Mt(3), Q(3);
03726
03727
03728 Info(109+0) = Gsc(6);
03729
03730
03731 const Vector &coor = theNodes[17]->getCrds();
03732 const Vector &TotDis = theNodes[17]->getTrialDisp();
03733
03734
03735
03736
03737
03738 Info(109+1) = TotDis(0);
03739
03740
03741
03742
03743 const char *tp = matpoint[1]->getType();
03744 int tag = matpoint[1]->getTag();
03745
03746
03747 float height = 1;
03748
03749 double offset[30];
03750
03751 offset[1] = -0.000; offset[4] = -0.000;
03752 offset[2] = 0.000; offset[5] = 0.000;
03753 offset[3] = 0.000; offset[6] = 0.000;
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 if (strcmp(tp, "ElasticIsotropic3D") == 0 )
03779 {
03780 wt = getWeightofGP();
03781 const Vector &end1Crd = theNodes[0]->getCrds();
03782 const Vector &end5Crd = theNodes[4]->getCrds();
03783 height = end1Crd(2) - end5Crd(2);
03784
03785
03786
03787
03788 }
03789
03790
03791 Mt(0) = 0; Mt(1) = 0; Mt(2) = 0;
03792
03793
03794
03795 for( short GP_c_r = 1 ; GP_c_r <= r_integration_order ; GP_c_r++ )
03796 {
03797
03798 for( short GP_c_s = 1 ; GP_c_s <= s_integration_order ; GP_c_s++ )
03799 {
03800
03801 rs = (GP_c_r-1)*s_integration_order+GP_c_s-1;
03802
03803 for( short GP_c_t = 1 ; GP_c_t <= t_integration_order ; GP_c_t++ )
03804 {
03805
03806 i =
03807 ((GP_c_r-1)*s_integration_order+GP_c_s-1)*t_integration_order+GP_c_t-1;
03808
03809 sts = matpoint[i]->getStressTensor();
03810 Info(i*4+1) = Gsc(i*3+1);
03811 Info(i*4+2) = Gsc(i*3+2);
03812 Info(i*4+3) = Gsc(i*3+3);
03813 Info(i*4+4) = sts.cval(3,3);
03814
03815
03816
03817
03818
03819 if (strcmp(tp, "ElasticIsotropic3D") == 0 ){
03820 Mt(GP_c_t-1) += wt(rs)*sts.cval(3,3)*( Info(i*4+1)-offset[tag] )/height;
03821
03822
03823 }
03824
03825
03826
03827
03828
03829 }
03830 }
03831 }
03832
03833 Info(109+2) = ( Mt(0)+Mt(1)+Mt(2) )*0.3333;
03834
03835
03836
03837
03838
03839
03840
03841 return eleInfo.setVector( Info );
03842 }
03843 case 4:
03844 {
03845 int count = r_integration_order* s_integration_order * t_integration_order;
03846 int i;
03847 stresstensor sts;
03848
03849
03850
03851
03852 InfoSt(0) = count;
03853
03854 for( short GP_c_r = 1 ; GP_c_r <= r_integration_order ; GP_c_r++ )
03855 {
03856
03857 for( short GP_c_s = 1 ; GP_c_s <= s_integration_order ; GP_c_s++ )
03858 {
03859
03860
03861
03862 for( short GP_c_t = 1 ; GP_c_t <= t_integration_order ; GP_c_t++ )
03863 {
03864
03865 i =
03866 ((GP_c_r-1)*s_integration_order+GP_c_s-1)*t_integration_order+GP_c_t-1;
03867
03868 sts = matpoint[i]->getStressTensor();
03869 InfoSt(i*6+1) = sts.cval(1,1);
03870 InfoSt(i*6+2) = sts.cval(2,2);
03871 InfoSt(i*6+3) = sts.cval(3,3);
03872 InfoSt(i*6+4) = sts.cval(1,2);
03873 InfoSt(i*6+5) = sts.cval(1,3);
03874 InfoSt(i*6+6) = sts.cval(2,3);
03875 }
03876 }
03877 }
03878 return eleInfo.setVector( InfoSt );
03879 }
03880
03881 case 41:
03882 {
03883 int count = r_integration_order* s_integration_order * t_integration_order;
03884 count = count / 2;
03885 stresstensor sts;
03886 sts = matpoint[count]->getStressTensor();
03887 InfoSpq2(0) =sts.p_hydrostatic();
03888 InfoSpq2(1) =sts.q_deviatoric();
03889 return eleInfo.setVector( InfoSpq2 );
03890 }
03891 case 5:
03892 return eleInfo.setMatrix(this->getTangentStiff());
03893
03894 case 6:
03895 {
03896 this->computeGaussPoint();
03897 return eleInfo.setVector( Gsc );
03898 }
03899
03900 default:
03901 return -1;
03902 }
03903
03904 }
03905
03906
03907
03909 Vector TwentyNodeBrick::getWeightofGP(void)
03910 {
03911
03912
03913
03914
03915 Vector Weight( FixedOrder * FixedOrder );
03916
03917 double r = 0.0;
03918 double rw = 0.0;
03919 double s = 0.0;
03920 double sw = 0.0;
03921 double t = 0.0;
03922 double tw = 0.0;
03923
03924 short where = 0;
03925 short rs = 0;
03926 double tmp = 0;
03927
03928 double weight = 0.0;
03929
03930 int dh_dim[] = {20,3};
03931
03932 tensor dh(2, dh_dim, 0.0);
03933
03934 double det_of_Jacobian = 0.0;
03935
03936 tensor Jacobian;
03937
03938 for( short GP_c_r = 1 ; GP_c_r <= r_integration_order ; GP_c_r++ )
03939 {
03940 r = get_Gauss_p_c( r_integration_order, GP_c_r );
03941 rw = get_Gauss_p_w( r_integration_order, GP_c_r );
03942 for( short GP_c_s = 1 ; GP_c_s <= s_integration_order ; GP_c_s++ )
03943 {
03944 s = get_Gauss_p_c( s_integration_order, GP_c_s );
03945 sw = get_Gauss_p_w( s_integration_order, GP_c_s );
03946
03947 rs = (GP_c_r-1)*s_integration_order+GP_c_s-1;
03948 Weight(rs) = 0;
03949
03950 for( short GP_c_t = 1 ; GP_c_t <= t_integration_order ; GP_c_t++ )
03951 {
03952 t = get_Gauss_p_c( t_integration_order, GP_c_t );
03953 tw = get_Gauss_p_w( t_integration_order, GP_c_t );
03954
03955
03956
03957
03958
03959 dh = dh_drst_at(r,s,t);
03960
03961 Jacobian = Jacobian_3D(dh);
03962 det_of_Jacobian = Jacobian.determinant();
03963
03964
03965
03966 weight = rw * sw * tw * det_of_Jacobian;
03967 Weight(rs) += weight;
03968
03969
03970
03971
03972
03973 }
03974
03975 tmp += Weight(rs);
03976 }
03977 }
03978
03979
03980
03981
03982 return Weight;
03983 }
03984
03985
03987
03988
03989
03990
03991
03992
03993
03994
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
04079
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
04117
04118
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
04151
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
04246
04247
04248
04250
04251
04252
04253
04254
04255
04256
04257
04258
04259
04260
04261
04262
04263
04264
04265
04266
04267
04268
04269
04270
04271
04272
04273
04274
04275
04276
04277
04278
04279
04280
04281
04282
04283
04284
04285
04286
04287
04288
04289
04290
04291
04292
04293
04294
04295
04296
04297
04298
04299
04300
04301
04303
04304
04305
04310
04312
04313
04314
04315
04316
04317
04318
04319
04320
04321
04322
04323
04324
04326
04327
04328
04329
04330
04331
04332
04333
04334
04335
04336
04340
04341
04342
04343
04344
04345
04346
04347
04348
04349
04350
04351
04352
04353
04354
04355
04356
04357
04358
04359
04360
04361
04362
04363
04364
04365
04366
04367
04368
04369
04370
04371
04372
04373
04374
04375
04376
04377
04378
04379
04380
04381
04382
04383
04384
04385
04386
04387
04388
04389
04390
04391
04392
04393
04394
04395
04396
04397
04398
04399
04400
04401
04402
04403
04404
04405
04406
04407
04408
04409
04410
04411
04412
04413
04414
04415
04416
04417
04418
04419
04420
04421
04422
04423
04425
04426
04427
04428
04429
04430
04431
04432
04433
04434
04435
04436
04437
04438
04439
04440
04441
04442
04443
04444
04445
04446
04447
04448
04449
04450
04451
04452
04453
04454
04455
04456
04457
04458
04459
04460
04461
04464
04465
04466
04467
04468
04469
04470
04471
04472
04473
04474
04475
04476
04477
04478
04479
04480
04481
04482
04483
04484
04485
04486
04487
04488
04489
04490
04491
04492
04493
04494
04495
04497
04498
04499
04500
04501
04502
04503
04504
04505
04506
04507
04508
04509
04510
04511
04512
04513
04514
04515
04516
04517
04518
04519
04520
04521
04522
04523
04524
04525
04526
04527
04528
04529
04530
04531
04532
04533
04534
04535
04536
04537
04538
04539
04540
04541
04542
04543
04544
04545
04546
04547
04548
04549
04550
04551
04552
04553
04554
04555
04556
04557
04558
04559
04560
04561
04562
04563
04564
04565
04566
04567
04568
04569
04570
04571
04572
04573
04574
04575
04576
04577
04578
04579
04580
04581
04582
04583
04584
04585
04586
04587
04588
04589
04590 double TwentyNodeBrick::get_Gauss_p_c(short order, short point_numb)
04591 {
04592
04593
04594 static double Gauss_coordinates[7][7];
04595
04596 Gauss_coordinates[1][1] = 0.0 ;
04597 Gauss_coordinates[2][1] = -0.577350269189626;
04598 Gauss_coordinates[2][2] = -Gauss_coordinates[2][1];
04599 Gauss_coordinates[3][1] = -0.774596669241483;
04600 Gauss_coordinates[3][2] = 0.0;
04601 Gauss_coordinates[3][3] = -Gauss_coordinates[3][1];
04602 Gauss_coordinates[4][1] = -0.861136311594053;
04603 Gauss_coordinates[4][2] = -0.339981043584856;
04604 Gauss_coordinates[4][3] = -Gauss_coordinates[4][2];
04605 Gauss_coordinates[4][4] = -Gauss_coordinates[4][1];
04606 Gauss_coordinates[5][1] = -0.906179845938664;
04607 Gauss_coordinates[5][2] = -0.538469310105683;
04608 Gauss_coordinates[5][3] = 0.0;
04609 Gauss_coordinates[5][4] = -Gauss_coordinates[5][2];
04610 Gauss_coordinates[5][5] = -Gauss_coordinates[5][1];
04611 Gauss_coordinates[6][1] = -0.932469514203152;
04612 Gauss_coordinates[6][2] = -0.661509386466265;
04613 Gauss_coordinates[6][3] = -0.238619186083197;
04614 Gauss_coordinates[6][4] = -Gauss_coordinates[6][3];
04615 Gauss_coordinates[6][5] = -Gauss_coordinates[6][2];
04616 Gauss_coordinates[6][6] = -Gauss_coordinates[6][1];
04617
04618 return Gauss_coordinates[order][point_numb];
04619 }
04620
04621 double TwentyNodeBrick::get_Gauss_p_w(short order, short point_numb)
04622 {
04623
04624
04625 static double Gauss_weights[7][7];
04626
04627 Gauss_weights[1][1] = 2.0;
04628 Gauss_weights[2][1] = 1.0;
04629 Gauss_weights[2][2] = 1.0;
04630 Gauss_weights[3][1] = 0.555555555555556;
04631 Gauss_weights[3][2] = 0.888888888888889;
04632 Gauss_weights[3][3] = Gauss_weights[3][1];
04633 Gauss_weights[4][1] = 0.347854845137454;
04634 Gauss_weights[4][2] = 0.652145154862546;
04635 Gauss_weights[4][3] = Gauss_weights[4][2];
04636 Gauss_weights[4][4] = Gauss_weights[4][1];
04637 Gauss_weights[5][1] = 0.236926885056189;
04638 Gauss_weights[5][2] = 0.478628670499366;
04639 Gauss_weights[5][3] = 0.568888888888889;
04640 Gauss_weights[5][4] = Gauss_weights[5][2];
04641 Gauss_weights[5][5] = Gauss_weights[5][1];
04642 Gauss_weights[6][1] = 0.171324492379170;
04643 Gauss_weights[6][2] = 0.360761573048139;
04644 Gauss_weights[6][3] = 0.467913934572691;
04645 Gauss_weights[6][4] = Gauss_weights[6][3];
04646 Gauss_weights[6][5] = Gauss_weights[6][2];
04647 Gauss_weights[6][6] = Gauss_weights[6][1];
04648
04649 return Gauss_weights[order][point_numb];
04650 }
04651
04652
04653 int TwentyNodeBrick::update()
04654 {
04655 double r = 0.0;
04656 double s = 0.0;
04657 double t = 0.0;
04658
04659 short where = 0;
04660
04661 int dh_dim[] = {20,3};
04662 tensor dh(2, dh_dim, 0.0);
04663
04664 static int disp_dim[] = {20,3};
04665 tensor incremental_displacements(2,disp_dim,0.0);
04666
04667 straintensor incremental_strain;
04668
04669 tensor Jacobian;
04670 tensor JacobianINV;
04671 tensor dhGlobal;
04672
04673 incremental_displacements = incr_disp();
04674
04675 for( short GP_c_r = 1 ; GP_c_r <= r_integration_order ; GP_c_r++ )
04676 {
04677 r = get_Gauss_p_c( r_integration_order, GP_c_r );
04678
04679 for( short GP_c_s = 1 ; GP_c_s <= s_integration_order ; GP_c_s++ )
04680 {
04681 s = get_Gauss_p_c( s_integration_order, GP_c_s );
04682
04683 for( short GP_c_t = 1 ; GP_c_t <= t_integration_order ; GP_c_t++ )
04684 {
04685 t = get_Gauss_p_c( t_integration_order, GP_c_t );
04686
04687
04688
04689 where =
04690 ((GP_c_r-1)*s_integration_order+GP_c_s-1)*t_integration_order+GP_c_t-1;
04691
04692 dh = dh_drst_at(r,s,t);
04693
04694 Jacobian = Jacobian_3D(dh);
04695
04696
04697 JacobianINV = Jacobian_3Dinv(dh);
04698
04699
04700
04701
04702
04703
04704 dhGlobal = dh("ij") * JacobianINV("kj");
04705
04706
04707
04708
04709
04710
04711
04712
04713
04714
04715
04716
04717
04718 incremental_strain =
04719 (dhGlobal("ib")*incremental_displacements("ia")).symmetrize11();
04720 incremental_strain.null_indices();
04721
04722
04723
04724
04725
04726
04727 if ( ( (matpoint[where]->matmodel)->setTrialStrainIncr( incremental_strain)) )
04728 opserr << "TwentyNodeBrick::update (tag: " << this->getTag() << "), update() failed\n";
04729 }
04730 }
04731 }
04732 return 0;
04733
04734 }
04735
04736
04737 #endif