Increasing the resolution should minimize the errors you describe, so
let's try changing the resolution of the example from 20 to 80.
For the first k vector, libctl outputs:
freqs:, 1, 0, 0, 0, 0.468635423832662, 0.638291336744692, 0.644294078505184,
0.708782322974947, 0.833240227293887, 0.838530108381437, 0.888552927525998,
0.912365111565089, 0.956401593706524, 0.96688794823519, 0.995072204624858
my C++ version gives
freqs:, 1, 0.000000, 0.000000, 0.000000, 0.46867332216046, 0.643273907256619,
0.648468474378238, 0.708990461881872, 0.71024493174324, 0.832879037664483,
0.888194262478292, 0.912697065006533, 0.956477451061452, 0.967457773105198,
0.998844428190729
libctl C++ Pct Diff
a b abs(a-b)/a*100%
0.46864 0.46867 0.0080870
0.63829 0.64327 0.7806107
0.64429 0.64847 0.6479023
0.70878 0.70899 0.0293657
0.83324 0.71024 14.7610847
0.83853 0.83288 0.6739258
0.88855 0.88819 0.0403651
0.91237 0.91270 0.0363838
0.95640 0.95648 0.0079315
0.96689 0.96746 0.0589339
0.99507 0.99884 0.3790904
Of course, a one to one column comparison doesn't make sense here. In
all likelyhood, the fifth C++ frequency is the same as the fourth C++
frequency, but this duplicate didn't pop up with the libctl version.
I think the only fix for this is throwing away "duplicate" points
based on some threshold scheme, but then you risk losing legitimately
distinct points. Perhaps it's less of an issue observed over the
entire band diagram.
Best Regards,
Matt
On Tue, 17 Oct 2006, Steven G. Johnson wrote:
The libctl interface does the epsilon averaging more accurately than the C++
interface (and much more quickly) because it can exploit the analytical form
of the geometric shapes, as well as adaptive cubature routines provided by
libctl.
Also, the libctl interface calls volume::center_origin() to put the origin at
the center of the cell (it is at the corner by default in C++), which could
cause differences in the gridding depending on the size of the cell, because
it always rounds the origin to the nearest grid point.
Some combination of these two probably explains any slight differences you
are seeing in the results.
Steven
On Tue, 17 Oct 2006, matt wrote:
I'm trying to reproduce the results of the band diagram calculation on the
example page using the c interface.
holey-wvg-bands example:
http://ab-initio.mit.edu/wiki/index.php/Meep_Tutorial/Band_diagram%2C_resonant_modes%2C_and_transmission_in_a_holey_waveguide#Band_diagram
I noticed that my c results are not quite the same as the libctl results,
and I was trying to figure out why.
h5topng showed no obvious differences in dielectric functions, but a
closer inspection using h5diff revealed some significant differences,
apparently near the boundary of the cylindrical hole.
_______________________________________________
meep-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss
_______________________________________________
meep-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss