flexcompute / tidy3d

Fast electromagnetic solver (FDTD) at scale.
https://docs.flexcompute.com/projects/tidy3d/en/latest/
GNU Lesser General Public License v2.1
173 stars 40 forks source link

Boundary conditions of mode solver #955

Open jan-david-fischbach opened 1 year ago

jan-david-fischbach commented 1 year ago

Is your feature request related to a problem? Please describe. I would like to calculate the slab modes of "1D" material stacks (e.g. for variational EIM).

Describe the solution you'd like It would be great to be able to set periodic BCs in the mode solver in order to do such calculations.

Describe alternatives you've considered Have a dedicated solver for slab modes. (Similar to https://www.computational-photonics.eu/oms.html)

Additional context Currently only PML or PEC are supported in the mode solver, afaik. Additionally it would also be nice, if one could specify PML only on one side, but not the other (x+ but not x-) (e.g. for bend waveguide simulations)

momchil-flex commented 1 year ago

Yeah there's no need to be unnecessarily restrictive with the mode solver BCs. We can work on this, but I should say it won't be very high priority. But if @lucas-flexcompute finds some time to take a stab at proposing how the API would work for this, I can help with the actual solver. In fact it should be pretty easy: a long time ago we had PBC before we changed to PEC.

The main annoying part is backwards compatibility of the API, so not sure if this will have to wait for 3.0 or not - if it proves annoying to handle currently.

jan-david-fischbach commented 1 year ago

I have realized, that setting the fdtd simulation to 2D the calculated modes become 1D, which essentially satisfies my need. Nonetheless other BCs can also be useful (I just don't need them right now). A potential improvement, that should be fully backwards compatible and relatively easy to implement, would be to allow for 1D planes in the ModeSolver, or to modify the error message in that case, prompting the user to use a 2D simulation region (fdtd) to calculate 1D eigenmodes.

momchil-flex commented 1 year ago

Great. I think the error message suggestion is a good one! And we may still want to allow for PML on one side only at least in Tidy3D 3.0.

tylerflex commented 6 months ago

Can maybe include this in #1414, thinking of closing this.

tylerflex commented 6 months ago

Actually will leave it open if only for the error message