-
Notifications
You must be signed in to change notification settings - Fork 0
/
shape_quad.m
41 lines (24 loc) · 762 Bytes
/
shape_quad.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Shape_Quad.m - 1/12/16 %
% author: Tehila Stone | Theo Dimitrasopoulos %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [N, B, detJ] = shape_quad(r, s, xn, ien, nen)
x = zeros(1,nen);
y = zeros(1,nen);
for i= 1:nen
x(1,i) = xn(1, ien(i));
y(1,i) = xn(2, ien(i));
end
[N, Nr, Ns] = shape2_quad(r,s);
[J] = jacobian_2d(r,s, x, y, nen);
detJ = det(J);
invJ = (inv(J));
B = zeros(nen,2);
Nsr= zeros(2,4);
for i = 1:nen
Nsr(1,i) = Nr(1,i);
Nsr(2,i) = Ns(1,i);
end
B = (invJ)*(Nsr);
B
end