Discussion:
[Meep-discuss] Error in 'A 90° bend' Python's tutorial
Diego Guisasola
2018-10-28 10:05:27 UTC
Permalink
Hello everyone!

I'm facing a problem when trying to implement the 'A 90° bend' Python's
tutorial.
The geometry that I'm using is the same as the one shown in the tutorial
but when I use the following lines of codes:

sim.use_output_directory()
sim.run(mp.at_every(0.6 , mp.output_png(mp.Ez, "-Zc dkbluered")), until=200)

The images I get are upside down. What I'm doing wrong?

The code is:

#Start of code

import meep as mp
import matplotlib.pyplot as plt

cell = mp.Vector3(16, 16, 0)
geometry = [mp.Block(mp.Vector3(12, 1, 1e20),
center=mp.Vector3(-2.5, -3.5),
material=mp.Medium(epsilon=12)),
mp.Block(mp.Vector3(1, 12, 1e20),
center=mp.Vector3(3.5, 2),
material=mp.Medium(epsilon=12))]
pml_layers = [mp.PML(1.0)]
resolution = 10

sources = [mp.Source(mp.ContinuousSource(wavelength=2*(11**0.5), width=20),
component=mp.Ez,
center=mp.Vector3(-7,-3.5),
size=mp.Vector3(0,1))]

sim = mp.Simulation(cell_size=cell,
boundary_layers=pml_layers,
geometry=geometry,
sources=sources,
resolution=resolution)

sim.use_output_directory()
sim.run(mp.at_every(0.6 , mp.output_png(mp.Ez, "-Zc dkbluered")), until=200)



#End of code--------------------------------

Then, I open a terminal in the folder where the images are located and use
the following command:

$ convert -delay 10 -loop 0 *.png animation.gif

in order to obtain the gif.

All the images and the gif, as well as the code are in a folder I
shared in Drive:

https://drive.google.com/drive/folders/1Dfz87jywXmfBqhzzkTN1MKP-PPtbwyrK?usp=sharing

Thanks in advance!!!
--
Atentamente,
Diego Guisasola.
Representante estudiantil ante el Comité Curricular de Ing. Electrónica.
--
El contenido de este mensaje y sus anexos son únicamente para el uso del
destinatario y pueden contener información  clasificada o reservada. Si
usted no es el destinatario intencional, absténgase de cualquier uso,
difusión, distribución o copia de esta comunicación.
Loading...