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
from typing import Tuple | |
import matplotlib.pyplot as plt | |
import meep as mp | |
import numpy as np | |
RESOLUTION_UM = 800 | |
WAVELENGTH_UM = 1.0 | |
AIR_UM = 1.0 |
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
"""Validates the adjoint gradient of the diffraction efficiency of a 1D grating. | |
The 2D test involves computing the gradient of the diffraction efficiency of | |
the first transmitted order in air with respect to the height of a 1D binary | |
grating. A linearly polarized planewave is from incident from the substrate on | |
which the grating is placed. The adjoint gradient is validated using the brute-force | |
finite difference via the directional derivative. | |
""" | |
rom enum import Enum |
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
"""Validates the adjoint gradient of the diffraction efficiency of a 1D grating. | |
The 2D test involves using subpixel smoothing to compute the gradient of the | |
diffraction efficiency of the first transmitted order in air of a 1D grating | |
on a substrate given a normally incident planewave from the substrate. The | |
adjoint gradient is validated using the brute-force finite difference via the | |
directional derivative. The grating structure is represented as a level set. | |
""" | |
from enum import Enum |
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 typing import Tuple | |
import matplotlib | |
matplotlib.use("agg") | |
import matplotlib.pyplot as plt | |
from mpl_toolkits.axes_grid1 import make_axes_locatable | |
import meep as mp | |
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 argparse | |
from typing import Tuple | |
import matplotlib | |
matplotlib.use("agg") | |
import matplotlib.pyplot as plt | |
import meep as mp | |
import numpy as np | |
parser = argparse.ArgumentParser() |
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 typing import Tuple | |
import matplotlib | |
matplotlib.use("agg") | |
import matplotlib.pyplot as plt | |
import meep as mp | |
import numpy as np | |
parser = argparse.ArgumentParser() |
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
""" | |
Checks that the constraint function with constraint L applied to a circle | |
with diameter d has a return value based on the convention that a violation | |
(L > d) is >=0 and a non-violation is ~0. | |
""" | |
from typing import Tuple | |
import matplotlib | |
matplotlib.use('agg') |
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
""" | |
Checks that the constraint function of a periodic design region | |
produces the same value whether or not a test feature crosses its | |
edge and wraps around back into the design region. | |
""" | |
from typing import Tuple | |
import matplotlib | |
matplotlib.use('agg') |
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 math | |
from typing import Tuple | |
import matplotlib | |
matplotlib.use("agg") | |
import matplotlib.pyplot as plt | |
import meep as mp | |
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 argparse | |
import matplotlib | |
matplotlib.use("agg") | |
import matplotlib.pyplot as plt | |
import meep as mp | |
import numpy as np | |
def radiated_flux(res: float, dpml_r: float, dpml_z: float, sr: float, | |
sz: float, fcen: float, m: int, rpos: float) -> float: | |
"""Computes the radiated flux for an Er point source in vacuum.""" |
NewerOlder