コード例 #1
0
    def __init__(self, simtime=0.5e-13, resolution = 8e-9,size_x = 0.3e-6, size_y = 0.3e-6,
                 size_z = .75e-6,thickness_mgf2 = 50.8e-9,**other_args):
    #def __init__(self, simtime=1e-13, resolution = 5e-9,size_x = 0.2e-6, size_y = 0.2e-6,
     #            size_z = 0.5e-6,thickness_mgf2 = 99.8e-9,**other_args):
	meep_utils.AbstractMeepModel.__init__(self) #Inizialitation of the class
	

	self.simulation_name = "AntirrefFilm30deg"    
        self.src_freq = 545e12     # [Hz] (note: srcwidth irrelevant for continuous_source)
	self.src_width= 130e12
	self.interesting_frequencies=(430e12,650e12)
        self.pml_thickness = 5.0e-8
        self.size_x = size_x 
        self.size_y = size_y
        self.size_z = size_z
        self.simtime = simtime      # [s]
	self.monitor_z1 = - 3e-7
	self.monitor_z2 =  thickness_mgf2/2 + 2.5e-7
        self.Kx = (2*np.pi*self.src_freq/c)*np.sin(np.pi/6)#6.8017e6 # 30 degrees
	self.Ky = 0
	self.padding=0
        self.register_locals(locals(), other_args)          ## Remember the parameters
        ## Define materials
        f_c = c / np.pi/self.resolution/meep_utils.meep.use_Courant()

        self.materials   = [meep_materials.material_dielectric(eps=1.904,where=self.where_MgF2)] #eps=1.904
	self.materials +=  [meep_materials.material_dielectric(eps=3.24, where = self.where_sust)] 
	#self.materials = [] # uncomment if no materials present
        for material in self.materials: self.fix_material_stability(material, f_c=2e15, verbose=1)
        meep_utils.plot_eps(self.materials, plot_conductivity=True, 
                draw_instability_area=(self.f_c(), 3*meep.use_Courant()**2), mark_freq={self.f_c():'$f_c$'})
        self.test_materials()
コード例 #2
0
    def __init__(self, comment="", simtime=100e-12, resolution=2e-6, cells=1, monzc=0e-6, Kx=0, Ky=0, padding=20e-6,
            monzd=60e-6, epsilon=100):
        meep_utils.AbstractMeepModel.__init__(self)        ## Base class initialisation
        self.simulation_name = "XCylWire"    ## 
        self.register_locals(locals())          ## Remember the parameters

        ## Initialization of materials used
        if 'TiO2' in comment:           self.materials = [meep_materials.material_TiO2_THz(where = self.where_diel)]
        elif 'DielLossless' in comment: self.materials = [meep_materials.material_dielectric(where = self.where_diel, eps=epsilon, loss=0.0)]
        elif 'Diel' in comment:         self.materials = [meep_materials.material_dielectric(where = self.where_diel, eps=epsilon, loss=0.05)]
        else:                           self.materials = []
        self.materials += [meep_materials.material_Metal_THz(where = self.where_metal)]

        ## Dimension constants for the simulation
        self.pml_thickness = 10e-6
        self.size_x = 40e-6
        self.size_y = 30e-6
        self.size_z = 80e-6+cells*self.monzd + 2*self.padding + 2*self.pml_thickness

        ## constants for the simulation
        (self.monitor_z1, self.monitor_z2) = (-(monzd*cells)/2+monzc - padding, (monzd*cells)/2+monzc + padding)  
        self.simtime = simtime      # [s]
        self.srcWidth = 2000e9     
        self.srcFreq = 4e9 + self.srcWidth/2 + (Ky**2+Kx**2)**.5 / (2*np.pi/3e8)  ## cutoff for oblique incidence
        self.interesting_frequencies = (0., 1000e9) 

        #meep_utils.plot_eps(self.materials, freq_range=(1e10, 1e14), plot_conductivity=True)
        self.TestMaterials() ## catches (most) errors in structure syntax, before they crash the callback
コード例 #3
0
    def __init__(self,
                 comment="",
                 simtime=100e-12,
                 resolution=2e-6,
                 cells=1,
                 monzc=0e-6,
                 Kx=0,
                 Ky=0,
                 padding=20e-6,
                 monzd=60e-6,
                 epsilon=100):
        meep_utils.AbstractMeepModel.__init__(
            self)  ## Base class initialisation
        self.simulation_name = "XCylWire"  ##
        self.register_locals(locals())  ## Remember the parameters

        ## Initialization of materials used
        if 'TiO2' in comment:
            self.materials = [
                meep_materials.material_TiO2_THz(where=self.where_diel)
            ]
        elif 'DielLossless' in comment:
            self.materials = [
                meep_materials.material_dielectric(where=self.where_diel,
                                                   eps=epsilon,
                                                   loss=0.0)
            ]
        elif 'Diel' in comment:
            self.materials = [
                meep_materials.material_dielectric(where=self.where_diel,
                                                   eps=epsilon,
                                                   loss=0.05)
            ]
        else:
            self.materials = []
        self.materials += [
            meep_materials.material_Metal_THz(where=self.where_metal)
        ]

        ## Dimension constants for the simulation
        self.pml_thickness = 10e-6
        self.size_x = 40e-6
        self.size_y = 30e-6
        self.size_z = 80e-6 + cells * self.monzd + 2 * self.padding + 2 * self.pml_thickness

        ## constants for the simulation
        (self.monitor_z1,
         self.monitor_z2) = (-(monzd * cells) / 2 + monzc - padding,
                             (monzd * cells) / 2 + monzc + padding)
        self.simtime = simtime  # [s]
        self.srcWidth = 2000e9
        self.srcFreq = 4e9 + self.srcWidth / 2 + (Ky**2 + Kx**2)**.5 / (
            2 * np.pi / 3e8)  ## cutoff for oblique incidence
        self.interesting_frequencies = (0., 1000e9)

        #meep_utils.plot_eps(self.materials, freq_range=(1e10, 1e14), plot_conductivity=True)
        self.TestMaterials(
        )  ## catches (most) errors in structure syntax, before they crash the callback
コード例 #4
0
    def __init__(self,
                 simtime=0.5e-13,
                 resolution=8e-9,
                 size_x=0.3e-6,
                 size_y=0.3e-6,
                 size_z=.75e-6,
                 thickness_mgf2=50.8e-9,
                 **other_args):
        #def __init__(self, simtime=1e-13, resolution = 5e-9,size_x = 0.2e-6, size_y = 0.2e-6,
        #            size_z = 0.5e-6,thickness_mgf2 = 99.8e-9,**other_args):
        meep_utils.AbstractMeepModel.__init__(
            self)  #Inizialitation of the class

        self.simulation_name = "AntirrefFilm30deg"
        self.src_freq = 545e12  # [Hz] (note: srcwidth irrelevant for continuous_source)
        self.src_width = 130e12
        self.interesting_frequencies = (430e12, 650e12)
        self.pml_thickness = 5.0e-8
        self.size_x = size_x
        self.size_y = size_y
        self.size_z = size_z
        self.simtime = simtime  # [s]
        self.monitor_z1 = -3e-7
        self.monitor_z2 = thickness_mgf2 / 2 + 2.5e-7
        self.Kx = (2 * np.pi * self.src_freq / c) * np.sin(
            np.pi / 6)  #6.8017e6 # 30 degrees
        self.Ky = 0
        self.padding = 0
        self.register_locals(locals(), other_args)  ## Remember the parameters
        ## Define materials
        f_c = c / np.pi / self.resolution / meep_utils.meep.use_Courant()

        self.materials = [
            meep_materials.material_dielectric(eps=1.904,
                                               where=self.where_MgF2)
        ]  #eps=1.904
        self.materials += [
            meep_materials.material_dielectric(eps=3.24, where=self.where_sust)
        ]
        #self.materials = [] # uncomment if no materials present
        for material in self.materials:
            self.fix_material_stability(material, f_c=2e15, verbose=1)
        meep_utils.plot_eps(self.materials,
                            plot_conductivity=True,
                            draw_instability_area=(self.f_c(),
                                                   3 * meep.use_Courant()**2),
                            mark_freq={self.f_c(): '$f_c$'})
        self.test_materials()
コード例 #5
0
    def __init__(self, comment="", simtime=100e-12, resolution=2e-6, cellnumber=1, cellsize=100e-6, padding=50e-6, 
            fillfraction=0.5, epsilon=2, **other_args):
        meep_utils.AbstractMeepModel.__init__(self)        ## Base class initialisation

        ## Constant parameters for the simulation
        self.simulation_name = "Slab"    
        self.src_freq, self.src_width = 1000e9, 4000e9  # [Hz] (note: gaussian source ends at t=10/src_width)
        self.interesting_frequencies = (10e9, 2000e9)    # Which frequencies will be saved to disk
        self.pml_thickness = 0.1*c/self.src_freq

        self.size_x = resolution*2 
        self.size_y = resolution
        self.size_z = cellnumber*cellsize + 4*padding + 2*self.pml_thickness
        self.monitor_z1, self.monitor_z2 = (-(cellsize*cellnumber/2)-padding, (cellsize*cellnumber/2)+padding)
        self.cellcenters = np.arange((1-cellnumber)*cellsize/2, cellnumber*cellsize/2, cellsize)

        self.register_locals(locals(), other_args)          ## Remember the parameters

        ## Define materials
        # note: for optical range, it was good to supply f_c=5e15 to fix_material_stability
        if 'Au' in comment:           
            m = meep_materials.material_Au(where=self.where_slab)
            self.fix_material_stability(m, verbose=0) ## rm all osc above the first one, to optimize for speed 
        elif 'Ag' in comment:           
            m = meep_materials.material_Ag(where=self.where_slab)
            self.fix_material_stability(m, verbose=0) ## rm all osc above the first one, to optimize for speed 
        else:
            m = meep_materials.material_dielectric(where=self.where_slab, loss=0.001, eps=epsilon)
        self.materials = [m]
コード例 #6
0
ファイル: spdc.py プロジェクト: aitatanit/python-meep-utils
    def __init__(self, comment="", simtime=15e-12, resolution=3e-6, size_x=1350e-6, size_y=1350e-6, size_z=0,
            wgwidth=10e-6, wgheight=20e-6, monzd=180e-6):
        meep_utils.AbstractMeepModel.__init__(self)        ## Base class initialisation
        self.simulation_name = "SPDC"    
        monzd=size_z

        self.register_locals(locals())          ## Remember the parameters

        ## Constants for the simulation
        substrate_z = size_x / 3
        self.pml_thickness = 10e-6
        self.monitor_z1, self.monitor_z2 = (-(monzd)/2, (monzd)/2)  
        self.simtime = simtime      # [s]
        self.srcFreq, self.srcWidth = 5000e9, 5000e9     # [Hz] (note: gaussian source ends at t=10/srcWidth)
        self.interesting_frequencies = (0e9, 2000e9)     # Which frequencies will be saved to disk
        self.Kx = 0; self.Ky = 0; self.padding=0
        self.size_x = size_x 
        self.size_y = size_y
        self.size_z = size_z

        ## Define materials
        self.materials   = [meep_materials.material_dielectric(eps=4., where = self.where_diel)]  
        #self.materials  += [meep_materials.material_dielectric(eps=4., where = self.where_substr)]  

        self.TestMaterials()
        f_c = c / np.pi/self.resolution/meep_utils.meep.use_Courant()
        meep_utils.plot_eps(self.materials, mark_freq=[f_c])
コード例 #7
0
    def __init__(self, comment="", simtime=100e-12, resolution=2e-6, cellnumber=1, cellsize=100e-6, padding=50e-6, 
            fillfraction=0.5, epsilon=2, **other_args):
        meep_utils.AbstractMeepModel.__init__(self)        ## Base class initialisation

        ## Constant parameters for the simulation
        self.simulation_name = "Slab"    
        self.src_freq, self.src_width = 1000e9, 4000e9  # [Hz] (note: gaussian source ends at t=10/src_width)
        self.interesting_frequencies = (10e9, 2000e9)    # Which frequencies will be saved to disk
        self.pml_thickness = 0.1*c/self.src_freq

        self.size_x = resolution*2 
        self.size_y = resolution
        self.size_z = cellnumber*cellsize + 4*padding + 2*self.pml_thickness
        self.monitor_z1, self.monitor_z2 = (-(cellsize*cellnumber/2)-padding, (cellsize*cellnumber/2)+padding)
        self.cellcenters = np.arange((1-cellnumber)*cellsize/2, cellnumber*cellsize/2, cellsize)

        self.register_locals(locals(), other_args)          ## Remember the parameters

        ## Define materials
        # note: for optical range, it was good to supply f_c=5e15 to fix_material_stability
        if 'Au' in comment:           
            m = meep_materials.material_Au(where=self.where_slab)
            self.fix_material_stability(m, verbose=0) ## rm all osc above the first one, to optimize for speed 
        elif 'Ag' in comment:           
            m = meep_materials.material_Ag(where=self.where_slab)
            self.fix_material_stability(m, verbose=0) ## rm all osc above the first one, to optimize for speed 
        else:
            m = meep_materials.material_dielectric(where=self.where_slab, loss=0.001, eps=epsilon)
        self.materials = [m]
コード例 #8
0
    def __init__(self, comment="", simtime=100e-12, resolution=3e-6, Kx=0, Ky=0, 
            spacing=75e-6, monzd=80e-6,                              # lateral simulation size, and the z-length left for whole structure
            apertured=5e-6, apertureth=5e-6, gaasth=2e-6,           # metal aperture (square hole size, metal thickness, gallium arsenide layer thickness)
            radius=10e-6, epsloss=0.01, spherey=0e-6, spherez=-14e-6, # dielectric sphere (radius and dielectric losses)
            wireth=4e-6, wirey=14e-6, wirez=-14e-6                    # metallic wire along x  (diameter, lateral position)
            ):
        meep_utils.AbstractMeepModel.__init__(self)        ## Base class initialisation
        self.simulation_name = "ApertureSphere"    
        self.register_locals(locals())          ## Remember the parameters

        ## Constants for the simulation
        self.pml_thickness = 20e-6
        self.monitor_z1, self.monitor_z2 = -monzd/2, self.apertureth+self.gaasth
        print  "self.monitor_z1, self.monitor_z2", self.monitor_z1, self.monitor_z2
        self.simtime = simtime      # [s]
        self.src_freq, self.src_width = 2000e9, 4000e9      # [Hz] (note: gaussian source ends at t=10/src_width)
        self.interesting_frequencies = (0e9, 4000e9)        # Which frequencies will be saved to disk

        self.size_x = spacing 
        self.size_y = spacing
        self.size_z = monzd*2 + 2*self.pml_thickness

        ## Define materials
        #self.materials = [meep_materials.material_dielectric(where = self.where_GaAs, eps=10)]  
        #self.materials += [meep_materials.material_TiO2_THz(where = self.where_TiO2)]  
        self.materials = []
        if self.radius > 0: self.materials += [meep_materials.material_dielectric(where = self.where_TiO2, eps=94., loss=epsloss)]  
        #if not 'NoGaAs' in comment:  self.materials += [meep_materials.material_dielectric(where = self.where_gaas, eps=12) ] %TODO test GaAs where-func
        self.materials += [meep_materials.material_Au(where = self.where_metal) ]
        for m in self.materials: self.fix_material_stability(m)

        ## Test the validity of the model
        meep_utils.plot_eps(self.materials, plot_conductivity=True, 
                draw_instability_area=(self.f_c(), 3*meep.use_Courant()**2), mark_freq={self.f_c():'$f_c$'})
        self.test_materials()
コード例 #9
0
    def __init__(self, comment="", simtime=100e-12, resolution=6e-6, cells=1, monzc=0e-6, Kx=0, Ky=0,
            xs=55e-6, ys=95e-6, zs=25e-6, xyspacing=150e-6, monzd=100e-6, padding=0e-6, metalspacing=0e-6):
        meep_utils.AbstractMeepModel.__init__(self)        ## Base class initialisation
        self.simulation_name = "DielectricBar"    ## 
        self.register_locals(locals())          ## Remember the parameters

        ## Initialization of materials used
        #self.materials = [meep_materials.material_TiO2_THz(where = self.where_TiO2)]
        #self.materials = [meep_materials.material_dielectric(where = self.where_TiO2, eps=4.)]
        self.materials = [
                meep_materials.material_dielectric(where = self.where_TiO2, eps=12.), 
                #meep_materials.material_STO(where = self.where_TiO2), 
                #meep_materials.material_STO_THz(where = self.where_TiO2), 
                #meep_materials.material_STO_hiloss(where = self.where_TiO2), 
                #meep_materials.material_Metal_THz(where = self.where_metal)
                ]

        ## Dimension constants for the simulation
        #self.size_x, self.size_y, self.size_z = xyspacing, xyspacing, 400e-6+cells*self.monzd
        self.size_x = resolution/1.8 if (xs==np.inf) else xyspacing
        self.size_y = resolution/.9 if (ys==np.inf) else xyspacing
        self.size_z = 300e-6+cells*self.monzd

        ## constants for the simulation
        self.pml_thickness = 30e-6
        (self.monitor_z1, self.monitor_z2) = (-(monzd*cells)/2+monzc, (monzd*cells)/2+monzc)  
        self.simtime = simtime      # [s]
        self.srcWidth = 2000e9     
        self.srcFreq = 1000e9     
        #self.srcFreq = 4e9 + self.srcWidth/2 + (Ky**2+Kx**2)**.5 / (2*np.pi/3e8)  ## cutoff for oblique incidence
        self.interesting_frequencies = (0., 3000e9) 

        self.TestMaterials() ## catches (most) errors in structure syntax, before they crash the callback
コード例 #10
0
    def __init__(self, comment="", simtime=100e-12, resolution=6e-6, cells=1, monzc=0e-6, Kx=0, Ky=0, padding=50e-6,
            radius=20e-6, xspacing=100e-6, monzd=100e-6, epsilon=600):
        meep_utils.AbstractMeepModel.__init__(self)        ## Base class initialisation
        self.simulation_name = "YCylWire"    ## 
        self.register_locals(locals())          ## Remember the parameters

        ## Initialization of materials used
        if 'TiO2' in comment:
            self.materials = [meep_materials.material_TiO2_THz(where = self.where_wire)]
        elif 'STO' in comment:
            self.materials = [meep_materials.material_STO_THz(where = self.where_wire)]
        elif 'Diel' in comment:
            self.materials = [meep_materials.material_dielectric(where = self.where_wire, eps=epsilon, loss=0.001)]
        else:
            self.materials = [meep_materials.material_Metal_THz(where = self.where_wire)]

        ## Dimension constants for the simulation
        #self.size_x, self.size_y, self.size_z = xyspacing, xyspacing, 400e-6+cells*self.monzd
        self.pml_thickness = 20e-6
        self.size_x = xspacing
        self.size_y = resolution/1.8
        self.size_z = 200e-6+cells*self.monzd + 2*self.padding + 2*self.pml_thickness

        ## constants for the simulation
        self.monitor_z1 =-(monzd*cells)/2+self.monzc - self.padding 
        self.monitor_z2 = (monzd*cells)/2+self.monzc + self.padding  
        self.simtime = simtime      # [s]
        self.srcWidth = 3000e9     
        self.srcFreq = 1e12 #4e9 + self.srcWidth/2 + (Ky**2+Kx**2)**.5 / (2*np.pi/3e8)  ## cutoff for oblique incidence
        self.interesting_frequencies = (0., 3000e9) 

        self.TestMaterials() ## catches (most) errors in structure syntax, before they crash the callback
コード例 #11
0
    def __init__(self, comment="", simtime=100e-12, resolution=2e-6, cells=1, Kx=0, Ky=0,
            width=64e-6, thick=26e-6, yspacing=96e-6, monzd=96e-6, epsilon=100, padding=50e-6):
        meep_utils.AbstractMeepModel.__init__(self)        ## Base class initialisation
        self.simulation_name = "XRectWire"    ## 
        self.monzc=0e-6 
        self.register_locals(locals())          ## Remember the parameters

        self.padding=50e-6
        self.monzc=0e-6 
        ## Initialization of materials used
        self.materials = [ meep_materials.material_dielectric(where = self.where_slab, eps=epsilon, loss=0.01),
                meep_materials.material_Metal_THz(where = self.where_met)]

        ## Dimension constants for the simulation
        #self.size_x, self.size_y, self.size_z = xyspacing, xyspacing, 400e-6+cells*self.monzd
        self.pml_thickness = 20e-6
        self.size_x = resolution/1.8
        self.size_y = yspacing
        self.size_z = 120e-6+cells*self.monzd + 2*self.padding + 2*self.pml_thickness

        ## constants for the simulation
        self.monitor_z1 =-(monzd*cells)/2+self.monzc - self.padding 
        self.monitor_z2 = (monzd*cells)/2+self.monzc + self.padding  
                
                 
        self.simtime = simtime      # [s]
        self.srcWidth = 3000e9     
        #self.srcFreq = 4e9 + self.srcWidth/2 + (Ky**2+Kx**2)**.5 / (2*np.pi/3e8)  ## cutoff for oblique incidence
        self.srcFreq = 1e12
        self.interesting_frequencies = (0., 1000e9) 

        self.TestMaterials() ## catches (most) errors in structure syntax, before they crash the callback
コード例 #12
0
ファイル: nearfield.py プロジェクト: xeeliu/python-meep-utils
    def __init__(
            self,
            comment="",
            simtime=100e-12,
            resolution=3e-6,
            Kx=0,
            Ky=0,
            spacing=75e-6,
            monzd=80e-6,  # lateral simulation size, and the z-length left for whole structure
            apertured=5e-6,
            apertureth=5e-6,
            gaasth=2e-6,  # metal aperture (square hole size, metal thickness, gallium arsenide layer thickness)
            radius=10e-6,
            epsloss=0.01,
            spherey=0e-6,
            spherez=-14e-6,  # dielectric sphere (radius and dielectric losses)
            wireth=4e-6,
            wirey=14e-6,
            wirez=-14e-6  # metallic wire along x  (diameter, lateral position)
    ):
        meep_utils.AbstractMeepModel.__init__(
            self)  ## Base class initialisation
        self.simulation_name = "ApertureSphere"
        self.register_locals(locals())  ## Remember the parameters

        ## Constants for the simulation
        self.pml_thickness = 20e-6
        self.monitor_z1, self.monitor_z2 = -monzd / 2, self.apertureth + self.gaasth
        print "self.monitor_z1, self.monitor_z2", self.monitor_z1, self.monitor_z2
        self.simtime = simtime  # [s]
        self.src_freq, self.src_width = 2000e9, 4000e9  # [Hz] (note: gaussian source ends at t=10/src_width)
        self.interesting_frequencies = (
            0e9, 4000e9)  # Which frequencies will be saved to disk

        self.size_x = spacing
        self.size_y = spacing
        self.size_z = monzd * 2 + 2 * self.pml_thickness

        ## Define materials
        #self.materials = [meep_materials.material_dielectric(where = self.where_GaAs, eps=10)]
        #self.materials += [meep_materials.material_TiO2_THz(where = self.where_TiO2)]
        self.materials = []
        if self.radius > 0:
            self.materials += [
                meep_materials.material_dielectric(where=self.where_TiO2,
                                                   eps=94.,
                                                   loss=epsloss)
            ]
        #if not 'NoGaAs' in comment:  self.materials += [meep_materials.material_dielectric(where = self.where_gaas, eps=12) ] %TODO test GaAs where-func
        self.materials += [meep_materials.material_Au(where=self.where_metal)]
        for m in self.materials:
            self.fix_material_stability(m)

        ## Test the validity of the model
        meep_utils.plot_eps(self.materials,
                            plot_conductivity=True,
                            draw_instability_area=(self.f_c(),
                                                   3 * meep.use_Courant()**2),
                            mark_freq={self.f_c(): '$f_c$'})
        self.test_materials()
コード例 #13
0
    def __init__(self, comment="", simtime=1000e-12, resolution=5e-6, cells=1, monzc=0e-6,
            BarWidth=100e-6, BarThick=100e-6, SubstrThick=50e-6, BarPeriod=200e-6, YCellShift=0,
            Kx=0, Ky=0):
        meep_utils.AbstractMeepModel.__init__(self)        ## Base class initialisation
        self.simulation_name = "CKEBars"    ## 
        self.register_locals(locals())          ## Remember the parameters


        ## Initialization of materials used
        self.materials = [meep_materials.material_TiO2_THz(where = self.where_TiO2), 
                meep_materials.material_dielectric(where = self.where_substr, eps=1.0)] ## XXX

        ## Dimension constants for the simulation
        monzd = BarThick + SubstrThick            ## monitor z-distance
        self.monzd = monzd
        self.size_x, self.size_y, self.size_z = resolution/1.8, BarPeriod, 500e-6 + cells*self.monzd

        ## constants for the simulation
        self.pml_thickness = 100e-6
        (self.monitor_z1, self.monitor_z2) = (-(monzd*cells)/2+monzc, (monzd*cells)/2+monzc)  
        self.simtime = simtime      # [s]
        self.srcFreq, self.srcWidth = 500e9, 1000e9     # [Hz], note: "Last source time" = 10/srcWidth
        self.interesting_frequencies = (0., 1000e9) 

        self.TestMaterials() ## catches (most) errors in structure syntax, before they crash the callback
コード例 #14
0
    def __init__(self, comment="", simtime=100e-12, resolution=4e-6, cellsize=100e-6, cellnumber=1, padding=20e-6, 
            radius=10e-6, epsilon='TiO2', loss=1, orientation="E", **other_args):

        meep_utils.AbstractMeepModel.__init__(self)        ## Base class initialisation
        self.simulation_name = "RodArray"

        self.register_locals(locals(), other_args)          ## Remember the parameters

        ## Constants for the simulation
        self.simtime = simtime      # [s]
        self.src_freq, self.src_width = 1000e9, 4000e9     # [Hz] (note: gaussian source ends at t=10/src_width)
        self.interesting_frequencies = (0e9, 3000e9)     # Which frequencies will be saved to disk
        self.pml_thickness = .1*c/self.src_freq

        if orientation=="E":
            self.size_x, self.size_y  = self.resolution*.6, cellsize
        elif orientation=="H":
            self.size_x, self.size_y  = cellsize, self.resolution*.6
        self.size_z = cellnumber*cellsize + 4*padding + 2*self.pml_thickness
        self.monitor_z1, self.monitor_z2 = (-(cellsize*cellnumber/2)-padding, (cellsize*cellnumber/2)+padding)
        self.cellcenters = np.arange((1-cellnumber)*cellsize/2, cellnumber*cellsize/2, cellsize)

        ## Define materials
        if epsilon=="TiO2":     ## use titanium dioxide if permittivity not specified...
            tio2 = meep_materials.material_TiO2(where=self.where_TiO2) 
            if loss != 1: tio2.pol[0]['gamma'] *= loss   ## optionally modify the first TiO2 optical phonon to have lower damping
        else:           ## ...or define a custom dielectric if permittivity not specified
            tio2 = meep_materials.material_dielectric(where=self.where_TiO2, eps=float(self.epsilon)) 
        self.fix_material_stability(tio2, verbose=0) ##f_c=2e13,  rm all osc above the first one, to optimize for speed 
        self.materials = [tio2]
        self.test_materials()
