We describe here a library aimed at automating the solution of partial differential equations using the finite element method. By employing novel techniques for automated code generation, the library combines a high level of expressiveness with efficient computation. Finite element variational forms may be expressed in near mathematical notation, from which low-level code is automatically generated, compiled, and seamlessly integrated with efficient implementations of computational meshes and high-performance linear algebra. Easy-to-use object-oriented interfaces to the library are provided in the form of a C++ library and a Python module. This article discusses the mathematical abstractions and methods used in the design of the library and its implementation. A number of examples are presented to demonstrate the use of the library in application code.
1 February 2014 in ACM Transactions on Mathematical Software
We present the Unified Form Language (UFL), which is a domain-specific language for representing weak formulations of partial differential equations with a view to numerical approximation. Features of UFL include support for variational forms and functionals, automatic differentiation of forms and expressions, arbitrary function space hierarchies for multifield problems, general differential operators and flexible tensor algebra. With these features, UFL has been used to effortlessly express finite element methods for complex systems of partial differential equations in near-mathematical notation, resulting in compact, intuitive and readable programs. We present in this work the language and its construction. An implementation of UFL is freely available as an open-source software library. The library generates abstract syntax tree representations of variational problems, which are used by other software libraries to generate concrete low-level implementations. Some application examples are presented and libraries that support UFL are highlighted.
1 September 2006 in ACM Transactions on Mathematical Software
As a key step towards a complete automation of the finite element method, we present a new algorithm for automatic and efficient evaluation of multilinear variational forms. The algorithm has been implemented in the form of a compiler, the FEniCS Form Compiler (FFC). We present benchmark results for a series of standard variational forms, including the incompressible Navier--Stokes equations and linear elasticity. The speedup compared to the standard quadrature-based approach is impressive; in some cases the speedup is as large as a factor of 1000.
In this paper, we discuss how to efficiently evaluate and assemble general finite element variational forms on $H(\mathrm{div})$ and $H(\mathrm{curl})$. The proposed strategy relies on a decomposition of the element tensor into a precomputable reference tensor and a mesh-dependent geometry tensor. Two key points must then be considered: the appropriate mapping of basis functions from a reference element, and the orientation of geometrical entities. To address these issues, we extend here a previously presented representation theorem for affinely mapped elements to Piola-mapped elements. We also discuss a simple numbering strategy that removes the need to contend with directions of facet normals and tangents. The result is an automated, efficient, and easy-to-use implementation that allows a user to specify finite element variational forms on $H(\mathrm{div})$ and $H(\mathrm{curl})$ in close to mathematical notation.