from cell import Cell from source import SineGaussianSource, ModeSource from monitor import Monitor from simulation import Simulation from movie import Movie from pml import PML from geometry import Geometry # Define simulation region cell = Cell(cell=(3.0, 3.0), space_step=0.01) # Define Boundary Condition pml = PML(cell, thickness=10, reflection=1e-7) # Define geometry geo = Geometry(cell, eps_r=12, size=(1.5, 0.18, 1.5, 3.0)) # Define the source source = SineGaussianSource(center=(1.5, 0.5), wavelength=0.95, width=0.1) # source = ModeSource(center=(0.5, 1.5), wg_w=0.18, res=1/0.01, wavelength=0.95, width=0.1) # Define the monitor monitor = Monitor(center=(1.5, 2.5)) # Define movie plotter plotter = Movie((301, 301)) # Initiate FDTD simulation sim = Simulation(cell=cell, boundary=pml, geometry=geo,
### # Hamid Alipour ### import sys from pml import PML from yahoo.search.factory import create_search import cgitb; cgitb.enable() import cgi print "Content-Type: text/html" print pml = PML() # pml.set_config("force_compile", True) pml.set("page_title", "Web Search") form = cgi.FieldStorage() if form.has_key("q") and form["q"].value.strip() != "": query = form["q"].value app_id = "YahooDemo" srch = create_search("web", app_id, query=query, results=10) if srch is None: srch = create_search("Web", app_id, query=query, results=10) dom = srch.get_results() results = srch.parse_results(dom)