The automation of PDE-constrained optimisation and its applications