3 % Assembly of the Weighted Mass Matrix by `P_1`-Lagrange finite elements
4 % - Basic version (see report).
6 % The Weighted Mass Matrix `\MasseF{w}` is given by
7 % ``\MasseF{w}_{i,j}=\int_\DOMH w(\q)\FoncBase_i(\q) \FoncBase_j(\q) d\q,\ \forall (i,j)\in{\ENS{1}{\nq}}^2``
8 % where `\FoncBase_i` are `P_1`-Lagrange basis functions.
10 % nq: total number of nodes of the mesh, also denoted by `\nq`,
11 % nme: total number of triangles, also denoted by `\nme`,
12 % me: Connectivity array, `3\times\nme` array.<br/>
13 % `\me(\jl,k)` is the storage index of the
14 % `\jl`-th vertex of the `k`-th triangle in the array `\q`, `\jl\in\{1,2,3\}` and
15 % `k\in{\ENS{1}{\nme}}`.
16 % areas: Array of areas, `1\times\nme` array. areas(k) is the area of the `k`-th triangle.
17 % Tw: Array of vertices weight `w` function values,
18 % `1\times\nq` array.<br/>
19 % `Tw(i)=w(\q^i),` `\forall i\in\ENS{1}{\nq}`.
22 % M: Global weighted mass matrix, `\nq\times\nq` sparse matrix.
28 % Tw=w(Th.q(1,:),Th.q(2,:));
35 % OptFEM2DP1 [V1.2b1] - Copyright (C) 2013 CJS (LAGA)
37 % This file is part of OptFEM2DP1.
38 % OptFEM2DP1 is free software: you can redistribute it and/or modify
39 % it under the terms of the GNU General Public License as published by
40 % the Free Software Foundation, either version 3 of the License, or
41 % (at your option) any later version.
43 % OptFEM2DP1 is distributed in the hope that it will be useful,
44 % but WITHOUT ANY WARRANTY; without even the implied warranty of
45 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
46 % GNU General Public License
for more details.
48 % You should have received a copy of the GNU General Public License
49 % along with
this program. If not, see <http:
61 M(i,j)=M(i,j)+E(il,jl);