# Copyright (c) 2005-2006 Anders Logg (logg@tti-c.org) # Licensed under the GNU GPL Version 2 # # The bilinear form a(v, u) and Linear form L(v) for the Stokes # equations using a mixed formulation (Taylor-Hood elements). # This is the 2D version. # Compile this form with FFC: ffc Stokes2D.form P1 = FiniteElement("Lagrange", "triangle", 1) P2 = FiniteElement("Vector Lagrange", "triangle", 2) TH = P2 + P1 (v, q) = BasisFunctions(TH) (u, p) = BasisFunctions(TH) f = Function(P2) a = (dot(grad(u), grad(v)) - p*div(v) + div(u)*q)*dx L = dot(f, v)*dx