Dear friends, I'm trying to change the structure during the simulation. The code below is one example. This code gives me a big error message. What is wrong with it?
res = 40 # pixels/um (originalmente, 20) eps = 9 # dielectric constant of the hole r = 0.4 # radius of the cylinder sy = 2 # tamanho da célula na direção y sx = 2 # tamanho da célula na direção x cell = mp.Vector3(sx,sy,0) geom = [mp.Cylinder(radius=r, center=mp.Vector3(), material=mp.Medium(epsilon=eps))] pml_layers = [mp.PML(1.0)] src = [mp.Source(mp.GaussianSource(0.2, fwidth=0.15), component=mp.Ez, center=mp.Vector3(), size=mp.Vector3())] def change_mat(sim): t = sim.meep_time() fn = t * 0.2 geom = [mp.Sphere(radius=r, center=mp.Vector3(fn))] mp.set_materials_from_geometry( sim.structure, geom, mp.Vector3(), sim.eps_averaging, sim.subpixel_tol, sim.subpixel_maxeval, sim.ensure_periodicity, False, sim.default_material, None, sim.extra_materials ) sim = mp.Simulation( cell_size=cell, resolution=res ) sim.run(mp.at_beginning(mp.output_epsilon), mp.at_time(10, change_mat), mp.at_end(mp.output_epsilon), until=60) -- Cícero Julião da Silva Junior ____________________________________ Instituto Federal de Alagoas - IFAL Campus Murici http://www.ifal.edu.br/
_______________________________________________ meep-discuss mailing list meep-discuss@ab-initio.mit.edu http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss