You are right. When I symmetrized the eps function the divergences disappeared.
I really didnt know that this one last pixel could have such a big influence.

I have also some other kind of divergences in other cases. They seem
not to be connected
to symmetries but arise from PML layers. I am starting to think if I
am not doing
any similar mistake there with those last pixels beyond the calculation volume.
In general what should appear on those last pixels ? Normally I just extend my
photonic crystal there without any special treatment. Is meep
expecting something special there ?

Thanks for your help Steven.

Thomas Jefferson

2008/7/31 Steven G. Johnson <[EMAIL PROTECTED]>:
> On Jul 30, 2008, at 9:20 PM, Jefferson Thomas wrote:
>> What you are saying is really very helpful. In fact I had no idea I
>> have to supply the symmetric
>> source. I will try it right now and see how it goes.
>
> See: http://ab-initio.mit.edu/wiki/index.php/Exploiting_symmetry_in_Meep
>
> If you don't supply a symmetric source, in practice Meep will
> symmetrize it for you, although it is better to have a symmetric
> source so that you get the same results with and without symmetry
> (this makes things easier to debug).  However, the fact that you were
> specifying an Ex source at y=0 but also specifying odd symmetry around
> y=0 indicates that you either have a typo or were fundamentally
> misunderstanding the relationship between symmetry and fields --
> either way, it is very important to correct.
>
>> On the other hand I dont understand the thing with the symmetric eps.
>> Although I dont know how meep works internally with the symmetries I
>> have been checking already many times
>> what requests it sends to the eps function. From what I have found
>> out, if there is any symmetry meep
>> asks the eps function only about one relevant half of the volume.
>
> Yes, it only evaluates the eps function in *about* one half of the
> volume.  However, it evaluates eps for about one pixel beyond the
> mirror plane too, and if your epsilon function isn't symmetric then
> terrible things can happen.
>
>> So lets say I declare the calculation volume :
>>           volume v = vol3d(10,10,10, resolution);
>> And then I specify the X symmetry :
>>           structure s(v, eps, pml(1.0), meep::mirror(meep::X, v));
>> Then all the vector requests that come to the eps function have x
>> coordinate
>> between 0 and 5 (or precisely between -0.xx and 5.xx but that is just
>> a minor issue).
>
> The 5.xx is not a minor issue.  It's exactly this tiny fraction beyond
> the midpoint that is causing your problem since your eps function is
> not symmetrical (as proved by the fact that the divergence disappears
> when I symmetrized your eps function).
>
> Hence the divergences you observe starting at the boundary, because
> the boundary conditions are internally inconsistent.
>
> Steven
>
>
> _______________________________________________
> 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

Reply via email to