00001 #include "pgm.h"
00002
00003
00004 void CST_NL(const vector2d *coor,const int *lm,vector2d *R_net,
00005 const vector2d *d,const double *c,
00006 int numnp,int numel,
00007 double *S11o,double *S22o,double *S12o)
00008 {
00009 int n1,n2,n3,i;
00010 double S11,S22,S12,u1,u2,u3,v1,v2,v3,x21,y21,x31,y31,x32,y32;
00011 double aa,B1,B2,B3,B4,B5,B6,dudx,dvdy,dudy,dvdx;
00012 double E11,E22,E12;
00013
00014 for (i=0;i<numel;i++) {
00015 n1=lm[3*i+0];
00016 n2=lm[3*i+1];
00017 n3=lm[3*i+2];
00018 u1 = d[n1].x;
00019 u2 = d[n2].x;
00020 u3 = d[n3].x;
00021 v1 = d[n1].y;
00022 v2 = d[n2].y;
00023 v3 = d[n3].y;
00024
00025 x21 = coor[n2].x-coor[n1].x;
00026 y21 = coor[n2].y-coor[n1].y;
00027 x31 = coor[n3].x-coor[n1].x;
00028 y31 = coor[n3].y-coor[n1].y;
00029 x32 = coor[n3].x-coor[n2].x;
00030 y32 = coor[n3].y-coor[n2].y;
00031
00032 aa = x21*y31-x31*y21;
00033 B1 = -y32/aa;
00034 B2 = x32/aa;
00035 B3 = y31/aa;
00036 B4 = -x31/aa;
00037 B5 = -y21/aa;
00038 B6 = x21/aa;
00039
00040 dudx = B1*u1 + B3*u2 + B5*u3;
00041 dvdy = B2*v1 + B4*v2 + B6*v3;
00042 dudy = B2*u1 + B4*u2 + B6*u3;
00043 dvdx = B1*v1 + B3*v2 + B5*v3;
00044 E11 = dudx + 0.5*(dudx*dudx + dvdx*dvdx);
00045 E22 = dvdy + 0.5*(dvdy*dvdy + dudy*dudy);
00046 E12 = dudy + dvdx + dudx*dudy + dvdy*dvdx;
00047
00048
00049 S11 = E11*c[0] + E22*c[1];
00050 S22 = E11*c[1] + E22*c[2];
00051 S12 = E12*c[3];
00052 S11o[i]=S11;
00053 S22o[i]=S22;
00054 S12o[i]=S12;
00055
00056
00057 R_net[n1] -= aa*0.5*vector2d(
00058 S11*B1*(1.0+dudx) +
00059 S22*B2*dudy +
00060 S12*(B2*(1.0+dudx) + B1*dudy)
00061 ,
00062 S11*B1*dvdx +
00063 S22*B2*(1.0+dvdy) +
00064 S12*(B1*(1.0+dvdy)+B2*dvdx)
00065 );
00066 R_net[n2] -= aa*0.5*vector2d(
00067 S11*B3*(1.0+dudx) +
00068 S22*B4*dudy +
00069 S12*(B4*(1.0+dudx) + B3*dudy)
00070 ,
00071 S11*B3*dvdx +
00072 S22*B4*(1.0+dvdy) +
00073 S12*(B3*(1.0+dvdy)+B4*dvdx)
00074 );
00075 R_net[n3] -= aa*0.5*vector2d(
00076 S11*B5*(1.0+dudx) +
00077 S22*B6*dudy +
00078 S12*(B6*(1.0+dudx) + B5*dudy)
00079 ,
00080 S11*B5*dvdx +
00081 S22*B6*(1.0+dvdy) +
00082 S12*(B5*(1.0+dvdy)+B6*dvdx)
00083 );
00084 }
00085 }