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 Loggx = cell.xL = sin(x[1])*v*dxAnother quantity is the (outwards pointing) facet normal cell.n. The normalvector is only defined on the boundary, so it can’t be used in a cellintegral.Example functional M, an integral of the normal component of a function gover the boundary:n = cell.ng = Function(VectorElement("CG", cell, 1))M = dot(n, g)*dsPython scalars (int, float) can be used anywhere a scalar expression is allowed.Another literal constant type is Identity which represents an n×nunit matrix of given size n, as in this example:# Geometric dimensiond = cell.d# d x d identiy matrixI = Identity(d)# Kronecker deltadelta_ij = I[i,j][Advanced] Note that there are some differences from FFC. In particular,using FacetNormal or cell.n does not implicitly add another coefficientFunction to the form, the normal should be automatically computed in UFCcode. Note also that MeshSize has been removed because the meaning isambiguous (does it mean min, max, avg, cell radius?), so use a Constantinstead.28

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

Saved successfully!

Ooh no, something went wrong!