Unified Form Language: A domain-specific language for weak formulations of partial differential equations
For researchers and engineers solving PDEs with finite element methods, UFL simplifies the expression of complex variational forms, but it is an incremental improvement over existing symbolic tools.
UFL is a domain-specific language for representing weak formulations of PDEs, enabling compact and readable finite element programs in near-mathematical notation. It supports automatic differentiation, arbitrary function space hierarchies, and flexible tensor algebra, and is used by other libraries for concrete implementations.
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 multi-field 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.