# Surface Normal for 2D Finite Element Method

Consider this BVP with variable coefficients: $$-\nabla\cdot(a\nabla u) = f\ in\ \Omega$$ $$-n\cdot(a\nabla u) = \kappa(u-g_D)-g_N\ on\ \partial \Omega$$ where $a>0,f,\kappa>0,g_D,g_N$ are given functions. To obtain the variational formulation of this problem, multiply $f=-\nabla\cdot(a\nabla u)$ by a test function $v$ and integrate over the domain $\Omega$: $$\int_{\Omega} fv\ dx = \int_{\Omega}-\nabla\cdot(a\nabla u)v\ dx$$ $$= \int_{\Omega} a\nabla u\cdot \nabla v\ dx-\int_{\partial \Omega}n\cdot (a\nabla u)v\ ds$$ $$= \int_{\Omega} a\nabla u\cdot \nabla v\ dx-\int_{\partial \Omega} (\kappa(u-g_D)-g_N)v\ ds$$

Green's thm was used in the second-to-last equality, and for the final equality we just used the BC. The steps and calculations following this are not a problem.

Now consider the BVP $$-\Delta u=f\ in\ \Omega$$ $$u=\sin{2\pi x_1}\cdot \sin{2\pi x_2}\ on\ \partial \Omega$$

Following the same idea as above we end up with $$\int_{\Omega} fv\ dx = \int_{\Omega} \nabla u\cdot \nabla v\ dx-\int_{\partial \Omega} n\cdot \nabla uv\ ds$$

At this point I am stuck. What should I do about $n$? I can't find any clues on this particular problem anywhere. Should I attempt to "eliminate" $n$ as in the first example (if so, how?), or should I use $n$ directly in further calculations?

I'm just looking for hints on how to handle $n$, no one seems to have had this same problem though.

• Actually, many thousands of mathematicians have had this problem back to the days of Euler! ;-) When there is a Dirichlet condition on the boundary (i.e. the dependent variable is specified), the trick to dealing with the integral over the boundary is to simply place a special requirement on the function, $v$; it must equal zero on the boundary where $u$ is specified. So the boundary integral disappears. – Bill Greene Dec 7 '16 at 22:38
• Thanks! I think I know what you're saying, it's similar to advice I got on the corresponding 1D case. But ok... when we implement this, won't we eventually need to adjust the stiffness matrix using values of $n$? (Not a very specific question, I know :-/ ) – Erik Vesterlund Dec 7 '16 at 22:56
• No, the restriction on $v$ eliminates this integral on all sections of the boundary where $u$ is prescribed. Prescribing $u$ is done by restricting $u$ as needed to satisfy the constraints. Usually this is done by fixing the nodal values of $u$ and this often involves modifying the stiffness matrix in some way. – Bill Greene Dec 8 '16 at 1:24

As @BillGreen already said in one of the comments, the test function $v$ is actually zero on the boundary, so the whole boundary integral simply disappears.
If you want to understand why $v$ is zero, take a look at lecture 21.5 of mine: http://www.math.colostate.edu/~bangerth/videos.html . The point is that $v$ is a variation of the solution $u$; so if $u=g$ on the boundary, then any variation $u+\epsilon v$ must also be equal to $g$ on the boundary, which can only be the case if $v$ is zero on the boundary.