# 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
For the case in which both the pressure and displacement fields are discontinuous across a discontinuity surface, the relevant functions spaces for the Taylor-Hood element read  
\[V =\left\{\mathbf{v}\in\left(L^{2}\left(\Omega\right)\right)^{d}\cap \left(H_{0}^{1}\left(\Omega\backslash\Gamma_{d}\right)\right)^{d},\mathbf{v}|_{ \Omega_{e}}\in\left(P^{2}\left(\Omega\right)\backslash\Gamma_{d}\right)^{d} \forall e\right\}, \tag{31}\] \[Q =\left\{p\in L^{2}\left(\Omega\right)\cap H^{1}\left(\Omega \backslash\Gamma_{d}\right),p|_{\Omega_{e}}\in P^{1}\left(\Omega\backslash \Gamma_{d}\right)\forall e\right\}. \tag{32}\]  
For the case in which the displacement field is discontinuous and the pressure field is continuous, the pressure space \(Q\) requires re-definition:  
\[Q=\left\{p\in H^{1}\left(\Omega\right),p|_{\Omega_{e}}\in P^{1}\left(\Omega \right)\forall e\right\}. \tag{33}\]  
The difference between the two formulations is subtle. Inspection of the Euler-Lagrange equations associated with the variational forms shows that in both cases  
\[\left(2\mu\
abla^{s}\mathbf{u}^{+}-p^{+}\mathbf{I}\right)\mathbf{n}^{+} =\mathbf{t}, \tag{34}\] \[\left(2\mu\
abla^{s}\mathbf{u}^{-}-p^{-}\mathbf{I}\right)\mathbf{n}^{-} =\mathbf{t}, \tag{35}\]  
which implies that weak continuity of the traction across discontinuity surfaces is enforced. For the continuous pressure case, this can be rephrased as enforcing  
\[\llbracket 2\mu\
abla^{s}\mathbf{u}\rrbracket\,\mathbf{n}^{+}=\mathbf{0} \tag{36}\]  
in a weak sense, which is the viscous part of the traction (continuity of pressure contribution is enforced point-wise by construction). For the discontinuous pressure case we have  
\[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}\]0  
which implies weak continuity of the total traction across the discontinuity surface. There is also a subtle difference between the two formulations in terms of how the incompressibility constraint is enforced, but since the Taylor-Hood element does not enforce \(\
abla\cdot\mathbf{u}=0\) element-wise, this is unlikely to be of consequence. We now show how one can switch trivially between discontinuous and continuous pressure formulations with a Taylor-Hood element using the form compiler. For a problem in which the traction acting on the discontinuity surface is made a function of the displacement jump across the surface according to  
\[\mathbf{t}= \begin{bmatrix}t_{n}\\ t_{s}\end{bmatrix} = \begin{bmatrix}K_{nn}&0\\ 0&K_{ss}\end{bmatrix}\begin{bmatrix}\llbracket u_{h}\rrbracket_{n}\\ \llbracket u_{h}\rrbracket_{s}\end{bmatrix} , \tag{38}\]where the subscripts \"\(n\)\" and \"\(s\)\" denote normal and tangential components relative to the discontinuity surface, the form compiler input for the problem with discontinuous pressure is shown in Figure 7.  
A quadratic Lagrange vector function space and a linear Lagrange function space, both of which include discontinuities, are defined and these are used for the displacement and pressure fields, respectively. The two spaces are combined to create a Taylor-Hood element and the definition of the variational forms follows directly from Equations (29) and (30). To switch to a formulation with continuous pressure, only the function spaces in the input to the form compiler, shown in Figure 7, need to be changed. The form compiler declarations of the function spaces for a Taylor-Hood formulation with a discontinuous displacement field and a continuous pressure field are shown in Figure 8.  
Using both formulations, a two-dimensional domain with sides of unit length and an internal cut-out section has been modelled. Two discontinuity surfaces are present. The displacement is prescribed on the bottom edge (\(\mathbf{u}_{h}=\mathbf{0}\) for \(y=0\)) and the top edge (\(\mathbf{u}_{h}=(0,1)\) for \(y=1\)). All other faces are traction-free. The shear modulus \(\mu=1\) and for the interface traction \(K_{nn}=2\) and \(K_{ss}=0\).