You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/TopOptEMFocus.jl
+12-32Lines changed: 12 additions & 32 deletions
Original file line number
Diff line number
Diff line change
@@ -78,7 +78,7 @@
78
78
# \end{aligned}
79
79
# ```
80
80
#
81
-
# We choose a filter radius $r_f=R_f/(2\sqrt{3})$ where $R_f=5$nm, in order to match a published result (using a slightly different filtering scheme) for comparison [6].
81
+
# We choose a filter radius $r_f=R_f/(2\sqrt{3})$ where $R_f=10$ nm, in order to match a published result (using a slightly different filtering scheme) for comparison [6].
82
82
#
83
83
# Next, we apply a smoothed threshold projection to the intermediate variable $p_f$ to obtain a "binarized" density parameter $p_t$ that tends towards values of $0$ or $1$ almost everywhere [6] as the steepness $\beta$ of the thresholding is increased:
84
84
# ```math
@@ -133,7 +133,7 @@ model = GmshDiscreteModel("../models/RecCirGeometry.msh")
133
133
134
134
# ## FE spaces for the magnetic field
135
135
#
136
-
# We use the first-order Lagrange finite-element basis functions. The Dirichlet edges are labeled as `DirichletEdges` in the mesh file. Since our problem involves complex numbers (because of the PML), we need to specify the `vector_type` as `Vector{ComplexF64}`.
136
+
# We use the first-order Lagrange finite-element basis functions. The Dirichlet edges are labeled as `DirichletEdges` in the mesh file. Since our problem involves complex numbers (because of the PML and the complex metal refractive index), we need to specify the `vector_type` as `Vector{ComplexF64}`.
# Now we use NLopt.jl package to implement the MMA algorithm for optimization. Note that we start with $\beta=8$ and then gradually increase it to $\beta=32$ in consistant with Ref. [6].
446
446
#
447
447
448
-
using NLopt, DelimitedFiles
448
+
using NLopt
449
449
450
-
functiongf_p_optimize(p_init, r, β, η, TOL =1e-4, MAX_ITER =500; phys_params, fem_params)
450
+
functiongf_p_optimize(p_init; r, β, η, TOL =1e-4, MAX_ITER =500, phys_params, fem_params)
# For the electric field, recall that $\vert E\vert^2\sim\vert \frac{1}{\epsilon}\nabla H\vert^2$, the factor 2 below comes from the amplitude compared to the incident plane wave. We can see that the optimized shapes are very similiar to the optimized shape in Ref. [6], proving our results.
525
505
#
526
506
527
-
maxe =30# Maximum electric field
507
+
maxe =30# Maximum electric field magnitude compared to the incident plane wave
0 commit comments