Hi Steven,
I want to compute the band structure of photonic crystal.
Then I wrote a simple code like the example in section 5.3 of C++ reference.
I wrote, f.initialize_with_n_tm(4). Then I compiled the code and run the program.
I saw, "meep: cannot require a hp compoint in a 2D grid"
Then I checked the source files you wrote.
In initialize.cpp,
void fields::initialize_with_nth_tm(int np0) {
require_component(Ez);
require_component(Hp);
for (int i=0;i<num_chunks;i++)
chunks[i]->initialize_with_nth_tm(np0, real(k[Z]));
}
void fields_chunk::initialize_with_nth_tm(int np1, double kz) {
const int im = int(m);
const int n = np1 - 1;
const double rroot = Jroot(im,n);
ktrans = rroot*a/v.nr();
kax = kz*2*pi/a;
m_for_J = im;
initialize_field(Ez, JJ);
initialize_field(Hp, JP);
}
I don't know why the field need to be intialized twice?
Is require_componet(Ez) for 1d,2d,3d coordinates and require_component(Hp) for cylindrical coordinates?
Why not require_component(Hr) here?
Could I ask how to compute a band structure using C++?
Many thanks!
Jun
_______________________________________________ mpb-discuss mailing list mpb-discuss@ab-initio.mit.edu http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/mpb-discuss