106 int extra_order = 2,
const std::vector<mesh::Tag>& pmc_tags = {});
108 [[nodiscard]]
const std::vector<PortMode>&
modes() const noexcept {
return modes_; }
118 [[nodiscard]]
const std::vector<Index>&
dofs() const noexcept {
return port_dofs_; }
130 [[nodiscard]]
Real length() const noexcept {
return length_; }
155 const std::vector<mesh::Tag>& pmc_tags);
157 void basis(
const Segment& seg,
Real s, std::vector<Real>& values,
158 std::vector<Real>& derivatives)
const;
159 [[nodiscard]]
const Segment& segment_at(
Real s)
const;
164 void section_field(
Index m,
Index cell,
const Point<2>& xi, Eigen::Matrix<Complex, 2, 1>& e_t,
165 Complex& e_z, Eigen::Matrix<Complex, 2, 1>& grad_e_z)
const;
167 std::vector<Segment> segments_;
175 std::vector<PortMode> modes_;
176 std::vector<Vector> profiles_;
177 std::vector<Vector> functionals_;
178 std::vector<Complex> normalisations_;
179 std::vector<Index> port_dofs_;
181 std::shared_ptr<const mesh::Mesh<2>> section_;
182 std::shared_ptr<const fespace::NedelecDofMap<2>> section_nedelec_;
183 std::shared_ptr<const fespace::DofMap<2>> section_h1_;
184 std::vector<WaveguideMode> section_modes_;
187extern template class PortModes<2>;
188extern template class PortModes<3>;
Definition dof_map.hpp:51
Definition material.hpp:149
Modes, functionals and normalisations of one port; built by Scattering from the setup.
Definition waveguide_port.hpp:94
Eigen::Matrix< Complex, Dim, 1 > transverse_field(Index m, const Point< Dim > &x) const
Index num_modes() const noexcept
Definition waveguide_port.hpp:109
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={})
Complex trace(Index m, Real s) const
const Point< Dim > & origin() const noexcept
Origin of the port frame; 2D: the start of the port coordinate (s increases along t').
Definition waveguide_port.hpp:132
const Point< Dim > & normal() const noexcept
Definition waveguide_port.hpp:137
std::vector< Complex > coefficients(const Vector &e) const
Coefficients of a discrete field.
const Point< Dim > & tangent2() const noexcept
3D: the second frame vector t₂ (t₁ × t₂ = n); 2D: unused.
Definition waveguide_port.hpp:136
const mesh::Mesh< 2 > * section() const noexcept
3D: the extracted cross-section mesh in frame coordinates (u, v); nothing in 2D.
Definition waveguide_port.hpp:139
const Vector & functional(Index m) const
Definition waveguide_port.hpp:112
const std::vector< Index > & dofs() const noexcept
DoFs touched by the port (sorted).
Definition waveguide_port.hpp:118
Complex normalisation(Index m) const
.
Definition waveguide_port.hpp:114
Real profile(Index m, Real s) const
2D: (the H_z profile) at the port coordinate s.
Real length() const noexcept
Definition waveguide_port.hpp:130
const std::vector< PortMode > & modes() const noexcept
Definition waveguide_port.hpp:108
const Point< Dim > & tangent() const noexcept
2D: the unit tangent t' of the port coordinate; 3D: the first frame vector t₁.
Definition waveguide_port.hpp:134
std::int32_t Tag
Integer tag of a physical group (Gmsh convention: positive; 0 means untagged).
Definition mesh.hpp:23
constexpr Tag kNoTag
Definition mesh.hpp:24
Definition absorption.hpp:21
double Real
Definition types.hpp:15
Eigen::Matrix< Real, Dim, 1 > Point
Definition types.hpp:27
constexpr std::size_t as_size(Index i) noexcept
Converts a non-negative global or local index to a container index.
Definition types.hpp:34
std::int64_t Index
global indices (DoFs, entities)
Definition types.hpp:17
Eigen::Matrix< Complex, Eigen::Dynamic, 1 > Vector
Definition types.hpp:20
std::complex< double > Complex
Definition types.hpp:16
Modal coefficients of a solution on one port.
Definition waveguide_port.hpp:87
std::vector< Complex > incoming
a_m (the setup's amplitudes)
Definition waveguide_port.hpp:88
std::vector< Complex > outgoing
b_m = c_m − a_m
Definition waveguide_port.hpp:89
Definition waveguide_port.hpp:79
Complex beta
propagation constant [1/m], Im β ≥ 0 (evanescent: iβ'')
Definition waveguide_port.hpp:80
Real power
power [W] of the outgoing mode of unit amplitude (0 if evanescent)
Definition waveguide_port.hpp:82
bool propagating
Definition waveguide_port.hpp:83
Complex effective_index
β / k0
Definition waveguide_port.hpp:81
A port of a scattering problem: the boundary facets of a waveguide cross-section.
Definition waveguide_port.hpp:55
mesh::Tag facet_tag
Definition waveguide_port.hpp:56
std::vector< mesh::Tag > pmc_tags
Definition waveguide_port.hpp:67
Index num_modes
Definition waveguide_port.hpp:59
std::vector< Complex > incident
Definition waveguide_port.hpp:60