Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modelling 3D photonic crystals #1

Open
sp94 opened this issue Jul 4, 2020 · 0 comments
Open

Modelling 3D photonic crystals #1

sp94 opened this issue Jul 4, 2020 · 0 comments
Labels
breaking Will change the interface enhancement New feature or request

Comments

@sp94
Copy link
Owner

sp94 commented Jul 4, 2020

Issue

Sometimes full 3D simulations (photonic crystal periodic in x, y, z directions) will be required, but Peacock.jl currently supports only 2D simulations (crystal periodic in x and y directions, and assumed homogeneous along the z direction).

Extending the solver (plane wave expansion method) to 3D is relatively straightforward. But the 2D and 3D solvers have different inputs and outputs, in particular the 2D solution is a scalar field (out of plane component of either E or H), and the 3D solution is a vector field (all three components of either E or H, for the simplest approach).

Current interface

Only for 2D

epf(x,y) = ...
muf(x,y) = ...
geometry = Geometry(epf, muf, a1, a2, d1, d2)
solver = Solver(geometry, fourier_space_cutoff)
modes = solve(solver, k, polarisation) # returns array of Mode with out-of-plane E or H, depending on polarisation

Desired interfaces

For 3D

epf(x,y,z) = ...
muf(x,y,z) = ...
geometry = Geometry(epf, muf, a1, a2, a3, d1, d2, d3)
solver = Solver3D(geometry, fourier_space_cutoff)
modes = solve(solver, k) # returns array of Mode with all components of E and H

For 2D

epf(x,y) = ...
muf(x,y) = ...
geometry = Geometry(epf, muf, a1, a2, d1, d2)
solver = SolverTE(geometry, fourier_space_cutoff) # <-- different Solvers for different polarisations
modes = solve(solver, k) # returns array of Mode with all components of E and H

Required changes

  • Make Geometry 3D, but create two constructors

    • Geometry(epf, muf, a1, a2, a3, d1, d2, d3) should produce a 3D geometry
    • Geometry(epf, muf, a1, a2, d1, d2) should produce a 2D geometry, internally represented as a thin 3D geometry
  • Separate Solver into SolverTE, SolverTM, and Solver3D

    • Allowing SolverTE and SolverTM to be constructed separately would reduce efficiency in cases where users wanted to solve for both polarisations, as their construction can share data. However, for 2D simulations this normally won't be too expensive, and if it was, we could create another function to construct SolverTE and SolverTM simultaneously.
  • Extend Mode to hold all six components of the electric/magnetic fields

struct Mode
    k0::Vector{Float64}
    ...
    # electric field components
    Sx::Vector{ComplexF64}
    Sy::Vector{ComplexF64}
    Sz::Vector{ComplexF64}
    # magnetic field components
    Ux::Vector{ComplexF64}
    Uy::Vector{ComplexF64}
    Uz::Vector{ComplexF64}
end
  • This would require storing more data for each Mode. However, this wouldn't be too expensive as the Fourier-space representations of the fields are efficient, and solve would return the same object for 3D, TE, and TM polarised simulations.
  • Allows the same Mode object to be returned for TE, TM, and 3D simulations
  • Users would also have instant access to all components of the electric/magnetic fields.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Will change the interface enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant