Hi, Steven,

I am using C++ interface now.
The structure I simulated is photonic crystal slab with square lattice, according to APL 86, 043104.
The slab has thickness 0.6a and dielectric constant of 12.25, and aire holes have radii of 0.3a.

The section of the code is below:  
//Initialize the volume which includes the size of the grid and the resolution.               
    volume v = vol3d(x_vector,  y_vector,  z_vector,  resolution);   
    structure s(v,  eps_slab,  pml(g_pml,  Z), meep::identity(),  0,  time_step,  true);
    trash_output_directory("bandgap");
    s.set_output_directory("bandgap");   
    fields f(&s);
    f.use_bloch(X,0);
    f.use_bloch(Y,0);
           
    master_printf("TE modes...\n");
    f.S = mirror(Z, v); // Odd symmetry
    ................

    for (size_t kindex = 0; kindex < k_points.size(); kindex++) {
        f.zero_fields();
        f.remove_sources();
        f.t = 0;
       
        double kx = k_points[kindex].x;
        double ky = k_points[kindex].y;
        double kz = k_points[kindex].z;
       
        f.use_bloch(X,kx);
        f.use_bloch(Y,ky);
        ........
I add a point source and use function get_field to get the field component.
Then I call do_harminv.

Is it right or not?
The code I write is ok when I do 2D simulation.
However, when I try to calculate the band diagram of the photonic crystal slab, I am failed.
But, it's ok when I use MEEP-0.9.

Many thanks!
Jun
_______________________________________________
meep-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

Reply via email to