hp-FEM
Adaptive hp-FEM suite for nano-optics
Loading...
Searching...
No Matches
Classes | Namespaces | Typedefs | Functions
maxwell_forms.hpp File Reference
#include <functional>
#include <optional>
#include <span>
#include <type_traits>
#include <Eigen/Core>
#include "hpfem/assembly/condensation.hpp"
#include "hpfem/assembly/h1_forms.hpp"
#include "hpfem/assembly/quadrature.hpp"
#include "hpfem/assembly/sparse_assembler.hpp"
#include "hpfem/core/types.hpp"
#include "hpfem/fespace/dof_map.hpp"
#include "hpfem/fespace/nedelec_basis.hpp"
#include "hpfem/mesh/geometry.hpp"
#include "hpfem/mesh/point_location.hpp"
Include dependency graph for maxwell_forms.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  hpfem::assembly::MaxwellForm< Dim >
 
struct  hpfem::assembly::MaxwellElement
 Element stiffness, mass and load of one cell in NedelecBasis function order. More...
 
struct  hpfem::assembly::MaxwellSystem
 
struct  hpfem::assembly::HcurlErrorNorms
 Errors of the discrete field against (E, curl E). More...
 

Namespaces

namespace  hpfem
 
namespace  hpfem::assembly
 

Typedefs

template<int Dim>
using hpfem::assembly::ComplexVector = Eigen::Matrix< Complex, Dim, 1 >
 
template<int Dim>
using hpfem::assembly::ComplexCurl = Eigen::Matrix< Complex, Dim==2 ? 1 :3, 1 >
 Curl of a physical field: scalar (1-vector) in 2D, 3-vector in 3D.
 
template<int Dim>
using hpfem::assembly::PermittivityTensor = Eigen::Matrix< Complex, Dim, Dim >
 Permittivity tensor ε (Dim × Dim) and inverse permeability tensor acting on curls.
 
template<int Dim>
using hpfem::assembly::InversePermeabilityTensor = Eigen::Matrix< Complex, Dim==2 ? 1 :3, Dim==2 ? 1 :3 >
 
template<int Dim>
using hpfem::assembly::CurlTensorField = std::function< InversePermeabilityTensor< Dim >(const Point< Dim > &)>
 
template<int Dim>
using hpfem::assembly::ComplexVectorField = std::function< ComplexVector< Dim >(const Point< Dim > &)>
 
template<int Dim>
using hpfem::assembly::ComplexCurlField = std::function< ComplexCurl< Dim >(const Point< Dim > &)>
 
template<int Dim>
using hpfem::assembly::CellFormFactory = std::function< MaxwellForm< Dim >(Index)>
 

Functions

template<int Dim>
MaxwellElement hpfem::assembly::element_maxwell (const fespace::NedelecBasis< Dim > &basis, const mesh::CellGeometry< Dim > &geometry, const QuadratureRule< Dim > &rule, const MaxwellForm< Dim > &form)
 
template<int Dim>
MaxwellSystem hpfem::assembly::assemble_maxwell (const fespace::NedelecDofMap< Dim > &dofs, const MaxwellForm< Dim > &form, int extra_order=2)
 Assembles S, M and b over all cells with rules exact for degree 2 p_c + extra_order.
 
template<int Dim>
MaxwellSystem hpfem::assembly::assemble_maxwell (const fespace::NedelecDofMap< Dim > &dofs, const std::type_identity_t< CellFormFactory< Dim > > &form_of_cell, int extra_order=2)
 
template<int Dim>
AssembledSystem hpfem::assembly::assemble_maxwell_operator (const fespace::NedelecDofMap< Dim > &dofs, const std::type_identity_t< CellFormFactory< Dim > > &form_of_cell, Real k_squared, int extra_order=2, StaticCondensation *condensation=nullptr)
 
template<int Dim>
Vector hpfem::assembly::assemble_maxwell_load (const fespace::NedelecDofMap< Dim > &dofs, const std::type_identity_t< CellFormFactory< Dim > > &form_of_cell, int extra_order=2)
 Load vector \( \ell(v) \) alone (new sources on an unchanged operator).
 
template<int Dim>
Matrix hpfem::assembly::assemble_maxwell_loads (const fespace::NedelecDofMap< Dim > &dofs, std::span< const std::type_identity_t< CellFormFactory< Dim > > > forms, int extra_order=2)
 
template<int Dim>
HcurlErrorNorms hpfem::assembly::hcurl_error (const fespace::NedelecDofMap< Dim > &dofs, const Vector &e_h, const std::type_identity_t< ComplexVectorField< Dim > > &field, const std::type_identity_t< std::function< ComplexCurl< Dim >(const Point< Dim > &)> > &curl, int extra_order=2)
 
template<int Dim>
HcurlErrorNorms hpfem::assembly::hcurl_error (const fespace::NedelecDofMap< Dim > &dofs, const Vector &e_h, const std::type_identity_t< ComplexVectorField< Dim > > &field, const std::type_identity_t< std::function< ComplexCurl< Dim >(const Point< Dim > &)> > &curl, std::span< const Index > cells, int extra_order=2)
 The same restricted to the given cells (e.g. the interior without the PML).
 
template<int Dim>
ComplexVector< Dim > hpfem::assembly::evaluate_hcurl (const fespace::NedelecDofMap< Dim > &dofs, const Vector &e_h, Index c, const Point< Dim > &xi)
 Physical value of the discrete field at reference point ξ of cell c.
 
template<int Dim>
ComplexCurl< Dim > hpfem::assembly::evaluate_hcurl_curl (const fespace::NedelecDofMap< Dim > &dofs, const Vector &e_h, Index c, const Point< Dim > &xi)
 
template<int Dim>
std::optional< ComplexVector< Dim > > hpfem::assembly::evaluate_hcurl (const fespace::NedelecDofMap< Dim > &dofs, const Vector &e_h, const mesh::PointLocator< Dim > &locator, const Point< Dim > &x)
 
template<int Dim>
std::optional< ComplexCurl< Dim > > hpfem::assembly::evaluate_hcurl_curl (const fespace::NedelecDofMap< Dim > &dofs, const Vector &e_h, const mesh::PointLocator< Dim > &locator, const Point< Dim > &x)
 
template MaxwellElement hpfem::assembly::element_maxwell< 2 > (const fespace::NedelecBasis< 2 > &, const mesh::CellGeometry< 2 > &, const QuadratureRule< 2 > &, const MaxwellForm< 2 > &)
 
template MaxwellElement hpfem::assembly::element_maxwell< 3 > (const fespace::NedelecBasis< 3 > &, const mesh::CellGeometry< 3 > &, const QuadratureRule< 3 > &, const MaxwellForm< 3 > &)
 
template MaxwellSystem hpfem::assembly::assemble_maxwell< 2 > (const fespace::NedelecDofMap< 2 > &, const MaxwellForm< 2 > &, int)
 
template MaxwellSystem hpfem::assembly::assemble_maxwell< 3 > (const fespace::NedelecDofMap< 3 > &, const MaxwellForm< 3 > &, int)
 
template MaxwellSystem hpfem::assembly::assemble_maxwell< 2 > (const fespace::NedelecDofMap< 2 > &, const CellFormFactory< 2 > &, int)
 
template MaxwellSystem hpfem::assembly::assemble_maxwell< 3 > (const fespace::NedelecDofMap< 3 > &, const CellFormFactory< 3 > &, int)
 
template AssembledSystem hpfem::assembly::assemble_maxwell_operator< 2 > (const fespace::NedelecDofMap< 2 > &, const CellFormFactory< 2 > &, Real, int, StaticCondensation *)
 
template AssembledSystem hpfem::assembly::assemble_maxwell_operator< 3 > (const fespace::NedelecDofMap< 3 > &, const CellFormFactory< 3 > &, Real, int, StaticCondensation *)
 
template Vector hpfem::assembly::assemble_maxwell_load< 2 > (const fespace::NedelecDofMap< 2 > &, const CellFormFactory< 2 > &, int)
 
template Vector hpfem::assembly::assemble_maxwell_load< 3 > (const fespace::NedelecDofMap< 3 > &, const CellFormFactory< 3 > &, int)
 
template Matrix hpfem::assembly::assemble_maxwell_loads< 2 > (const fespace::NedelecDofMap< 2 > &, std::span< const CellFormFactory< 2 > >, int)
 
template Matrix hpfem::assembly::assemble_maxwell_loads< 3 > (const fespace::NedelecDofMap< 3 > &, std::span< const CellFormFactory< 3 > >, int)
 
template HcurlErrorNorms hpfem::assembly::hcurl_error< 2 > (const fespace::NedelecDofMap< 2 > &, const Vector &, const ComplexVectorField< 2 > &, const std::function< ComplexCurl< 2 >(const Point< 2 > &)> &, int)
 
template HcurlErrorNorms hpfem::assembly::hcurl_error< 3 > (const fespace::NedelecDofMap< 3 > &, const Vector &, const ComplexVectorField< 3 > &, const std::function< ComplexCurl< 3 >(const Point< 3 > &)> &, int)
 
template HcurlErrorNorms hpfem::assembly::hcurl_error< 2 > (const fespace::NedelecDofMap< 2 > &, const Vector &, const ComplexVectorField< 2 > &, const std::function< ComplexCurl< 2 >(const Point< 2 > &)> &, std::span< const Index >, int)
 
template HcurlErrorNorms hpfem::assembly::hcurl_error< 3 > (const fespace::NedelecDofMap< 3 > &, const Vector &, const ComplexVectorField< 3 > &, const std::function< ComplexCurl< 3 >(const Point< 3 > &)> &, std::span< const Index >, int)
 
template ComplexVector< 2 > hpfem::assembly::evaluate_hcurl< 2 > (const fespace::NedelecDofMap< 2 > &, const Vector &, Index, const Point< 2 > &)
 
template ComplexVector< 3 > hpfem::assembly::evaluate_hcurl< 3 > (const fespace::NedelecDofMap< 3 > &, const Vector &, Index, const Point< 3 > &)
 
template ComplexCurl< 2 > hpfem::assembly::evaluate_hcurl_curl< 2 > (const fespace::NedelecDofMap< 2 > &, const Vector &, Index, const Point< 2 > &)
 
template ComplexCurl< 3 > hpfem::assembly::evaluate_hcurl_curl< 3 > (const fespace::NedelecDofMap< 3 > &, const Vector &, Index, const Point< 3 > &)
 
template std::optional< ComplexVector< 2 > > hpfem::assembly::evaluate_hcurl< 2 > (const fespace::NedelecDofMap< 2 > &, const Vector &, const mesh::PointLocator< 2 > &, const Point< 2 > &)
 
template std::optional< ComplexVector< 3 > > hpfem::assembly::evaluate_hcurl< 3 > (const fespace::NedelecDofMap< 3 > &, const Vector &, const mesh::PointLocator< 3 > &, const Point< 3 > &)
 
template std::optional< ComplexCurl< 2 > > hpfem::assembly::evaluate_hcurl_curl< 2 > (const fespace::NedelecDofMap< 2 > &, const Vector &, const mesh::PointLocator< 2 > &, const Point< 2 > &)
 
template std::optional< ComplexCurl< 3 > > hpfem::assembly::evaluate_hcurl_curl< 3 > (const fespace::NedelecDofMap< 3 > &, const Vector &, const mesh::PointLocator< 3 > &, const Point< 3 > &)
 

Detailed Description

Element and global assembly of the time-harmonic Maxwell forms on the Nédélec space: \( s(E,v) = \int_\Omega \mu^{-1}\,\nabla\times E \cdot \nabla\times v \) (stiffness), \( m(E,v) = \int_\Omega \varepsilon\,E\cdot v \) (mass), \( \ell(v) = \int_\Omega f\cdot v \), so that the curl–curl problem of docs/theory/maxwell.md reads \( (S - \omega^2 M)\,e = b \) with \( f = i\omega J \) (convention exp(-iωt), ADR-0002; test functions not conjugated). Tensors are complex (lossy, anisotropic media, PML stretching); see docs/theory/maxwell.md#discrete-forms.