hp-FEM
Adaptive hp-FEM suite for nano-optics
Loading...
Searching...
No Matches
Classes | Namespaces | Typedefs | Functions
hypercircle.hpp File Reference
#include <span>
#include <type_traits>
#include <vector>
#include "hpfem/assembly/h1_forms.hpp"
#include "hpfem/assembly/maxwell_forms.hpp"
#include "hpfem/assembly/periodic.hpp"
#include "hpfem/core/types.hpp"
#include "hpfem/fespace/dof_map.hpp"
#include "hpfem/solvers/linear_solver.hpp"
Include dependency graph for hypercircle.hpp:

Go to the source code of this file.

Classes

struct  hpfem::adaptivity::HypercircleParts
 Squared contributions of the two constitutive relations of one cell. More...
 
struct  hpfem::adaptivity::HypercircleEstimate
 Element indicators of a primal/dual pair. More...
 

Namespaces

namespace  hpfem
 
namespace  hpfem::adaptivity
 

Typedefs

template<int Dim>
using hpfem::adaptivity::DualDofMap = std::conditional_t< Dim==2, fespace::DofMap< 2 >, fespace::NedelecDofMap< 3 > >
 Space of the dual unknown: H1 in 2D (scalar curl), Nédélec in 3D.
 
template<int Dim>
using hpfem::adaptivity::DualForm = std::conditional_t< Dim==2, assembly::ScalarForm< 2 >, assembly::MaxwellForm< 3 > >
 Per-cell form of the dual problem in the units of the respective assembler.
 

Functions

template<int Dim>
DualForm< Dim > hpfem::adaptivity::dual_form (const assembly::MaxwellForm< Dim > &primal, Real k_squared)
 
template<int Dim>
Vector hpfem::adaptivity::dual_solution (const DualDofMap< Dim > &dual_dofs, const std::type_identity_t< assembly::CellFormFactory< Dim > > &form_of_cell, Real k_squared, std::span< const Index > essential_facets={}, std::span< const assembly::PeriodicPair< Dim > > periodic={}, int extra_order=2, solvers::DirectSolverBackend backend=solvers::DirectSolverBackend::kAuto)
 
template<int Dim>
HypercircleEstimate hpfem::adaptivity::hypercircle_estimate (const fespace::NedelecDofMap< Dim > &dofs, const Vector &e_h, const DualDofMap< Dim > &dual_dofs, const Vector &sigma_h, const std::type_identity_t< assembly::CellFormFactory< Dim > > &form_of_cell, Real k_squared, int extra_order=2)
 
template DualForm< 2 > hpfem::adaptivity::dual_form< 2 > (const assembly::MaxwellForm< 2 > &, Real)
 
template DualForm< 3 > hpfem::adaptivity::dual_form< 3 > (const assembly::MaxwellForm< 3 > &, Real)
 
template Vector hpfem::adaptivity::dual_solution< 2 > (const DualDofMap< 2 > &, const assembly::CellFormFactory< 2 > &, Real, std::span< const Index >, std::span< const assembly::PeriodicPair< 2 > >, int, solvers::DirectSolverBackend)
 
template Vector hpfem::adaptivity::dual_solution< 3 > (const DualDofMap< 3 > &, const assembly::CellFormFactory< 3 > &, Real, std::span< const Index >, std::span< const assembly::PeriodicPair< 3 > >, int, solvers::DirectSolverBackend)
 
template HypercircleEstimate hpfem::adaptivity::hypercircle_estimate< 2 > (const fespace::NedelecDofMap< 2 > &, const Vector &, const DualDofMap< 2 > &, const Vector &, const assembly::CellFormFactory< 2 > &, Real, int)
 
template HypercircleEstimate hpfem::adaptivity::hypercircle_estimate< 3 > (const fespace::NedelecDofMap< 3 > &, const Vector &, const DualDofMap< 3 > &, const Vector &, const assembly::CellFormFactory< 3 > &, Real, int)
 

Detailed Description

Dual (complementary) formulation of the curl–curl problem and the hypercircle (Prager–Synge) error bound. For the primal problem \( \nabla\times(\mu^{-1}\nabla\times E) - k^2\varepsilon E = f + \nabla\times g \) the dual unknown is the (scaled) magnetic field \( \sigma = \mu^{-1}\nabla\times E - g \), which satisfies \( \nabla\times\sigma = f + k^2\varepsilon E \) and therefore the dual curl–curl problem \( \nabla\times((k^2\varepsilon)^{-1}\nabla\times\sigma) - \mu\sigma = \nabla\times((k^2\varepsilon)^{-1} f) + \mu g \). In 3D \( \sigma \) lives in the same Nédélec space as E; in 2D the curl of a vector is a scalar, so \( \sigma \) is an H1 function with \( \nabla\times\sigma = (\partial_y\sigma, -\partial_x\sigma) \). For a pair \( (E_h, \sigma_h) \) of discrete fields the constitutive-relation error \( \eta_K^2 = \|\sigma_h - (\mu^{-1}\nabla\times E_h - g)\|^2_{\mu,K} + \|(k^2\varepsilon)^{-1}(\nabla\times\sigma_h - f) - E_h\|^2_{-k^2\varepsilon,K} \) is computable without any constant, and for the coercive problem (k² < 0, real symmetric positive μ and ε) it is a guaranteed upper bound of the energy error: \( \|\mu^{-1/2}\nabla\times(E - E_h)\|^2 - k^2\|\varepsilon^{1/2}(E - E_h)\|^2 \le \sum_K \eta_K^2 \) for any \( \sigma_h \) with the dual essential boundary condition (the Galerkin solution of the dual problem gives the sharpest bound). For the indefinite time-harmonic problem the same quantity is the constitutive-relation error estimator (reliable up to the inf-sup constant). See docs/theory/error-estimation.md#dual-formulation-and-guaranteed-bounds.