OptFEM2D  0.1
Matlab optimized FEM2D
 All Files Functions Groups Pages
ElemStiffMatP1.m
Go to the documentation of this file.
1 function AElem=ElemStiffMatP1(q1,q2,q3,area)
2 % function AElem=ElemStiffMatP1(q1,q2,q3,area)
3 % Computation of the element stiffness matrix for a triangle with
4 % vertices 'q1,q2,q3' and area 'area'
5 %
6 % Parameters:
7 % q1: `2\times 1` array, first vertex of the triangle,
8 % q2: `2\times 1` array, second vertex of the triangle,
9 % q3: `2\times 1` array, third vertex of the triangle,
10 % area: triangle area
11 %
12 % Return values:
13 % AElem: `3\times 3` matrix
14 %
15 M=[q2-q3, q3-q1, q1-q2];
16 AElem=(1/(4*area))*M'*M;