3 % Computation of the element weighted mass matrix
for
4 % `P_1`-Lagrange finite elements
8 % w: values of the weight function at the triangle vertices,
12 % AElem: Element weighted mass matrix, `3\times 3` matrix
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)];