# Bilinear and linear forms  a = dot(grad(v), grad(u))*dx + k*djump(v)*djump(u)*dc  L = v*f*dx
## 5 Examples
### Incompressible elasticity with cohesive discontinuity surfaces  
Incompressible elasticity (or Stokes flow) is usually posed as a mixed problem with the displacement and pressure fields as unknowns. In the context of finite element analysis, stability requirements pose restrictions on the allowable combination of finite element spaces for the displacement and pressure fields. For example, it is well known that using equal order Lagrange basis functions for the displacement and pressure fields leads to an unstable formulation. The Taylor-Hood family of elements are examples of stable elements for incompressible elasticity, and involve a continuous piecewise quadratic basis for the displacement field and continuous piecewise linear basis for the pressure field on simplices. A common criticism of Taylor-Hood elements is that they are difficult to implement due to the different order basis functions. If this objection is accepted, it is compounded when considering discontinuous solutions. One has to deal with not only different basis functions, but also the enriched degrees of freedom for the discontinuous fields. Furthermore, one may wish to use, and perhaps switch between, combinations of continuous and discontinuous fields. At the very least, these issues require careful software design. The complexity argument is completely obviated by automated code generation as one can use arbitrary combinations of basis functions trivially, as well as switch between combinations of continuous and discontinuous functions with minimal effort, as we will illustrate. Incompressible elasticity serves as a demonstration of the ease with which multi-physics problems can be dealt with using automated code generation. We consider two incompressible elasticity formulations, both involving a displacement field which is discontinuous across surfaces. The first formulation involves a pressure field which is permitted to be discontinuous across surfaces, and the second formulation involves a pressure field which is continuous  
Figure 6: Three-dimensional elasticity problem. The mesh on the surface of the cube is shown in (a) and the displacement magnitude contours are shown in (b). The discontinuity surfaces are visible in both figures. across surfaces. In both cases, the problem is expressed abstractly as: find \(\mathbf{u}_{h}\in V\) and \(p_{h}\in Q\) such that  
\[a\left(\mathbf{v}_{h};q_{h},\mathbf{u}_{h};p_{h}\right)=L\left(\mathbf{v}_{h};q_{h}\right) \quad\forall\mathbf{v}_{h}\in V,\;q_{h}\in Q. \tag{28}\]  
For a problem with homogeneous Dirichlet boundary conditions on the displacement, the bilinear and linear forms read:  
\[a\left(\mathbf{v}_{h};q_{h},\mathbf{u}_{h};p_{h}\right) =\int_{\Omega\backslash\Gamma_{d}}\
abla\mathbf{v}_{h}\cdot 2\mu \
abla^{s}\mathbf{u}_{h}-\left(\
abla\cdot\mathbf{v}_{h}\right)p_{h}+q_{h}\
abla\cdot \mathbf{u}_{h}\,d\Omega+\int_{\Gamma_{d}}\llbracket\mathbf{v}_{h}\rrbracket\cdot\mathbf{t} \,d\Gamma, \tag{29}\] \[L\left(\mathbf{v}_{h};q_{h}\right) =\int_{\Omega}\mathbf{v}_{h}\cdot\mathbf{f}\,d\Omega, \tag{30}\]  
where \(\mu\) is the shear modulus, \(\mathbf{t}\) is the traction acting on the discontinuity surface and \(\mathbf{f}\) is a source term.