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

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

Go to the source code of this file.

Functions

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

Detailed Description

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

Definition in file MassWAssemblingP1OptV2.m.

Function Documentation

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

Assembling Mass Weight Matrix by $P_1$-Lagrange finite elements using "OptV2" 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=MassWAssemblingP1OptV2(Th.nq,Th.nme,Th.me,Th.areas,Tw);
See Also
SquareMesh
Author
Francois Cuvelier
Date
2012-03-09

Copyright (c) 2012, Francois Cuvelier, Gilles Scarella All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted only in compliance with the BSD license, see http://www.opensource.org/licenses/bsd-license.php

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 MassWAssemblingP1OptV2.m.