API
ClosedWaveguideDispersion.allocate_matries
ClosedWaveguideDispersion.assemble_A
ClosedWaveguideDispersion.assemble_B
ClosedWaveguideDispersion.calc_diagram
ClosedWaveguideDispersion.plot_diagram
ClosedWaveguideDispersion.setup_bdcs
ClosedWaveguideDispersion.setup_dofs
ClosedWaveguideDispersion.setup_fevs
ClosedWaveguideDispersion.setup_grid
ClosedWaveguideDispersion.allocate_matries
— Methodallocate_matries(dh::DofHandler, cst::ConstraintHandler)
Create a sparsity pattern by DofHandler dh
and ConstraintHandler cst
.
ClosedWaveguideDispersion.assemble_A
— Methodassemble_A(cv::CellValues, dh::DofHandler, A::SparseMatrixCSC, α::Float64)
Assemble the matrix $\mathbf{A}$ which is given by the sesquilinear form
$\int \nabla u \cdot \nabla \bar{v} - 2i \alpha \partial_{1} u \bar{v} + \alpha^{2} u \bar{v} dx.$
ClosedWaveguideDispersion.assemble_B
— Methodassemble_B(cv::CellValues, dh::DofHandler, B::SparseMatrixCSC, n::Function)
Assemble the matrix $\mathbf{B}$ which is given by the sesquilinear form
$\int n(x_{2}, x_{2}) u \bar{v} dx.$
ClosedWaveguideDispersion.calc_diagram
— Methodcalc_diagram(cv::CellValues, dh::DofHandler, cst::ConstraintHandler, A::SparseMatrixCSC, B::SparseMatrixCSC, n::Function, bz; nevs::Int=6)
Compute the dispersion diagram for a 2D periodic closed waveguide. The propagation of the wave in this waveguide is described by
$\Delta u + k^2 n(x_{1}, x_{2})u = 0.$
To get the dispersion diagram, We need to solve generalized linear eigenvalue problems parametered by $\alpha$ in the Brillouin zone bz
which are derived by Finite element method. The generalized linear eigenvalue problems come from
$\int \nabla u \cdot \nabla \bar{v} - 2i \alpha \partial_{1} u \bar{v} + \alpha^{2} u \bar{v} dx = k^{2} \int n(x_{2}, x_{2}) u \bar{v} dx.$
Arguments
cv
: CellValuesdh
: DofHandlercst
: ConstraintHandlerA
: matrix $\mathbf{A}$ generated byassemble_A
B
: matrix $\mathbf{B}$ generated byassemble_B
n
: refractive index which describe the property of the mediumbz
: discrete Brillouin zonenevs
: the number of eigenvalues
ClosedWaveguideDispersion.plot_diagram
— Methodplot_diagram(bz, μ;period=1.0, title="Dispersion Diagram", xlabel="Brillouin zone")
Plot the disperison diagram.
Arguments
bz
: discrete Brillouin zoneμ
: eigenvalues with respect to $\alpha$ inbz
period
: period of the closed waveguide in the horizontal direction
ClosedWaveguideDispersion.setup_bdcs
— Methodsetup_bdcs(dh::DofHandler; period=1.0)
Impose the periodic boundary condition in the horizontal direction.
Arguments
dh
: DofHandlerperiod
: the period of the closed waveguide in the horizontal direction.
ClosedWaveguideDispersion.setup_dofs
— Methodsetup_dofs(grid::Grid, ip)
Define the DofHandler according to the mesh grid
and the interpolation ip
.
ClosedWaveguideDispersion.setup_fevs
— Methodsetup_fevs(ip)
Set up the quadreture rule and CellValues (for the integral on domain). Here we only consider 2D problem.
Arguments
ip
: the interpolation
ClosedWaveguideDispersion.setup_grid
— Methodsetup_grid(;lc=0.05, period=1.0, height=1.0)
Generate the mesh for the periodic cell by using Gmsh.
Arguments
lc
: the mesh sizeperiod
: the period of the periodic closed waveguideheight
: the height of the periodic closed waveguide