Vous êtes sur la page 1sur 5

clear

nel=16;
nnel=4;
ndof=6;
nnode=25;
sdof=nnode*ndof;
edof=nnel*ndof;
emodule=3e6;
poisson=0.0;
t=3;
nglxb=2; nglyb=2;
nglb=nglxb*nglyb;
nglxs=1; nglys=1;
ngls=nglxs*nglys;
gcoord=[0.0 0.0 0.0; 0.0 6.25 0.0; 0.0 12.5 0.0; 0.0 18.75 0.0;0.0 25.0 0.0; 4.3
4 0.0 -0.38;4.34 6.25 -0.38;4.34 12.5 -0.38;4.34 18.75 -0.38;4.34 25.0 -0.38;
8.55 0.0 -1.51;8.55 6.25 -1.51;8.55 12.5 -1.51;8.55 18.75 -1.51;8.55 25.0 -1.51;
12.5 0.0 -3.35;12.5 6.25 -3.35;12.5 12.5 -3.35;12.5 18.75 -3.35;12.5 25.0 -3.35;
16.1 0.0 -5.85;16.1 6.25 -5.85;16.1 12.5 -5.85;16.1 18.75 -5.85;16.1 25.0 -5.85]
;
gcoord=12.0*gcoord;
nodes={{6,7,2,1},{7,8,3,2},{8,9,4,3},{9,10,5,4},{11,12,7,6},{12,13,8,7},{13,14,9
,8},{14,15,10,9},{16,17,12,11},{17,18,13,12},{18,19,14,13},{19,20,15,14},{21,22,
17,16},{22,23,18 17},{23,24,19,18},{24,25,20,19];
bcdof={1 3 5 6 7 11 12 13 17 18 19 23 24 25 26 28 29 30 31 33 56 58 60 61 63 86
88 90 91 93 116 118 120 121 122 123 146 148 150};
bcval=Table[0,{1},{bcdof}];
ff=Table[0,{sdof},{1}];
kk=Table[0,{sdof},{sdof}];
disp=Table[0,{sdof},{1}];
index=Table[0,{edof},{1}];
kinmtsb=Table[0,{3},{edof}];
matmtsb=Table[0,{3},{3}];
kinmtsm=Table[0,{3},{edof}];
matmtsm=Table[0,{3},{3}];
kinmtss=Table[0,{2},{edof}];
matmtss=Table[0,{2},{2}];
tr3d=Table[0,{edof},{edof}];

ff[3,1]=-613.6;
ff[9,1]=-1227.2;
ff[15,1]=-1227.2;
ff[21,1]=-1227.2;
ff[27,1]=-613.6;
ff[33,1]=-1227.2;
ff[39,1]=-2454.4;
ff[45,1]=-2454.4;
ff[51,1]=-2454.4;
ff[57,1]=-1227.2;
ff[63,1]=-1227.2;
ff[69,1]=-2454.4;
ff[75,1]=-2454.4;
ff[81,1]=-2454.4;

ff[87,1]=-1227.2;
ff[93,1]=-1227.2;
ff[99,1]=-2454.4;
ff[105,1]=-2454.4;
ff[111,1]=-2454.4;
ff[117,1]=-1227.2;
ff[123,1]=-613.6;
ff[129,1]=-1227.2;
ff[135,1]=-1227.2;
ff[141,1]=-1227.2;
ff[147,1]=-613.6;
if iopt==1
matmtrx= elastic/(1-poisson*poisson)* ...
[1 poisson 0; ...
poisson 1 0; ...
0 0 (1-poisson)/2];
elseif iopt==2
matmtrx= elastic/((1+poisson)*(1-2*poisson))* ...
[(1-poisson) poisson 0;
poisson (1-poisson) 0;
0 0 (1-2*poisson)/2];
elseif iopt==3
matmtrx= elastic/((1+poisson)*(1-2*poisson))* ...
[(1-poisson) poisson poisson 0;
poisson (1-poisson) poisson 0;
poisson poisson (1-poisson) 0;
0
0
0 (1-2*poisson)/2];
else
matmtrx= elastic/((1+poisson)*(1-2*poisson))* ...
[(1-poisson) poisson poisson 0 0
0;
poisson (1-poisson) poisson 0 0
0;
poisson poisson (1-poisson)
0 0
0;
0
0
0
(1-2*poisson)/2 0
0;
0
0
0
0
(1-2*poisson)/2 0;
0
0
0
0
0 (1-2*poisson)/2];
end

shearm=0.5*emodule/(1.0+poisson);
shcof=5/6;
matmtss=shearm*shcof*t*{{1 0}, {0 1}};
/*****************************************/
feglqd1[ngl_] := [ngll = ngl; point1 = Table[0, {ngll}];
weight1 = Table[0, {ngll}];
If[ngll == 1, point1[[1]] = 0.0; weight1[[1]] = 2.0;,
If[ngll == 2, point1[[1]] = -0.577350269189626;
point1[[2]] = -point1[[1]];
weight1[[1]] = 1.0;
weight1[[2]] = weight1[[1]];,
If[ngll == 3, point1[[1]] = -0.774596669241483;
point1[[2]] = 0.0;
point1[[3]] = -point1[[1]];

weight1[[1]] = 0.555555555555556;
weight1[[2]] = 0.888888888888889;
weight1[[3]] = weight1[[1]];,
If[ngll == 4, point1[[1]] = -0.861136311594053;
point1[[2]] = -0.339981043584856;
point1[[3]] = -point1[[2]];
point1[[4]] = -point1[[1]];
weight1[[1]] = 0.347854845137454;
weight1[[2]] = 0.652145154862546;
weight1[[3]] = weight1[[2]];
weight1[[4]] = weight1[[1]];, point1[[1]] = -0.906179845938664;
point1[[2]] = -0.538469310105683;
point1[[3]] = 0.0;
point1[[4]] = -point1[[2]];
point1[[5]] = -point1[[1]];
weight1[[1]] = 0.236926885056189;
weight1[[2]] = 0.478628670499366;
weight1[[3]] = 0.568888888888889;
weight1[[4]] = weight1[[2]];
weight1[[5]] = weight1[[1]];]]]] Return[{weight1, point1}]];

/&**********************************************************&/
function [tr3d,xprime,yprime]=fetransh(xcoord,ycoord,zcoord,n)
%-------------------------------------------------------------% Purpose:
%
Compute direction cosines between three-dimensional
%
local and global coordinate axes
%
% Synopsis:
%
[tr3d,xprime,yprime]=fetransh(xcoord,ycoord,zcoord,n)
%
% Variable Description:
%
xcoord - nodal x coordinates (4x1)
%
ycoord - nodal y coordinates (4X1)
%
zcoord - nodal z coordinates (4X1)
%
n - number of nodes per element
%
tr3d - 3d transformation matrix from local to global axes
%
xprime - coordinate in terms of the local axes (4x1)
%
yprime - coordinate in terms of the global axes (4X1)
%
% Note:
%
The local x-axis is defined in the direction from the first node
%
to the second node. Nodes 1, 2 and 4 define the local xy-plane.
%
The local z-axis is defined normal to the local xy-plane.
%
The local y-axis is defined normal to the x and z axes.
%-------------------------------------------------------------------------%
% compute direction cosines
%
v12x=xcoord(2)-xcoord(1);
v12y=ycoord(2)-ycoord(1);
v12z=zcoord(2)-zcoord(1);
l12=sqrt(v12x^2+v12y^2+v12z^2);

v23x=xcoord(3)-xcoord(2);
v23y=ycoord(3)-ycoord(2);
v23z=zcoord(3)-zcoord(2);
l23=sqrt(v23x^2+v23y^2+v23z^2);
v34x=xcoord(4)-xcoord(3);
v34y=ycoord(4)-ycoord(3);
v34z=zcoord(4)-zcoord(3);
l34=sqrt(v34x^2+v34y^2+v34z^2);
v14x=xcoord(4)-xcoord(1);
v14y=ycoord(4)-ycoord(1);
v14z=zcoord(4)-zcoord(1);
l14=sqrt(v14x^2+v14y^2+v14z^2);
v13x=xcoord(3)-xcoord(1);
v13y=ycoord(3)-ycoord(1);
v13z=zcoord(3)-zcoord(1);
l13=sqrt(v13x^2+v13y^2+v13z^2);
v1tx=v12y*v14z-v12z*v14y;
v1ty=v12z*v14x-v12x*v14z;
v1tz=v12x*v14y-v12y*v14x;
v1yx=v1ty*v12z-v1tz*v12y;
v1yy=v1tz*v12x-v1tx*v12z;
v1yz=v1tx*v12y-v1ty*v12x;
vxx=v12x/l12;
vxy=v12y/l12;
vxz=v12z/l12;
vyx=v1yx/sqrt(v1yx^2+v1yy^2+v1yz^2);
vyy=v1yy/sqrt(v1yx^2+v1yy^2+v1yz^2);
vyz=v1yz/sqrt(v1yx^2+v1yy^2+v1yz^2);
vzx=v1tx/sqrt(v1tx^2+v1ty^2+v1tz^2);
vzy=v1ty/sqrt(v1tx^2+v1ty^2+v1tz^2);
vzz=v1tz/sqrt(v1tx^2+v1ty^2+v1tz^2);
%
% transformation matrix
%
for i=1:2*n
i1=(i-1)*3+1;
i2=i1+1;
i3=i2+1;
tr3d(i1,i1)=vxx;
tr3d(i1,i2)=vxy;
tr3d(i1,i3)=vxz;
tr3d(i2,i1)=vyx;
tr3d(i2,i2)=vyy;
tr3d(i2,i3)=vyz;
tr3d(i3,i1)=vzx;
tr3d(i3,i2)=vzy;
tr3d(i3,i3)=vzz;
end
%
% compute nodal values in terms of local axes
%
alpa213=acos((l12^2+l13^2-l23^2)/(2*l12*l13));
alpa314=acos((l13^2+l14^2-l34^2)/(2*l13*l14));
alpa41y=2*atan(1)-alpa213-alpa314;
xprime(1)=0; yprime(1)=0;
xprime(2)=l12; yprime(2)=0;
xprime(3)=l13*cos(alpa213); yprime(3)=l13*sin(alpa213);
xprime(4)=l14*sin(alpa41y); yprime(4)=l14*cos(alpa41y);

Vous aimerez peut-être aussi