OptFEM2DP1 Toolbox  V1.2b3
Matlab/Octave Optimized P1-Lagrange Finite Element Method in 2D
 All Files Functions Pages
ElemMassWMatP1.m
Go to the documentation of this file.
1 function AElem=ElemMassWMatP1(area,w)
2 % function AElem=ElemMassWMatP1(area,w)
3 % Computation of the element weighted mass matrix for
4 % `P_1`-Lagrange finite elements
5 %
6 % Parameters:
7 % area: triangle area
8 % w: values of the weight function at the triangle vertices,
9 % `3\times 1` array
10 %
11 % Return values:
12 % AElem: Element weighted mass matrix, `3\times 3` matrix
13 %
14 % Example:
15 % @verbatim
16 % area=1/2.;
17 % w=ones(3,1);
18 % AElem=ElemMassWMatP1(area);
19 % @endverbatim
20 % Copyright:
21 % See \ref license
22  AElem=(area/30)*[ 3*w(1)+w(2)+w(3), w(1)+w(2)+w(3)/2, w(1)+w(2)/2+w(3); ...
23  w(1)+w(2)+w(3)/2, w(1)+3*w(2)+w(3), w(1)/2+w(2)+w(3); ...
24  w(1)+w(2)/2+w(3), w(1)/2+w(2)+w(3), w(1)+w(2)+3*w(3)];