13.07.2015 Views

UFL Specification and User Manual 0.3 - FEniCS Project

UFL Specification and User Manual 0.3 - FEniCS Project

UFL Specification and User Manual 0.3 - FEniCS Project

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>UFL</strong> <strong>Specification</strong> <strong>and</strong> <strong>User</strong> <strong>Manual</strong> <strong>0.3</strong>Martin S. Alnæs, Anders Logg(v, q) = TestFunctions(TH)(u, p) = TrialFunctions(TH)f = Function(P2)a = (inner(grad(v), grad(u)) - div(v)*p + q*div(u))*dxL = dot(v, f)*dxThis example is implemented in the file stokes.ufl in the collection ofdemonstration forms included with the <strong>UFL</strong> source distribution.3.8 Mixed formulation of PoissonWe next consider the following formulation of Poisson’s equation as a pair offirst order equations for σ ∈ H(div) <strong>and</strong> u ∈ L 2 :σ +∇u = 0, (3.17)∇·σ = f. (3.18)We multiply the two equations by a pair of test functions τ <strong>and</strong> w <strong>and</strong>integrate by parts to obtain the following variational problem: Find (σ,u) ∈V = H(div)×L 2 such thata((τ,w),(σ,u)) = L((τ,w)) ∀(τ,w) ∈ V, (3.19)wherea((τ,w),(σ,u)) =L((τ,w);f) =∫∫ΩΩτ ·σ −∇·τ u+w∇·σdx, (3.20)w ·f dx. (3.21)We may implement the corresponding forms in our form language using firstorder BDM H(div)-conforming elements for σ <strong>and</strong> piecewise constant L 2 -conforming elements for u as follows:68

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!