OptFEM2D  0.1
Matlab optimized FEM2D
 All Files Functions Groups Pages
MassWAssemblingP1base.m File Reference

Assembling Mass Weight Matrix by $P_1$-Lagrange finite elements using "base" version (see report). More...

Go to the source code of this file.

Functions

function M = MassWAssemblingP1base (nq, nme, me, areas, Tw)
 Assembling Mass Weight Matrix by $P_1$-Lagrange finite elements using "base" version (see report).
 

Detailed Description

Assembling Mass Weight Matrix by $P_1$-Lagrange finite elements using "base" version (see report).

Definition in file MassWAssemblingP1base.m.

Function Documentation

function M = MassWAssemblingP1base (   nq,
  nme,
  me,
  areas,
  Tw 
)

Assembling Mass Weight Matrix by $P_1$-Lagrange finite elements using "base" version (see report).

The Mass Weight Matrix is given by

\[\MasseF{w}_{i,j}=\int_\DOMH w(\q)\FoncBase_i(\q) \FoncBase_j(\q) d\q,\ \forall (i,j)\in\ENS{1}{\nq}^2\]

where $\FoncBase_i$ are $P_1$-Lagrange basis functions.

Example
    Th=SquareMesh(10);
    w=@(x,y) cos(x+y);
    Tw=w(Th.q(1,:),Th.q(2,:));
    Mw=MassWAssemblingP1base(Th.nq,Th.nme,Th.me,Th.areas,Tw);
See Also
SquareMesh
Parameters
nqtotal number of nodes of the mesh, also noted $\nq$,
nmenumber of triangles, also noted $\nme$,
me$3\times\nme$ int32 array, $\me(\jl,k)$ index of storage, in the array $q$, of the $\jl$-th vertex of the triangle of index $k$, $\jl\in\{1,2,3\}$ and $k\in\{1,\hdots,\nme\}.$ Also noted $\me$.
areas$1\times\nme$ array, areas(k) is the area of triangle k.
Tw$\nme$ double array, $Tw(i)=w(\q^i),$ $\forall i\in\ENS{1}{\nq}$.
Return values
M$\nq\times\nq$ sparse matrix

Definition at line 17 of file MassWAssemblingP1base.m.