コード例 #15
0
    def __init__(self, comment="", simtime=100e-12, resolution=4e-6, cellsize=100e-6, cellnumber=1, padding=20e-6, 
            radius=10e-6, epsilon='TiO2', loss=1, orientation="E", **other_args):

        meep_utils.AbstractMeepModel.__init__(self)        ## Base class initialisation
        self.simulation_name = "RodArray"

        self.register_locals(locals(), other_args)          ## Remember the parameters

        ## Constants for the simulation
        self.simtime = simtime      # [s]
        self.src_freq, self.src_width = 1000e9, 4000e9     # [Hz] (note: gaussian source ends at t=10/src_width)
        self.interesting_frequencies = (0e9, 3000e9)     # Which frequencies will be saved to disk
        self.pml_thickness = .1*c/self.src_freq

        if orientation=="E":
            self.size_x, self.size_y  = self.resolution*.6, cellsize
        elif orientation=="H":
            self.size_x, self.size_y  = cellsize, self.resolution*.6
        self.size_z = cellnumber*cellsize + 4*padding + 2*self.pml_thickness
        self.monitor_z1, self.monitor_z2 = (-(cellsize*cellnumber/2)-padding, (cellsize*cellnumber/2)+padding)
        self.cellcenters = np.arange((1-cellnumber)*cellsize/2, cellnumber*cellsize/2, cellsize)

        ## Define materials
        if epsilon=="TiO2":     ## use titanium dioxide if permittivity not specified...
            tio2 = meep_materials.material_TiO2(where=self.where_TiO2) 
            if loss != 1: tio2.pol[0]['gamma'] *= loss   ## optionally modify the first TiO2 optical phonon to have lower damping
        else:           ## ...or define a custom dielectric if permittivity not specified
            tio2 = meep_materials.material_dielectric(where=self.where_TiO2, eps=float(self.epsilon)) 
        self.fix_material_stability(tio2, verbose=0) ##f_c=2e13,  rm all osc above the first one, to optimize for speed 
        self.materials = [tio2]
        self.test_materials()
コード例 #16
0
    def __init__(self, comment="", simtime=100e-12, resolution=2e-6, cells=1, monzc=0e-6, Kx=0, Ky=0, padding=100e-6,
            radius=4e-6, spacing=100e-6, monzd=100e-6, epsilon=600, xlen=50e-6):
        meep_utils.AbstractMeepModel.__init__(self)        ## Base class initialisation
        self.simulation_name = "XCylWire"    ## 
        self.register_locals(locals())          ## Remember the parameters

        ## Initialization of materials used
        self.materials = [
                meep_materials.material_Metal_THz(where = self.where_particle),
                #meep_materials.material_TiO2_THz(where = self.where_particle),
                meep_materials.material_dielectric(where = self.where_filling, eps=epsilon)]

        ## Dimension constants for the simulation
        #self.size_x, self.size_y, self.size_z = xyspacing, xyspacing, 400e-6+cells*self.monzd
        self.pml_thickness = 100e-6
        self.size_x = spacing
        self.size_y = spacing
        self.size_z = 400e-6+cells*self.monzd + 2*self.padding + 2*self.pml_thickness

        ## constants for the simulation
        (self.monitor_z1, self.monitor_z2) = (-(monzd*cells)/2+monzc - padding , (monzd*cells)/2+monzc + padding)  
        self.simtime = simtime      # [s]
        self.srcWidth = 3000e9     
        self.srcFreq = 4e9 + self.srcWidth/2 + (Ky**2+Kx**2)**.5 / (2*np.pi/3e8)  ## cutoff for oblique incidence
        self.interesting_frequencies = (0., 1000e9) 

        self.TestMaterials() ## catches (most) errors in structure syntax, before they crash the callback
コード例 #17
0
    def __init__(
            self,
            simtime=3.5e-13,
            resolution=4e-9,
            size_x=2.25e-6,
            size_y=0.1e-6,
            size_z=8e-7,
            thickness_Au=1.5e-7,
            depthx=5e-8,
            depthz=1e-7,
            thickness_sapphire=2e-7,  #1.6e-7,
            period=7.5e-7,
            Nslits=3,
            **other_args):
        meep_utils.AbstractMeepModel.__init__(
            self)  #Inizialitation of the class

        # Sapphire substrate thickness taken from Kim D S, Hohng S C, Malyarchuk V, Yoon
        #Y C, Ahn Y H, Yee K J, Park J W, Kim J, Park Q H and Lienau C 2003 Phys. Rev. Lett. 91 143901

        self.simulation_name = "SlabSubsCont3GaussSapphire"
        self.src_freq = 375e12  # [Hz] (note: srcwidth irrelevant for continuous_source)
        self.src_width = 160e12
        self.interesting_frequencies = (250e12, 500e12)
        self.pml_thickness = 2.5e-8
        self.Nslits = int(Nslits)
        self.size_x = size_x
        self.size_y = size_y
        self.size_z = size_z
        self.simtime = simtime  # [s]
        self.monitor_z1 = (-thickness_Au - 1e-7)
        self.monitor_z2 = 3.9e-7
        self.monitor_z3 = 1e-8
        self.Kx = 0  #(2*np.pi*self.src_freq/c)*np.sin(np.pi/6)#6.8017e6 # 30 degrees
        self.Ky = 0
        self.padding = 0
        self.register_locals(locals(), other_args)  ## Remember the parameters
        ## Define materials
        f_c = c / np.pi / self.resolution / meep_utils.meep.use_Courant()

        #self.materials = []
        self.materials = [meep_materials.material_Au(where=self.where_AuGauss)]
        #self.materials[0].pol[1:3]=[]
        self.materials += [
            meep_materials.material_dielectric(eps=3.133,
                                               where=self.where_sapphire)
        ]
        #self.materials += [meep_materials.material_Sapphire(where=self.where_sapphire)]

        for material in self.materials:
            self.fix_material_stability(material, f_c=2e15, verbose=1)
        meep_utils.plot_eps(self.materials,
                            plot_conductivity=True,
                            draw_instability_area=(self.f_c(),
                                                   3 * meep.use_Courant()**2),
                            mark_freq={self.f_c(): '$f_c$'})
        self.test_materials()
コード例 #18
0
    def __init__(self, comment="", simtime=30e-12, resolution=4e-6, cellsize=100e-6, cellnumber=1, padding=50e-6, 
            radius=30e-6, wirethick=0, wirecut=0, loss=1, epsilon="TiO2", diel=1, **other_args):
        meep_utils.AbstractMeepModel.__init__(self)        ## Base class initialisation

        ## Constant parameters for the simulation
        self.simulation_name = "SphereWire"    
        self.src_freq, self.src_width = 1000e9, 4000e9    # [Hz] (note: gaussian source ends at t=10/src_width)
        self.interesting_frequencies = (10e9, 3000e9)    # Which frequencies will be saved to disk
        self.pml_thickness = .1*c/self.src_freq

        self.size_x = cellsize if (radius>0 or wirecut>0) else resolution/1.8
        self.size_y = cellsize
        self.size_z = cellnumber*cellsize + 4*padding + 2*self.pml_thickness
        self.monitor_z1, self.monitor_z2 = (-(cellsize*cellnumber/2)-padding, (cellsize*cellnumber/2)+padding)
        self.cellcenters = np.arange((1-cellnumber)*cellsize/2, cellnumber*cellsize/2, cellsize)

        self.register_locals(locals(), other_args)          ## Remember the parameters

        ## Define materials (with manual Lorentzian clipping) 
        self.materials = []  
        if radius > 0:
            if epsilon=="TiO2":     ## use titanium dioxide if permittivity not specified...
                tio2 = meep_materials.material_TiO2(where=self.where_sphere) 
                if loss != 1: tio2.pol[0]['gamma'] *= loss   ## optionally modify the first TiO2 optical phonon to have lower damping
                else:           ## ...or define a custom dielectric if permittivity not specified
                    tio2 = meep_materials.material_dielectric(where=self.where_sphere, eps=float(self.epsilon)) 
            self.fix_material_stability(tio2, verbose=0) ##f_c=2e13,  rm all osc above the first one, to optimize for speed 
            self.materials.append(tio2)

        self.materials.append(meep_materials.material_dielectric(where=self.where_diel, eps=self.diel))

        if wirethick > 0:
            au = meep_materials.material_Au(where=self.where_wire)
            #au.pol[0]['sigma'] /= 100
            #au.pol[0]['gamma'] *= 10000
            self.fix_material_stability(au, verbose=0)
            self.materials.append(au)

        ## Test the validity of the model
        meep_utils.plot_eps(self.materials, plot_conductivity=True, 
                draw_instability_area=(self.f_c(), 3*meep.use_Courant()**2), mark_freq={self.f_c():'$f_c$'})
        self.test_materials()
コード例 #19
0
    def __init__(self, comment="", simtime=30e-12, resolution=4e-6, cellsize=100e-6, cellnumber=1, padding=50e-6, 
            radius=30e-6, wirethick=0, wirecut=0, loss=1, epsilon="TiO2", diel=1, **other_args):
        meep_utils.AbstractMeepModel.__init__(self)        ## Base class initialisation

        ## Constant parameters for the simulation
        self.simulation_name = "SphereWire"    
        self.src_freq, self.src_width = 1000e9, 4000e9    # [Hz] (note: gaussian source ends at t=10/src_width)
        self.interesting_frequencies = (10e9, 3000e9)    # Which frequencies will be saved to disk
        self.pml_thickness = .1*c/self.src_freq

        self.size_x = cellsize if (radius>0 or wirecut>0) else resolution/1.8
        self.size_y = cellsize
        self.size_z = cellnumber*cellsize + 4*padding + 2*self.pml_thickness
        self.monitor_z1, self.monitor_z2 = (-(cellsize*cellnumber/2)-padding, (cellsize*cellnumber/2)+padding)
        self.cellcenters = np.arange((1-cellnumber)*cellsize/2, cellnumber*cellsize/2, cellsize)

        self.register_locals(locals(), other_args)          ## Remember the parameters

        ## Define materials (with manual Lorentzian clipping) 
        self.materials = []  
        if radius > 0:
            if epsilon=="TiO2":     ## use titanium dioxide if permittivity not specified...
                tio2 = meep_materials.material_TiO2(where=self.where_sphere) 
                if loss != 1: tio2.pol[0]['gamma'] *= loss   ## optionally modify the first TiO2 optical phonon to have lower damping
            else:           ## ...or define a custom dielectric if permittivity not specified
                tio2 = meep_materials.material_dielectric(where=self.where_sphere, eps=float(self.epsilon)) 
            self.fix_material_stability(tio2, verbose=0) ##f_c=2e13,  rm all osc above the first one, to optimize for speed 
            self.materials.append(tio2)

        self.materials.append(meep_materials.material_dielectric(where=self.where_diel, eps=self.diel))

        if wirethick > 0:
            au = meep_materials.material_Au(where=self.where_wire)
            #au.pol[0]['sigma'] /= 100
            #au.pol[0]['gamma'] *= 10000
            self.fix_material_stability(au, verbose=0)
            self.materials.append(au)

        ## Test the validity of the model
        meep_utils.plot_eps(self.materials, plot_conductivity=True, 
                draw_instability_area=(self.f_c(), 3*meep.use_Courant()**2), mark_freq={self.f_c():'$f_c$'})
        self.test_materials()
コード例 #20
0
    def __init__(self, comment="", simtime=100e-12, resolution=3e-6, cells=1, monzc=0e-6, Kx=0, Ky=0, padding=50e-6,
            radius=10e-6, yspacing=100e-6, zspacing=100e-6, monzd=200e-6, epsilon=100, **other_args):
        meep_utils.AbstractMeepModel.__init__(self)        ## Base class initialisation
        self.simulation_name = "Wedge"    ## 
        print(other_args)
        self.register_locals(locals(), other_args)          ## Remember the parameters

        ## Initialization of materials used
        if 'TiO2' in comment:
            self.materials = [meep_materials.material_TiO2_THz(where = self.where_wire)]
        elif 'STO' in comment:
            self.materials = [meep_materials.material_STO_THz(where = self.where_wire)]
        elif 'DielLossless' in comment:
            self.materials = [meep_materials.material_dielectric(where = self.where_wire, eps=epsilon, loss=0.0)]
        elif 'DielLoLoss' in comment:
            self.materials = [meep_materials.material_dielectric(where = self.where_wire, eps=epsilon, loss=0.005)]
        else:
            self.materials = [meep_materials.material_dielectric(where = self.where_wire, eps=epsilon, loss=0)]


        ## Dimension constants for the simulation
        #self.size_x, self.size_y, self.size_z = xyspacing, xyspacing, 400e-6+cells*self.monzd
        self.pml_thickness = 50e-6
        self.size_x = resolution/1.8
        self.size_y = 2200e-6
        self.size_z = 2000e-6+cells*self.monzd + 2*self.padding + 2*self.pml_thickness

        ## constants for the simulation
        (self.monitor_z1, self.monitor_z2) = (-(monzd*cells)/2+monzc - padding, (monzd*cells)/2+monzc + padding)  
        self.simtime = simtime      # [s]
        self.src_width = 3000e9     
        self.src_freq = 4e9 + self.src_width/2 + (Ky**2+Kx**2)**.5 / (2*np.pi/3e8)  ## cutoff for oblique incidence
        self.interesting_frequencies = (0., 2000e9) 

        ## Test the validity of the model
        #meep_utils.plot_eps(self.materials, plot_conductivity=True, 
                #draw_instability_area=(self.f_c(), 3*meep.use_Courant()**2), mark_freq={self.f_c():'$f_c$'})
        try:
            self.test_materials() ## catches (most) errors in structure syntax, before they crash the callback
        except:
            print(sys.exc())
コード例 #21
0
    def __init__(self,
                 comment="",
                 simtime=50e-15,
                 resolution=3e-9,
                 cells=1,
                 monzc=0e-9,
                 Kx=0,
                 Ky=0,
                 padding=25e-9,
                 thick=4e-9,
                 width=4e-9,
                 xspacing=50e-9,
                 monzd=100e-9):
        meep_utils.AbstractMeepModel.__init__(
            self)  ## Base class initialisation
        self.simulation_name = "XCylWire"  ##
        self.register_locals(locals())  ## Remember the parameters

        ## Initialization of materials used
        if 'Diel' in comment:
            self.materials = [
                meep_materials.material_dielectric(where=self.where_wire,
                                                   eps=20,
                                                   loss=0.001)
            ]
        else:
            self.materials = [
                meep_materials.material_Au(where=self.where_wire)
            ]

        ## Dimension constants for the simulation
        #self.size_x, self.size_y, self.size_z = xyspacing, xyspacing, 400e-6+cells*self.monzd
        self.pml_thickness = 10e-9
        self.size_x = xspacing
        self.size_y = resolution / 1.8
        self.size_z = 100e-9 + cells * self.monzd + 2 * self.padding + 2 * self.pml_thickness

        ## constants for the simulation
        (self.monitor_z1,
         self.monitor_z2) = (-(monzd * cells) / 2 + monzc - padding,
                             (monzd * cells) / 2 + monzc + padding)
        self.simtime = simtime  # [s]
        self.srcWidth = 3000e12
        self.srcFreq = 4e12 + self.srcWidth / 2 + (Ky**2 + Kx**2)**.5 / (
            2 * np.pi / 3e8)  ## cutoff for oblique incidence
        self.interesting_frequencies = (0., 1000e12)

        #meep_utils.plot_eps(self.materials)
        self.TestMaterials(
        )  ## catches (most) errors in structure syntax, before they crash the callback
コード例 #22
0
    def __init__(self, comment="", simtime=100e-15, resolution=5e-9, cellnumber=1, padding=2e-6, cellsize = 200e-9,
            epsilon=33.97, blend=0, **other_args):
        """ This structure demonstrates that scatter.py can also compute the reflectance and transmittance of samples on 
        a substrate. The substrate is though to have effectively infinite thickness, since its back interface is not 
        included in the simulation volume. It is assumed that with thick enough substrate there will be no Fabry-Perot 
        interferences arising from the 
        reflection from its back side, so this kind of simulation can not predict them.

        The monitor planes can also be placed inside a dielectric, to enable the transmitted wave amplitude to be sensed 
        in the substrate medium. In this case the measured waveforms are 
        rescaled so that the transmitted energy is returned the same as if measured after reflection-less transition to vacuum. 
        This way, reflectance*2+transmittance*+losses still sum up to one.

        This example also demonstrates that on a steep interface with air the transmitted and reflected waves have 
        exactly the same energy with the choice of permittivity: ((1+.5**.5)/(1-.5**.5))**2, that is roughly 33.97.
        
        """
        meep_utils.AbstractMeepModel.__init__(self)        ## Base class initialisation

        ## Constant parameters for the simulation
        self.simulation_name = "HalfSpace"    
        self.src_freq, self.src_width = 500e12, 1000e12    # [Hz] (note: gaussian source ends at t=10/src_width)
        self.interesting_frequencies = (10e12, 1000e12)    # Which frequencies will be saved to disk
        self.pml_thickness = 500e-9

        self.size_z = blend + 4*padding + 2*self.pml_thickness + 6*resolution
        self.size_x = resolution*1.8 if other_args.get('Kx',0)==0 else resolution*5  ## allow some space along x if oblique incidence is set
        self.size_y = resolution*1.8 if other_args.get('Ky',0)==0 else resolution*5  ## dtto
        print  'self.size_x, self.size_y', self.size_x, self.size_y
        self.monitor_z1, self.monitor_z2 = (-padding-blend/2, padding+blend/2)
        self.register_locals(locals(), other_args)          ## Remember the parameters
        self.mon2eps = epsilon                  ## store what dielectric is the second monitor embedded in

        ## Define materials
        self.materials = []  
        if 'Au' in comment:         self.materials += [meep_materials.material_Au(where=self.where_m)]
        elif 'Ag' in comment:       self.materials += [meep_materials.material_Ag(where=self.where_m)]
        elif 'metal' in comment.lower():    
            self.materials += [meep_materials.material_Au(where=self.where_m)]
            self.materials[-1].pol[1:] = []
            self.materials[-1].pol[0]['gamma'] = 0
        else:                       self.materials += [meep_materials.material_dielectric(where=self.where_m, eps=self.epsilon)]

        for m in self.materials: 
            self.fix_material_stability(m, f_c=3e15) ## rm all osc above the first one, to optimize for speed 

        ## Test the validity of the model
        meep_utils.plot_eps(self.materials, plot_conductivity=True, 
                draw_instability_area=(self.f_c(), 3*meep.use_Courant()**2), mark_freq={self.f_c():'$f_c$'})
        self.test_materials()
コード例 #23
0
    def __init__(self, comment="", simtime=100e-15, resolution=5e-9, cellnumber=1, padding=2e-6, cellsize = 200e-9,
            epsilon=33.97, blend=0, **other_args):
        """ This structure demonstrates that scatter.py can also compute the reflectance and transmittance of samples on 
        a substrate. The substrate can have an infinite thickness, since its back interface is not included in the simulation 
        volume. It is assumed that with thick enough substrate there will be no Fabry-Perot interferences due to reflection from
        its back side; this kind simulation can not predict them.

        The monitor planes can also be placed inside a dielectric. In this case the measured waveforms are 
        rescaled so that the transmitted energy is returned the same as if measured after reflection-less transition to vacuum. 
        This way, reflectance*2+transmittance*+losses still sum up to one.

        This example also demonstrates that on a steep interface with air the transmitted and reflected waves have 
        exactly the same energy with the choice of permittivity: ((1+.5**.5)/(1-.5**.5))**2, that is roughly 33.97.
        
        """
        meep_utils.AbstractMeepModel.__init__(self)        ## Base class initialisation

        ## Constant parameters for the simulation
        self.simulation_name = "HalfSpace"    
        self.src_freq, self.src_width = 500e12, 1000e12    # [Hz] (note: gaussian source ends at t=10/src_width)
        self.interesting_frequencies = (10e12, 1000e12)    # Which frequencies will be saved to disk
        self.pml_thickness = 500e-9

        self.size_z = blend + 4*padding + 2*self.pml_thickness + 6*resolution
        self.size_x = resolution*1.8 if other_args.get('Kx',0)==0 else resolution*5  ## allow some space along x if oblique incidence is set
        self.size_y = resolution*1.8 if other_args.get('Ky',0)==0 else resolution*5  ## dtto
        print  'self.size_x, self.size_y', self.size_x, self.size_y
        self.monitor_z1, self.monitor_z2 = (-padding-blend/2, padding+blend/2)
        self.register_locals(locals(), other_args)          ## Remember the parameters
        self.mon2eps = epsilon                  ## store what dielectric is the second monitor embedded in

        ## Define materials
        self.materials = []  
        if 'Au' in comment:         self.materials += [meep_materials.material_Au(where=self.where_m)]
        elif 'Ag' in comment:       self.materials += [meep_materials.material_Ag(where=self.where_m)]
        elif 'metal' in comment.lower():    
            self.materials += [meep_materials.material_Au(where=self.where_m)]
            self.materials[-1].pol[1:] = []
            self.materials[-1].pol[0]['gamma'] = 0
        else:                       self.materials += [meep_materials.material_dielectric(where=self.where_m, eps=self.epsilon)]

        for m in self.materials: 
            self.fix_material_stability(m, f_c=3e15) ## rm all osc above the first one, to optimize for speed 

        ## Test the validity of the model
        meep_utils.plot_eps(self.materials, plot_conductivity=True, 
                draw_instability_area=(self.f_c(), 3*meep.use_Courant()**2), mark_freq={self.f_c():'$f_c$'})
        self.test_materials()
コード例 #24
0
    def __init__(self, comment="", simtime=100e-15, resolution=10e-9, cellnumber=1, padding=200e-9, cellsize = 200e-9,
            epsilon=33.97, blend=0, **other_args):
        """ This structure demonstrates that scatter.py can also be used for samples on a substrate with an infinite 
        thickness. The back side of the substrate is not simulated, and it is assumed there will be no Fabry-Perot
        interferences between its sides.

        The monitor planes are enabled to be placed also inside a dielectric. In which case the wave amplitude is 
        adjusted so that the light intensity is maintained. The field amplitudes and phases have physical meaning 
        only when both monitor planes are in the same medium, though.

        Besides, the example demonstrates that on a steep interface with air the transmitted and reflected waves have 
        exactly the same energy with the choice of permittivity: ((1+.5**.5)/(1-.5**.5))**2, that is roughly 33.97.
        
        """
        meep_utils.AbstractMeepModel.__init__(self)        ## Base class initialisation

        ## Constant parameters for the simulation
        self.simulation_name = "HalfSpace"    
        self.src_freq, self.src_width = 500e12, 100e12    # [Hz] (note: gaussian source ends at t=10/src_width)
        self.interesting_frequencies = (10e12, 1000e12)    # Which frequencies will be saved to disk
        self.pml_thickness = 500e-9

        self.size_x = resolution*1.8 
        self.size_y = resolution*1.8
        self.size_z = blend + 2*padding + 2*self.pml_thickness + 6*resolution
        self.monitor_z1, self.monitor_z2 = (-padding, padding)
        self.register_locals(locals(), other_args)          ## Remember the parameters
        self.mon2eps = epsilon                  ## store what dielectric is the second monitor embedded in

        ## Define materials
        self.materials = []  
        if 'Au' in comment:         self.materials += [meep_materials.material_Au(where=self.where_m)]
        elif 'Ag' in comment:       self.materials += [meep_materials.material_Ag(where=self.where_m)]
        elif 'metal' in comment:    
            self.materials += [meep_materials.material_Au(where=self.where_m)]
            self.materials[-1].pol[1:] = []
            self.materials[-1].pol[0]['gamma'] = 0
        else:                       self.materials += [meep_materials.material_dielectric(where=self.where_m, eps=self.epsilon)]

        for m in self.materials: 
            self.fix_material_stability(m, f_c=3e15) ## rm all osc above the first one, to optimize for speed 

        ## Test the validity of the model
        meep_utils.plot_eps(self.materials, plot_conductivity=True, 
                draw_instability_area=(self.f_c(), 3*meep.use_Courant()**2), mark_freq={self.f_c():'$f_c$'})
        self.test_materials()
コード例 #25
0
    def __init__(self, comment="", simtime=2e-15, resolution=.5e-9, cellnumber=1, padding=100e-9, cellsize=10e-9, cellsizex=0, cellsizey=0, 
            epsilon=.9, gdepth=10e-9, gwidth=10e-9,  **other_args):
        """ Similar to the HalfSpace model, but defines a deep ultraviolet grating    
        Rear side does not define any padding - useful for reflective surfaces/gratings only
        """
        meep_utils.AbstractMeepModel.__init__(self)        ## Base class initialisation

        ## TODO: test out the effect of halving simtime, halving resolution, halving padding...

        ## Constant parameters for the simulation
        self.simulation_name = "DUVGrating"    
        self.src_freq, self.src_width = 24e15, 48e15    # [Hz] (note: gaussian source ends at t=10/src_width)
        self.interesting_frequencies = (.1e15, 40e15)    # Which frequencies will be saved to disk
        self.pml_thickness = 20e-9

        self.size_z = 2*padding + gdepth + 2*self.pml_thickness + 6*resolution

        if cellsizex != 0:
            self.size_x = cellsizex         ## non-flat periodic structure (grating?) with user-defined pitch
        elif other_args.get('Kx',0) != 0:
            self.size_x = resolution*5      ## flat structure, but oblique incidence requires several-pixel with 
        else:
            self.size_x = resolution*1.8    ## flat structure, zero component of K-vector, so we can make the structure as flat as possible
        if cellsizey != 0:
            self.size_y = cellsizey         ## dtto as for size_x above
        elif other_args.get('Ky',0) != 0:
            self.size_y = resolution*5      
        else:
            self.size_y = resolution*1.8 

        print  'self.size_x, self.size_y', self.size_x, self.size_y
        self.monitor_z1, self.monitor_z2 = (-padding-gdepth/2, padding+gdepth/2)
        self.register_locals(locals(), other_args)          ## Remember the parameters
        self.mon2eps = epsilon                  ## store what dielectric is the second monitor embedded in

        ## Define materials
        self.materials = []  
        self.materials += [meep_materials.material_dielectric(where=self.where_m, eps=self.epsilon)]

        for m in self.materials: 
            self.fix_material_stability(m, f_c=60e15) ## rm all osc above the first one, to optimize for speed 

        ## Test the validity of the model
        meep_utils.plot_eps(self.materials, plot_conductivity=True, 
                draw_instability_area=(self.f_c(), 3*meep.use_Courant()**2), mark_freq={self.f_c():'$f_c$'})
        self.test_materials()
コード例 #26
0
    def __init__(self, comment="", simtime=30e-12, resolution=4e-6, cellsize=50e-6, cellsizey=30e-6, cellnumber=1,
            padding=50e-6, wirewidth=6.5e-6, wirelength=29e-6, loss=1, epsilon="Si", **other_args):
        meep_utils.AbstractMeepModel.__init__(self)        ## Base class initialisation

        ## Constant parameters for the simulation
        self.simulation_name = "WiresOnSiWire"    
        self.src_freq, self.src_width = 1000e9, 4000e9    # [Hz] (note: gaussian source ends at t=10/src_width)
        self.interesting_frequencies = (10e9, 3000e9)    # Which frequencies will be saved to disk
        self.pml_thickness = .3*c/self.src_freq

        self.size_x = cellsize
        self.size_y = cellsizey
        self.size_z = cellsize + 4*padding + 2*self.pml_thickness
        self.monitor_z1, self.monitor_z2 = (-(cellsize*cellnumber/2)-padding, (cellsize*cellnumber/2)+padding)

        self.register_locals(locals(), other_args)          ## Remember the parameters

        ## Define materials (with manual Lorentzian clipping) 
        self.materials = []  

        if epsilon=="Si":     ## use silicon if permittivity not specified...
            si = meep_materials.material_Si_MIR(where=self.where_substr) 
            if loss != 1: si.pol[0]['gamma'] *= loss   ## optionally modify the first TiO2 optical phonon to have lower damping
        else:           ## ...or define a custom dielectric if permittivity not specified
            si = meep_materials.material_dielectric(where=self.where_substr, eps=float(self.epsilon)) 
        self.fix_material_stability(si, verbose=0) ## rm all osc above the first one, to optimize for speed 
        self.mon2eps =  meep_utils.analytic_eps(mat=si, freq=1e12) ## store what dielectric is the second monitor embedded in
        print '>>>>>>>>>>>>>>>>>>>>>>>>> self.mon2eps',self.mon2eps
        #self.mon2eps = 12 ## store what dielectric is the second monitor embedded in
        self.materials.append(si)

        au = meep_materials.material_Au(where=self.where_wire)
        #au.pol[0]['sigma'] /= 100
        #au.pol[0]['gamma'] *= 10000
        self.fix_material_stability(au, verbose=0)
        self.materials.append(au)


        ## Test the validity of the model
        meep_utils.plot_eps(self.materials, plot_conductivity=True, 
                draw_instability_area=(self.f_c(), 3*meep.use_Courant()**2), mark_freq={self.f_c():'$f_c$'})
        self.test_materials()
コード例 #27
0
    def cell_centers(self):
        """ Helper function for stacked multilayered metamaterials """
        return np.arange(-self.monzd*(self.cells-1)/2, self.monzd*(self.cells-1)/2+1e-12, self.monzd)
        ## alternatively: add surrounding two cells to compare the propagation _inside_ a metamaterial
        #return np.arange(-self.monzd*(self.cells+1)/2, self.monzd*(self.cells+1)/2+1e-12, self.monzd)
        meep_utils.AbstractMeepModel.__init__(self)        ## Base class initialisation
        self.simulation_name = "XCylWire"    ## 
        self.register_locals(locals())          ## Remember the parameters

        ## Initialization of materials used
        self.materials = [meep_materials.material_dielectric(where = self.where_wire, eps=epsilon, loss=0.01),
                meep_materials.material_Metal_THz(where = self.where_metal)
                ]

        #if 'TiO2' in comment:
            #self.materials = [meep_materials.material_TiO2_THz(where = self.where_wire)]
        #elif 'STO' in comment:
            #self.materials = [meep_materials.material_STO_THz(where = self.where_wire)]
        #elif 'DielLossless' in comment:
            #self.materials = [meep_materials.material_dielectric(where = self.where_wire, eps=epsilon, loss=0.0)]
        #elif 'Diel' in comment:
            #self.materials = [meep_materials.material_dielectric(where = self.where_wire, eps=epsilon, loss=0.01)]
        #else:
            #self.materials = [meep_materials.material_Metal_THz(where = self.where_wire)]
#

        ## Dimension constants for the simulation
        #self.size_x, self.size_y, self.size_z = xyspacing, xyspacing, 400e-6+cells*self.monzd
        self.pml_thickness = 20e-6
        self.size_x = resolution/1.8
        self.size_y = yspacing
        self.size_z = 200e-6+cells*self.monzd + 2*self.padding + 2*self.pml_thickness

        ## constants for the simulation
        (self.monitor_z1, self.monitor_z2) = (-(monzd*cells)/2+monzc - padding, (monzd*cells)/2+monzc + padding)  
        self.simtime = simtime      # [s]
        self.srcWidth = 5000e9     
        self.srcFreq = 4e9 + self.srcWidth/2 + (Ky**2+Kx**2)**.5 / (2*np.pi/3e8)  ## cutoff for oblique incidence
        self.interesting_frequencies = (0., 2000e9) 

        #meep_utils.plot_eps(self.materials, freq_range=(1e10, 1e14), plot_conductivity=True)
        self.TestMaterials() ## catches (most) errors in structure syntax, before they crash the callback
コード例 #28
0
    def __init__(self, comment="", simtime=30e-12, resolution=4e-6, cellsize=50e-6, cellsizey=30e-6, cellnumber=1,
            padding=50e-6, wirewidth=6.5e-6, wirelength=29e-6, loss=1, epsilon="Si", **other_args):
        meep_utils.AbstractMeepModel.__init__(self)        ## Base class initialisation

        ## Constant parameters for the simulation
        self.simulation_name = "WiresOnSiWire"    
        self.src_freq, self.src_width = 1000e9, 4000e9    # [Hz] (note: gaussian source ends at t=10/src_width)
        self.interesting_frequencies = (10e9, 3000e9)    # Which frequencies will be saved to disk
        self.pml_thickness = .3*c/self.src_freq

        self.size_x = cellsize
        self.size_y = cellsizey
        self.size_z = cellsize + 4*padding + 2*self.pml_thickness
        self.monitor_z1, self.monitor_z2 = (-(cellsize*cellnumber/2)-padding, (cellsize*cellnumber/2)+padding)

        self.register_locals(locals(), other_args)          ## Remember the parameters

        ## Define materials (with manual Lorentzian clipping) 
        self.materials = []  

        if epsilon=="Si":     ## use silicon if permittivity not specified...
            si = meep_materials.material_Si_MIR(where=self.where_substr) 
            if loss != 1: si.pol[0]['gamma'] *= loss   ## optionally modify the first TiO2 optical phonon to have lower damping
        else:           ## ...or define a custom dielectric if permittivity not specified
            si = meep_materials.material_dielectric(where=self.where_substr, eps=float(self.epsilon)) 
        self.fix_material_stability(si, verbose=0) ## rm all osc above the first one, to optimize for speed 
        self.mon2eps =  meep_utils.analytic_eps(mat=si, freq=1e12) ## store what dielectric is the second monitor embedded in
        print '>>>>>>>>>>>>>>>>>>>>>>>>> self.mon2eps',self.mon2eps
        #self.mon2eps = 12 ## store what dielectric is the second monitor embedded in
        self.materials.append(si)

        au = meep_materials.material_Au(where=self.where_wire)
        #au.pol[0]['sigma'] /= 100
        #au.pol[0]['gamma'] *= 10000
        self.fix_material_stability(au, verbose=0)
        self.materials.append(au)


        ## Test the validity of the model
        meep_utils.plot_eps(self.materials, plot_conductivity=True, 
                draw_instability_area=(self.f_c(), 3*meep.use_Courant()**2), mark_freq={self.f_c():'$f_c$'})
        self.test_materials()
コード例 #29
0
    def __init__(self,
                 comment="",
                 simtime=200e-12,
                 resolution=5e-6,
                 cells=1,
                 monzc=0e-6,
                 BarWidth=50e-6,
                 BarThick=50e-6,
                 BarPeriod=100e-6,
                 YCellShift=0,
                 XCut=0,
                 Kx=0,
                 Ky=0):
        meep_utils.AbstractMeepModel.__init__(
            self)  ## Base class initialisation
        self.simulation_name = "CKEBars"  ##
        self.register_locals(locals())  ## Remember the parameters

        ## Initialization of materials used
        #self.materials = [meep_materials.material_TiO2_THz(where = self.where_TiO2)]
        self.materials = [
            meep_materials.material_Sapphire_THz(where=self.where_TiO2),
            meep_materials.material_dielectric(where=self.where_substr,
                                               eps=4.0)
        ]

        ## Dimension constants for the simulation
        monzd = BarPeriod  ## monitor z-distance
        self.monzd = monzd
        self.size_x, self.size_y, self.size_z = resolution, BarPeriod, 500e-6 + cells * self.monzd
        #self.size_x, self.size_y, self.size_z = BarPeriod, BarPeriod, 500e-6 + cells*self.monzd

        ## constants for the simulation
        self.pml_thickness = 100e-6
        (self.monitor_z1, self.monitor_z2) = (-(monzd * cells) / 2 + monzc,
                                              (monzd * cells) / 2 + monzc)
        self.simtime = simtime  # [s]
        self.srcFreq, self.srcWidth = 500e9, 1000e9  # [Hz], note: "Last source time" = 10/srcWidth
        self.interesting_frequencies = (0., 1000e9)

        self.TestMaterials(
        )  ## catches (most) errors in structure syntax, before they crash the callback
コード例 #30
0
    def __init__(self,
                 comment="",
                 simtime=15e-12,
                 resolution=3e-6,
                 size_x=1350e-6,
                 size_y=1350e-6,
                 size_z=0,
                 wgwidth=10e-6,
                 wgheight=20e-6,
                 monzd=180e-6):
        meep_utils.AbstractMeepModel.__init__(
            self)  ## Base class initialisation
        self.simulation_name = "SPDC"
        monzd = size_z

        self.register_locals(locals())  ## Remember the parameters

        ## Constants for the simulation
        substrate_z = size_x / 3
        self.pml_thickness = 10e-6
        self.monitor_z1, self.monitor_z2 = (-(monzd) / 2, (monzd) / 2)
        self.simtime = simtime  # [s]
        self.srcFreq, self.srcWidth = 5000e9, 5000e9  # [Hz] (note: gaussian source ends at t=10/srcWidth)
        self.interesting_frequencies = (
            0e9, 2000e9)  # Which frequencies will be saved to disk
        self.Kx = 0
        self.Ky = 0
        self.padding = 0
        self.size_x = size_x
        self.size_y = size_y
        self.size_z = size_z

        ## Define materials
        self.materials = [
            meep_materials.material_dielectric(eps=4., where=self.where_diel)
        ]
        #self.materials  += [meep_materials.material_dielectric(eps=4., where = self.where_substr)]

        self.TestMaterials()
        f_c = c / np.pi / self.resolution / meep_utils.meep.use_Courant()
        meep_utils.plot_eps(self.materials, mark_freq=[f_c])
