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...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<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[i].dx(j)*u[i].dx(j)*dxL = v[i]*f[i]*dxThisexampleisimplementedinthefilepoisson system.uflinthecollectionof demonstration forms included with the <strong>UFL</strong> source distribution.3.4 The strain-strain term of linear elasticityThe strain-strain term of linear elasticity,∫a(v,u) = ǫ(v) : ǫ(u)dx, (3.6)Ωwhereǫ(v) = 1 2 (∇v +(∇v)⊤ ) (3.7)can be implemented as follows:element = VectorElement("Lagrange", tetrahedron, 1)v = TestFunction(element)u = TrialFunction(element)def epsilon(v):Dv = grad(v)return 0.5*(Dv + Dv.T)a = inner(epsilon(v), epsilon(u))*dxAlternatively, index notation can be used to define the form:a = 0.25*(Dx(v[j], i) + Dx(v[i], j))* \(Dx(u[j], i) + Dx(u[i], j))*dx64

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

Saved successfully!

Ooh no, something went wrong!