This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
import numpy as np | |
import meep as mp | |
def dipole_emission(res: float, dpml_r: float, dpml_z: float, s: float, | |
m: int, fcen: float) -> float: | |
"""Computes the complex fields from an Er point source at r=z=0 in vacuum.""" | |
cell_size = mp.Vector3(s+dpml_r,0,s+2*dpml_z) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
from numpy.linalg import norm | |
from numpy import conj | |
import meep as mp | |
def dipole_emission(res: float, dpml_r: float, dpml_z: float, s: float, | |
m: int, fcen: float) -> float: | |
"""Computes the DFT fields from an Er point source at r=z=0 in vacuum.""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import meep as mp | |
import argparse | |
def radiated_flux(res: float, dpml_r: float, dpml_z: float, s: float, | |
m: int, fcen: float) -> float: | |
"""Computes the radiated flux for an Er point source at r=z=0 in vacuum.""" | |
cell_size = mp.Vector3(s+dpml_r,0,s+2*dpml_z) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
from numpy.linalg import norm | |
from numpy import conj | |
import meep as mp | |
def dipole_emission(res: float, dpml_r: float, dpml_z: float, s: float, | |
m: int, fcen: float) -> float: | |
"""Computes the complex fields from an Er point source at r=z=0 in vacuum.""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import meep as mp | |
import argparse | |
def radiated_flux(res: float, dpml_r: float, s: float) -> float: | |
"""Computes the radiated flux for an Er point source at r=0 in a cavity | |
in vacuum with metallic sidewalls.""" | |
cell_size = mp.Vector3(s+dpml_r,0,s) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Topology optimization of the waveguide mode converter using | |
Meep's adjoint solver from A M. Hammond et al., Optics Express, | |
Vol. 30, pp. 4467-4491 (2022). doi.org/10.1364/OE.442074 | |
The worst-case optimization is based on minimizing the maximum | |
of R + (1-T) where R is $|S_{11}|^2$ for mode 1 and T is $|S_{21}|^2$ | |
for mode 2 across six different wavelengths. The minimum linewidth | |
criteria is 90 nm. The optimization uses the method of moving | |
asymptotes (MMA) algorithm from NLopt. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Computes the worst-case reflectance and transmittance of a mode converter. | |
This script uses Meep to compute the reflectance and transmittance over a | |
number of sampled wavelengths of a mode converter imported as an image. | |
Each wavelength is a separate simulation to ensure the eigenmode source | |
is correct. The results are printed in CSV format including the | |
worst-case values. | |
""" | |
import numpy as np |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import meep as mp | |
import argparse | |
import numpy as np | |
import matplotlib | |
matplotlib.use('agg') | |
import matplotlib.pyplot as plt | |
parser = argparse.ArgumentParser() | |
parser.add_argument( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Computes the radiation pattern of an antenna in free space. | |
import meep as mp | |
import math | |
import numpy as np | |
import matplotlib | |
matplotlib.use('agg') | |
import matplotlib.pyplot as plt | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import meep as mp | |
import numpy as np | |
import math | |
import matplotlib | |
matplotlib.use('agg') | |
import matplotlib.pyplot as plt | |
resolution = 50 # pixels/μm |