# Copyright (c) 2005-2007 Anders Logg # # This file is part of DOLFIN. # # DOLFIN is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # DOLFIN is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with DOLFIN. If not, see . # # The bilinear form a(u, v) and Linear form L(v) for the Stokes # equations using a mixed formulation (Taylor-Hood elements). # # Compile this form with FFC: ffc -l dolfin -f split Stokes.ufl from ufl_legacy import (Coefficient, dx, FiniteElement, VectorElement, div, dot, inner, grad, tetrahedron, TestFunction, TrialFunction) P2 = VectorElement("Lagrange", tetrahedron, 2) P1 = FiniteElement("Lagrange", tetrahedron, 1) u = TrialFunction(P2) p = TrialFunction(P1) v = TestFunction(P2) q = TestFunction(P1) f = Coefficient(P2) g = Coefficient(P1) c = Coefficient(P1) a00 = inner(grad(u), grad(v))*dx a01 = -div(v)*p*dx a10 = -div(u)*q*dx a11 = c*p*q*dx L0 = dot(f, v)*dx L1 = dot(g, q)*dx forms = [a00, a01, a10, a11, L0, L1]