NanoComp / meep

free finite-difference time-domain (FDTD) software for electromagnetic simulations
GNU General Public License v2.0
1.17k stars 598 forks source link

Problem: a even_symmetric structure with odd_symmetric source #2664

Open chenshang2 opened 9 months ago

chenshang2 commented 9 months ago

Hello everyone.

I have some problems when indicating the symmetries in a simulation. so for a structure with mirror symmetry along y plane, and pumped by an odd source (TE modes), you need a -1 phase factor to calculate the right field. I am simulating this kind of device and I find that when I indicate: mp.Mirror(mp.Y,phase=-1) with a TE0 mode. the simulation will not converge and keep running, the DFT field shows that in the beginning the field seems fine but after around 200 time steps the field just disappears. Do you have any suggestions like where I should be more careful? Thanks!

Update: this bug only appears when there is an inverse-designed region (material grid) there..... the version I am using is v1.20.0

stevengj commented 9 months ago

the DFT field shows that in the beginning the field seems fine but after around 200 time steps the field just disappears.

Have never seen that. Is it blowing up or something?

chenshang2 commented 9 months ago

the DFT field shows that in the beginning the field seems fine but after around 200 time steps the field just disappears.

Have never seen that. Is it blowing up or something?

Yeah I tried v1.22.0, and in a low resolution (10pixel/um), the simulation blows up with an error that the simulated field goes to inf..... but right now the simulation is fine after I double the resolution. Just curious why the symmetry could blow up the simulation in my previous case? I used to think that the symmetry only tried to copy the field and with certain phase factors.