|
hp-FEM
Adaptive hp-FEM suite for nano-optics
|
#include <pml.hpp>
Public Types | |
| using | Thickness = std::array< Real, kNumSides > |
| x-min, x-max, y-min, y-max[, z-min, z-max] | |
Public Member Functions | |
| PmlBox (const Point< Dim > &lower, const Point< Dim > &upper, const Thickness &thickness, Real k0, Real background_index=1.0, PmlProfile profile={}) | |
| const Point< Dim > & | lower () const noexcept |
| const Point< Dim > & | upper () const noexcept |
| const Thickness & | thickness () const noexcept |
| const PmlProfile & | profile () const noexcept |
| Real | sigma_max (std::size_t side) const noexcept |
| \( \hat\sigma_{\max} \) of side k (0 for a side without layer). | |
| Real | k0 () const noexcept |
| Vacuum wavenumber the layers were designed for. | |
| Real | max_resolution (Real cell_size, Real index) const |
| Point< Dim > | outer_lower () const |
| Outer boundary of the layers: the box enlarged by the thicknesses. | |
| Point< Dim > | outer_upper () const |
| bool | in_layer (const Point< Dim > &x) const |
| True if x lies in at least one layer (some \( s_\xi \ne 1 \)). | |
| ComplexCoordinates< Dim > | stretch (const Point< Dim > &x) const |
| Stretch factors \( s_\xi(x) = 1 + i\hat\sigma_\xi \) per axis (1 inside the box). | |
| ComplexCoordinates< Dim > | stretched_coordinate (const Point< Dim > &x) const |
| assembly::PermittivityTensor< Dim > | permittivity (Complex eps_r, const Point< Dim > &x) const |
| assembly::PermittivityTensor< Dim > | permittivity (const assembly::PermittivityTensor< Dim > &eps, const Point< Dim > &x) const |
| assembly::InversePermeabilityTensor< Dim > | inverse_permeability (Complex mu_r, const Point< Dim > &x) const |
Static Public Member Functions | |
| static Real | recommended_thickness (Real k0, Real background_index, Real cell_size, Real wavelengths=0.5) |
| static Real | recommended_thickness (Real k0, Real background_index, Real cell_size, const PmlProfile &profile, int p) |
| static Real | resolution_limit (int p) noexcept |
| static PmlBox | uniform (const Point< Dim > &lower, const Point< Dim > &upper, Real thickness, Real k0, Real background_index=1.0, PmlProfile profile={}) |
| The same thickness on all sides. | |
Static Public Attributes | |
| static constexpr std::size_t | kNumSides = 2 * static_cast<std::size_t>(Dim) |
PML layers of given thickness on the sides of the interior box [lower, upper]. A side with thickness 0 carries no layer (e.g. a periodic or PEC direction). The layers must be covered by mesh cells; cell facets should coincide with the box faces.
| using hpfem::pml::PmlBox< Dim >::Thickness = std::array<Real, kNumSides> |
x-min, x-max, y-min, y-max[, z-min, z-max]
| hpfem::pml::PmlBox< Dim >::PmlBox | ( | const Point< Dim > & | lower, |
| const Point< Dim > & | upper, | ||
| const Thickness & | thickness, | ||
| Real | k0, | ||
| Real | background_index = 1.0, |
||
| PmlProfile | profile = {} |
||
| ) |
| k0 | vacuum wavenumber [1/m]; |
| background_index | real part of the refractive index of the medium the layer continues (sets σ_max); |
| InvalidArgument | for a degenerate box, negative thickness, k0 ≤ 0 or an unusable profile. |
| bool hpfem::pml::PmlBox< Dim >::in_layer | ( | const Point< Dim > & | x | ) | const |
True if x lies in at least one layer (some \( s_\xi \ne 1 \)).
| assembly::InversePermeabilityTensor< Dim > hpfem::pml::PmlBox< Dim >::inverse_permeability | ( | Complex | mu_r, |
| const Point< Dim > & | x | ||
| ) | const |
Effective inverse permeability acting on curls: \( \mu_r^{-1}\Lambda^2/\det\Lambda \) (3D, diagonal) or the scalar \( 1/(\mu_r s_x s_y) \) (2D, out-of-plane curl).
|
inlinenoexcept |
Vacuum wavenumber the layers were designed for.
|
inlinenoexcept |
| Real hpfem::pml::PmlBox< Dim >::max_resolution | ( | Real | cell_size, |
| Real | index | ||
| ) | const |
Largest \( |k s| h \) over the layers for cells of size cell_size in a medium of real index index ( \( k = k_0 n \), \( s \) at the far end of each layer): the resolution the stretched field \( e^{iks\xi} \) asks of the mesh, to be kept below resolution_limit(p). A layer meshed with a medium of higher index than the background_index it was designed for (a substrate) is the usual offender.
| Point< Dim > hpfem::pml::PmlBox< Dim >::outer_lower | ( | ) | const |
Outer boundary of the layers: the box enlarged by the thicknesses.
| Point< Dim > hpfem::pml::PmlBox< Dim >::outer_upper | ( | ) | const |
| assembly::PermittivityTensor< Dim > hpfem::pml::PmlBox< Dim >::permittivity | ( | Complex | eps_r, |
| const Point< Dim > & | x | ||
| ) | const |
Effective permittivity tensor \( \varepsilon_r\det\Lambda\,\Lambda^{-2} \) of an isotropic material (diagonal).
| assembly::PermittivityTensor< Dim > hpfem::pml::PmlBox< Dim >::permittivity | ( | const assembly::PermittivityTensor< Dim > & | eps, |
| const Point< Dim > & | x | ||
| ) | const |
Effective permittivity tensor of an anisotropic material, \( ildearepsilon_{ij} = arepsilon_{ij}\det\Lambda/(s_i s_j) \) (ADR-0015 §2); in 2D eps is the in-plane block and \( s_z = 1 \). Equals the scalar overload for \( arepsilon = arepsilon_r I \).
|
inlinenoexcept |
|
static |
The smallest thickness (whole cells of size cell_size) at which the profile stays resolved for polynomial order p: \( |k s| h \le \) resolution_limit(p) at the far end of the layer, where \( |s| = \sqrt{1 + \hat\sigma_{\max}^2} \) and \( \hat\sigma_{\max} \propto 1 / \text{thickness} \). At least the thickness of the half-wavelength rule.
| InvalidArgument | if even an unstretched layer is not resolved ( \( k_0 n h \) above the limit) or for non-positive arguments. |
|
static |
Layer thickness adapted to the wavelength and the mesh: wavelengths local wavelengths \( \lambda_0 / n \), rounded up to a whole number of cells of size cell_size, so the layer boundary falls on cell facets of a structured mesh.
| InvalidArgument | for non-positive arguments. |
|
staticnoexcept |
Largest \( |k s| h \) the stretched field may have on cells of order p: 3 for \( p \ge 4 \) (docs/theory/pml.md), \( 0.75\,p \) below.
|
inlinenoexcept |
\( \hat\sigma_{\max} \) of side k (0 for a side without layer).
| ComplexCoordinates< Dim > hpfem::pml::PmlBox< Dim >::stretch | ( | const Point< Dim > & | x | ) | const |
Stretch factors \( s_\xi(x) = 1 + i\hat\sigma_\xi \) per axis (1 inside the box).
| ComplexCoordinates< Dim > hpfem::pml::PmlBox< Dim >::stretched_coordinate | ( | const Point< Dim > & | x | ) | const |
Stretched coordinates \( \tilde x_\xi = x_\xi + i\int_{\text{box}}^{x_\xi}\hat\sigma \) (closed form for the polynomial profile); an outgoing analytic field evaluated at \( \tilde x \) is the exact solution inside the layer.
|
inlinenoexcept |
|
static |
The same thickness on all sides.
|
inlinenoexcept |
|
staticconstexpr |