hp-FEM
Adaptive hp-FEM suite for nano-optics
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
hpfem::physics::PortModes< Dim > Class Template Reference

Modes, functionals and normalisations of one port; built by Scattering from the setup. More...

#include <waveguide_port.hpp>

Public Member Functions

 PortModes (const fespace::NedelecDofMap< Dim > &dofs, mesh::Tag facet_tag, const materials::MaterialMap &materials, Real omega, Index num_modes, int extra_order=2, const std::vector< mesh::Tag > &pmc_tags={})
 
const std::vector< PortMode > & modes () const noexcept
 
Index num_modes () const noexcept
 
const Vector & functional (Index m) const
 
Complex normalisation (Index m) const
 \( N_m = \int_\Gamma \hat e_m\cdot\hat w_m \).
 
std::vector< Complex > coefficients (const Vector &e) const
 Coefficients \( c_m = q_m^\top e / N_m = a_m + b_m \) of a discrete field.
 
const std::vector< Index > & dofs () const noexcept
 DoFs touched by the port (sorted).
 
Complex trace (Index m, Real s) const
 
Real profile (Index m, Real s) const
 2D: \( h_m(s) \) (the H_z profile) at the port coordinate s.
 
Eigen::Matrix< Complex, Dim, 1 > transverse_field (Index m, const Point< Dim > &x) const
 
Real length () const noexcept
 
const Point< Dim > & origin () const noexcept
 Origin of the port frame; 2D: the start of the port coordinate (s increases along t').
 
const Point< Dim > & tangent () const noexcept
 2D: the unit tangent t' of the port coordinate; 3D: the first frame vector t₁.
 
const Point< Dim > & tangent2 () const noexcept
 3D: the second frame vector t₂ (t₁ × t₂ = n); 2D: unused.
 
const Point< Dim > & normal () const noexcept
 
const mesh::Mesh< 2 > * section () const noexcept
 3D: the extracted cross-section mesh in frame coordinates (u, v); nothing in 2D.
 

Detailed Description

template<int Dim>
class hpfem::physics::PortModes< Dim >

Modes, functionals and normalisations of one port; built by Scattering from the setup.

Constructor & Destructor Documentation

◆ PortModes()

template<int Dim>
hpfem::physics::PortModes< Dim >::PortModes ( const fespace::NedelecDofMap< Dim > &  dofs,
mesh::Tag  facet_tag,
const materials::MaterialMap &  materials,
Real  omega,
Index  num_modes,
int  extra_order = 2,
const std::vector< mesh::Tag > &  pmc_tags = {} 
)

Solves the cross-section problem of the facets tagged facet_tag with the materials of their inside cells at ω and keeps num_modes modes (3D: at most the guided ones). Quadrature on the port of degree 2p + extra_order. pmc_tags: see WaveguidePort::pmc_tags (3D only).

Exceptions
InvalidArgumentfor a tag without boundary facets, a lossy material on the port, facets not on one straight line (2D) / plane (3D), ω ≤ 0, num_modes < 1 or the port tag among pmc_tags; NotImplemented for pmc_tags in 2D; Error if the 3D mode solver does not converge.

Member Function Documentation

◆ coefficients()

template<int Dim>
std::vector< Complex > hpfem::physics::PortModes< Dim >::coefficients ( const Vector &  e) const

Coefficients \( c_m = q_m^\top e / N_m = a_m + b_m \) of a discrete field.

◆ dofs()

template<int Dim>
const std::vector< Index > & hpfem::physics::PortModes< Dim >::dofs ( ) const
inlinenoexcept

DoFs touched by the port (sorted).

◆ functional()

template<int Dim>
const Vector & hpfem::physics::PortModes< Dim >::functional ( Index  m) const
inline

\( q_m \): the functional \( \int_\Gamma\phi_i\cdot\hat w_m \) on the DoF map (full size; nonzero on the port DoFs only).

◆ length()

template<int Dim>
Real hpfem::physics::PortModes< Dim >::length ( ) const
inlinenoexcept

2D: length of the port line; 3D: twice the largest distance of a port vertex from the vertex centroid.

◆ modes()

template<int Dim>
const std::vector< PortMode > & hpfem::physics::PortModes< Dim >::modes ( ) const
inlinenoexcept

◆ normal()

template<int Dim>
const Point< Dim > & hpfem::physics::PortModes< Dim >::normal ( ) const
inlinenoexcept

◆ normalisation()

template<int Dim>
Complex hpfem::physics::PortModes< Dim >::normalisation ( Index  m) const
inline

\( N_m = \int_\Gamma \hat e_m\cdot\hat w_m \).

◆ num_modes()

template<int Dim>
Index hpfem::physics::PortModes< Dim >::num_modes ( ) const
inlinenoexcept

◆ origin()

template<int Dim>
const Point< Dim > & hpfem::physics::PortModes< Dim >::origin ( ) const
inlinenoexcept

Origin of the port frame; 2D: the start of the port coordinate (s increases along t').

◆ profile()

template<int Dim>
Real hpfem::physics::PortModes< Dim >::profile ( Index  m,
Real  s 
) const

2D: \( h_m(s) \) (the H_z profile) at the port coordinate s.

Exceptions
InvalidArgumentin 3D.

◆ section()

template<int Dim>
const mesh::Mesh< 2 > * hpfem::physics::PortModes< Dim >::section ( ) const
inlinenoexcept

3D: the extracted cross-section mesh in frame coordinates (u, v); nothing in 2D.

◆ tangent()

template<int Dim>
const Point< Dim > & hpfem::physics::PortModes< Dim >::tangent ( ) const
inlinenoexcept

2D: the unit tangent t' of the port coordinate; 3D: the first frame vector t₁.

◆ tangent2()

template<int Dim>
const Point< Dim > & hpfem::physics::PortModes< Dim >::tangent2 ( ) const
inlinenoexcept

3D: the second frame vector t₂ (t₁ × t₂ = n); 2D: unused.

◆ trace()

template<int Dim>
Complex hpfem::physics::PortModes< Dim >::trace ( Index  m,
Real  s 
) const

2D: tangential trace \( \hat e_m(s) \) of mode m at the port coordinate s ∈ [0, length].

Exceptions
InvalidArgumentin 3D.

◆ transverse_field()

template<int Dim>
Eigen::Matrix< Complex, Dim, 1 > hpfem::physics::PortModes< Dim >::transverse_field ( Index  m,
const Point< Dim > &  x 
) const

Tangential electric field \( \hat e_m \) of mode m at the point x on the port (3D: the mode of the cross-section mapped into the frame; 2D: \( \hat e_m t' \)).

Exceptions
InvalidArgumentif x does not lie on the port.

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