diff --git a/example_1D_dielectric_slabs/EBars_eps100_R=10000_eps=1.png b/example_1D_dielectric_slabs/EBars_eps100_R=10000_eps=1.png index 58074b6..8117497 100644 Binary files a/example_1D_dielectric_slabs/EBars_eps100_R=10000_eps=1.png and b/example_1D_dielectric_slabs/EBars_eps100_R=10000_eps=1.png differ diff --git a/example_1D_dielectric_slabs/EBars_eps100_R=10000_eps=10.png b/example_1D_dielectric_slabs/EBars_eps100_R=10000_eps=10.png index d7d807e..38048d0 100644 Binary files a/example_1D_dielectric_slabs/EBars_eps100_R=10000_eps=10.png and b/example_1D_dielectric_slabs/EBars_eps100_R=10000_eps=10.png differ diff --git a/example_1D_dielectric_slabs/EBars_eps100_R=10000_eps=2.png b/example_1D_dielectric_slabs/EBars_eps100_R=10000_eps=2.png index e9606ff..d219cbe 100644 Binary files a/example_1D_dielectric_slabs/EBars_eps100_R=10000_eps=2.png and b/example_1D_dielectric_slabs/EBars_eps100_R=10000_eps=2.png differ diff --git a/example_1D_dielectric_slabs/batch.sh b/example_1D_dielectric_slabs/batch.sh index c595bf7..ddbeb9c 100755 --- a/example_1D_dielectric_slabs/batch.sh +++ b/example_1D_dielectric_slabs/batch.sh @@ -10,6 +10,7 @@ mkdir data -p #for rr in 0 3000 10000 12000 rr=10000 +#for ee in `seq 1 1 20` for ee in `seq 1 1 20` do ## Prepare and print the parameters that are used in IFC.ctl to define the structure @@ -19,8 +20,8 @@ do ## Generate IFC and fields (at Gamma, X and M points) mpb $param ../compute_dispersion_and_modes.ctl | grep kgrid > freq.csv cp freq.csv data/freq_`echo $param | tr ' ' '_'`.csv - mpb-data -m 2 [eh].*h5 - mpb-data -m 2 epsilon.h5 + mpb-data -m 2 compute_dispersion_and_modes-*h5 + mpb-data -m 2 compute_dispersion_and_modes-epsilon.h5 ## Plot the results python ../plot_dispersion_and_modes.py $param @@ -29,7 +30,7 @@ do #python ../HxHyEz_plot.py [e].*h5 [h].*h5 [h].*h5 ## Clean up - rm -r [eh].*h5 + rm -r compute_dispersion_and_modes-*h5 done diff --git a/plot_dispersion_and_modes.py b/plot_dispersion_and_modes.py index 2e6dd5f..50dc966 100755 --- a/plot_dispersion_and_modes.py +++ b/plot_dispersion_and_modes.py @@ -26,6 +26,7 @@ import matplotlib.cm as cm filename = "freq.csv" +ctlscript = "compute_dispersion_and_modes-" ## what is prepended to *.h5 files; try empty if simulation fails to find them bandnumber = 6 cellspacing = 100e-6 fcoef = c / cellspacing @@ -76,16 +77,16 @@ def plot_IFC(Kx, Ky, freqs):#{{{ plt.grid(True) #}}} def generate_filenames(k=1, band=1, pol='tm'):#{{{ - file_Ez = 'e.k%02d.b%02d.z.%s.h5' % (k, band, pol) - file_Hx = 'h.k%02d.b%02d.x.%s.h5' % (k, band, pol) - file_Hy = 'h.k%02d.b%02d.y.%s.h5' % (k, band, pol) + file_Ez = '%se.k%02d.b%02d.z.%s.h5' % (ctlscript, k, band, pol) + file_Hx = '%sh.k%02d.b%02d.x.%s.h5' % (ctlscript, k, band, pol) + file_Hy = '%sh.k%02d.b%02d.y.%s.h5' % (ctlscript, k, band, pol) return file_Ez, file_Hx, file_Hy #}}} def plot_mode(file1, file2, file3, title='', plot_vectors=True):#{{{ #print "---------" #print h5py.File('epsilon.h5', "r").keys() #print h5py.File(file2, "r").keys() - eps = np.array(h5py.File('epsilon.h5', "r")['data-new']) + eps = np.array(h5py.File('%sepsilon.h5' % ctlscript, "r")['data-new']) Ez_data = np.array(h5py.File(file1, "r")['z.i-new']) Hx_data = np.array(h5py.File(file2, "r")['x.r-new']) Hy_data = np.array(h5py.File(file3, "r")['y.r-new'])