Exemple #1
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
    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())
Exemple #3
0
    def __init__(self, comment="TiO2", simtime=10e-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):
        meep_utils.AbstractMeepModel.__init__(self)        ## Base class initialisation
        self.simulation_name = "Wedge"    ## 
        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 '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)]
        elif 'Diel' in comment:
            self.materials = [meep_materials.material_dielectric(where = self.where_wire, eps=epsilon, loss=0.05)]
        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 = 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.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., 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
    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())
    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()