ABSTRACT
function [S,T] = GLANT(Nn,Ne,n1L,n2L,n3L,xn,yn);
% Global Assembly two-dimensional node-based
% triangular elements
for e = 1:Ne;
n(1,e) = n1L(e);
n(2,e) = n2L(e);
n(3,e) = n3L(e);
end
% Initialization
S = zeros(Nn,Nn);
T = zeros(Nn,Nn);
% Loop through all elements
for e = 1: Ne;
% coordinates of the element nodes
for i = 1:3;
x(i) = xn(n(i,e));
y(i) = yn(n(i,e));
end
% compute the element matrix entries
b(1) = y(2) − y(3);
b(2) = y(3) − y(1);
b(3) = y(1) − y(2);
c(1) = x(3) − x(2);
c(2) = x(1) − x(3);
c(3) = x(2) − x(1);
Area = 0.5 * abs (b(2)*c(3) − b(3) *c(2));
% Compute the element matrix entries
for i = 1:3;
for j = 1:3;
Se(i,j)= (0.25/Area)*(b(i)*b(j) + c(i) * c(j));
if i == j
Te(i,j)= Area/6;
else
Te(i,j)= Area/12;
end
% Assemble the Element matrices into Global FEM System
S(n(i,e),n(j,e)) = S(n(i,e),n(j,e)) + Se(i,j);
T(n(i,e),n(j,e)) = T(n(i,e),n(j,e)) + Te(i,j);
end
end
end