Skip to main content
QUICK REVIEW

[Paper Review] fenics-optim -- Convex optimization interface in FEniCS

Jérémy Bleyer|arXiv (Cornell University)|Jan 10, 2020
Embedded Systems Design TechniquesComputer Science6 citations
TL;DR

This paper introduces fenics-optim, a Python package that automates the formulation and solution of convex variational problems in FEniCS by leveraging conic programming and finite element discretization. It enables users to express complex PDE-constrained optimization problems in just a few lines of code, with efficient solution via the Mosek interior-point solver, achieving high accuracy and scalability across applications from image processing to computational mechanics.

ABSTRACT

<strong>fenics-optim</strong> is a Python library that aims at providing a simple user interface in FEniCS for solving convex optimization problems. In particular, it relies on the <strong>Mosek</strong> mathematical programming library. In particular, Mosek is a state-of-the art solver for linear programming (LP), convex quadratic programming (QP), second-order conic programming (SOCP) and semi-definite programming (SDP). The project can be accessed at https://gitlab.enpc.fr/navier-fenics/fenics-optim

Motivation & Objective

  • To address the challenge of formulating and solving convex variational problems with non-smooth terms in scientific computing, particularly in image processing and computational mechanics.
  • To provide a unified, high-level interface that mimics the continuous mathematical formulation of optimization problems, reducing implementation complexity.
  • To automate finite element discretization for various element types, including standard Lagrange, DG, and H(div)/H(curl) elements, within a single framework.
  • To enable efficient numerical solution of large-scale convex problems, especially those with non-smooth terms, using state-of-the-art interior-point methods via Mosek.
  • To bridge the gap between symbolic PDE formulation in FEniCS and modern conic optimization, supporting both smooth and non-smooth convex functionals.

Proposed method

  • Formulates convex variational problems using FEniCS’s Unified Form Language (UFL) and represents convex functions—especially non-smooth ones—within the conic programming framework.
  • Discretizes problems using FEniCS’s finite element capabilities, including support for mixed and mixed-hybrid formulations via mixed finite element spaces.
  • Employs Mosek as the interior-point solver to achieve high-accuracy solutions in polynomial time, particularly effective for problems with complex constraints and non-smooth terms.
  • Introduces a block-structured optimization framework where variables and constraints are defined in blocks, enabling modular and scalable problem construction.
  • Uses quadrature-based function spaces (e.g., Quadrature elements) to represent auxiliary variables like Lagrange multipliers and dual variables pointwise in the conic formulation.
  • Supports both equality and inequality constraints through function-based constraint definitions, with automatic assembly of linear forms using UFL and FEniCS’s form compiler.

Experimental results

Research questions

  • RQ1Can convex variational problems arising in image processing and solid mechanics be formulated and solved with minimal user code using a high-level finite element framework?
  • RQ2How can non-smooth convex terms (e.g., total variation, L1 norms) be efficiently represented and solved within a finite element context using conic optimization?
  • RQ3To what extent can the integration of FEniCS’s finite element capabilities with Mosek’s interior-point solver improve the accuracy and efficiency of solving large-scale convex PDE-constrained problems?
  • RQ4Can a modular, block-structured optimization interface be designed to support complex, multi-field variational problems with mixed finite elements?
  • RQ5How does the proposed framework compare in performance and robustness to first-order methods commonly used in image processing, especially for problems with non-smooth objectives?

Key findings

  • The fenics-optim package enables the formulation of complex convex variational problems in just a few lines of Python code, closely mirroring the continuous mathematical formulation.
  • The framework supports a wide range of finite elements, including mixed and hybrid elements, and enables automatic discretization of problems involving non-smooth terms.
  • Using Mosek’s interior-point method, the approach achieves high-accuracy solutions in polynomial time, outperforming first-order methods in terms of solution precision.
  • The conic reformulation of non-smooth terms—such as the rotated quadratic cone for the obstacle problem—enables efficient and stable numerical solution via modern conic solvers.
  • The block-structured constraint formulation allows for modular and scalable problem construction, with automatic handling of sparsity and matrix assembly through FEniCS’s form compiler.
  • The explicit construction of the obstacle problem using quadrature-based variables and conic constraints demonstrates the framework’s ability to handle pointwise constraints in a weak form, achieving accurate and robust solutions.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.