00001 #include "plquadcontact.h" 00002 #include "global.h" 00003 #include "element.h" 00004 #include "node.h" 00005 #include "globmat.h" 00006 #include "intp.h" 00007 #include "basefun.h" 00008 00009 plquadcontact::plquadcontact (void) 00010 { 00011 long i; 00012 00013 nne=4; ndofe=8; 00014 nb=1; tncomp=2; 00015 00016 ssst = planecontact; 00017 00018 ncomp = new long [nb]; 00019 ncomp[0]=2; 00020 00021 nip = new long* [nb]; 00022 intordsm = new long* [nb]; 00023 for (i=0;i<nb;i++){ 00024 nip[i] = new long [nb]; 00025 intordsm[i] = new long [nb]; 00026 } 00027 00028 nip[0][0]=3; 00029 intordsm[0][0]=3; 00030 tnip=3; 00031 } 00032 00033 00034 00035 plquadcontact::~plquadcontact (void) 00036 { 00037 long i; 00038 00039 for (i=0;i<nb;i++){ 00040 delete [] nip[i]; 00041 delete [] intordsm[i]; 00042 } 00043 delete [] nip; 00044 delete [] intordsm; 00045 00046 delete [] ncomp; 00047 00048 } 00049 00050 00051 00052 /** 00053 The function initializes basic data on elements. 00054 00055 @param eid - element id 00056 00057 JK, 11.6.2006 00058 00059 void plquadcontact::eleminit (long eid) 00060 { 00061 00062 long ii,jj; 00063 00064 Mt->elements[eid].nb=nb; 00065 Mt->elements[eid].intordsm = new long* [nb]; 00066 Mt->elements[eid].nip = new long* [nb]; 00067 00068 for (ii=0;ii<nb;ii++){ 00069 Mt->elements[eid].intordsm[ii] = new long [nb]; 00070 Mt->elements[eid].nip[ii] = new long [nb]; 00071 for (jj=0;jj<nb;jj++){ 00072 Mt->elements[eid].intordsm[ii][jj]=intordsm[ii][jj]; 00073 Mt->elements[eid].nip[ii][jj]=nip[ii][jj]; 00074 } 00075 } 00076 } 00077 */ 00078 00079 00080 /** 00081 function approximates function defined by nodal values 00082 00083 @param xi,eta - coordinates on element 00084 @param nodval - nodal values 00085 00086 JK 00087 */ 00088 double plquadcontact::approx (double xi,vector &nodval) 00089 { 00090 double f; 00091 vector bf(nne); 00092 00093 bf_lin_1d (bf.a,xi); 00094 // we need approximation as on 1D element with 2 nodes 00095 bf[2] = 0.0; 00096 bf[3] = 0.0; 00097 00098 scprd (bf,nodval,f); 00099 00100 return f; 00101 } 00102 00103 00104 00105 /** 00106 The function assembles transformation %matrix x_g = T x_l 00107 for transformation from the local nodal coordinate systems. 00108 00109 @param nodes - array containing node numbers 00110 @param tmat - transformation %matrix 00111 00112 JK, 11.6.2006 00113 */ 00114 void plquadcontact::transf_matrix (ivector &nod,matrix &tmat) 00115 { 00116 long i,n,m; 00117 00118 fillm (0.0,tmat); 00119 00120 n=nod.n; 00121 m=tmat.m; 00122 for (i=0;i<m;i++){ 00123 tmat[i][i]=1.0; 00124 } 00125 00126 for (i=0;i<n;i++){ 00127 if (Mt->nodes[nod[i]].transf>0){ 00128 tmat[i*2][i*2] = Mt->nodes[nod[i]].e1[0]; tmat[i*2][i*2+1] = Mt->nodes[nod[i]].e2[0]; 00129 tmat[i*2+1][i*2] = Mt->nodes[nod[i]].e1[1]; tmat[i*2+1][i*2+1] = Mt->nodes[nod[i]].e2[1]; 00130 } 00131 } 00132 } 00133 00134 00135 00136 /** 00137 The function computes stiffness %matrix of plane rectangular 00138 finite element for contact problems. 00139 00140 @param eid - number of element 00141 @param ri,ci - row and column indices 00142 @param sm - resulting stiffness %matrix 00143 00144 @return The function returns resulting stiffnes %matrix in the parameter sm. 00145 00146 JF, 29.10.2012 00147 */ 00148 void plquadcontact::stiffness_matrix (long eid,long ri,long ci,matrix &sm) 00149 { 00150 long i,ipp; 00151 double xi,jac,thick; 00152 ivector nodes (nne); 00153 vector w(intordsm[0][0]),gp(intordsm[0][0]); 00154 vector x(nne),y(nne), t(nne); 00155 matrix gm(ncomp[0],ndofe),d(tncomp,tncomp); 00156 00157 fillm (0.0,sm); 00158 00159 Mt->give_node_coord2d(x,y,eid); 00160 Mt->give_elemnodes (eid,nodes); 00161 Mc->give_thickness (eid,nodes,t); 00162 00163 gauss_points (gp.a,w.a,intordsm[0][0]); 00164 00165 ipp=Mt->elements[eid].ipp[ri][ci]; 00166 00167 for (i=0;i<intordsm[0][0];i++) 00168 { 00169 xi=gp[i]; 00170 00171 geom_matrix (gm, x, y, xi, jac); 00172 // matrix of stiffness of the material 00173 Mm->matstiff (d,ipp); 00174 // thickness in integration point 00175 thick = approx (xi,t); 00176 jac*=w[i]*thick; 00177 // contribution to the stiffness matrix of the element 00178 bdbjac (sm,gm,d,gm,jac); 00179 00180 ipp++; 00181 } 00182 } 00183 00184 00185 00186 /** 00187 Function computes stiffness %matrix of one element. If it is required, nodal values 00188 are transformed to the local nodal coordinate systems. 00189 00190 @param eid - number of element 00191 @param sm - stiffness %matrix (output) 00192 00193 @return The function returns required stiffness %matrix in the parameter sm. 00194 00195 Created by Tomas Koudelka, 11.2008 00196 */ 00197 void plquadcontact::res_stiffness_matrix(long eid, matrix &sm) 00198 { 00199 long transf; 00200 ivector nodes(nne); 00201 00202 stiffness_matrix(eid,0,0,sm); 00203 00204 // transformation of stiffness matrix 00205 // (in the case of nodal coordinate systems) 00206 Mt->give_elemnodes(eid,nodes); 00207 transf = Mt->locsystems(nodes); 00208 if (transf>0){ 00209 matrix tmat(ndofe,ndofe); 00210 transf_matrix(nodes,tmat); 00211 glmatrixtransf(sm,tmat); 00212 } 00213 } 00214 00215 00216 00217 /** 00218 The function computes strains at integration points. If there are 00219 defined loacal nodal coordinate systems then the corresponding 00220 components of the dislacement %vector are transformed. 00221 00222 @param lcid - load case id 00223 @param eid - element id 00224 00225 @return The function stores resulting strains in the array strains 00226 of the element integration points. 00227 00228 JK, 11.6.2006 00229 */ 00230 void plquadcontact::res_mainip_strains (long lcid,long eid) 00231 { 00232 00233 vector aux,x(nne),y(nne),r(ndofe); 00234 ivector nodes(nne); 00235 matrix tmat; 00236 00237 // nodal displacements 00238 eldispl (lcid,eid,r.a); 00239 00240 // transformation of displacement vector 00241 long transf = Mt->locsystems (nodes); 00242 if (transf>0){ 00243 allocv (ndofe,aux); 00244 allocm (ndofe,ndofe,tmat); 00245 transf_matrix (nodes,tmat); 00246 //locglobtransf (aux,r,tmat); 00247 lgvectortransf (aux,r,tmat); 00248 copyv (aux,r); 00249 destrv (aux); 00250 destrm (tmat); 00251 } 00252 00253 mainip_strains (lcid,eid,0,0,r); 00254 00255 } 00256 00257 00258 00259 /** 00260 The function computes strains at integration points of element. 00261 It is used in geometrically linear problems. 00262 00263 @param lcid - load case id 00264 @param eid - element id 00265 @param ri,ci - row and column indices 00266 @param ii - number of block 00267 @param r - %vector of nodal displacements 00268 00269 @return The function stores resulting strains in the array strains 00270 of the element integration points. 00271 00272 JK, 11.6.2006 00273 */ 00274 void plquadcontact::mainip_strains (long lcid,long eid,long ri,long ci,vector &r) 00275 { 00276 long i,ipp; 00277 double xi,jac; 00278 ivector nodes (nne); 00279 vector w(intordsm[ri][ci]),gp(intordsm[ri][ci]),t(nne); 00280 vector x(nne),y(nne); 00281 matrix gm(ncomp[0],ndofe),d(tncomp,tncomp); 00282 vector eps(tncomp); 00283 00284 fillm (0.0,gm); 00285 00286 Mt->give_node_coord2d(x,y,eid); 00287 Mt->give_elemnodes (eid,nodes); 00288 00289 gauss_points (gp.a,w.a,intordsm[ri][ci]); 00290 00291 ipp=Mt->elements[eid].ipp[ri][ci]; 00292 00293 for (i=0;i<intordsm[ri][ci];i++) 00294 { 00295 xi=gp[i]; 00296 00297 geom_matrix (gm, x, y, xi, jac); 00298 00299 mxv (gm, r, eps); 00300 00301 Mm->storestrain (lcid,ipp,eps); 00302 00303 ipp++; 00304 } 00305 } 00306 00307 00308 00309 /** 00310 The function assembles strain-displacement (geometric) %matrix. 00311 00312 @param gm - resulting geometric %matrix (output) 00313 @param x,y - nodal coordinates 00314 @param xi - natural coordinate of required integration point 00315 @param jac - Jacobian of transformation (output) 00316 00317 @return The function returns resulting geometric %matrix in the parameter gm. 00318 00319 JF, 15.10.2012 00320 */ 00321 00322 void plquadcontact::geom_matrix (matrix &gm,vector &x,vector &y,double xi,double &jac) 00323 { 00324 matrix transf(2,2); 00325 matrix n1(2,2),n2(2,2); 00326 matrix pom(2,2); 00327 double l,dx,dy; 00328 00329 dx = x[1] - x[0]; 00330 dy = y[1] - y[0]; 00331 00332 fillm(0.0,gm); 00333 00334 fillm(0.0,n1); 00335 fillm(0.0,n2); 00336 fillm(0.0,transf); 00337 fillm(0.0,pom); 00338 00339 n1[0][0]=(1-xi)/2; 00340 n1[1][1]=(1-xi)/2; 00341 00342 n2[0][0]=(1+xi)/2; 00343 n2[1][1]=(1+xi)/2; 00344 00345 l=sqrt(dx*dx+dy*dy); 00346 00347 transf[0][0]=dx/l; 00348 transf[0][1]=dy/l; 00349 transf[1][0]=-dy/l; 00350 transf[1][1]=dx/l; 00351 00352 mxm(transf,n1,pom); 00353 gm[0][4]=pom[0][0]; 00354 gm[0][5]=pom[0][1]; 00355 gm[1][4]=pom[1][0]; 00356 gm[1][5]=pom[1][1]; 00357 00358 cmulm(-1.0,pom); 00359 gm[0][0]=pom[0][0]; 00360 gm[0][1]=pom[0][1]; 00361 gm[1][0]=pom[1][0]; 00362 gm[1][1]=pom[1][1]; 00363 00364 mxm(transf,n2,pom); 00365 gm[0][6]=pom[0][0]; 00366 gm[0][7]=pom[0][1]; 00367 gm[1][6]=pom[1][0]; 00368 gm[1][7]=pom[1][1]; 00369 00370 cmulm(-1.0,pom); 00371 gm[0][2]=pom[0][0]; 00372 gm[0][3]=pom[0][1]; 00373 gm[1][2]=pom[1][0]; 00374 gm[1][3]=pom[1][1]; 00375 00376 jac=l/2; 00377 } 00378 00379 00380 00381 /** 00382 The function computes stresses at element integration points 00383 00384 @param lcid - load case id 00385 @param eid - element id 00386 00387 @return The function stores resulting stresses in the stress array 00388 of the element integration points. 00389 00390 TKo, 11.2012 00391 */ 00392 void plquadcontact::res_mainip_stresses (long lcid,long eid) 00393 { 00394 long ri,ci; 00395 ri=0; 00396 ci=0; 00397 compute_nlstress (lcid,eid,ri,ci); 00398 } 00399 00400 00401 00402 /** 00403 Function computes correct stresses at integration points on element. 00404 00405 @param lcid - number of load case 00406 @param eid - element id 00407 @param ri,ci - row and column indices 00408 00409 @return The function stores resulting stresses in the stress array 00410 of the element integration points. 00411 00412 Created by Tomas Koudelka, 11.2008 00413 */ 00414 00415 void plquadcontact::compute_nlstress (long lcid,long eid,long ri,long ci) 00416 { 00417 long i,ipp; 00418 00419 ipp=Mt->elements[eid].ipp[ri][ci]; 00420 00421 for(i=0;i<intordsm[0][0];i++) 00422 { 00423 // computation of correct stresses 00424 if (Mp->strcomp==1) 00425 Mm->computenlstresses(ipp); 00426 ipp++; 00427 } 00428 } 00429 00430 00431 00432 /** 00433 Function computes internal forces in the case of geometrical linear computation. 00434 00435 @param lcid - number of load case 00436 @param eid - element id 00437 @param ri,ci - row and column indices 00438 @param ifor - %vector of internal forces (output) 00439 @param x,y - %vectors of nodal coordinates 00440 00441 @return The function returns %vector of internal forces in the parameter ifor. 00442 00443 Created by Tomas Koudelka, 11.2008 00444 */ 00445 void plquadcontact::internal_forces (long lcid,long eid,long ri,long ci,vector &ifor,vector &x, vector &y) 00446 { 00447 integratedquant iq; 00448 iq=locstress; 00449 00450 // computation of stresses 00451 compute_nlstress (lcid,eid,ri,ci); 00452 00453 // integration of stresses over the element 00454 elem_integration (iq,lcid,eid,ri,ci,ifor,x,y); 00455 } 00456 00457 00458 00459 /** 00460 Function computes resulting internal forces (from correct stresses) 00461 00462 @param lcid - number of load case 00463 @param eid - element id 00464 @param ifor - %vector of internal forces 00465 00466 @return The function returns resulting %vector of internal forces in the parameter ifor. 00467 00468 Created by Tomas Koudelka, 11.2008 00469 */ 00470 void plquadcontact::res_internal_forces (long lcid,long eid,vector &ifor) 00471 { 00472 long transf; 00473 ivector nodes (nne); 00474 vector v(ndofe),x(nne),y(nne); 00475 00476 Mt->give_node_coord2d (x,y,eid); 00477 00478 internal_forces (lcid,eid,0,0,ifor,x,y); 00479 00480 // transformation of nodal forces 00481 // (in the case of nodal coordinate systems) 00482 Mt->give_elemnodes (eid,nodes); 00483 transf = Mt->locsystems (nodes); 00484 if (transf>0){ 00485 matrix tmat (ndofe,ndofe); 00486 transf_matrix (nodes,tmat); 00487 //globloctransf (ifor,v,tmat); 00488 glvectortransf (ifor,v,tmat); 00489 copyv (v,ifor); 00490 } 00491 } 00492 00493 00494 00495 /** 00496 The function integrates selected quantity on the selected finite element. 00497 It results in nodal values. 00498 00499 @param iq - type of integrated quantity (see alias.h) 00500 @param lcid - number of load case 00501 @param eid - element id 00502 @param ri,ci - row and column indices 00503 @param nv - nodal values 00504 @param x,y - nodal coordinates 00505 00506 @return The function returns nodal values of the integrated quantity in the parameter nv. 00507 00508 JF, 29.10.2012 00509 */ 00510 void plquadcontact::elem_integration (integratedquant iq,long lcid,long eid,long ri,long ci,vector &nv,vector &x,vector &y) 00511 { 00512 long ipp,i; 00513 double xi,jac,thick; 00514 ivector nodes (nne); 00515 vector ipv(tncomp),contr(ndofe), t(nne); 00516 vector w(intordsm[0][0]); 00517 matrix gm(tncomp,ndofe); 00518 vector gp(intordsm[0][0]); 00519 00520 00521 fillv(0.0,nv); 00522 00523 gauss_points (gp.a,w.a,intordsm[0][0]); 00524 00525 ipp=Mt->elements[eid].ipp[ri][ci]; 00526 Mt->give_elemnodes (eid,nodes); 00527 Mc->give_thickness (eid,nodes,t); 00528 00529 for (i=0;i<intordsm[0][0];i++) 00530 { 00531 xi =gp[i]; 00532 // function assembles required quantity at integration point 00533 Mm->givequantity(iq,lcid,ipp,0,ipv); 00534 // strain-displacement (geometric) matrix 00535 geom_matrix(gm,x,y,xi,jac); 00536 // contribution to the internal forces 00537 mtxv(gm,ipv,contr); 00538 // thickness in integration point 00539 thick = approx (xi,t); 00540 cmulv(jac*w[i]*thick,contr); 00541 // summation 00542 addv(contr,nv,nv); 00543 ipp++; 00544 } 00545 } 00546 00547 00548 00549 00550 00551 /* 00552 OLD VERSION 00553 */ 00554 00555 00556 // plquadcontact::plquadcontact (void) 00557 // { 00558 // long i,j; 00559 00560 // nne=4; ndofe=8; 00561 // nb=1; tncomp=2; 00562 00563 // ncomp = new long [nb]; 00564 // ncomp[0]=2; 00565 00566 // nip = new long* [nb]; 00567 // //intordsm = new long* [nb]; 00568 // for (i=0;i<nb;i++){ 00569 // nip[i] = new long [nb]; 00570 // //intordsm[i] = new long [nb]; 00571 // } 00572 00573 // nip[0][0]=2; 00574 00575 // tnip=0; 00576 // for (i=0;i<nb;i++){ 00577 // for (j=0;j<nb;j++){ 00578 // tnip+=nip[i][j]; 00579 // } 00580 // } 00581 // } 00582 00583 // plquadcontact::~plquadcontact (void) 00584 // { 00585 // long i; 00586 00587 // for (i=0;i<nb;i++){ 00588 // delete [] nip[i]; 00589 // //delete [] intordsm[i]; 00590 // } 00591 // delete [] nip; 00592 // //delete [] intordsm; 00593 00594 // delete [] ncomp; 00595 00596 // } 00597 00598 // /** 00599 // function initializes basic data on elements 00600 00601 // @param eid - element id 00602 00603 // JK, 11.6.2006 00604 // */ 00605 // void plquadcontact::eleminit (long eid) 00606 // { 00607 00608 // long ii,jj; 00609 00610 // Mt->elements[eid].nb=nb; 00611 // //Mt->elements[eid].intordsm = new long* [nb]; 00612 // Mt->elements[eid].nip = new long* [nb]; 00613 00614 // for (ii=0;ii<nb;ii++){ 00615 // //Mt->elements[eid].intordsm[ii] = new long [nb]; 00616 // Mt->elements[eid].nip[ii] = new long [nb]; 00617 // for (jj=0;jj<nb;jj++){ 00618 // //Mt->elements[eid].intordsm[ii][jj]=intordsm[ii][jj]; 00619 // Mt->elements[eid].nip[ii][jj]=nip[ii][jj]; 00620 // } 00621 // } 00622 00623 // } 00624 00625 // /** 00626 // function assembles transformation %matrix x_g = T x_l 00627 00628 // @param nodes - array containing node numbers 00629 // @param tmat - transformation %matrix 00630 00631 // JK, 11.6.2006 00632 // */ 00633 // void plquadcontact::transf_matrix (ivector &nod,matrix &tmat) 00634 // { 00635 // long i,n,m; 00636 00637 // fillm (0.0,tmat); 00638 00639 // n=nod.n; 00640 // m=tmat.m; 00641 // for (i=0;i<m;i++){ 00642 // tmat[i][i]=1.0; 00643 // } 00644 00645 // for (i=0;i<n;i++){ 00646 // if (Mt->nodes[nod[i]].transf>0){ 00647 // tmat[i*2][i*2] = Mt->nodes[nod[i]].e1[0]; tmat[i*2][i*2+1] = Mt->nodes[nod[i]].e2[0]; 00648 // tmat[i*2+1][i*2] = Mt->nodes[nod[i]].e1[1]; tmat[i*2+1][i*2+1] = Mt->nodes[nod[i]].e2[1]; 00649 // } 00650 // } 00651 // } 00652 00653 00654 00655 00656 00657 00658 00659 00660 00661 00662 00663 00664 00665 00666 00667 00668 // /** 00669 // function computes stiffness %matrix of plane rectangular 00670 // finite element for contact problems 00671 00672 // @param eid - number of element 00673 // @param ri,ci - row and column indices 00674 // @param sm - stiffness %matrix 00675 // @param x,y - vectors of nodal coordinates 00676 00677 // JK, 11.6.2006 00678 // */ 00679 // void plquadcontact::stiffness_matrix (long eid,long ri,long ci,matrix &sm,vector &x,vector &y) 00680 // { 00681 // long ipp; 00682 // matrix d(2,2); 00683 00684 // fillm (0.0,sm); 00685 00686 // // number of appropriate integration point 00687 // ipp=Mt->elements[eid].ipp[ri][ci]; 00688 00689 // // matrix of stiffness of the material 00690 // Mm->matstiff (d,ipp); 00691 00692 // sm[0][0]=d[0][0]; 00693 // sm[0][2]=0.0-d[0][0]; 00694 00695 // sm[1][1]=d[1][1]; 00696 // sm[1][3]=0.0-d[1][1]; 00697 00698 // sm[2][0]=0.0-d[0][0]; 00699 // sm[2][2]=d[0][0]; 00700 00701 // sm[3][1]=0.0-d[1][1]; 00702 // sm[3][3]=d[1][1]; 00703 00704 00705 00706 // sm[4][4]=d[0][0]; 00707 // sm[4][6]=0.0-d[0][0]; 00708 00709 // sm[5][5]=d[1][1]; 00710 // sm[5][7]=0.0-d[1][1]; 00711 00712 // sm[6][4]=0.0-d[0][0]; 00713 // sm[6][6]=d[0][0]; 00714 00715 // sm[7][5]=0.0-d[1][1]; 00716 // sm[7][7]=d[1][1]; 00717 00718 // } 00719 00720 00721 // /** 00722 // function computes stiffness %matrix of quadrilateral element 00723 // for contact problems 00724 00725 // @param lcid - load case id 00726 // @param eid - element id 00727 // @param sm - stiffness %matrix 00728 00729 // JK, 11.6.2006 00730 // */ 00731 // void plquadcontact::res_stiffness_matrix (long lcid,long eid,matrix &sm) 00732 // { 00733 // long transf; 00734 // ivector nodes(nne); 00735 // vector x(nne),y(nne); 00736 // Mt->give_node_coord2d (x,y,eid); 00737 // Mt->give_elemnodes (eid,nodes); 00738 00739 // stiffness_matrix (eid,0,0,sm,x,y); 00740 00741 // // transformation of stiffness matrix 00742 // transf = Mt->locsystems (nodes); 00743 // if (transf>0){ 00744 // matrix tmat (ndofe,ndofe); 00745 // transf_matrix (nodes,tmat); 00746 // glmatrixtransf (sm,tmat); 00747 // } 00748 // } 00749 00750 00751 00752 00753 00754 00755 00756 00757 00758 00759 00760 00761 00762 00763 00764 00765 00766 00767 00768 // /** 00769 // function computes strains at integration points 00770 00771 // @param lcid - load case id 00772 // @param eid - element id 00773 00774 // JK, 11.6.2006 00775 // */ 00776 // void plquadcontact::res_mainip_strains (long lcid,long eid) 00777 // { 00778 // vector aux,x(nne),y(nne),r(ndofe); 00779 // ivector nodes(nne); 00780 // matrix tmat; 00781 00782 // // coordinates of nodes of element 00783 // Mt->give_node_coord2d (x,y,eid); 00784 // // node numbers of element 00785 // Mt->give_elemnodes (eid,nodes); 00786 // // nodal displacements 00787 // eldispl (lcid,eid,r.a); 00788 00789 // // transformation of displacement vector 00790 // long transf = Mt->locsystems (nodes); 00791 // if (transf>0){ 00792 // allocv (ndofe,aux); 00793 // allocm (ndofe,ndofe,tmat); 00794 // transf_matrix (nodes,tmat); 00795 // //locglobtransf (aux,r,tmat); 00796 // lgvectortransf (aux,r,tmat); 00797 // copyv (aux,r); 00798 // destrv (aux); 00799 // destrm (tmat); 00800 // } 00801 00802 // // 00803 // mainip_strains (lcid,eid,0,0,x,y,r); 00804 00805 // } 00806 00807 // /** 00808 // function computes strains at integration points of element 00809 // function is used in geometrically linear problems 00810 00811 // @param lcid - load case id 00812 // @param eid - element id 00813 // @param ri,ci - row and column indices 00814 // @param ii - number of block 00815 // @param x,y - arrays with node coordinates 00816 // @param r - %vector of nodal displacements 00817 00818 // JK, 11.6.2006 00819 // */ 00820 // void plquadcontact::mainip_strains (long lcid,long eid,long ri,long ci,vector &x,vector &y,vector &r) 00821 // { 00822 // long ipp; 00823 // vector displdiff(2); 00824 00825 // ipp=Mt->elements[eid].ipp[ri][ci]; 00826 00827 // displdiff[0]=r[0]-r[2]; 00828 // displdiff[1]=r[1]-r[3]; 00829 00830 // Mm->storestrain (lcid,ipp,displdiff); 00831 // ipp++; 00832 00833 // displdiff[0]=r[6]-r[4]; 00834 // displdiff[1]=r[7]-r[5]; 00835 00836 // Mm->storestrain (lcid,ipp,displdiff); 00837 00838 // } 00839 00840 00841 00842 00843 00844 00845 00846 00847 00848 00849 00850 00851 // /** 00852 // function computes internal forces 00853 00854 // @param lcid - number of load case 00855 // @param eid - element id 00856 // @param ri,ci - row and column indices 00857 // @param ifor - vector of internal forces 00858 // @param x,y - vectors of nodal coordinates 00859 00860 // JK, 11.6.2006 00861 // */ 00862 // void plquadcontact::internal_forces (long lcid,long eid,long ri,long ci,vector &ifor,vector &x,vector &y) 00863 // { 00864 // long ipp; 00865 // vector nodfor (2); 00866 00867 // // number of apropriate integration point 00868 // ipp=Mt->elements[eid].ipp[ri][ci]; 00869 00870 // if (Mp->strcomp==1) 00871 // Mm->computenlstresses (ipp); 00872 00873 // Mm->givestress (lcid,ipp,nodfor); 00874 00875 // ifor[0]=nodfor[0]; 00876 // ifor[1]=nodfor[1]; 00877 // ifor[2]=0.0-nodfor[0]; 00878 // ifor[3]=0.0-nodfor[1]; 00879 00880 // if (Mp->strcomp==1) 00881 // Mm->computenlstresses (ipp); 00882 00883 // Mm->givestress (lcid,ipp,nodfor); 00884 00885 // ifor[4]=0.0-nodfor[0]; 00886 // ifor[5]=0.0-nodfor[1]; 00887 // ifor[6]=nodfor[0]; 00888 // ifor[7]=nodfor[1]; 00889 00890 // } 00891 00892 00893 // /** 00894 // function computes internal forces 00895 00896 // @param lcid - load case id 00897 // @param eid - element id 00898 // @param ifor - %vector of internal forces 00899 00900 // JK, 11.6.2006 00901 // */ 00902 // void plquadcontact::res_internal_forces (long lcid,long eid,vector &ifor) 00903 // { 00904 // vector x(nne),y(nne); 00905 00906 // Mt->give_node_coord2d (x,y,eid); 00907 00908 // internal_forces (lcid,eid,0,0,ifor,x,y); 00909 // } 00910