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 LoggThe corresponding finite element variational problem for discontinuous firstorder elements may be implemented as follows:cell = triangleDG1 = FiniteElement("Discontinuous Lagrange", cell, 1)v = TestFunction(DG1)u = TrialFunction(DG1)f = Function(DG1)g = Function(DG1)#h = MeshSize(cell) # TODO: Do we include MeshSize in <strong>UFL</strong>?h = Constant(cell)alpha = 1 # TODO: Set to proper valuegamma = 1 # TODO: Set to proper valuea = dot(grad(v), grad(u))*dx \- dot(avg(grad(v)), jump(u))*dS \- dot(jump(v), avg(grad(u)))*dS \+ alpha/h(’+’)*dot(jump(v), jump(u))*dS \- dot(grad(v), jump(u))*ds \- dot(jump(v), grad(u))*ds \+ gamma/h*v*u*dsL = v*f*dx + v*g*dsThis example is implemented in the file poisson dg.ufl in the collection ofdemonstration forms included with the <strong>UFL</strong> source distribution.3.10 Quadrature elementsFIXME: The code examples in this section have been mostly converted to<strong>UFL</strong> syntax, but the quadrature elements need some more updating, as wellas the text. In <strong>UFL</strong>, I think we should define the element order <strong>and</strong> not the70

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

Saved successfully!

Ooh no, something went wrong!