


grinprodgausquad Computes the integral of the product of the gradients in 2D FEM for quadratic isoparametric triangular elements Function int=grinprodgausquad(g,sigma); calculates the integral of the product of the gradients in 2D FEM for quadratic isoparametric triangular elements INPUT g = nodal coordinates sigma = conductivity of the element OUTPUT int = value of the integral


0001 function int=grinprodgausquad(g,sigma); 0002 0003 %grinprodgausquad Computes the integral of the product of the gradients in 2D FEM for quadratic isoparametric triangular elements 0004 % Function int=grinprodgausquad(g,sigma); 0005 % calculates the integral of the product of the gradients in 2D FEM for quadratic 0006 % isoparametric triangular elements 0007 % 0008 % 0009 % INPUT 0010 % 0011 % g = nodal coordinates 0012 % sigma = conductivity of the element 0013 % 0014 % OUTPUT 0015 % 0016 % int = value of the integral 0017 0018 % P. Ronkanen and M. Vauhkonen 10.5. 1996 0019 % University of Kuopio, Department of Applied Physics, PO Box 1627, 0020 % FIN-70211 Kuopio, Finland, email: Marko.Vauhkonen@uku.fi 0021 0022 0023 w=[1/6*ones(3,1)]; 0024 ip=[1/2 0;1/2 1/2;0 1/2]; 0025 0026 int=0; 0027 for ii=1:3 0028 S=[2*ip(ii,1)^2+2*ip(ii,2)^2+4*ip(ii,1)*ip(ii,2)-3*ip(ii,1)-3*ip(ii,2)+1; ... 0029 -4*ip(ii,1)^2-4*ip(ii,1)*ip(ii,2)+4*ip(ii,1); ... 0030 2*ip(ii,1)^2-ip(ii,1);4*ip(ii,1)*ip(ii,2);2*ip(ii,2)^2-ip(ii,2); ... 0031 -4*ip(ii,2)^2-4*ip(ii,1)*ip(ii,2)+4*ip(ii,2)]; 0032 L=[4*(ip(ii,1)+ip(ii,2))-3, -8*ip(ii,1)-4*ip(ii,2)+4, ... 0033 4*ip(ii,1)-1, 4*ip(ii,2), 0, -4*ip(ii,2); ... 0034 4*(ip(ii,1)+ip(ii,2))-3, -4*ip(ii,1), ... 0035 0, 4*ip(ii,1), 4*ip(ii,2)-1, -8*ip(ii,2)-4*ip(ii,1)+4]; 0036 Jt=L*g; 0037 iJt=inv(Jt); 0038 dJt=abs(det(Jt)); 0039 G=iJt*L; 0040 int=int+w(ii)*G'*G*dJt; 0041 end 0042 int=sigma*int; 0043 0044 0045