Dear Prof. Johnson and MEEP users, I have been playing around with the Cherenkov radiation example with the goal of monitoring the fields generated due to the interaction of the moving charge with a geometry (cathodoluminescence, transition radiation, scattered fields). I also aim to obtain the frequency dependent scattering flux due to the interaction of the moving charge and the geometry (similar to https://meep.readthedocs.io/en/latest/Python_Tutorials/Basics/#mie-scattering-of-a-lossless-dielectric-sphere but for a moving charge source and more likely for a conductive dispersive material).
By including a non dispersive material (see the code at the end of this message) the following results can be obtained: Simulation: https://cdn.discordapp.com/attachments/767857295517548625/779371382819127336/simulation.png Ey component: https://cdn.discordapp.com/attachments/767857295517548625/779371340486148106/cher_Ey.gif Hz component: https://cdn.discordapp.com/attachments/767857295517548625/779371365673205771/cher_Hz.gif I have encountered the following issues: 1. For the Ey component there seems to remain a strong source like field at the origin of the moving charge. I am unsure why this happens. This is also true for the Cherenkov radiation example without any changes. 2. When flux monitors are included in the simulation, the following error pops up “RuntimeError: meep: allocate field components (by adding sources) before adding dft objects”. Do the dft/flux objects etc need to be saved and reinitialized in every with step functions? 3. Less important issue but h5utils gives a colormap error "h5topng error: invalid colormap file" which is not resolved even when given a direct path. I have overcome this by saving the png files with a different method so I just include this here as a possible bug. These issues do not change when the default material is set to 1 (vacuum) and the Cherenkov radiation effect is no longer there. Ey: https://cdn.discordapp.com/attachments/767857295517548625/779372550844710952/no_cher_Ey.gif I imagine the solution to these issues is not that easy but I was wondering if there are any pointers as to how this could be resolved. It would be amazing to be able to perform cathodoluminescence simulations on MEEP (and maybe even calculate the EELS response through the absorbed energy in the geometry). With dispersive materials high resolution and possibly changes to the Courant factor/ PML are required (for metals at least) so I haven’t had the time to verify if everything works yet (for now I have been getting the NaN or Inf fields error). Thank you very much for your time. Best wishes Nikolaos CL code: import meep as mp import numpy as np import h5py import matplotlib.pyplot as plt sx = 60 sy = 60 cell_size = mp.Vector3(sx,sy,0) dpml = 1 pml_layers = [mp.PML(thickness=dpml)] v = 0.7 # velocity of point charge #symmetries = [mp.Mirror(direction=mp.Y)] material_set=mp.Medium(epsilon=12) geometry = [mp.Block(mp.Vector3(0.2,0.5,mp.inf), center=mp.Vector3(0,0,0), material=material_set)] sim = mp.Simulation(resolution=25, cell_size=cell_size, default_material=mp.Medium(index=1), #symmetries=symmetries, boundary_layers=pml_layers, geometry=geometry ) def move_source(sim): sim.change_sources([mp.Source(mp.ContinuousSource(frequency=1e-10), component=mp.Ex, center=mp.Vector3(-0.5*sx+dpml+v*sim.meep_time()))]) #box_tr = sim.add_flux(frq_cen, dfrq, nfrq, mp.FluxRegion(center=mp.Vector3(x=sx/2-dpml-1),size=mp.Vector3(0,sx-2*dpml))) sim.use_output_directory("Data") sim.run(move_source, mp.at_every(1, mp.output_png(mp.Ey, "-Zc bluered")), until=sx/v)
_______________________________________________ meep-discuss mailing list meep-discuss@ab-initio.mit.edu http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss