-
Notifications
You must be signed in to change notification settings - Fork 633
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
subpixel smoothing for MaterialGrid
causes modified results and field instabilities when used with symmetry
#1841
Comments
Very nice! Here are some initial thoughts:
|
Even when explicitly adding symmetry to the
Note that the frequency for (1) differs from (2), (3), and (4) in the fourth decimal digit. The relative error is less than 1%.
matgrid = mp.MaterialGrid(mp.Vector3(Nx,Ny),
mp.air,
mp.Medium(index=n),
weights=filtered_weights,
grid_type='U_MEAN',
do_averaging=True,
beta=1000,
eta=0.5)
geometry = [mp.Block(center=mp.Vector3(),
size=mp.Vector3(design_shape.x,design_shape.y,0),
material=matgrid),
mp.Block(center=mp.Vector3(),
size=mp.Vector3(design_shape.x,design_shape.y,0),
material=matgrid,
e2=mp.Vector3(y=-1))]
symmetries = [mp.Mirror(mp.X,phase=+1),
mp.Mirror(mp.Y,phase=-1)]
sim = mp.Simulation(cell_size=cell_size,
geometry=geometry,
sources=src,
resolution=res,
symmetries=symmetries,
boundary_layers=[mp.PML(dpml)]) |
Additional results for 1. weights = np.logical_and(np.sqrt(np.square(xv) + np.square(yv)) > rad,
np.sqrt(np.square(xv) + np.square(yv)) < rad+w,
dtype=np.double)
filter_radius = 4/res
filtered_weights = mpa.conic_filter(weights,
filter_radius,
design_shape.x,
design_shape.y,
design_region_resolution)
beta = 1000
eta = 0.5
projected_weights = mpa.tanh_projection(filtered_weights, beta, eta)
matgrid = mp.MaterialGrid(mp.Vector3(Nx,Ny),
mp.air,
mp.Medium(index=n),
weights=projected_weights,
do_averaging=False,
beta=0) 2. weights = np.logical_and(np.sqrt(np.square(xv) + np.square(yv)) > rad,
np.sqrt(np.square(xv) + np.square(yv)) < rad+w,
dtype=np.double)
matgrid = mp.MaterialGrid(mp.Vector3(Nx,Ny),
mp.air,
mp.Medium(index=n),
weights=weights,
do_averaging=False,
beta=0) |
A follow up to the discussion in #1780 related to subpixel smoothing for the
MaterialGrid
involving a demonstration of a continuous frequency response from continuous changes in the input geometry. Following @smartalecH's suggestion of increasing the filter radius (to four pixels rather than one), we are now finally able to demonstrate nearly exact agreement for the example involving a resonant Hz-polarized mode of a ring resonator represented using twoCylinder
objects and theMaterialGrid
. However, the only caveat for producing these results is that symmetries (i.e., the two mirror symmetries in x and y) had to be turned off for theMaterialGrid
. This is because either the symmetries produced slightly different results than the no-symmetry case or, for certain values of the ring radius, were causing the fields to blow up. Not being able to use symmetries to reduce the size of the computation (in this case by a factor of 4) when using aMaterialGrid
to represent the ring resonator as a level-set function is obviously a major performance limitation.The next validation test is to demonstrate quadratic convergence of the gradient (using the directional derivative) versus resolution.
MaterialGrid
Cylinder
The text was updated successfully, but these errors were encountered: