[Paper Review] Automatic shape derivatives for transient PDEs in FEniCS and Firedrake
This paper presents a high-level algorithmic differentiation framework in FEniCS and Firedrake that automatically computes first and second-order shape derivatives for time-dependent, nonlinear PDEs on both stationary and morphing domains. By extending dolfin-adjoint to track mesh variations through symbolic manipulation of variational forms, the method enables efficient, discretely consistent shape optimization with verified convergence via Taylor tests.
In industry, shape optimization problems are of utter importance when designing structures such as aircraft, automobiles and turbines. For many of these applications, the structure changes over time, with a prescribed or non-prescribed movement. Therefore, it is important to capture these features in simulations when optimizing the design of the structure. Using gradient based algorithms, deriving the shape derivative manually can become very complex and error prone, especially in the case of time-dependent non-linear partial differential equations. To ease this burden, we present a high-level algorithmic differentiation tool that automatically computes first and second order shape derivatives for partial differential equations posed in the finite element frameworks FEniCS and Firedrake. The first order shape derivatives are computed using the adjoint method, while the second order shape derivatives are computed using a combination of the tangent linear method and the adjoint method. The adjoint and tangent linear equations are symbolically derived for any sequence of variational forms. As a consequence our methodology works for a wide range of PDE problems and is discretely consistent. We illustrate the generality of our framework by presenting several examples, spanning the range of linear, non-linear and time-dependent PDEs for both stationary and transient domains.
Motivation & Objective
- To automate the computation of shape derivatives for time-dependent, nonlinear PDEs in finite element frameworks.
- To support both stationary and transient (morphing) domains in shape optimization problems.
- To extend high-level algorithmic differentiation to handle mesh-dependent variational forms, enabling discrete consistency.
- To verify the accuracy of computed shape derivatives using Taylor tests for first and second-order derivatives.
- To demonstrate the framework's generality across linear, nonlinear, and time-dependent PDEs with minimal code overhead.
Proposed method
- The framework extends dolfin-adjoint to track mesh deformations by overloading the Mesh class and assembly routines in FEniCS/Firedrake.
- First-order shape derivatives are computed using the adjoint method, solving a single adjoint PDE independent of shape parameter count.
- Second-order shape derivatives are computed using a combination of the tangent linear method and adjoint method, enabling Hessian computation.
- The method uses symbolic manipulation of variational forms via UFL, with Gâteux derivatives and pull-back to reference elements for mesh sensitivity analysis.
- The computational graph includes mesh parameters, enabling automatic differentiation through mesh geometry changes.
- The framework inherits performance benefits of high-level AD, including near-optimal memory use and native parallelization support.
Experimental results
Research questions
- RQ1Can high-level algorithmic differentiation be extended to compute shape derivatives for time-dependent PDEs with moving domains in FEniCS and Firedrake?
- RQ2How can first- and second-order shape derivatives be computed efficiently and accurately for nonlinear, transient PDEs using symbolic variational forms?
- RQ3What is the convergence behavior of the computed shape derivatives when verified via Taylor expansion?
- RQ4How does the computational cost of shape derivative evaluation compare to the forward problem in complex, nonlinear PDEs?
- RQ5To what extent does the framework maintain discrete consistency when differentiating through mesh-dependent variational forms?
Key findings
- The first-order shape derivative was verified with a convergence rate of approximately 1.00 in the Taylor test, confirming correctness.
- The second-order shape derivative achieved a convergence rate of 2.00 for the first derivative term and 2.99–3.12 for the second derivative term, confirming second-order accuracy.
- The adjoint solve for the first-order derivative was faster than the forward solve (312.00 s vs. 465.34 s), due to the nonlinear forward problem requiring ~2 Newton iterations per time step.
- The second-order derivative computation took 807.52 s, which is 1.74 times the forward solve time, demonstrating scalability despite higher complexity.
- The entire shape differentiation framework required only 7 lines of additional code, with mesh deformation implemented in 26 lines, showing minimal code intrusion.
- The framework successfully handled a complex Navier-Stokes problem with 14,808 degrees of freedom, demonstrating applicability to real-world industrial problems.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.