
This demo illustrates how to:

* Read mesh and subdomains from file
* Use mixed function spaces
* Use enriched function spaces

The solution for :math:`u` and :math:`p` in this demo will look as follows:

.. image:: ../plot_u.png
    :scale: 75 %

.. image:: ../plot_p.png
    :scale: 75 %

Equation and problem definition
-------------------------------


Strong formulation:

.. math::

	- \nabla \cdot (\nabla u + p I) &= f \quad {\rm in} \ \Omega, \\
                	\nabla \cdot u &= 0 \quad {\rm in} \ \Omega. \\

.. note::
	The sign of the pressure has been flipped from the classical definition. This is done in order to have a symmetric (but not positive-definite) system of equations 		rather than a non-symmetric (but positive-definite) system of equations.

A typical set of boundary conditions on the boundary :math:`\partial \Omega = \Gamma_{D} \cup \Gamma_{N}` can be:

.. math::

	u &= u_0 \quad {\rm on} \ \Gamma_{D}, \\
	\nabla u \cdot n + p n &= g  \quad\;\; {\rm on} \ \Gamma_{N}. \\

The Stokes equations can easily be formulated in a mixed variational form; that is, a form where the two variables, the velocity and the pressure, are approximated simultaneously. Using the abstract framework, we have the problem: find :math:`(u, p) \in W`, such that

.. math::

	a((u, p), (v, q)) = L((v, q))

for all :math:`(v, q) \in W`, where

.. math::

	a((u, p), (v, q))
				&= \int_{\Omega} [\nabla u \cdot \nabla v
                 + \nabla \cdot v \ p
                 + \nabla \cdot u \ q] \, {\rm d} x, \\
	L((v, q))
				&= \int_{\Omega} f \cdot v \, {\rm d} x
    			+ \int_{\partial \Omega_N} g \cdot v \, {\rm d} s. \\

The space :math:`W` should be a mixed (product) function space: :math:`W = V \times Q` such that :math:`u \in V \, {\rm and} \, q \in Q`.

In this demo, we shall consider the following definitions of the input functions, the domain, and the boundaries:


* :math:`\Omega = [0,1]\times[0, 1] \backslash {\rm dolphin}` (a unit square)
* :math:`\Gamma_D =`
* :math:`\Gamma_N =`
* :math:`u_0 = (- \sin(\pi x_1), 0.0) \, {\rm for} \, x_0 = 1 \, {\rm and} \, u_0 = (0.0, 0.0)` otherwise
* :math:`f = (0.0, 0.0)`
* :math:`g = (0.0, 0.0)`






