Skip to content

Generate adjoint and control operators

René Heß requested to merge feature/adjoint into master

About

Make it possible to generate adjoint and control operators. You need to provide an ufl file with form, an objective function and one/several control parameters. The objective function and control parameters are specified in the corresponding ini file. See dune-perftool/test/adjoint/ for an example.

The generated local operators will do the following:

Notation

  • State: u=\sum_j z_j \phi_j
  • Control: m
  • Adjoint vector: \lambda
  • PDE: r(u,m,v) = 0\quad\forall v has solution u=u(m)
  • Objective function: J(z,m)
  • Reduced objective function: \hat{J}(m)=J(z(m),m)

Forward Solve

The normal forward solves uses methods for setting up the residual and the jacobian:

  • Residual: (R(z,m))_i = r(\sum_j z_j \phi_j, m, \phi_i)
  • Jacobian: (\nabla_{z} R(z, m))_{ij} = \frac{\partial (R(z,m))_i}{\partial z_j}

Adjoint Operator

The adjoint operator can be used to solve the PDE

(\nabla_{z} R(z, m))^T \lambda = - \nabla_{z} J(z,m)

Control Operator

The control operator can then be used to calculate the derivative of the objective function w.r.t. the control parameters. See the example for correct driver code.

\nabla_{m} \hat{J}(m) = (\nabla_{m} R(z,m))^T \lambda + \nabla_{m} J(z, m)
Edited by René Heß

Merge request reports

Loading