3 % Computation of the element stiffness matrix
for
4 % `P_1`-Lagrange finite elements
7 % q1: Coordinates of the first vertex in the triangle, `2\times 1` array (
double)
8 % q2: Coordinates of the second vertex in the triangle, `2\times 1` array (
double)
9 % q3: Coordinates of the third vertex in the triangle, `2\times 1` array (
double)
10 % area: triangle area (
double)
13 % AElem: Element stiffness matrix, `3\times 3` matrix (
double)
17 % q1=[0;0];q2=[0;1];q3=[1;0];
22 % OptFEM2DP1 [V1.2b1] - Copyright (C) 2013 CJS (LAGA)
24 % This file is part of OptFEM2DP1.
25 % OptFEM2DP1 is free software: you can redistribute it and/or modify
26 % it under the terms of the GNU General Public License as published by
27 % the Free Software Foundation, either version 3 of the License, or
28 % (at your option) any later version.
30 % OptFEM2DP1 is distributed in the hope that it will be useful,
31 % but WITHOUT ANY WARRANTY; without even the implied warranty of
32 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33 % GNU General Public License
for more details.
35 % You should have received a copy of the GNU General Public License
36 % along with
this program. If not, see <http:
37 M=[q2-q3, q3-q1, q1-q2];
38 AElem=(1/(4*area))*M
'*M;