コード例 #31
0
    def __init__(self, simtime=3.5e-13, resolution =4e-9,size_x = 2.25e-6, size_y = 0.1e-6,
                 size_z = 8e-7, thickness_Au = 1.5e-7,depthx = 5e-8, depthz = 1e-7,
	         thickness_sapphire = 2e-7, #1.6e-7,
	         period =7.5e-7, Nslits =3, **other_args):
	meep_utils.AbstractMeepModel.__init__(self) #Inizialitation of the class
	
	# Sapphire substrate thickness taken from Kim D S, Hohng S C, Malyarchuk V, Yoon 
	#Y C, Ahn Y H, Yee K J, Park J W, Kim J, Park Q H and Lienau C 2003 Phys. Rev. Lett. 91 143901


	self.simulation_name = "SlabSubsCont3GaussSapphire" 
        self.src_freq = 375e12     # [Hz] (note: srcwidth irrelevant for continuous_source)
	self.src_width= 160e12
	self.interesting_frequencies=(250e12,500e12)
        self.pml_thickness = 2.5e-8
	self.Nslits = int(Nslits)
        self.size_x = size_x 
        self.size_y = size_y
        self.size_z = size_z
        self.simtime = simtime      # [s]
	self.monitor_z1 = (-thickness_Au - 1e-7)
	self.monitor_z2 =3.9e-7
	self.monitor_z3 = 1e-8
        self.Kx = 0#(2*np.pi*self.src_freq/c)*np.sin(np.pi/6)#6.8017e6 # 30 degrees
	self.Ky = 0
	self.padding=0
        self.register_locals(locals(), other_args)          ## Remember the parameters
        ## Define materials
        f_c = c / np.pi/self.resolution/meep_utils.meep.use_Courant()

	#self.materials = []
        self.materials   = [meep_materials.material_Au(where=self.where_AuGauss)]
	#self.materials[0].pol[1:3]=[]
	self.materials += [meep_materials.material_dielectric(eps=3.133,where=self.where_sapphire)]
	#self.materials += [meep_materials.material_Sapphire(where=self.where_sapphire)]

        for material in self.materials: self.fix_material_stability(material, f_c=2e15,
        verbose=1)
        meep_utils.plot_eps(self.materials, plot_conductivity=True, 
                draw_instability_area=(self.f_c(), 3*meep.use_Courant()**2), mark_freq={self.f_c():'$f_c$'})
        self.test_materials()
コード例 #32
0
    def __init__(self,
                 comment="",
                 simtime=100e-12,
                 resolution=6e-6,
                 cells=1,
                 monzc=0e-6,
                 padding=50e-6,
                 radius=25e-6,
                 wzofs=0e-6,
                 spacing=75e-6,
                 wlth=10e-6,
                 wtth=10e-6,
                 Kx=0,
                 Ky=0,
                 epsilon=100):
        meep_utils.AbstractMeepModel.__init__(
            self)  ## Base class initialisation
        self.simulation_name = "SphereWire"  ##
        monzd = spacing

        self.register_locals(locals())  ## Remember the parameters
        #wlth=1e-6
        #wtth=90e-6
        #wlth=6e-6
        #wtth=1000e-6

        ## Definition of materials used
        #self.materials = [meep_materials.material_dielectric(where = self.where_diel, eps=4.)]
        #self.materials = [meep_materials.material_TiO2_THz_HIEPS(where = self.where_TiO2),
        #meep_materials.material_Metal_THz(where = self.where_metal)]
        ## Initialization of materials used
        if 'TiO2NC' in comment:
            self.materials = [
                meep_materials.material_TiO2_NC_THz(where=self.where_TiO2),
            ]
            #meep_materials.material_Metal_THz(where = self.where_metal) ]
        elif 'TiO2' in comment:
            self.materials = [
                meep_materials.material_TiO2_THz(where=self.where_TiO2),
                meep_materials.material_Metal_THz(where=self.where_metal)
            ]
        elif 'Diel' in comment:
            self.materials = [
                meep_materials.material_dielectric(where=self.where_TiO2,
                                                   eps=epsilon),
                meep_materials.material_Metal_THz(where=self.where_metal)
            ]
        else:
            self.materials = [
                meep_materials.material_STO_THz(where=self.where_TiO2),
                meep_materials.material_Metal_THz(where=self.where_metal)
            ]

        ## constants for the simulation
        self.pml_thickness = 20e-6
        self.monitor_z1, self.monitor_z2 = (-(monzd * cells) / 2 + monzc -
                                            padding, (monzd * cells) / 2 +
                                            monzc + padding)
        self.simtime = simtime  # [s]
        self.srcFreq, self.srcWidth = 1000e9, 2000e9  # [Hz], note: "Last source time" = 10/srcWidth
        self.interesting_frequencies = (0e9, 1000e9)

        ## Dimension constants for the simulation
        self.size_x = spacing
        self.size_y = spacing
        self.size_z = 60e-6 + cells * monzd + 2 * self.pml_thickness + 2 * self.padding
        #self.size_x, self.size_y, self.size_z = resolution/1.8, spacing, size_z ## two dimensional case XXX

        self.TestMaterials()
        print "CellCenters:", self.cell_centers()
コード例 #33
0
    def __init__(self,
                 comment="",
                 simtime=100e-15,
                 resolution=10e-9,
                 cellnumber=1,
                 padding=200e-9,
                 cellsize=200e-9,
                 epsilon=33.97,
                 blend=0,
                 **other_args):
        """ This structure demonstrates that scatter.py can also be used for samples on a substrate with an infinite 
        thickness. The back side of the substrate is not simulated, and it is assumed there will be no Fabry-Perot
        interferences between its sides.

        The monitor planes are enabled to be placed also inside a dielectric. In which case the wave amplitude is 
        adjusted so that the light intensity is maintained. The field amplitudes and phases have physical meaning 
        only when both monitor planes are in the same medium, though.

        Besides, the example demonstrates that on a steep interface with air the transmitted and reflected waves have 
        exactly the same energy with the choice of permittivity: ((1+.5**.5)/(1-.5**.5))**2, that is roughly 33.97.
        
        """
        meep_utils.AbstractMeepModel.__init__(
            self)  ## Base class initialisation

        ## Constant parameters for the simulation
        self.simulation_name = "HalfSpace"
        self.src_freq, self.src_width = 500e12, 100e12  # [Hz] (note: gaussian source ends at t=10/src_width)
        self.interesting_frequencies = (
            10e12, 1000e12)  # Which frequencies will be saved to disk
        self.pml_thickness = 500e-9

        self.size_x = resolution * 1.8
        self.size_y = resolution * 1.8
        self.size_z = blend + 2 * padding + 2 * self.pml_thickness + 6 * resolution
        self.monitor_z1, self.monitor_z2 = (-padding, padding)
        self.register_locals(locals(), other_args)  ## Remember the parameters
        self.mon2eps = epsilon  ## store what dielectric is the second monitor embedded in

        ## Define materials
        self.materials = []
        if 'Au' in comment:
            self.materials += [meep_materials.material_Au(where=self.where_m)]
        elif 'Ag' in comment:
            self.materials += [meep_materials.material_Ag(where=self.where_m)]
        elif 'metal' in comment:
            self.materials += [meep_materials.material_Au(where=self.where_m)]
            self.materials[-1].pol[1:] = []
            self.materials[-1].pol[0]['gamma'] = 0
        else:
            self.materials += [
                meep_materials.material_dielectric(where=self.where_m,
                                                   eps=self.epsilon)
            ]

        for m in self.materials:
            self.fix_material_stability(
                m, f_c=3e15
            )  ## rm all osc above the first one, to optimize for speed

        ## Test the validity of the model
        meep_utils.plot_eps(self.materials,
                            plot_conductivity=True,
                            draw_instability_area=(self.f_c(),
                                                   3 * meep.use_Courant()**2),
                            mark_freq={self.f_c(): '$f_c$'})
        self.test_materials()
コード例 #34
0
    def __init__(self,
                 comment="",
                 simtime=100e-12,
                 resolution=3e-6,
                 cells=1,
                 monzc=0e-6,
                 Kx=0,
                 Ky=0,
                 padding=50e-6,
                 radius=10e-6,
                 yspacing=100e-6,
                 zspacing=100e-6,
                 monzd=200e-6,
                 epsilon=100,
                 **other_args):
        meep_utils.AbstractMeepModel.__init__(
            self)  ## Base class initialisation
        self.simulation_name = "Wedge"  ##
        print(other_args)
        self.register_locals(locals(), other_args)  ## Remember the parameters

        ## Initialization of materials used
        if 'TiO2' in comment:
            self.materials = [
                meep_materials.material_TiO2_THz(where=self.where_wire)
            ]
        elif 'STO' in comment:
            self.materials = [
                meep_materials.material_STO_THz(where=self.where_wire)
            ]
        elif 'DielLossless' in comment:
            self.materials = [
                meep_materials.material_dielectric(where=self.where_wire,
                                                   eps=epsilon,
                                                   loss=0.0)
            ]
        elif 'DielLoLoss' in comment:
            self.materials = [
                meep_materials.material_dielectric(where=self.where_wire,
                                                   eps=epsilon,
                                                   loss=0.005)
            ]
        else:
            self.materials = [
                meep_materials.material_dielectric(where=self.where_wire,
                                                   eps=epsilon,
                                                   loss=0)
            ]

        ## Dimension constants for the simulation
        #self.size_x, self.size_y, self.size_z = xyspacing, xyspacing, 400e-6+cells*self.monzd
        self.pml_thickness = 50e-6
        self.size_x = resolution / 1.8
        self.size_y = 2200e-6
        self.size_z = 2000e-6 + cells * self.monzd + 2 * self.padding + 2 * self.pml_thickness

        ## constants for the simulation
        (self.monitor_z1,
         self.monitor_z2) = (-(monzd * cells) / 2 + monzc - padding,
                             (monzd * cells) / 2 + monzc + padding)
        self.simtime = simtime  # [s]
        self.src_width = 3000e9
        self.src_freq = 4e9 + self.src_width / 2 + (Ky**2 + Kx**2)**.5 / (
            2 * np.pi / 3e8)  ## cutoff for oblique incidence
        self.interesting_frequencies = (0., 2000e9)

        ## Test the validity of the model
        #meep_utils.plot_eps(self.materials, plot_conductivity=True,
        #draw_instability_area=(self.f_c(), 3*meep.use_Courant()**2), mark_freq={self.f_c():'$f_c$'})
        try:
            self.test_materials(
            )  ## catches (most) errors in structure syntax, before they crash the callback
        except:
            print(sys.exc())