Accessing Optimized Adjoint Geometry. #3099
-
|
I'm fairly new to using MEEP and could not find anything in the tutorials or other discussions about doing this. I have a very basic simulation that uses the adjoint solver and spits out some optimized geometry stored as the variable x=solver.optimize(x0). The code does not do any of the epigraph formulation or anything, it is similar to the 90-degree bend example. I wanted to know how I could save the result of this optimization so that I could visualize the evolution of the fields through my optimized structure? I initally thought that I could do something like design_variables_opt = mp.MaterialGrid(discretized_region, photochromic, silicon, grid_type='U_MEAN',
do_averaging=False, weights=x)but when I do geo = [mp.Block(size = design_region_size, center = mp.Vector3(0,0), material = design_variables_opt)]The design region ends up being just purely white and any other geometry I add ends up being gray. Again this is probably a trivial problem I just haven't found the solution to it. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
So I ended up figuring this out for anyone wondering. In the MaterialGrid you need to set weights=x.reshape((design_region_resolution+1, design_region_resolution+1)) |
Beta Was this translation helpful? Give feedback.
So I ended up figuring this out for anyone wondering. In the MaterialGrid you need to set weights=x.reshape((design_region_resolution+1, design_region_resolution+1))