forked from Qinxiaoye/FEM2D
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdfun2D.m
37 lines (33 loc) · 1.05 KB
/
dfun2D.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
function [N_ks,N_yt] = dfun2D(ks,yt,mnode)
% ÇóĞκ¯ÊıµÄµ¼Êı£¬¶şÎ¬
if mnode == 4
N_ks = zeros(4,1);
N_yt = zeros(4,1);
N_ks(1) = (-1+yt)/4;
N_ks(2) = (1-yt)/4;
N_ks(3) = (1+yt)/4;
N_ks(4) = (-1-yt)/4;
N_yt(1) = (-1+ks)/4;
N_yt(2) = (-1-ks)/4;
N_yt(3) = (1+ks)/4;
N_yt(4) = (1-ks)/4;
else % mnode == 8
N_ks = zeros(8,1);
N_yt = zeros(8,1);
N_ks(1) = (-1/4).*((-1)+yt).*(2.*ks+yt);
N_ks(2) = (1/4).*((-1)+yt).*((-2).*ks+yt);
N_ks(3) = (1/4).*(1+yt).*(2.*ks+yt);
N_ks(4) = (-1/4).*(1+yt).*((-2).*ks+yt);
N_ks(5) = ks.*((-1)+yt);
N_ks(6) = (1/2).*(1+(-1).*yt.^2);
N_ks(7) = (-1).*ks.*(1+yt);
N_ks(8) = (1/2).*((-1)+yt.^2);
N_yt(1) = (-1/4).*((-1)+ks).*(ks+2.*yt);
N_yt(2) = (1/4).*(1+ks).*((-1).*ks+2.*yt);
N_yt(3) = (1/4).*(1+ks).*(ks+2.*yt);
N_yt(4) = (-1/4).*((-1)+ks).*((-1).*ks+2.*yt);
N_yt(5) = (1/2).*((-1)+ks.^2);
N_yt(6) = (-1).*(1+ks).*yt;
N_yt(7) = (1/2).*(1+(-1).*ks.^2);
N_yt(8) = ((-1)+ks).*yt;
end