0001 function dshape = element_d_shape_function(type,x,y,z)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023 if(strcmp(type,'tri3'))
0024 dshape = delemshapetri3(x,y,z);
0025 elseif(strcmp(type,'tri6'))
0026 dshape = delemshapetri6(x,y,z);
0027 elseif(strcmp(type,'tri10'))
0028 dshape = delemshapetri10(x,y,z);
0029 elseif(strcmp(type,'tet4'))
0030 dshape = delemshapetet4(x,y,z);
0031 elseif(strcmp(type,'tet10'))
0032 dshape = delemshapetet10(x,y,z);
0033 else
0034 error('Incorrect number of input arguments')
0035 end
0036
0037
0038
0039 function dshape = delemshapetri3(x,y,z)
0040 dshape(1,1) = -1; dshape(1,2) = 1; dshape(1,3) = 0;
0041 dshape(2,1) = -1; dshape(2,2) = 0; dshape(2,3) = 1;
0042 end
0043
0044 function dshape = delemshapetri6(x,y,z)
0045 dshape(1,1) = -3 + 4*x + 4*y; dshape(2,1) = -3 + 4*x + 4*y;
0046 dshape(1,2) = 4*x - 1; dshape(2,2) = 0;
0047 dshape(1,3) = 0; dshape(2,3) = 4*y-1;
0048 dshape(1,4) = 4 - 8*x - 4*y; dshape(2,4) = -4*x;
0049 dshape(1,5) = 4*y; dshape(2,5) = 4*x;
0050 dshape(1,6) = -4*y; dshape(2,6) = 4 - 4*x - 8*y;
0051 end
0052
0053 function dshape=delemshapetri10(x,y,z)
0054 dshape(1,1) = 0.5*(36*x+36*y-27*x*x-27*y*y-54*x*y-11); dshape(2,1) = 0.5*(36*x+36*y-27*x*x-27*y*y-54*x*y-11);
0055 dshape(1,2) = 13.5*x*x-9*x+1; dshape(2,2) = 0;
0056 dshape(1,3) = 0; dshape(2,3) = 13.5*y*y-9*y+1;
0057 dshape(1,4) = 4.5*(2-10*x+9*x*x+12*x*y-5*y+3*y*y); dshape(2,4) = 4.5*(6*x*x-5*x+6*x*y);
0058 dshape(1,5) = 4.5*(y-6*x*y-9*x*x+8*x-1); dshape(2,5) = 4.5*x*(1-3*x);
0059 dshape(1,6) = 27*x*y-4.5*y; dshape(2,6) = 4.5*x*(3*x-1);
0060 dshape(1,7) = 4.5*y*(3*y-1); dshape(2,7) = 27*x*y-4.5*x;
0061 dshape(1,8) = 4.5*y*(1-3*y); dshape(2,8) = 4.5*(x-6*x*y-9*y*y+8*y-1);
0062 dshape(1,9) = 4.5*(6*x*y-5*y+6*y*y); dshape(2,9) = 4.5*(2-5*x+3*x*x+12*x*y-10*y+9*y*y);
0063 dshape(1,10) = 27*y-54*x*y-27*y*y; dshape(2,10) = 27*x-54*x*y-27*x*x;
0064 end
0065
0066
0067
0068
0069
0070
0071
0072
0073 function dshape = delemshapetet4(x,y,z)
0074 dshape(1,1) = -1; dshape(2,1) = -1; dshape(3,1) = -1;
0075 dshape(1,2) = 1; dshape(2,2) = 0; dshape(3,2) = 0;
0076 dshape(1,3) = 0; dshape(2,3) = 1; dshape(3,3) = 0;
0077 dshape(1,4) = 0; dshape(2,4) = 0; dshape(3,4) = 1;
0078 end
0079
0080 function dshape = delemshapetet10(x,y,z)
0081 dshape(1,1) = -3 + 4*x + 4*y + 4*z; dshape(2,1) = -3 + 4*x + 4*y + 4*z; dshape(3,1) = -3 + 4*x + 4*y + 4*z;
0082 dshape(1,2) = 4*x - 1; dshape(2,2) = 0; dshape(3,2) = 0;
0083 dshape(1,3) = 0; dshape(2,3) = 4*y-1; dshape(3,3) = 0;
0084 dshape(1,4) = 0; dshape(2,4) = 0; dshape(3,4) = 4*z - 1;
0085 dshape(1,5) = 4 - 8*x - 4*y - 4*z; dshape(2,5) = -4*x; dshape(3,5) = -4*x;
0086 dshape(1,6) = -4*y; dshape(2,6) = 4 - 4*x - 8*y - 4*z; dshape(3,6) = -4*y;
0087 dshape(1,7)= -4*z; dshape(2,7)= -4*z; dshape(3,7) = 4 - 4*x - 4*y - 8*z;
0088 dshape(1,8) = 4*y; dshape(2,8) = 4*x; dshape(3,8) = 0;
0089 dshape(1,9) = 0; dshape(2,9) = 4*z; dshape(3,9) = 4*y;
0090 dshape(1,10) = 4*z; dshape(2,10) = 0; dshape(3,10) = 4*x;
0091 end
0092
0093 end