Core API

Dimensions

PhoXonic.Dim1Type
Dim1

One-dimensional structures (e.g., Bragg mirrors, superlattices).

source
PhoXonic.Dim2Type
Dim2

Two-dimensional structures (e.g., photonic crystal slabs, 2D phononic crystals).

source
PhoXonic.Dim3Type
Dim3

Three-dimensional structures (e.g., 3D photonic crystals, bulk phononic crystals).

source

Lattice

PhoXonic.LatticeType
Lattice{D<:Dimension}

Represents a periodic lattice in D dimensions.

Fields

  • vectors: Primitive lattice vectors as a tuple of SVectors
  • reciprocal: Reciprocal lattice vectors (computed automatically)
source
PhoXonic.fcc_latticeFunction
fcc_lattice(a::Real=1.0)

Create a 3D face-centered cubic lattice with conventional lattice constant a.

source

Materials

PhoXonic.DielectricType
Dielectric(ε, μ=1.0)

Isotropic dielectric material with permittivity ε and permeability μ.

Examples

air = Dielectric(1.0)
silicon = Dielectric(11.7)
source
PhoXonic.IsotropicElasticType
IsotropicElastic(ρ, C11, C12, C44)

Isotropic elastic material with density ρ and elastic constants.

For isotropic materials: C44 = (C11 - C12) / 2

Fields

  • ρ: Mass density [kg/m³]
  • C11: Elastic constant (λ + 2μ) [Pa]
  • C12: Elastic constant (λ) [Pa]
  • C44: Shear modulus (μ) [Pa]

Examples

# Steel
steel = IsotropicElastic(7800.0, 282e9, 113e9, 84.5e9)

# From Lamé parameters
epoxy = IsotropicElastic(ρ=1180.0, λ=4.43e9, μ=1.59e9)
source
PhoXonic.from_E_νFunction
from_E_ν(ρ, E, ν)

Create isotropic elastic material from Young's modulus E and Poisson's ratio ν.

source

Shapes

PhoXonic.CircleType
Circle(center, radius)

A circle in 2D.

Examples

c = Circle(Vec2(0, 0), 0.2)
c = Circle([0.0, 0.0], 0.2)
source
PhoXonic.RectangleType
Rectangle(center, size)

An axis-aligned rectangle in 2D.

Examples

r = Rectangle(Vec2(0, 0), Vec2(0.5, 0.3))
source
PhoXonic.CylinderType
Cylinder(center, radius, height, axis)

A cylinder in 3D with specified center, radius, height, and axis direction. Default axis is along z.

source

Geometry

PhoXonic.GeometryType
Geometry{D<:Dimension, M<:Material}

Represents the geometry of a periodic crystal structure.

Fields

  • lattice: The periodic lattice
  • background: Background material
  • inclusions: List of (shape, material) pairs

Examples

lattice = square_lattice(1.0)
air = Dielectric(1.0)
rod = Dielectric(8.9)
geo = Geometry(lattice, air, [(Circle(Vec2(0,0), 0.2), rod)])
source
PhoXonic.discretizeFunction
discretize(geo::Geometry{Dim2}, resolution, property, [method])

Discretize a 2D geometry onto a grid.

Arguments

  • geo: The geometry to discretize
  • resolution: Tuple (Nx, Ny) of grid points
  • property: Property to extract (:ε, :μ, :ρ, :C11, :C12, :C44)
  • method: Discretization method (default: SimpleGrid())

Returns

A matrix of property values on the grid.

source
discretize(geo::Geometry{Dim1}, resolution, property, [method])

Discretize a 1D geometry onto a grid.

source
discretize(geo::Geometry{Dim3}, resolution, property, [method])

Discretize a 3D geometry onto a grid.

Arguments

  • geo: The 3D geometry to discretize
  • resolution: Tuple (Nx, Ny, Nz) of grid points
  • property: Property to extract (:ε, :μ, :ρ, :C11, :C12, :C44, etc.)
  • method: Discretization method (default: SimpleGrid())

Returns

A 3D array of property values on the grid.

source
discretize(geometry, resolution, ...)

Discretize geometry on a grid.

See concrete method signatures for detailed documentation and keyword arguments.

source
PhoXonic.SimpleGridType
SimpleGrid

Simple point-sampling discretization. Each grid point gets the material value at that exact location.

source
PhoXonic.SubpixelAverageType
SubpixelAverage

Subpixel averaging for smoother material boundaries. Uses volume fractions to average material properties.

source

Plane Wave Basis

PhoXonic.PlaneWaveBasisType
PlaneWaveBasis{D<:Dimension}

Plane wave basis for D-dimensional periodic structures.

Fields

  • lattice: The underlying lattice
  • cutoff: Maximum index for plane waves
  • indices: List of (p, q, ...) indices for each plane wave
  • G: Reciprocal lattice vectors for each plane wave
  • num_pw: Total number of plane waves
source
PhoXonic.convolution_matrixFunction
convolution_matrix(f::AbstractMatrix, basis::PlaneWaveBasis{Dim2})

Compute the convolution matrix for a 2D function f(r).

The convolution matrix C has elements: C[i,j] = f̂(Gi - Gj) where f̂ is the Fourier transform of f.

Arguments

  • f: Real-space function values on a grid (Nx × Ny)
  • basis: Plane wave basis

Returns

A complex matrix of size (numpw × numpw).

source
convolution_matrix(f::AbstractVector, basis::PlaneWaveBasis{Dim1})

Compute the convolution matrix for a 1D function f(x).

source
convolution_matrix(f::AbstractArray{T,3}, basis::PlaneWaveBasis{Dim3}) where T

Compute the convolution matrix for a 3D function f(r).

source

See also: