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 Logga = v.dx(i)*u.dx(i)*dxThis example is implemented in the file poisson.ufl in the collection ofdemonstration forms included with the <strong>UFL</strong> source distribution.3.3 Vector-valued PoissonThe bilinear <strong>and</strong> linear forms for a system of (independent) Poisson equations,∫a(v,u) = ∇v : ∇udx, (3.4)Ω∫L(v;f) = v ·f dx, (3.5)with v, u <strong>and</strong> f vector-valued can be implemented as follows:Ωelement = VectorElement("Lagrange", triangle, 1)v = TestFunction(element)u = TrialFunction(element)f = Function(element)a = inner(grad(v), grad(u))*dxL = dot(v, f)*dxAlternatively, index notation may be used like this:a = Dx(v[i], j)*Dx(u[i], j)*dxL = v[i]*f[i]*dxor like this:63

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

Saved successfully!

Ooh no, something went wrong!