# Matlab implementation of 2D Interior penalty discontinuous Galerkin poisson problem

Basically, I am trying to solve the 2D poisson problem in order to learn implementation of IPDG methods. The problem states $-\nabla a(x)(\nabla u)=0\ \text{in} \ \Omega$ with $U=0$ on Dirichlet boundary $\Gamma_D$. The weak DG formulation gives find u such that $$a_{\epsilon}(u,v)=l(v)$$ where $$a_{\epsilon}(u,v)=\sum_{K\in T_h}\int_K a\nabla u\cdot \nabla v-\sum_{e\in \Gamma_h\cup \Gamma_D}\int_e\{a\nabla u\cdot n_e\}[v]+ \sum_{e\in \Gamma_h\cup \Gamma_D}\int_e\epsilon\{a\nabla v\cdot n_e\}[u] + \sum_{e\in \Gamma_h\cup \Gamma_D}\frac{\sigma_0}{|e|}\int_e[u][v]$$ Note that $\Gamma_h$ represents the collection of interior edges and $\epsilon$ chooses the method from SIPG,NIPG or IIPG. I understand very well how to compute and assemble the integral over volume in matlab but the skeleton terms (2nd and third terms and fourth ) are my problems. I need help with a simple matlab code for these three terms. I need to know how to code them and assemble them.

• I highly recommend reading Riviere's book, Discontinuous Galerkin Methods for Elliptic & Parabolic Equations: Theory & Implementation. It should have what you're looking for. – Paul Jul 4 '15 at 18:16
• Dear paul, I have the book and am following the algorithm, but I still get confused on the computation and assembly of the interior and boundary integrals on page 54. Any help with matlab code will be appreciated. – sola Jul 5 '15 at 18:00

Since you read Riviere's book and know how to assemble element integrals I assume you are familiar with concepts such as

• transformation to reference elements,