OptFEM2D Toolbox for Matlab  V1.2b1
Matlab/Octave Optimized P1-Lagrange Finite Element Method in 2D
 All Files Functions Pages
ElemMassMatP1.m
Go to the documentation of this file.
1 function AElem=ElemMassMatP1(area)
2 % function AElem=ElemMassMat(area)
3 % Computation of the element mass matrix for
4 % `P_1`-Lagrange finite elements
5 %
6 % Parameters:
7 % area: triangle area (double)
8 %
9 % Return values:
10 % AElem: Element mass matrix, `3\times 3` matrix (double)
11 % ``AElem=\frac{area}{12}\left( \begin{array}{ccc}
12 % 2 &1 &1 \\
13 % 1 &2 &1 \\
14 % 1 &1 &2
15 % \end{array} \right)``
16 %
17 % Example:
18 % @verbatim
19 % area=1/2.;
20 % AElem=ElemMassMatP1(area);
21 % @endverbatim
22 %
23 % OptFEM2DP1 [V1.2b1] - Copyright (C) 2013 CJS (LAGA)
24 %
25 % This file is part of OptFEM2DP1.
26 % OptFEM2DP1 is free software: you can redistribute it and/or modify
27 % it under the terms of the GNU General Public License as published by
28 % the Free Software Foundation, either version 3 of the License, or
29 % (at your option) any later version.
30 %
31 % OptFEM2DP1 is distributed in the hope that it will be useful,
32 % but WITHOUT ANY WARRANTY; without even the implied warranty of
33 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 % GNU General Public License for more details.
35 %
36 % You should have received a copy of the GNU General Public License
37 % along with this program. If not, see <http://www.gnu.org/licenses/>.
38 AElem=(area/12)*[2 1 1; 1 2 1; 1 1 2];