Choosing a Sensitivity Method
To evaluate sensitivities as part of a multiphysics problem solution, an auxiliary linear problem must be solved, in addition to the original equation, using one of these methods:
Select one of the Forward Sensitivity methods to evaluate the derivatives of all solution variables and an optional objective function.
Select the Adjoint Sensitivity method to look only at derivatives of a scalar objective function.
Forward Sensitivity
Use the forward (or forward numeric) sensitivity method to solve for the derivatives of all dependent variables, plus an optional scalar objective function, with respect to a small number of control variables. The forward method requires one extra linear system solution for each control variable.
The linear system that must be solved is the same as the last linearization needed for solving the forward model. Thus, when using a direct solver (for example, PARDISO) the extra work amounts only to one back-substitution per control variable DOF. The forward numeric method uses numerical perturbation rather than analytical methods to calculate forward sensitivities, and can be used when the analytical method fails for some reason or as a tool to verify that the analytical method is correct. In addition, the forward numeric method requires two additional residual evaluations. The iterative linear and segregated solvers can reuse preconditioners and other data but must otherwise perform a complete solution each time. Further, the forward numeric method only differentiates the PDE problem numerically (giving a numeric method for the forward sensitivity). The objective sensitivity is still differentiated analytically (both with respect to the controls and with respect to the PDE variables). The functional sensitivity is therefore computed with a hybrid method.
Adjoint Sensitivity
The adjoint method solves for the derivatives of a single scalar objective function with respect to any number of control variables, requiring only one single additional linear system solution. In addition to the objective function gradient, the discrete adjoint solution is computed. This quantity represents the sensitivity of the objective function with respect to an additional generalized force applied as a nodal force to the corresponding solution component.
The auxiliary linear system is in this case the transpose of the last linearization needed for solving the forward model. The MUMPS and PARDISO linear solvers can solve the transposed problem at the cost of a back-substitution, while the SPOOLES linear solver needs to do a new factorization if the problem is not symmetric or Hermitian. The iterative solvers can reuse most preconditioning information as can the segregated solver, which, however, loops over the segregated steps in reversed order.