Giter VIP home page Giter VIP logo

fdfd_local_field's Introduction

FDFD Local Field

This application solves Maxwell’s equations in the frequency domain in parallel for multiple instances of a parametrized geometry using finite difference frequency domain numerical (FDFD) scheme, with the goal of

  1. solving for metasurfaces using domain decomposition,
  2. train surrogate models for offline Maxwell’s solve and large-scale optimization.

The design of metasurfaces — large-area ultrathin nanopatterned surfaces designed to mimic bulky lenses — is computationally challenging because of the enormous range of scales they involve. Indeed, they present two very different length scales, namely their feature size (of the order of 10 nm) and their diameter (of the order of the centimeter). Recent work from Johnson group @MIT Mathematics [1] has made the design possible using decomposition methods which breaks the computational domain of the metasurface into multiple smaller domains. A first approach is to solve Maxwell's equations for a multitude of subdomains in parallel and online. However, during large scale optimization, we need to simulate many different metasurfaces and this online approach remains slow. A second approach is to use a surrogate model, which is trained using solutions to Maxwell’s equation on the subdomain but is much faster to evaluate. A surrogate model dramatically increases the speed of simulation for metasurfaces and makes large scale optimization possible, at the cost of a tradeoff between training time and accuracy if the surrogate model. Using embarrassingly parallel solves for the training subdomains simulations alleviates this trade-off.

Julia enables us to write and solve Maxwell’s equations in 2D very elegantly and efficiently. Julia also gives us more freedom and control than its commercial software counterpart.

References

[1] R. Pestourie, C. Pérez-Arancibia, Z. Lin, W. Shin, F. Capasso, and S. G. Johnson, “Inverse design of large-area metasurfaces,” Opt. Express, vol. 26, no. 26, pp. 33732–33747, Dec. 2018, doi: 10.1364/OE.26.033732.

fdfd_local_field's People

Contributors

rpestourie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

fdfd_local_field's Issues

Glitch in subpixel averaging

In the function ϵ_hole_layers and ϵ_pillar_function, there are subpixel averaging. Now let us take the former function as an example. In the code, the weight for the subpixel averaging is weight_eps_hole, which is given by
half_width = ps[it_holes]/2δ - w_offset
n_half_width = floor(Int64, half_width)
weight_eps_hole = half_width - n_half_width
Here w_offset is defined as
if x[nx÷2] == 0
w_offset=1/2
else
w_offset=0
end
When I use this code, the elements in the array x is positive by default and hence w_offset is zero by default. Beside, the default value of δ is 0.025.

There is a glitch when ps[it_holes] takes some special values. For example, for ps[it_holes]=0.35, the correct values of half_width, n_half_width, and weight_eps_hole should be
half_width=7, n_half_width =7, weight_eps_hole=0.
However, when ps[it_holes]=0.35 is in Float64, Julia gives the results below:
half_width=6.999999999999999, n_half_width =6, weight_eps_hole=0.9999999999999991.
The same situation happens for ps[it_holes]=0.7. The correct values of half_width, n_half_width, and weight_eps_hole should be
half_width=14, n_half_width =14, weight_eps_hole=0.
However, when ps[it_holes]=0.7 is in Float64, Julia gives the results below:
half_width=13.999999999999998, n_half_width =13, weight_eps_hole=0.9999999999999982.

Similar situations happen when ps[it_holes]=0.35 and 0.7 are in Float32 or BigFloat. When using Float16, the values of weight_eps_hole produced by Julia are 0.001953125 and 0.00390625, which are close to the correct value (zero) but not accurate.
I think the glitch can be largely removed when we choose Chebyshev points for ps[it_holes], because in most cases Chebyshev points are not so special as 0.35 or 0.7.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.