How to compute the band structure using C++?

"Jun She" <[email protected]>
Newsgroups gmane.comp.science.photonic-bands
Message-ID <[email protected]>
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
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/mpb-discuss
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.