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
- 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 Logg# FE1Gradient.uflelement = FiniteElement("Lagrange", triangle, 1)DG = VectorElement("Discontinuous Lagrange", triangle, 0)v = TestFunction(DG)u = TrialFunction(DG)u0 = Function(element)a = dot(v, u)*dxL = dot(v, grad(u0))*dxThe 3 forms can be implemented using the QuadratureElement in a similarfashion in which only the element declaration is different:# QE1NonlinearPoisson.uflelement = FiniteElement("Lagrange", triangle, 1)QE = FiniteElement("Quadrature", triangle, 2)sig = VectorElement("Quadrature", triangle, 2)# QE1Tangent.uflelement = FiniteElement("Lagrange", triangle, 1)QE = FiniteElement("Quadrature", triangle, 2)# QE1Gradient.uflelement = FiniteElement("Lagrange", triangle, 1)QE = VectorElement("Quadrature", triangle, 2)Note that we use 2 points when declaring the QuadratureElement. This isbecause the RHS of the Tangent.form is 2 nd order <strong>and</strong> therefore we need 2points for exact integration. Due to consistency issues, when passing functionsaround between the forms, we also need to use 2 points when declaringthe QuadratureElement in the other forms.73