Assignment 6 (Due Dec. 1) Math. 610:600 (Last modified on 2015-11-16 10:03) This assignment involves using the mixed finite element method with lowest order Raviart-Thomas elements on triangles. These element were discussed in class. You will use the same triangulations which were used in the midterm (generated by the mesh generator TRIANGLE). You will have to also use edge data from TRIANGLE. TRIANGLE has the capability to mark edges (this will be discussed in recitation). You will need to assemble the stiffness matrix for the mixed system. The first problem considered is (0.1) −∆p = f, p = g, in Ω, on ∂Ω. You will have to select g and f so that p = sin(x)sin(y) is the solution. The variational space for this problem is H div (Ω) × L2 (Ω). Note that the Dirichlet boundary condition is a natural boundary condition and appears in the first equation, namely, Z (0.2) A(u, v) − (∇ · v, p) = − v · n g dx. ∂Ω You should derive the above equation to make sure that you understand where it came from and what A(·, ·) needs to be. The integral on the right hand side ends up generating data for the velocity DOFS. Problem 1. Generate the stiffness matrix for the above problem. The code that generates A(·, ·) should be general enough so that it can generate the stiffness matrix corresponding to the bilinear form α(v, w) + β(∇ · v, ∇ · w), v, w ∈ Vh , with α, β constants. Note that spaces Vh and Wh have all degrees of freedom, e.g., Vh has edge DOFS even on the boundary. You will have to use the edge flags generated by TRIANGLE to identify the boundary edges so that you can set up the right hand side data coming from (0.2). The second part of the right hand side vector comes from the second equation, namely, −(∇ · u, q) = −(f, q). 1 2 For each of the triangulations of the previous assignment, build the stiffness matrix, in sparse form, and the right hand side for the mixed approximation to (0.1). Then compute the approximate solution. Now build the stiffness matrix for the H-div bilinear form, namely, fij = (ψj , ψi ) + (∇ · ψj , ∇ · ψi ) M and compute the approximate solution. Report the approximate H div -error f(dv − cv ))t · (dv − cv )]1/2 . ev := [(M Here cv is the velocity part of the computed solution and dv is the approximate interpolant of the analytic solution. You can use the midpoint quadrature to approximate the integral over the edge of u · n (to compute dv ). Here u = −∇p. Now, estimate the pressure error. Note that the degree of freedom for the pressure is the integral over the triangle. Define (dP )j to be the value of the analytic solution p at the barycenter of the j’th triangle multiplied by Aj , the area of the j’th triangle. The approximation to the L2 (Ω) error is thus, ep := X j 2 ((cp )j − (dp )j ) /Aj 1/2 . Also report the pressure error as a function of the triangulation. The next problem illustrates how you can deal with a mean value constraint in a finite element code (the same issue arises when using H 1 conforming elements, in traction boundary condition elasticity problems, etc.). Naively, one could implement a zero mean value condition on the pressure space by taking M − 1 of the M basis elements and subtracting the mean value from each one. This however leads to a set of basis elements with non-local support. Fortunately, the thing that saves you is that the bilinear form does not see the constants. Thus, one can assemble the pressure matrix using the original, locally support basis elements and this coincides with the matrix that you would have gotten if you used the non-locally supported basis elements. To get the (M − 1) × (M − 1) system, you simply assemble the matrix, skipping either the first or last pressure element. Of course, you cannot skip any velocity elements and contributions from any velocity element to the skipped pressure element must also be discarded. 3 Problem 2. Now, do the same problem as in the midterm without the lower order term −∆p = 5π 2 cos(πx) cos(2πy), on Ω, ∂p = 0, on ∂Ω, ∂n again using the mixed approximation. In this case, the variational space is H0div (Ω)×{L2 (Ω)/1}. Here L2 (Ω)/1 denotes the functions in L2 (Ω) with zero mean value. You need to now assemble a stiffness matrix which excludes all velocity DOFS on ∂Ω. You also have to avoid one pressure DOF as discussed above. Run your code on the triangulations of the previous problem and report the velocity and pressure errors as above. However, because of the way that the mean value was treated (discussed above), your code will not product the correct mean value for the pressure. The simplest thing to do is to subtract the mean value from both your solution cp and the interpolant dp . After doing this, you should see convergence of the pressure.