Replies: 3 comments 6 replies
-
Check out some of the comments from #2067. Basically what you are describing requires a level set (an "explicit" level set in this case). Luckily meep's adjoint code supports that (using the new subpixel smoothing feature), but you still need to map whatever basis functions you specify to densities. Again, the above discussion describes that. We've been working on a paper that describes this for quite some time... life just gets in the way. |
Beta Was this translation helpful? Give feedback.
-
This happens anyway with density-based topology optimization once β goes to infinity (and one can also penalize intermediate values in other ways, e.g. with the damping parameter or a penalty term). (This kind of "binarization" process is usually necessary to obtain a manufacturable structure!) So it's not clear to me what new thing you're trying to accomplish here. Yes, it's possible to implement level-set methods with custom degrees of freedom if you define a smooth mapping from your degrees of freedom to a level-set function with β=∞, as @smartalecH outlined above, but that's a lot of work to go through if you can use density-based TO as-is. (Note that even with density-based TO you can still restrict the dimensionality of the design. e.g. if you want to design aperiodic gratings, i.e. univariate materials, you can just apply a 1d material grid to a 2d or 3d object. We do this all the time to design 2d-patterned structures in 3d, by applying a 2d material grid to a 3d design region.) |
Beta Was this translation helpful? Give feedback.
-
Hi @smartalecH , hi @stevengj , Thanks a lot for your help and feedback. I have given it a try first with a "simple" case. I have optimized an aspheric surface (using the conic constant and the radius of curvature as parameters) via another software package. For such a surface, I define a uniform illumination from air for which the aspheric surface focuses the incoming field. Following, I compute the coupling efficiency or the similarity of the focused field with respect to a Gaussian like field distribution. I have implemented the same structure and system using meep for which I verified that I obtain similar results as for the reference design software. I then decided to "adjust" the parameters describing such a surface in order to give it a try to the adjoint based optimization approach. (I know that I am optimizing just for two simple parameters but I wanted to start by optimizing a "simple" reference system with few parameters) The problem that I have is that the merit function does not change so much in value and after a few iterations, the optimization routine just finishes without having the merit function reaching to the value from the original design. The following curve shows an example of the evolution of my merit function: Also, I have noticed that the gradient with respect to my two free parameters is really "small" (in the order of 10e-6) Could it be that I am not providing the correct gradient information to the optimization routine? This is the mapping function that I am using for generating the
For the mapping, I am using a sigmoid function with the threshold value defined at the contour of the aspheric surface height profile (zz). As I said, I have verified that above mapping function results in the reference aspheric surface if I directly use the parameters obtained during the original optimization via the other commercial software. As for the function that is given to the optimization routine, this is how I have defined it:
As you can see, I use the ```tensor_jacobian_product" function in order to back propagate the gradients from the pointwise gradient evaluations for each pixel point to the gradients corresponding to my two optimization parameters. Finally, this is how I set up everything in order to run the optimization routine:
I have used different MEEP example scripts as references and adapted my code accordingly as shown above. Do you notice anything suspicious or problematic in how I set up everything? Also, do you have any idea in mind about how could I tackle this problem? What could I test? Could it be that my mapping function is not adequate? Should I try a different optimization algorithm or should I use a different formulation for the optimization problem? (Using an epigraph formulation?) Any suggestions on how could I move on forward with this? As always, thanks a lot for your feedback and help! |
Beta Was this translation helpful? Give feedback.
-
Hello there friends from the meep community,
I wanted to ask for a bit of your guidance. I have read the publication "High-performance hybrid time/frequency-domain topology optimization for large-scale photonics inverse design" in where you combine a density based design approach with adjoint problems based gradient evaluations.
I have no experience with such optimization methods and therefore I wanted to ask for your feedback about a similar but probably different implementation. Instead of an optimization based on individual pixels, I would like to optimize for a sufficiently "smooth" structure that could be described maybe by a linear combination of basis terms or an aperiodic grating structure for which each local grating period could be adjusted.
Since I imagine (again I am not really sure) that performing such an optimization would be more efficient through gradient-based methods, I would like to know if for such a case I could compute the gradients by relying on a similar adjoint problem formulation.
In summary, I would like to use a gradient-based optimization algorithm (via adjoint methods) but for "regular" and parametrizable structures with probably a large number of parameters (i.e, smooth surfaces and aperiod gratings)
Therefore, my questions would be:
2.1 If not, what would I need to adjust from your code base?
Thanks a lot for your feedback!
Beta Was this translation helpful? Give feedback.
All reactions