Unified form language: A domain-specific language for weak formulations of partial differential equations

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]  Lukas Exl,et al.  Numerical methods for the stray-field calculation: A comparison of recently developed algorithms , 2012, 1204.4302.

[2]  Anders Logg,et al.  DOLFIN: Automated finite element computing , 2010, TOMS.

[3]  Anders Logg,et al.  FFC: the FEniCS Form Compiler , 2012 .

[4]  M. Fortin,et al.  A stable finite element for the stokes equations , 1984 .

[5]  Barak A. Pearlmutter,et al.  Nesting forward-mode AD in a functional framework , 2008, High. Order Symb. Comput..

[6]  Griewank,et al.  On automatic differentiation , 1988 .

[7]  Garth N. Wells,et al.  Optimal control with stochastic PDE constraints and uncertain controls , 2011, ArXiv.

[8]  Paris Gamni Seventh international conference on Domain decomposition methods in scientific and engineering computing , 1993 .

[9]  D. Arnold,et al.  Finite element exterior calculus, homological techniques, and applications , 2006, Acta Numerica.

[10]  M. Rognes,et al.  Efficient Assembly of H(div) and H(curl) Conforming Finite Elements , 2012, 1205.3085.

[11]  Jerzy Karczmarczuk Functional Differentiation of Computer Programs , 2001, High. Order Symb. Comput..

[12]  Paul Hudak,et al.  Building domain-specific embedded languages , 1996, CSUR.

[13]  David A. Ham,et al.  Finite element assembly strategies on multi‐core and many‐core architectures , 2013 .

[14]  André Massing,et al.  A Stabilized Nitsche Fictitious Domain Method for the Stokes Problem , 2012, J. Sci. Comput..

[15]  Anders Logg,et al.  A compiler for variational forms , 2006, TOMS.

[16]  X. Yi On Automatic Differentiation , 2005 .

[17]  Zeyun Yu,et al.  Modelling cardiac calcium sparks in a three‐dimensional reconstruction of a calcium release unit , 2012, The Journal of physiology.

[18]  Kent-André Mardal,et al.  On the efficiency of symbolic computations combined with code generation for finite element methods , 2010, TOMS.

[19]  D. Arnold An Interior Penalty Finite Element Method with Discontinuous Elements , 1982 .

[20]  Christophe Prud'homme,et al.  A domain specific embedded language in C++ for automatic differentiation, projection, integration and variational formulations , 2006, Sci. Program..

[21]  Anders Logg,et al.  Finite element variational forms , 2012 .

[22]  Garth N. Wells,et al.  Optimizations for quadrature representations of finite element tensors through automated code generation , 2011, TOMS.

[23]  Ralph E. Johnson,et al.  Design Patterns: Abstraction and Reuse of Object-Oriented Design , 1993, ECOOP.

[24]  Kevin R. Long,et al.  Unified Embedded Parallel Finite Element Computations via Software-Based Fr[e-acute]chet Differentiation , 2010, SIAM J. Sci. Comput..

[25]  Douglas N. Arnold,et al.  On the consistency of the combinatorial codifferential , 2012 .

[26]  Patricia Brunner,et al.  A deterministic approach to the adapted optode placement for illumination of highly scattering tissue , 2012, Biomedical optics express.

[27]  L. D. Marini,et al.  Two families of mixed finite elements for second order elliptic problems , 1985 .

[28]  Garth N. Wells,et al.  Analysis of an Interface Stabilized Finite Element Method: The Advection-Diffusion-Reaction Equation , 2010, SIAM J. Numer. Anal..

[29]  P. Hood,et al.  A numerical solution of the Navier-Stokes equations using the finite element technique , 1973 .

[30]  David A. Ham,et al.  Automated Derivation of the Adjoint of High-Level Transient Finite Element Programs , 2012, SIAM J. Sci. Comput..

[31]  Joze Korelc,et al.  Automatic Generation of Finite-Element Code by Simultaneous Optimization of Expressions , 1997, Theor. Comput. Sci..

[32]  Anders Logg,et al.  UFC: a Finite Element Code Generation Interface , 2012 .

[33]  Barak A. Pearlmutter,et al.  Lazy multivariate higher-order forward-mode AD , 2007, POPL '07.

[34]  David A. Padua,et al.  SPL: a language and compiler for DSP algorithms , 2001, PLDI '01.

[35]  Anders Logg,et al.  DOLFIN: a C++/Python Finite Element Library , 2012 .

[36]  Anders Logg,et al.  Automated Code Generation for Discontinuous Galerkin Methods , 2008, SIAM J. Sci. Comput..

[37]  Hans Petter Langtangen,et al.  A FEniCS-Based Programming Framework for Modeling Turbulent Flow by the Reynolds-Averaged Navier-Stokes Equations , 2011, ArXiv.

[38]  Kent-Andre Mardal,et al.  SyFi and SFC: symbolic finite elements and form compilation , 2012 .

[39]  Garth N. Wells,et al.  Energy Stable and Momentum Conserving Hybrid Finite Element Method for the Incompressible Navier-Stokes Equations , 2010, SIAM J. Sci. Comput..

[40]  Jonathan Richard Shewchuk,et al.  A Compiler for Parallel Finite Element Methods with Domain-Decomposed Unstructured Meshes , 1993 .

[41]  David E. Bernholdt,et al.  Synthesis of High-Performance Parallel Programs for a Class of ab Initio Quantum Chemistry Models , 2005, Proceedings of the IEEE.

[42]  Anders Logg,et al.  Unified framework for finite element assembly , 2009, Int. J. Comput. Sci. Eng..

[43]  Garth N. Wells,et al.  Phase field model for coupled displacive and diffusive microstructural processes under thermal loading , 2010, 1010.1871.

[44]  Paul S. Wang,et al.  FINGER: A Symbolic System for Automatic Generation of Numerical Programs in Finite Element Analysis , 1986, J. Symb. Comput..

[45]  Anders Logg,et al.  Automated Goal-Oriented Error Control I: Stationary Variational Problems , 2012, SIAM J. Sci. Comput..

[46]  Simon W. Funke,et al.  A framework for automated PDE-constrained optimisation , 2013, ArXiv.

[47]  David A. Ham,et al.  Towards generating optimised finite element solvers for GPUs from high-level specifications , 2010, ICCS.

[48]  Stefan Ulbrich,et al.  Advanced Numerical Methods for PDE Constrained Optimization with Application to Optimal Design in Navier Stokes Flow , 2012, Constrained Optimization and Optimal Control for Partial Differential Equations.

[49]  Anders Logg,et al.  Efficient Assembly of $H(\mathrmdiv) and H(\mathrmcurl)$ Conforming Finite Elements , 2009, SIAM J. Sci. Comput..

[50]  Garth N. Wells,et al.  Automated Modelling of Evolving Discontinuities , 2009, Algorithms.

[51]  Anders Logg,et al.  Automated Solution of Differential Equations by the Finite Element Method: The FEniCS Book , 2012 .