OptFEM3DP1 Toolbox  20130618_070730
Matlab/Octave Optimized P1-Lagrange Finite Element Method in 3D
 All Files Functions Variables Pages
ElemStiffElasMat3DBbP1.m
Go to the documentation of this file.
1 function [Elem]=ElemStiffElasMat3DBbP1(ql,V,H)
2 % NAME
3 % [Elem]=ElemStiffElasMat3DBbP1(ql,V,H)
4 % INPUTS
5 % area : double (element volume)
6 % ql : matrix 3x4
7 % ql(:,il) ...
8 % H : Hooke matrix (6x6)
9 % OUTPUTS
10 % Elem : matrix 12x12
11 % DESCRIPTION
12 % Compute P1-Lagrange elementary Stiff matrix.
13 % Numbering of local points in reference element is :
14 % P=[(0, 0, 0), (1, 0, 0), (0, 1, 0), (0, 0, 1)]
15 %----------------------------------------
16 % Automatic generation with sage
17 % (c) Cuvelier F. email:cuvelier@math.univ-paris13.fr
18 % Copyright:
19 % See \ref license
20 D12=ql(:,1)-ql(:,2);
21 D13=ql(:,1)-ql(:,3);
22 D14=ql(:,1)-ql(:,4);
23 D23=ql(:,2)-ql(:,3);
24 D24=ql(:,2)-ql(:,4);
25 D34=ql(:,3)-ql(:,4);
26 G=zeros(3,4);
27 G(1,1)=-D23(2)*D24(3) + D23(3)*D24(2);
28 G(2,1)=D23(1)*D24(3) - D23(3)*D24(1);
29 G(3,1)=-D23(1)*D24(2) + D23(2)*D24(1);
30 G(1,2)=D13(2)*D14(3) - D13(3)*D14(2);
31 G(2,2)=-D13(1)*D14(3) + D13(3)*D14(1);
32 G(3,2)=D13(1)*D14(2) - D13(2)*D14(1);
33 G(1,3)=-D12(2)*D14(3) + D12(3)*D14(2);
34 G(2,3)=D12(1)*D14(3) - D12(3)*D14(1);
35 G(3,3)=-D12(1)*D14(2) + D12(2)*D14(1);
36 G(1,4)=D12(2)*D13(3) - D12(3)*D13(2);
37 G(2,4)=-D12(1)*D13(3) + D12(3)*D13(1);
38 G(3,4)=D12(1)*D13(2) - D12(2)*D13(1);
39 B=zeros(12,6);
40 
41 for il=1:4
42  B(il,[1,4,5])=G(:,il);
43  B(il+4,[4,2,6])=G(:,il);
44  B(il+8,[5,6,3])=G(:,il);
45 end
46 % for il=1:4
47 % B(il+4,[4,2,6])=M(:,il);
48 % end
49 % for il=1:4
50 % B(il+8,[5,6,3])=M(:,il);
51 % end
52 
53 Elem=B*H*B'/(36*V);