Equation: Poisson Equation Discretized by
Element in 3D
We explain the assembling of the matrix equation for the lowest order BDM element discretization of Poisson equation.
[u,sigma] = Poisson3BDM1(node,elem,bdEdge,f,g_D,varargin)
Created by Ming Wang at Dec 30. 2010.
Copyright (C) Long Chen. See COPYRIGHT.txt for details.
Contents
Data Structure
[elem2dof,dofSign,face] = dof3BDM1(elem);
will construct local to global index map; see ifem dof3BDM1doc for details.
Local Bases
Suppose
is the vertices of the
-th face. The basis along with their div are given by


Inside one tetrahedron, the 12 bases functions along with their div corresponding to 4 local faces [2 3 4; 1 4 3; 1 2 4; 1 3 2] are:(
)




Locally, we order the local bases in the following way:

and rewrite the local bases as:

Because of the different oritentation of local and global faces, from local bases to the global one, the direction should be corrected. That is
phiGlobal(elem2dof(t,1),:) = phi(t,1)*dofSign(t,1);
Mass Matrix
We use the integral formula

to get

In order to calculate the mass matrix, we need to construct a matrix, say, locBasesIdx, to calculate the local index used in the bases. For example, for basis
, we compute
in the way:
= locBasesIdx(i,1);
= locBasesIdx(i,2);
= locBasesIdx(i,3);
where locBasesIdx are constructed as:
locFace = [2 3 4; 1 4 3; 1 2 4; 1 3 2]; locBasesIdx = [locFace(:,[1 2 3]);locFace(:,[2 3 1]);locFace(:,[3 1 2])];
For two local bases
and
,

Matrix for Differential Operator
We record
and then the computation
is straightforward. Just remember to correct the direction.
Right hand side
We use 5-points quadrature which is exact for cubic polynomials. In the barycentric coordinate, the 5-points are
![$$ p_1 = [1/4, 1/4, 1/4, 1/4], \quad w_1 = -4/5 $$](Poisson3BDM1doc_eq74336.png)
![$$ p_2 = [1/2, 1/6, 1/6, 1/6], \quad w_2 = 9/20 $$](Poisson3BDM1doc_eq82295.png)
![$$ p_3 = [1/6, 1/2, 1/6, 1/6], \quad w_3 = 9/20 $$](Poisson3BDM1doc_eq94827.png)
![$$ p_4 = [1/6, 1/6, 1/2, 1/6], \quad w_4 = 9/20 $$](Poisson3BDM1doc_eq60463.png)
![$$ p_5 = [1/6, 1/6, 1/6, 1/2], \quad w_5 = 9/20 $$](Poisson3BDM1doc_eq63061.png)
Note that the two for loops are nested in such a way that the point pxy and the evulation Jp is just computed once.
The local to global assembling is computed using accumarray
b = accumarray(elem2dof(:),bt(:),[Ndof 1]);