fancompute / angler

Frequency-domain photonic simulation and inverse design optimization for linear and nonlinear devices
https://arxiv.org/abs/1811.01255
MIT License
158 stars 49 forks source link

Specifying permittivity with geometric primitives #26

Open ianwilliamson opened 5 years ago

ianwilliamson commented 5 years ago

It would be useful to implement some hooks into a computational geometry package to allow the user to specify an input permittivity distribution (or even the optimization design region) using collections of geometric primitives, e.g. rectangles, circles, etc. The user could also specify transformations of these objects, e.g. rotations, arrays, etc.

This would make it much easier to specify certain types of structures, e.g. waveguide bends, couplers, photonic crystals, ring resonators, etc, compared to the current approach of using conditionals operating directly on the array values.

For example, in my FDFD.jl package I use https://github.com/stevengj/GeometryPrimitives.jl There may be similar packages for python.

twhughes commented 5 years ago

Sounds good to me. We could also define our own, seems simple enough.

In a way, what's in structures.py is a basic template for defining complicated permittivity distributions out some geometric parameters. We could also define a more general geometries.py package that allows users to define basic shapes to construct structures out of.

shoyer commented 5 years ago

scikit-image defines a bunch of these: http://scikit-image.org/docs/dev/api/skimage.draw.html

twhughes commented 5 years ago

@shoyer This looks really useful, thanks!

When I get some time, I may overhaul the structures.py interface and use these for convenience.

twhughes commented 5 years ago

@ianwilliamson @momchilmm We can use our shape @primitives for this potentially