?? grinprodgausquad.m
字號:
function int=grinprodgausquad(g,sigma);
%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
w=[1/6*ones(3,1)];
ip=[1/2 0;1/2 1/2;0 1/2];
int=0;
for ii=1:3
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; ...
-4*ip(ii,1)^2-4*ip(ii,1)*ip(ii,2)+4*ip(ii,1); ...
2*ip(ii,1)^2-ip(ii,1);4*ip(ii,1)*ip(ii,2);2*ip(ii,2)^2-ip(ii,2); ...
-4*ip(ii,2)^2-4*ip(ii,1)*ip(ii,2)+4*ip(ii,2)];
L=[4*(ip(ii,1)+ip(ii,2))-3, -8*ip(ii,1)-4*ip(ii,2)+4, ...
4*ip(ii,1)-1, 4*ip(ii,2), 0, -4*ip(ii,2); ...
4*(ip(ii,1)+ip(ii,2))-3, -4*ip(ii,1), ...
0, 4*ip(ii,1), 4*ip(ii,2)-1, -8*ip(ii,2)-4*ip(ii,1)+4];
Jt=L*g;
iJt=inv(Jt);
dJt=abs(det(Jt));
G=iJt*L;
int=int+w(ii)*G'*G*dJt;
end
int=sigma*int;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -