hp-FEM
Adaptive hp-FEM suite for nano-optics
Loading...
Searching...
No Matches
Public Member Functions | List of all members
hpfem::physics::ConicalScattering Class Reference

#include <conical_scattering.hpp>

Public Member Functions

 ConicalScattering (const fespace::NedelecDofMap< 2 > &transverse, const fespace::DofMap< 2 > &longitudinal, ConicalScatteringSetup setup)
 
const ConicalScatteringSetup & setup () const noexcept
 
const fespace::NedelecDofMap< 2 > & transverse () const noexcept
 
const fespace::DofMap< 2 > & longitudinal () const noexcept
 
Real wavenumber () const noexcept
 
Real beta () const noexcept
 
const fespace::NedelecDofMap< 2 > & transverse_dofs () const noexcept
 
const fespace::DofMap< 2 > & longitudinal_dofs () const noexcept
 
const materials::Material & background_material (Index cell) const
 
assembly::ConicalForm form_of_cell (Index cell) const
 Per-cell form: material tensors (stretched inside the PML) and the source.
 
const std::vector< Index > & free_dofs () const noexcept
 Free block DoFs after the PEC elimination (Nédélec first, then H1).
 
const std::optional< fespace::Constraints > & constraints () const noexcept
 
const std::vector< Index > & system_dofs () const noexcept
 
const std::optional< fespace::Constraints > & system_constraints () const noexcept
 The constraints on system_dofs() (constraints(), or their H1 part on the scalar path).
 
ConicalSolution solve () const
 
Vector load () const
 
ConicalSolution solution_from (const Vector &block) const
 
adaptivity::Estimate estimate (const ConicalSolution &solution, const adaptivity::EstimatorOptions &options={}) const
 
ConicalError error (const ConicalSolution &solution, const std::function< ConicalVector(const Point< 2 > &)> &exact, const std::function< ConicalVector(const Point< 2 > &)> &exact_curl={}, int extra_order=4) const
 
ConicalVector field (const ConicalSolution &solution, Index cell, const Point< 2 > &xi) const
 Physical field (E_x, E_y, E_z) of the unknown at reference point ξ of cell c.
 
ConicalVector total_field (const ConicalSolution &solution, Index cell, const Point< 2 > &xi) const
 
ConicalVector scattered_field (const ConicalSolution &solution, Index cell, const Point< 2 > &xi) const
 
std::optional< ConicalVector > total_field (const ConicalSolution &solution, const mesh::PointLocator< 2 > &locator, const Point< 2 > &x) const
 
std::optional< ConicalVector > scattered_field (const ConicalSolution &solution, const mesh::PointLocator< 2 > &locator, const Point< 2 > &x) const
 
ConicalVector incident_field (const Point< 2 > &x) const
 Physical incident field (E_x, E_y, E_z) at x (zero without an incident field).
 
ConicalVector incident_curl (const Point< 2 > &x) const
 
ConicalVector incident_h_field (const Point< 2 > &x) const
 
ConicalVector curl_field (const ConicalSolution &solution, Index cell, const Point< 2 > &xi) const
 Physical curl of the unknown field at reference point ξ of cell c.
 
ConicalVector h_field (const ConicalSolution &solution, Index cell, const Point< 2 > &xi) const
 
Point< 3 > poynting (const ConicalSolution &solution, Index cell, const Point< 2 > &xi) const
 
std::optional< ConicalVector > h_field (const ConicalSolution &solution, const mesh::PointLocator< 2 > &locator, const Point< 2 > &x) const
 The same at a physical point located with locator, or nothing outside the mesh.
 
std::optional< Point< 3 > > poynting (const ConicalSolution &solution, const mesh::PointLocator< 2 > &locator, const Point< 2 > &x) const
 

Detailed Description

Assembles \( S(\beta) - k_0^2M \) with PML, PEC, Bloch and hanging-node constraints and the source, solves, and evaluates the fields.

Constructor & Destructor Documentation

◆ ConicalScattering()

hpfem::physics::ConicalScattering::ConicalScattering ( const fespace::NedelecDofMap< 2 > &  transverse,
const fespace::DofMap< 2 > &  longitudinal,
ConicalScatteringSetup  setup 
)
Exceptions
InvalidArgumentfor ω ≤ 0, neither or both of incident field and current, mismatched maps, a PML box with a layer on a periodic side, or (with an incident field) a cell whose permeability differs from the background's.

Member Function Documentation

◆ background_material()

const materials::Material & hpfem::physics::ConicalScattering::background_material ( Index  cell) const

Background material of cell c: the stack's layer at the cell centroid, otherwise materials.background().

◆ beta()

Real hpfem::physics::ConicalScattering::beta ( ) const
inlinenoexcept

◆ constraints()

const std::optional< fespace::Constraints > & hpfem::physics::ConicalScattering::constraints ( ) const
inlinenoexcept

Hanging-node and Bloch constraints on the free block DoFs (none on a conforming mesh without periodic directions).

◆ curl_field()

ConicalVector hpfem::physics::ConicalScattering::curl_field ( const ConicalSolution &  solution,
Index  cell,
const Point< 2 > &  xi 
) const

Physical curl of the unknown field at reference point ξ of cell c.

◆ error()

ConicalError hpfem::physics::ConicalScattering::error ( const ConicalSolution &  solution,
const std::function< ConicalVector(const Point< 2 > &)> &  exact,
const std::function< ConicalVector(const Point< 2 > &)> &  exact_curl = {},
int  extra_order = 4 
) const

L2 errors of the unknown field and its conical curl against an exact physical field (E_x, E_y, E_z) and curl given as functions of the point (empty curl: zero).

◆ estimate()

adaptivity::Estimate hpfem::physics::ConicalScattering::estimate ( const ConicalSolution &  solution,
const adaptivity::EstimatorOptions &  options = {} 
) const

Element indicators of a solution (adaptivity::conical_residual_estimate with the per-cell forms of this problem, β and k0²).

◆ field()

ConicalVector hpfem::physics::ConicalScattering::field ( const ConicalSolution &  solution,
Index  cell,
const Point< 2 > &  xi 
) const

Physical field (E_x, E_y, E_z) of the unknown at reference point ξ of cell c.

◆ form_of_cell()

assembly::ConicalForm hpfem::physics::ConicalScattering::form_of_cell ( Index  cell) const

Per-cell form: material tensors (stretched inside the PML) and the source.

◆ free_dofs()

const std::vector< Index > & hpfem::physics::ConicalScattering::free_dofs ( ) const
inlinenoexcept

Free block DoFs after the PEC elimination (Nédélec first, then H1).

◆ h_field() [1/2]

std::optional< ConicalVector > hpfem::physics::ConicalScattering::h_field ( const ConicalSolution &  solution,
const mesh::PointLocator< 2 > &  locator,
const Point< 2 > &  x 
) const

The same at a physical point located with locator, or nothing outside the mesh.

◆ h_field() [2/2]

ConicalVector hpfem::physics::ConicalScattering::h_field ( const ConicalSolution &  solution,
Index  cell,
const Point< 2 > &  xi 
) const

Magnetic field \( H = \nabla\times E/(i\omega\mu_0\mu_r) \) [A/m] of the total field (unknown plus incident field as the formulation requires) with the permeability of the cell's material; convention exp(-iωt).

◆ incident_curl()

ConicalVector hpfem::physics::ConicalScattering::incident_curl ( const Point< 2 > &  x) const

Physical curl of the incident field at x: setup.incident_curl, or central differences of incident_field (zero without an incident field).

◆ incident_field()

ConicalVector hpfem::physics::ConicalScattering::incident_field ( const Point< 2 > &  x) const

Physical incident field (E_x, E_y, E_z) at x (zero without an incident field).

◆ incident_h_field()

ConicalVector hpfem::physics::ConicalScattering::incident_h_field ( const Point< 2 > &  x) const

Magnetic field of the incident wave in the background medium of the setup, \( H = \nabla\times E/(i\omega\mu_0\mu_r) \) [A/m].

◆ load()

Vector hpfem::physics::ConicalScattering::load ( ) const

The load of solve over the full block DoFs (E_x, E_y | v), before the PEC elimination and the constraints: the scattered-field source \( k_0^2(\varepsilon - \varepsilon_b)E^{inc} \) of the cells whose permittivity deviates from the background, or the current; assembled on the source cells only (zero if there are none). Problems that differ only in the excitation share the operator, so the factorisation one of them kept (KeptFactorisation::solve_many) solves the loads of the others without assembling or factorising again (the incidences from cover and substrate of a grating cell, issue #216).

◆ longitudinal()

const fespace::DofMap< 2 > & hpfem::physics::ConicalScattering::longitudinal ( ) const
inlinenoexcept

◆ longitudinal_dofs()

const fespace::DofMap< 2 > & hpfem::physics::ConicalScattering::longitudinal_dofs ( ) const
inlinenoexcept

◆ poynting() [1/2]

std::optional< Point< 3 > > hpfem::physics::ConicalScattering::poynting ( const ConicalSolution &  solution,
const mesh::PointLocator< 2 > &  locator,
const Point< 2 > &  x 
) const

◆ poynting() [2/2]

Point< 3 > hpfem::physics::ConicalScattering::poynting ( const ConicalSolution &  solution,
Index  cell,
const Point< 2 > &  xi 
) const

Time-averaged Poynting vector \( S = \tfrac12\mathrm{Re}(E\times\bar H) \) [W/m^2] of the total field (energy-flow maps; its z component is the power flow along the lines).

◆ scattered_field() [1/2]

std::optional< ConicalVector > hpfem::physics::ConicalScattering::scattered_field ( const ConicalSolution &  solution,
const mesh::PointLocator< 2 > &  locator,
const Point< 2 > &  x 
) const

◆ scattered_field() [2/2]

ConicalVector hpfem::physics::ConicalScattering::scattered_field ( const ConicalSolution &  solution,
Index  cell,
const Point< 2 > &  xi 
) const

◆ setup()

const ConicalScatteringSetup & hpfem::physics::ConicalScattering::setup ( ) const
inlinenoexcept

◆ solution_from()

ConicalSolution hpfem::physics::ConicalScattering::solution_from ( const Vector &  block) const

The solution of a full block coefficient vector (E_x, E_y | v), e.g. a column of KeptFactorisation::solve_many of load(): the scattered field with an incident field, the total field with a current.

Exceptions
InvalidArgumentif the size is not the number of block DoFs.

◆ solve()

ConicalSolution hpfem::physics::ConicalScattering::solve ( ) const
Exceptions
Errorif the factorisation fails.

◆ system_constraints()

const std::optional< fespace::Constraints > & hpfem::physics::ConicalScattering::system_constraints ( ) const
inlinenoexcept

The constraints on system_dofs() (constraints(), or their H1 part on the scalar path).

◆ system_dofs()

const std::vector< Index > & hpfem::physics::ConicalScattering::system_dofs ( ) const
inlinenoexcept

The unknowns solve factorises before the constraints: free_dofs(), or the free H1 block DoFs (offset by the Nédélec count) on the scalar E_z path.

◆ total_field() [1/2]

std::optional< ConicalVector > hpfem::physics::ConicalScattering::total_field ( const ConicalSolution &  solution,
const mesh::PointLocator< 2 > &  locator,
const Point< 2 > &  x 
) const

The same at a physical point located with locator (built on the mesh), or nothing outside the mesh.

◆ total_field() [2/2]

ConicalVector hpfem::physics::ConicalScattering::total_field ( const ConicalSolution &  solution,
Index  cell,
const Point< 2 > &  xi 
) const

Total / scattered field (the incident field added or subtracted as the formulation requires; without an incident field both coincide).

◆ transverse()

const fespace::NedelecDofMap< 2 > & hpfem::physics::ConicalScattering::transverse ( ) const
inlinenoexcept

◆ transverse_dofs()

const fespace::NedelecDofMap< 2 > & hpfem::physics::ConicalScattering::transverse_dofs ( ) const
inlinenoexcept

◆ wavenumber()

Real hpfem::physics::ConicalScattering::wavenumber ( ) const
inlinenoexcept

The documentation for this class was generated from the following file: