facebookresearch / fmmax

Fourier modal method with Jax
MIT License
97 stars 10 forks source link

Absorbing boundary layer #27

Closed mfschubert closed 1 year ago

mfschubert commented 1 year ago

It would be nice to support x/y absorbing boundary conditions, so that non-periodic structures could be modeled.

Unfortunately, this seems to be a bit involved, since u-PML would require magnetic, anisotropic materials. The implementation could be relatively straightforward for the basic "FFT" formulation of the FMM, but it would be good to make this available also for the vector formulations.

If this were implemented, there would also be an opportunity to simplify the layer eigensolve code, which currently has several different functions to handle e.g. uniform, patterned, isotropic, anisotropic cases.

smartalecH commented 1 year ago

We should be able to add scalar absorbing boundary layers without too much hassle, right? They won't converge as quickly as PML (which will require larger domains and consequently more Fourier orders) but they seem like a quick and dirty solution.

smartalecH commented 1 year ago

(might be good to replace "boundary condition" with "boundary layer" to avoid ambiguity)

mfschubert commented 1 year ago

We should be able to add scalar absorbing boundary layers without too much hassle, right? They won't converge as quickly as PML (which will require larger domains and consequently more Fourier orders) but they seem like a quick and dirty solution.

Yes, that would be a viable alternative. There would be no changes to the core code in this case, it would just be a matter of providing a permittivity array that includes the absorbing material.

smartalecH commented 1 year ago

There would be no changes to the core code in this case, it would just be a matter of providing a permittivity array that includes the absorbing material.

Cool. It might still be worth it to provide an API so the user doesn't have to worry about this. Specifically, we can create a function like

def pad_with_conductivity(length, strength):
    # does the hard stuff

which takes care of the appropriate padding and scaling etc.

mfschubert commented 1 year ago

This has been addressed by https://github.com/facebookresearch/fmmax/pull/29