API Reference
WaveOperators.CircleWaveOperators.GridWaveOperators.HorizontalLineWaveOperators.IntegralEquationWaveOperators.RectangleWaveOperators.RectangleWaveOperators.ShapeSliceWaveOperators.SlabWaveOperators.VerticalLineWaveOperators.add_current!WaveOperators.add_current!WaveOperators.add_mode!WaveOperators.compute_modesWaveOperators.generate_GWaveOperators.getindicesWaveOperators.is_inWaveOperators.posWaveOperators.set_contrast!WaveOperators.solve
WaveOperators.Circle — MethodCircle(position::T, radius) where T <: TupleCreates a Circle at position with radius radius.
WaveOperators.Grid — MethodGrid(height::Real, width::Real, h::Real, k::Real)Creates a height by width grid with discretization h and wavenumber k. This grid will define our problem domain.
WaveOperators.HorizontalLine — TypeHoriztonalLine(y2::Float64)Creates a horiztonal line (across the entire domain) at y position y.
WaveOperators.IntegralEquation — TypeIntegralEquationThis object represents the physics equation
\[z + G\mathbf{diag}(\theta)z = Gb,\]
in compact form. Specifically, G_design maps from the design region to the design region, and G_target maps from the design region to the target. By only dealing with the reduced form of the system, we avoid unnecessary computation. The reduced form of the physics is
\[\begin{aligned} z^\mathrm{design} + G^\mathrm{design}z^\mathrm{design} &= b^\mathrm{design}\\ z^\mathrm{target} + G^\mathrm{target}z^\mathrm{design} &= b^\mathrm{target} \end{aligned}\]
WaveOperators.Rectangle — MethodRectangle(w::N, h::M) where {N <: Real, M <: Real}Creates a Rectangle at (0,0) with dimensions w by h.
WaveOperators.Rectangle — MethodRectangle(position::T, shape::U) where {T <: Tuple, U <: Tuple}Creates a Rectangle at positionwith dimensionsshape. Both inputs are tuples of floats (Tuple{Float64, Float64}`).
WaveOperators.ShapeSlice — TypeShapeSlice(shape::Shape, line::VerticalLine)Creates a vertical slice (defined by line) of shape.
WaveOperators.Slab — TypeSlab(position::Float64, width::Float64)Creates a Slab (horizontal rectangle that strectes across the entire domain) at y position position with (vertical) width width.
WaveOperators.VerticalLine — TypeVerticalLine(x::Float64)Creates a vertical line (across the entire domain) at x position x.
WaveOperators.add_current! — Methodadd_current!(g::Grid, positions, input)Adds excitation input to the grid g at positions positions.
WaveOperators.add_current! — Methodadd_current!(g::Grid, s::S, input::N) where {S <: Shape, N <: Number}Adds excitation input to the grid g at position s.
WaveOperators.add_mode! — Methodadd_mode!(g::Grid, x, n_mode::Int)Adds mode number n_mode to the grid g at position x, which may be an x axis position or a VerticalLine.
WaveOperators.compute_modes — Methodcompute_modes(g::Grid, x)Returns the modes of the excitation on the grid g.
WaveOperators.generate_G — Methodfunction generate_G(g::Grid, design, target)Generates the IntegralEquation (Green's function G and excitations b) for the equation
\[z + G\mathbf{diag}(\theta)z = Gb,\]
The inputs design and target may be indices or shapes.
WaveOperators.getindices — Methodgetindices(g::Grid, s::Shape) where S <: ShapeGets indices (wrt the grid g) of the shape s
WaveOperators.is_in — Functionis_in(s::Shape, p::Position)Checks if p (a tuple (x::Float64, y::Float64)) is in the shape s.
WaveOperators.pos — Functionpos(g::Grid, x)Returns the position of x in grid
WaveOperators.set_contrast! — Methodset_contrast!(g::Grid, s::S, val) where S <: ShapeSets the contrast of the shape s in grid g to be val.
WaveOperators.solve — Methodsolve(g::Grid)Computes the field on the grid g (an excitation should be added first).