hp-FEM
Adaptive hp-FEM suite for nano-optics
Loading...
Searching...
No Matches
band_structure.hpp
Go to the documentation of this file.
1#pragma once
13#include <vector>
14
17#include "hpfem/core/types.hpp"
21#include "hpfem/mesh/mesh.hpp"
23
24namespace hpfem::physics {
25
28template <int Dim>
45
47template <int Dim>
48struct Bands {
50 std::vector<Real> wavenumber;
51 std::vector<Real> residual;
58 [[nodiscard]] std::vector<Real> normalised(Real lattice_constant) const;
59};
60
62template <int Dim>
64 public:
68 [[nodiscard]] const BandStructureSetup<Dim>& setup() const noexcept { return setup_; }
69 [[nodiscard]] const fespace::NedelecDofMap<Dim>& dofs() const noexcept { return *dofs_; }
70 [[nodiscard]] const fespace::DofMap<Dim>& h1() const noexcept { return *h1_; }
72 [[nodiscard]] const SparseMatrix& stiffness() const noexcept { return stiffness_; }
74 [[nodiscard]] const SparseMatrix& mass() const noexcept { return mass_; }
80 [[nodiscard]] fespace::Constraints constraints(const Point<Dim>& wave_vector) const;
82 [[nodiscard]] Real lattice_constant() const;
84 [[nodiscard]] Bands<Dim> bands(const Point<Dim>& wave_vector) const;
87 [[nodiscard]] std::vector<Bands<Dim>> path(const std::vector<Point<Dim>>& corners,
88 int segments) const;
89
90 private:
91 const fespace::NedelecDofMap<Dim>* dofs_;
92 const fespace::DofMap<Dim>* h1_;
94 SparseMatrix stiffness_;
95 SparseMatrix mass_;
96 SparseMatrix gradient_;
97 std::vector<Index> free_nd_;
98 std::vector<Index> free_h1_;
99};
100
101extern template struct BandStructureSetup<2>;
102extern template struct BandStructureSetup<3>;
103extern template struct Bands<2>;
104extern template struct Bands<3>;
105extern template class BandStructure<2>;
106extern template class BandStructure<3>;
107
108} // namespace hpfem::physics
Definition constraints.hpp:26
Definition dof_map.hpp:51
Definition material.hpp:149
Assembles the pencil once and solves the Bloch eigenproblem per wave vector.
Definition band_structure.hpp:63
const BandStructureSetup< Dim > & setup() const noexcept
Definition band_structure.hpp:68
const SparseMatrix & mass() const noexcept
Relative mass matrix M, , full size.
Definition band_structure.hpp:74
fespace::Constraints constraints(const Point< Dim > &wave_vector) const
assembly::MaxwellForm< Dim > form_of_cell(Index cell) const
BandStructure(const fespace::NedelecDofMap< Dim > &dofs, const fespace::DofMap< Dim > &h1, BandStructureSetup< Dim > setup)
std::vector< Bands< Dim > > path(const std::vector< Point< Dim > > &corners, int segments) const
const fespace::NedelecDofMap< Dim > & dofs() const noexcept
Definition band_structure.hpp:69
const SparseMatrix & stiffness() const noexcept
Relative stiffness matrix S, , full size.
Definition band_structure.hpp:72
const fespace::DofMap< Dim > & h1() const noexcept
Definition band_structure.hpp:70
Real lattice_constant() const
Lattice constant: the length of the first lattice vector.
Bands< Dim > bands(const Point< Dim > &wave_vector) const
Bands at the wave vector k (phases per lattice vector).
Definition absorption.hpp:21
DirectSolverBackend
Direct solver backends.
Definition linear_solver.hpp:70
double Real
Definition types.hpp:15
Eigen::Matrix< Real, Dim, 1 > Point
Definition types.hpp:27
Eigen::Matrix< Complex, Eigen::Dynamic, Eigen::Dynamic > Matrix
Definition types.hpp:22
Eigen::SparseMatrix< Complex, Eigen::RowMajor, Index > SparseMatrix
Definition types.hpp:24
std::int64_t Index
global indices (DoFs, entities)
Definition types.hpp:17
Definition maxwell_forms.hpp:58
Definition band_structure.hpp:29
Index num_bands
Definition band_structure.hpp:33
int max_iterations
Definition band_structure.hpp:37
int extra_quadrature_order
Definition band_structure.hpp:39
solvers::DirectSolverBackend solver
Definition band_structure.hpp:38
std::vector< mesh::Tag > pec_tags
optional metallic walls
Definition band_structure.hpp:32
std::vector< assembly::PeriodicPair< Dim > > lattice
master/slave tags and lattice vectors
Definition band_structure.hpp:31
bool keep_modes
Definition band_structure.hpp:43
Real tolerance
Definition band_structure.hpp:36
materials::MaterialMap materials
lossless, by cell tag
Definition band_structure.hpp:30
Index krylov_dimension
Definition band_structure.hpp:35
Real shift
σ of the shift-invert in units of (2π / a)² (negative: below band 0)
Definition band_structure.hpp:34
The bands at one Bloch wave vector.
Definition band_structure.hpp:48
std::vector< Real > normalised(Real lattice_constant) const
Normalised frequencies ω a / (2π c0) for the lattice constant a.
Matrix modes
Definition band_structure.hpp:56
std::vector< Real > wavenumber
k0 of the bands, ascending [1/m]
Definition band_structure.hpp:50
Point< Dim > wave_vector
k [1/m]
Definition band_structure.hpp:49
std::vector< Real > residual
Definition band_structure.hpp:51