Physics
Maxwell equation assembly and material properties.
Materials
DistributedEmitterOpt.refindex — Function
refindex(material::String) -> (n_interp, k_interp)Load refractive index data for a material and return interpolation functions. The interpolants are callable with wavelength in nm.
Example
n_Ag, k_Ag = refindex("Ag")
n_532 = n_Ag(532.0) # Real part at 532 nm
k_532 = k_Ag(532.0) # Imaginary partDistributedEmitterOpt.complex_index — Function
complex_index(material::String, λ::Float64) -> ComplexF64Get complex refractive index n + ik at wavelength λ (nm).
DistributedEmitterOpt.resolve_index — Function
resolve_index(mat::MaterialSpec, λ::Float64) → ComplexF64Get complex refractive index at wavelength λ (nm).
- String: lookup from material database
- Float64: use directly as real index
DistributedEmitterOpt.plasmon_period — Function
plasmon_period(n_fluid, n_metal, λ) -> Float64Estimate surface plasmon polariton wavelength: λ_spp = λ / Re(√(εm·εf / (εm + εf)))
Maxwell assembly
DistributedEmitterOpt.PhysicalParams — Type
PhysicalParamsPhysical parameters for a single frequency solve.
DistributedEmitterOpt.assemble_maxwell — Function
assemble_maxwell(pt, sim, phys) -> SparseMatrixAssemble Maxwell curl-curl matrix with Sommerfeld ABC.
A = ∫ (∇×v)·(∇×u) dΩ - k²∫ ε(p)v·u dΩ + ik√ε ∫ v·u dS (ABC)
DistributedEmitterOpt.assemble_source — Function
assemble_source(sim, phys; source_y=true) -> VectorAssemble source vector for plane wave incidence.
Maxwell solver
DistributedEmitterOpt.solve_forward! — Function
solve_forward!(pde, pt, sim, pool) -> Dict{CacheKey, CellField}Solve Maxwell for every unique field configuration. Caches LU factorizations in the pool.
DistributedEmitterOpt.solve_adjoint! — Function
solve_adjoint!(pde, sources, sim, pool) -> Dict{CacheKey, CellField}Solve adjoint Maxwell for each adjoint source. Reuses the LU factors already in the pool.
Solve A'x = b (adjoint system).
DistributedEmitterOpt.pde_sensitivity — Function
pde_sensitivity(pde, fields, adjoints, pf, pt, sim, control; space=sim.Pf)Compute dg/dpf from the PDE term (lambda^T dA/dp E), summed over all field configs.
DistributedEmitterOpt.build_phys_params — Function
build_phys_params(fc, env, sim; α=0.0)Build PhysicalParams for a given FieldConfig and Environment.