hp-FEM
Adaptive hp-FEM suite for nano-optics
Loading...
Searching...
No Matches
Classes | Namespaces | Functions
residual_estimator.hpp File Reference
#include <span>
#include <type_traits>
#include <vector>
#include "hpfem/assembly/maxwell_forms.hpp"
#include "hpfem/assembly/periodic.hpp"
#include "hpfem/core/types.hpp"
#include "hpfem/fespace/dof_map.hpp"
Include dependency graph for residual_estimator.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  hpfem::adaptivity::EstimatorOptions
 
struct  hpfem::adaptivity::ResidualParts
 Squared contributions of the four residual terms of one cell. More...
 
struct  hpfem::adaptivity::Estimate
 Element indicators of one discrete solution. More...
 

Namespaces

namespace  hpfem
 
namespace  hpfem::adaptivity
 

Functions

template<int Dim>
Estimate hpfem::adaptivity::residual_estimate (const fespace::NedelecDofMap< Dim > &dofs, const Vector &e_h, Real k_squared, const std::type_identity_t< assembly::CellFormFactory< Dim > > &form_of_cell, const EstimatorOptions &options={}, std::span< const assembly::PeriodicPair< Dim > > periodic={})
 
template<int Dim>
std::vector< Complex > hpfem::adaptivity::weighted_residual (const fespace::NedelecDofMap< Dim > &dofs, const Vector &e_h, Real k_squared, const std::type_identity_t< assembly::CellFormFactory< Dim > > &form_of_cell, const fespace::NedelecDofMap< Dim > &weight_dofs, const Vector &weight, const EstimatorOptions &options={})
 
template std::vector< Complex > hpfem::adaptivity::weighted_residual< 2 > (const fespace::NedelecDofMap< 2 > &, const Vector &, Real, const assembly::CellFormFactory< 2 > &, const fespace::NedelecDofMap< 2 > &, const Vector &, const EstimatorOptions &)
 
template std::vector< Complex > hpfem::adaptivity::weighted_residual< 3 > (const fespace::NedelecDofMap< 3 > &, const Vector &, Real, const assembly::CellFormFactory< 3 > &, const fespace::NedelecDofMap< 3 > &, const Vector &, const EstimatorOptions &)
 
template Estimate hpfem::adaptivity::residual_estimate< 2 > (const fespace::NedelecDofMap< 2 > &, const Vector &, Real, const assembly::CellFormFactory< 2 > &, const EstimatorOptions &, std::span< const assembly::PeriodicPair< 2 > >)
 
template Estimate hpfem::adaptivity::residual_estimate< 3 > (const fespace::NedelecDofMap< 3 > &, const Vector &, Real, const assembly::CellFormFactory< 3 > &, const EstimatorOptions &, std::span< const assembly::PeriodicPair< 3 > >)
 

Detailed Description

Residual-based a-posteriori error estimator for the time-harmonic curl–curl problem \( \nabla\times(\mu^{-1}\nabla\times E) - k^2\varepsilon E = f + \nabla\times g \) on a Nédélec space (Beck, Hiptmair, Hoppe & Wohlmuth 2000; hp weights after Schöberl 2008). Per cell K with diameter h_K and order p_K,

\[ \eta_K^2 = \frac{h_K^2}{p_K^2}\,\|R_K\|^2_{L^2(K)} + \frac{h_K^2}{p_K^2}\,\ell^2\|\nabla\cdot d\|^2_{L^2(K)} + \sum_{F\subset\partial K}\frac{h_F}{2p_F}\Big(\|[\![n\times w]\!]\|^2_{L^2(F)} + \ell^2\|[\![n\cdot d]\!]\|^2_{L^2(F)}\Big), \]

with \( w = \mu^{-1}\nabla\times E_{hp} - g \), \( d = f + k^2\varepsilon E_{hp} \), the element residual \( R_K = d - \nabla\times w \) and the length scale \( \ell = 1/k \) of the Gauss-law terms (EstimatorOptions::length_scale): \( \nabla\cdot d \) carries one inverse length more than \( R_K \), so without \( \ell \) the published form holds only for lengths of order one and the Gauss-law terms dominate SI-scale problems by \( 1/(kh)^2 \). Interior facets (hanging child facets against the cell of their parent) and, with periodic, the Bloch slave facets, whose jump is taken against the phase-shifted master cells (assembly::PeriodicLocator) and credited to both sides; PEC facets carry no residual, natural (PMC) facets are not accounted for. Complex coefficients and PML cells enter through the per-cell form, so the estimator measures the residual of the equation actually solved. Convention exp(-iωt) as everywhere. See docs/theory/error-estimation.md.