hp-FEM
Adaptive hp-FEM suite for nano-optics
Loading...
Searching...
No Matches
Classes | Namespaces | Functions
sensitivity.hpp File Reference
#include <vector>
#include "hpfem/core/types.hpp"
#include "hpfem/mesh/mesh.hpp"
#include "hpfem/physics/conical_scattering.hpp"
#include "hpfem/physics/scattering.hpp"
Include dependency graph for sensitivity.hpp:
This graph shows which files directly or indirectly include this file:

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
 

Functions

template<int Dim>
Vector hpfem::physics::adjoint_solution (const Scattering< Dim > &problem, const Vector &q)
 
template<int Dim>
Vector hpfem::physics::adjoint_solution (const Scattering< Dim > &problem, const ScatteringSolution< Dim > &solution, const Vector &q)
 
template<int Dim>
Complex hpfem::physics::material_sensitivity (const Scattering< Dim > &problem, const ScatteringSolution< Dim > &solution, const Vector &adjoint, mesh::Tag tag)
 
template<int Dim>
Vector hpfem::physics::material_residual_derivative (const Scattering< Dim > &problem, const ScatteringSolution< Dim > &solution, mesh::Tag tag)
 
ConicalAdjoint hpfem::physics::conical_adjoint_solution (const ConicalScattering &problem, const Vector &q_e, const Vector &q_v)
 
ConicalAdjoint hpfem::physics::conical_adjoint_solution (const ConicalScattering &problem, const ConicalSolution &solution, const Vector &q_e, const Vector &q_v)
 
Vector hpfem::physics::conical_material_residual_derivative (const ConicalScattering &problem, const ConicalSolution &solution, mesh::Tag tag)
 
Complex hpfem::physics::conical_material_sensitivity (const ConicalScattering &problem, const ConicalSolution &solution, const ConicalAdjoint &adjoint, mesh::Tag tag)
 

Detailed Description

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.