![]() |
OptFEM2DP1 Toolbox
1.2b4
Matlab/Octave Optimized P1-Lagrange Finite Element Method in 2D
|
00001 function [Elem]=ElemStiffElasMatP1Ba(q1,q2,q3,area,lambda,mu) 00002 % function [Elem]=ElemStiffElasMatP1Ba(q1,q2,q3,area,lambda,mu) 00003 % Computation of the element stiffness elasticity matrix for 00004 % `P_1`-Lagrange method. 00005 % The method for numbering the degrees of freedom is local alternate numbering (classical method) 00006 % 00007 % Hooke's matrix : 00008 % C=[L + 2*M L 0] 00009 % [ L L + 2*M 0] 00010 % [ 0 0 M] 00011 % Numbering of local points in reference element is : 00012 % P=[(0, 0), (1, 0), (0, 1)] 00013 % 00014 % Parameters: 00015 % q1 : array of coordinates of the first point of the triangle 00016 % q2 : array of coordinates of the second point of the triangle 00017 % q3 : array of coordinates of the third point of the triangle 00018 % area : triangle area 00019 % lambda : first Lame coefficient in Hooke's law 00020 % mu : second Lame coefficient in Hooke's law 00021 % 00022 % Return values: 00023 % Elem : element stiffness elasticity matrix, 6-by-6 matrix 00024 % 00025 % Example: 00026 % @verbatim 00027 % q1=[0;0];q2=[1;0];q3=[0;1]; 00028 % area=1/2.; 00029 % lambda=1.; mu=1.; 00030 % KElem=ElemStiffElasMatP1Ba(q1,q2,q3,area,lambda,mu); 00031 % @endverbatim 00032 00033 % Copyright: 00034 % See \ref license 00035 00036 u=q2-q3; 00037 v=q3-q1; 00038 w=q1-q2; 00039 % Matrice de Hooke 00040 C=[lambda+2*mu,lambda,0;lambda,lambda+2*mu,0;0,0,mu]; 00041 % Matrice des déformations (x par 2*area) 00042 B=[u(2),0,v(2),0,w(2),0; ... 00043 0,-u(1),0,-v(1),0,-w(1); ... 00044 -u(1),u(2),-v(1),v(2),-w(1),w(2)]; 00045 Elem=B'*C*B/(4*area);