00001 #include "argyrisplate.h"
00002 #include "global.h"
00003 #include "globmat.h"
00004 #include "genfile.h"
00005 #include "node.h"
00006 #include "element.h"
00007 #include "intpoints.h"
00008 #include "loadcase.h"
00009 #include <stdlib.h>
00010 #include <math.h>
00011
00012
00013
00014 argyrisplate::argyrisplate (void)
00015 {
00016 long i,j;
00017
00018
00019 nne=6;
00020
00021 ndofe=21;
00022
00023 tncomp=3;
00024
00025 gncomp=4;
00026
00027 napfun=1;
00028
00029 intordmm=2;
00030
00031 ned=3;
00032
00033 nned=3;
00034
00035 intordb=2;
00036
00037 ssst=platek;
00038
00039
00040 nb=1;
00041
00042
00043 ncomp = new long [nb];
00044 ncomp[0]=3;
00045
00046
00047
00048 cncomp = new long [nb];
00049 cncomp[0]=0;
00050
00051
00052
00053 nip = new long* [nb];
00054 intordsm = new long* [nb];
00055 for (i=0;i<nb;i++){
00056 nip[i] = new long [nb];
00057 intordsm[i] = new long [nb];
00058 }
00059
00060 nip[0][0]=7;
00061
00062
00063 tnip=0;
00064 for (i=0;i<nb;i++){
00065 for (j=0;j<nb;j++){
00066 tnip+=nip[i][j];
00067 }
00068 }
00069
00070 intordsm[0][0]=7;
00071 }
00072
00073
00074 argyrisplate::~argyrisplate (void)
00075 {
00076 long i;
00077
00078 for (i=0;i<nb;i++){
00079 delete [] nip[i];
00080 delete [] intordsm[i];
00081 }
00082 delete [] nip;
00083 delete [] intordsm;
00084
00085 delete [] cncomp;
00086 delete [] ncomp;
00087 }
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098 void argyrisplate::fx (double x,double y,vector &shapef)
00099 {
00100 shapef[0] = 1.0;
00101
00102 shapef[1] = x;
00103 shapef[2] = y;
00104
00105 shapef[3] = x*x;
00106 shapef[4] = x*y;
00107 shapef[5] = y*y;
00108
00109 shapef[6] = x*x*x;
00110 shapef[7] = x*x*y;
00111 shapef[8] = x*y*y;
00112 shapef[9] = y*y*y;
00113
00114 shapef[10] = x*x*x*x;
00115 shapef[11] = x*x*x*y;
00116 shapef[12] = x*x*y*y;
00117 shapef[13] = x*y*y*y;
00118 shapef[14] = y*y*y*y;
00119
00120 shapef[15] = x*x*x*x*x;
00121 shapef[16] = x*x*x*x*y;
00122 shapef[17] = x*x*x*y*y;
00123 shapef[18] = x*x*y*y*y;
00124 shapef[19] = x*y*y*y*y;
00125 shapef[20] = y*y*y*y*y;
00126 }
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136 void argyrisplate::dfdx (double x,double y,vector &shapef)
00137 {
00138 shapef[0] = 0.0;
00139
00140 shapef[1] = 1.0;
00141 shapef[2] = 0.0;
00142
00143 shapef[3] = 2.0*x;
00144 shapef[4] = y;
00145 shapef[5] = 0.0;
00146
00147 shapef[6] = 3.0*x*x;
00148 shapef[7] = 2.0*x*y;
00149 shapef[8] = y*y;
00150 shapef[9] = 0.0;
00151
00152 shapef[10] = 4.0*x*x*x;
00153 shapef[11] = 3.0*x*x*y;
00154 shapef[12] = 2.0*x*y*y;
00155 shapef[13] = y*y*y;
00156 shapef[14] = 0.0;
00157
00158 shapef[15] = 5.0*x*x*x*x;
00159 shapef[16] = 4.0*x*x*x*y;
00160 shapef[17] = 3.0*x*x*y*y;
00161 shapef[18] = 2.0*x*y*y*y;
00162 shapef[19] = y*y*y*y;
00163 shapef[20] = 0.0;
00164 }
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174 void argyrisplate::dfdxdx (double x,double y,vector &shapef)
00175 {
00176 shapef[0] = 0.0;
00177
00178 shapef[1] = 0.0;
00179 shapef[2] = 0.0;
00180
00181 shapef[3] = 2.0;
00182 shapef[4] = 0.0;
00183 shapef[5] = 0.0;
00184
00185 shapef[6] = 6.0*x;
00186 shapef[7] = 2.0*y;
00187 shapef[8] = 0.0;
00188 shapef[9] = 0.0;
00189
00190 shapef[10] = 12.0*x*x;
00191 shapef[11] = 6.0*x*y;
00192 shapef[12] = 2.0*y*y;
00193 shapef[13] = 0.0;
00194 shapef[14] = 0.0;
00195
00196 shapef[15] = 20.0*x*x*x;
00197 shapef[16] = 12.0*x*x*y;
00198 shapef[17] = 6.0*x*y*y;
00199 shapef[18] = 2.0*y*y*y;
00200 shapef[19] = 0.0;
00201 shapef[20] = 0.0;
00202 }
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212 void argyrisplate::dfdy (double x,double y,vector &shapef)
00213 {
00214 shapef[0] = 0.0;
00215
00216 shapef[1] = 0.0;
00217 shapef[2] = 1.0;
00218
00219 shapef[3] = 0.0;
00220 shapef[4] = x;
00221 shapef[5] = 2.0*y;
00222
00223 shapef[6] = 0.0;
00224 shapef[7] = x*x;
00225 shapef[8] = 2.0*x*y;
00226 shapef[9] = 3.0*y*y;
00227
00228 shapef[10] = 0.0;
00229 shapef[11] = x*x*x;
00230 shapef[12] = 2.0*x*x*y;
00231 shapef[13] = 3.0*x*y*y;
00232 shapef[14] = 4.0*y*y*y;
00233
00234 shapef[15] = 0.0;
00235 shapef[16] = x*x*x*x;
00236 shapef[17] = 2.0*x*x*x*y;
00237 shapef[18] = 3.0*x*x*y*y;
00238 shapef[19] = 4.0*x*y*y*y;
00239 shapef[20] = 5.0*y*y*y*y;
00240 }
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250 void argyrisplate::dfdydy (double x,double y,vector &shapef)
00251 {
00252 shapef[0] = 0.0;
00253
00254 shapef[1] = 0.0;
00255 shapef[2] = 0.0;
00256
00257 shapef[3] = 0.0;
00258 shapef[4] = 0.0;
00259 shapef[5] = 2.0;
00260
00261 shapef[6] = 0.0;
00262 shapef[7] = 0.0;;
00263 shapef[8] = 2.0*x;
00264 shapef[9] = 6.0*y;
00265
00266 shapef[10] = 0.0;
00267 shapef[11] = 0.0;
00268 shapef[12] = 2.0*x*x;
00269 shapef[13] = 6.0*x*y;
00270 shapef[14] = 12.0*y*y;
00271
00272 shapef[15] = 0.0;
00273 shapef[16] = 0.0;
00274 shapef[17] = 2.0*x*x*x;
00275 shapef[18] = 6.0*x*x*y;
00276 shapef[19] = 12.0*x*y*y;
00277 shapef[20] = 20.0*y*y*y;
00278 }
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288 void argyrisplate::dfdxdy (double x,double y,vector &shapef)
00289 {
00290 shapef[0] = 0.0;
00291
00292 shapef[1] = 0.0;
00293 shapef[2] = 0.0;
00294
00295 shapef[3] = 0.0;
00296 shapef[4] = 1.0;
00297 shapef[5] = 0.0;
00298
00299 shapef[6] = 0.0;
00300 shapef[7] = 2.0*x;
00301 shapef[8] = 2.0*y;
00302 shapef[9] = 0.0;
00303
00304 shapef[10] = 0.0;
00305 shapef[11] = 3.0*x*x;
00306 shapef[12] = 4.0*x*y;
00307 shapef[13] = 3.0*y*y;
00308 shapef[14] = 0.0;
00309
00310 shapef[15] = 0.0;
00311 shapef[16] = 4.0*x*x*x;
00312 shapef[17] = 6.0*x*x*y;
00313 shapef[18] = 6.0*x*y*y;
00314 shapef[19] = 4.0*y*y*y;
00315 shapef[20] = 0.0;
00316 }
00317
00318
00319
00320
00321
00322
00323
00324
00325 void argyrisplate::shapefunctions (long eid)
00326 {
00327 long i;
00328 double nor;
00329 ivector nodes(nne);
00330 vector x(nne),y(nne),sf(ndofe),s(2),n(2);
00331 matrix mat(ndofe,ndofe),unitm(ndofe,ndofe);
00332
00333
00334 Mt->give_node_coord2d (x,y,eid);
00335
00336 Mt->give_elemnodes (eid,nodes);
00337
00338
00339
00340 fx (x[0],y[0],sf);
00341 for (i=0;i<ndofe;i++){
00342 mat[0][i]=sf[i];
00343 }
00344
00345 dfdx (x[0],y[0],sf);
00346 for (i=0;i<ndofe;i++){
00347 mat[1][i]=sf[i];
00348 }
00349
00350 dfdy (x[0],y[0],sf);
00351 for (i=0;i<ndofe;i++){
00352 mat[2][i]=sf[i];
00353 }
00354
00355 dfdxdx (x[0],y[0],sf);
00356 for (i=0;i<ndofe;i++){
00357 mat[3][i]=sf[i];
00358 }
00359
00360 dfdxdy (x[0],y[0],sf);
00361 for (i=0;i<ndofe;i++){
00362 mat[4][i]=sf[i];
00363 }
00364
00365 dfdydy (x[0],y[0],sf);
00366 for (i=0;i<ndofe;i++){
00367 mat[5][i]=sf[i];
00368 }
00369
00370
00371
00372 fx (x[1],y[1],sf);
00373 for (i=0;i<ndofe;i++){
00374 mat[6][i]=sf[i];
00375 }
00376
00377 dfdx (x[1],y[1],sf);
00378 for (i=0;i<ndofe;i++){
00379 mat[7][i]=sf[i];
00380 }
00381
00382 dfdy (x[1],y[1],sf);
00383 for (i=0;i<ndofe;i++){
00384 mat[8][i]=sf[i];
00385 }
00386
00387 dfdxdx (x[1],y[1],sf);
00388 for (i=0;i<ndofe;i++){
00389 mat[9][i]=sf[i];
00390 }
00391
00392 dfdxdy (x[1],y[1],sf);
00393 for (i=0;i<ndofe;i++){
00394 mat[10][i]=sf[i];
00395 }
00396
00397 dfdydy (x[1],y[1],sf);
00398 for (i=0;i<ndofe;i++){
00399 mat[11][i]=sf[i];
00400 }
00401
00402
00403
00404
00405 fx (x[2],y[2],sf);
00406 for (i=0;i<ndofe;i++){
00407 mat[12][i]=sf[i];
00408 }
00409
00410 dfdx (x[2],y[2],sf);
00411 for (i=0;i<ndofe;i++){
00412 mat[13][i]=sf[i];
00413 }
00414
00415 dfdy (x[2],y[2],sf);
00416 for (i=0;i<ndofe;i++){
00417 mat[14][i]=sf[i];
00418 }
00419
00420 dfdxdx (x[2],y[2],sf);
00421 for (i=0;i<ndofe;i++){
00422 mat[15][i]=sf[i];
00423 }
00424
00425 dfdxdy (x[2],y[2],sf);
00426 for (i=0;i<ndofe;i++){
00427 mat[16][i]=sf[i];
00428 }
00429
00430 dfdydy (x[2],y[2],sf);
00431 for (i=0;i<ndofe;i++){
00432 mat[17][i]=sf[i];
00433 }
00434
00435
00436
00437
00438 if (nodes[0]<nodes[1]){
00439
00440 s[0]=x[1]-x[0];
00441 s[1]=y[1]-y[0];
00442 }else{
00443
00444 s[0]=x[0]-x[1];
00445 s[1]=y[0]-y[1];
00446 }
00447
00448 n[0]=0.0-s[1];
00449 n[1]=s[0];
00450
00451 nor = n[0]*n[0]+n[1]*n[1];
00452 n[0]/=sqrt(nor);
00453 n[1]/=sqrt(nor);
00454
00455
00456 dfdx (x[3],y[3],sf);
00457 for (i=0;i<ndofe;i++){
00458 mat[18][i]=sf[i]*n[0];
00459 }
00460
00461 dfdy (x[3],y[3],sf);
00462 for (i=0;i<ndofe;i++){
00463 mat[18][i]+=sf[i]*n[1];
00464 }
00465
00466
00467
00468
00469
00470 if (nodes[1]<nodes[2]){
00471
00472 s[0]=x[2]-x[1];
00473 s[1]=y[2]-y[1];
00474 }else{
00475
00476 s[0]=x[1]-x[2];
00477 s[1]=y[1]-y[2];
00478 }
00479
00480 n[0]=0.0-s[1];
00481 n[1]=s[0];
00482
00483 nor = n[0]*n[0]+n[1]*n[1];
00484 n[0]/=sqrt(nor);
00485 n[1]/=sqrt(nor);
00486
00487
00488 dfdx (x[4],y[4],sf);
00489 for (i=0;i<ndofe;i++){
00490 mat[19][i]=sf[i]*n[0];
00491 }
00492
00493 dfdy (x[4],y[4],sf);
00494 for (i=0;i<ndofe;i++){
00495 mat[19][i]+=sf[i]*n[1];
00496 }
00497
00498
00499
00500
00501
00502
00503 if (nodes[2]<nodes[0]){
00504
00505 s[0]=x[0]-x[2];
00506 s[1]=y[0]-y[2];
00507 }else{
00508
00509 s[0]=x[2]-x[0];
00510 s[1]=y[2]-y[0];
00511 }
00512
00513 n[0]=0.0-s[1];
00514 n[1]=s[0];
00515
00516 nor = n[0]*n[0]+n[1]*n[1];
00517 n[0]/=sqrt(nor);
00518 n[1]/=sqrt(nor);
00519
00520
00521 dfdx (x[5],y[5],sf);
00522 for (i=0;i<ndofe;i++){
00523 mat[20][i]=sf[i]*n[0];
00524 }
00525
00526 dfdy (x[5],y[5],sf);
00527 for (i=0;i<ndofe;i++){
00528 mat[20][i]+=sf[i]*n[1];
00529 }
00530
00531
00532
00533 for (i=0;i<ndofe;i++){
00534 unitm[i][i]=1.0;
00535 }
00536 if (Mt->elements[eid].tmat==NULL){
00537 Mt->elements[eid].tmat = new matrix [1];
00538 Mt->elements[eid].tmat[0].m=ndofe;
00539 Mt->elements[eid].tmat[0].n=ndofe;
00540 Mt->elements[eid].tmat[0].a=new double [ndofe*ndofe];
00541 }
00542
00543 gemp (mat.a,Mt->elements[eid].tmat[0].a,unitm.a,ndofe,ndofe,1.0e-15,1);
00544
00545 }
00546
00547
00548
00549
00550
00551
00552
00553
00554
00555
00556 void argyrisplate::geom_matrix (matrix &gm,double x,double y,long eid)
00557 {
00558 long i;
00559 vector sfdxdx(ndofe),sfdydy(ndofe),sfdxdy(ndofe),v1(ndofe),v2(ndofe),v3(ndofe);
00560
00561 fillm (0.0,gm);
00562
00563 dfdxdx (x,y,sfdxdx);
00564 dfdydy (x,y,sfdydy);
00565 dfdxdy (x,y,sfdxdy);
00566
00567 vxm (sfdxdx,Mt->elements[eid].tmat[0],v1);
00568 vxm (sfdydy,Mt->elements[eid].tmat[0],v2);
00569 vxm (sfdxdy,Mt->elements[eid].tmat[0],v3);
00570
00571 for (i=0;i<ndofe;i++){
00572 gm[0][i]+=v1(i);
00573 gm[1][i]+=v2(i);
00574 gm[2][i]+=v3(i);
00575 }
00576
00577 }
00578
00579
00580
00581
00582
00583
00584
00585
00586
00587
00588
00589
00590 void argyrisplate::stiffness_matrix (long eid,long ri,long ci,matrix &sm,vector &x,vector &y)
00591 {
00592
00593 long i,ipp;
00594
00595 double xi,eta,jac;
00596 ivector nodes(nne);
00597 vector t(nne),gp1,gp2,w,xx(3),yy(3);
00598 matrix gm(tncomp,ndofe),d(tncomp,tncomp);
00599
00600 xx[0]=x[0];
00601 xx[1]=x[1];
00602 xx[2]=x[2];
00603 yy[0]=y[0];
00604 yy[1]=y[1];
00605 yy[2]=y[2];
00606
00607 shapefunctions (eid);
00608
00609 Mt->give_elemnodes (eid,nodes);
00610 Mc->give_thickness (eid,nodes,t);
00611
00612 fillm (0.0,sm);
00613
00614 allocm (ncomp[0],ndofe,gm);
00615 allocv (intordsm[0][0],gp1);
00616 allocv (intordsm[0][0],gp2);
00617 allocv (intordsm[0][0],w);
00618
00619 gauss_points_tr (gp1.a,gp2.a,w.a,intordsm[0][0]);
00620
00621 ipp=Mt->elements[eid].ipp[0][0];
00622
00623 for (i=0;i<intordsm[0][0];i++){
00624
00625 xi = gp1[i]*x[0]+gp2[i]*x[1]+(1.0-gp1[i]-gp2[i])*x[2];
00626 eta = gp1[i]*y[0]+gp2[i]*y[1]+(1.0-gp1[i]-gp2[i])*y[2];
00627
00628
00629 geom_matrix (gm,xi,eta,eid);
00630
00631
00632 Mm->matstiff (d,ipp);
00633
00634
00635
00636
00637 jac=w[i]*det2d (xx.a,yy.a);
00638
00639
00640 bdbjac (sm,gm,d,gm,jac);
00641
00642 ipp++;
00643 }
00644
00645 destrv (gp1); destrv (gp2); destrv (w); destrm (gm);
00646
00647 }
00648
00649
00650
00651
00652
00653
00654
00655
00656
00657 void argyrisplate::res_stiffness_matrix (long eid,matrix &sm)
00658 {
00659
00660 vector x(nne),y(nne);
00661 ivector nodes(nne);
00662
00663
00664 Mt->give_node_coord2d (x,y,eid);
00665
00666 stiffness_matrix (eid,0,0,sm,x,y);
00667
00668
00669
00670
00671
00672
00673
00674
00675 }