  In this paper we present a framework for automated shape differentiation in
the finite element software NGSolve. Our approach combines the mathematical
Lagrangian approach for differentiating PDE constrained shape functions with
the automated differentiation capabilities of NGSolve. The user can decide
which degree of automatisation is required and thus allows for either a more
custom-like or black-box-like behaviour of the software.
  We discuss the automatic generation of first and second order shape
derivatives for unconstrained model problems as well as for more realistic
problems that are constrained by different types of partial differential
equations. We consider linear as well as nonlinear problems and also problems
which are posed on surfaces. In numerical experiments we verify the accuracy of
the computed derivatives via a Taylor test. Finally we present first and second
order shape optimisation algorithms and illustrate them for several numerical
optimisation examples ranging from nonlinear elasticity to Maxwell's equations.
