|
hp-FEM
Adaptive hp-FEM suite for nano-optics
|
#include <vector>#include "hpfem/core/types.hpp"#include "hpfem/mesh/mesh.hpp"#include "hpfem/physics/conical_scattering.hpp"#include "hpfem/physics/scattering.hpp"

Go to the source code of this file.
Classes | |
| struct | hpfem::physics::ConicalAdjoint |
| Adjoint of the conical solver as block coefficients (in-plane and scaled longitudinal). More... | |
Namespaces | |
| namespace | hpfem |
| namespace | hpfem::physics |
Sensitivities of linear observables by the adjoint solve (M12). For the discrete problem \( A(\varepsilon)\,e = b(\varepsilon) \) and a linear goal \( Q(e) = q^\top e \) (no conjugation, as the forms) the derivative with respect to a parameter θ is \( \partial_\theta Q = z^\top(\partial_\theta b - \partial_\theta A\, e) \) with the adjoint \( z \) of \( A^\top z = q \). With hanging-node and Bloch constraints (prolongation P, reduced system \( P^HAP \)) the adjoint lives in the test space, \( (P^\top A\bar P)\,z_r = P^\top q,\ z = \bar P z_r \), exactly as the goal-oriented estimator (goal_oriented.hpp), but on the primal space instead of the enriched one.
Material derivatives: θ is the relative permittivity \( \varepsilon_r \) of all cells of a tag (holomorphic in \( \varepsilon_r \), so the real and imaginary parts follow from one complex derivative). Then \( \partial_\varepsilon A = -k_0^2 M_{\text{tag}} \) and, in the scattered-field formulation, \( \partial_\varepsilon b = k_0^2\,\ell_{\text{tag}} (E^{inc}) \) with \( \ell_{\text{tag}}(v) = \int_{\text{tag}} E^{inc}\cdot v \), so that
\[ \frac{dQ}{d\varepsilon_{\text{tag}}} = k_0^2\int_{\text{tag}} E_{\text{tot}}\cdot z\,dx = k_0^2\, z^\top\big(M_{\text{tag}}\,e + \ell_{\text{tag}}(E^{inc})\big) , \]
the derivative of the discrete goal (verified against finite differences to 1e-6 in test_sensitivity.cpp). Cells of the tag inside a PML are refused (the stretch couples the layer to ε). Quadratic observables (efficiencies, fluxes) follow by the chain rule from the complex amplitude, e.g. \( \partial R_m = 2R_m\,\mathrm{Re}(\partial Q)/|A_m| \) with \( Q = A_m\cdot\bar A_m/|A_m| \) (hpfem.grating.sensitivity). See docs/theory/maxwell.md#sensitivities-by-the-adjoint-solve.