  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.
