I want to solve the heat equation with a (Discontinuous Galerkin) Bassi-Rebay formulation. My toy problem is -\Delta u = -4\pi² sin(2\pi x) \quad \forall x \in [0,1] with homogeneous Dirichlet conditions. I am implementing a 1D solver (with Legendre polynomials), but I have an conditioning issue is my square matrix of the linear system. So I first want to try a FreeFem implementation before continuing.
Your code solves the problem as a 2d problem. In order to have a well-posed problem (non singular matrix) you have to include the y derivatives, with for example Neumann boundary condition at the bottom and top.
Moreover, there was a sign error for the jump terms. This is probably related to the FreeFem convention that the jump is “external minus internal” whereas it can be the opposite in several papers.