Re: [Meep-discuss] Problem with Inverted Pyramid Structure at Small Absorption

2020-08-15 Thread Ardavan Oskooi
Note that due to the Fourier Uncertainty Principle, the runtime should 
be at least ~1/frequency resolution. In practice, the runtime may even 
have to be twice as large as demonstrated in 
https://meep.readthedocs.io/en/latest/Python_Tutorials/Custom_Source/#stochastic-dipole-emission-in-light-emitting-diodes. 
Try switching to the meep.Simulation(run=run_time) run function and 
repeatedly double run_time.


On 8/15/2020 8:11, J. Philip Haupt wrote:
I've tried increasing PML thickness (went up to 8 micron) and 
resolution (went up to 150). As for run time, I am using the decay 
factor, and have manually been terminating it when the reflectances 
exceed unity. I think the maximum time I've run for is around 3000 units.




___
meep-discuss mailing list
meep-discuss@ab-initio.mit.edu
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

Re: [Meep-discuss] ModeSolver in Cylindrical Coordinates

2020-08-15 Thread Kramnik Daniel
As an immediate solution, I implemented the coordinate transform method the
following paper to simulate bent waveguides in the MPB modesolver:
https://www.osapublishing.org/ol/abstract.cfm?uri=ol-38-11-1778

Essentially, I define a "get_epsilon" method that returns an epsilon tensor
in the transformed coordinates, then pass that as a "material" into each
block in my geometry. The background index also needs to be transformed, so
in the end every pixel in the mesh needs to evaluate this "get_epsilon"
method.

Unfortunately, the run time of the mode solver becomes extremely long when
passing in a get_epsilon method for the material. Each "initializing
epsilon function" step takes around a minute on a 200x100x1 grid, and this
method seems to be called many times when I call "find_k". Overall the
modesolver takes several minutes to execute. This seems strange, since the
geometry isn't changing. Do you have any suggestions for speeding things
up? I am also not getting the mode solutions I expect, but the slow speed
of the simulations seems more pressing, since it prevents me from debugging
further. Code attached.

Thanks again,
Daniel



On Fri, Aug 14, 2020 at 1:54 PM Steven G. Johnson 
wrote:

> See https://github.com/NanoComp/meep/issues/1319
>
> Note you can also implement any source you want on your own by adding a
> volume source with an amplitude function (e.g. interpolated from a file, or
> your own mode solver).
>
> On Aug 14, 2020, at 12:19 PM, Kramnik Daniel 
> wrote:
>
> Thanks, is there any plan to implement cylindrical coordinates?
>
> On Fri, Aug 14, 2020 at 9:14 AM Ardavan Oskooi 
> wrote:
>
>> Meep's eigenmode decomposition (and eigenmode source) feature only
>> supports Cartesian coordinates.
>>
>> On 8/13/20 01:23, Kramnik Daniel wrote:
>> > I'm trying to design some silicon photonic ring resonator structures
>> > using MEEP/MPB and was wondering if the modesolver can work in
>> > cylindrical coordinates. It looks like the FDTD solver supports
>> > cylindrical coordinates, based on the "ring resonator" examples.
>>
> ___
> meep-discuss mailing list
> meep-discuss@ab-initio.mit.edu
> http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss
>
>
>
# Script that designs wrapped couplers for microring resonators using MEEP's modesolver
# The modesolver does not support cylindrical coordinates, so instead we transform the geometry and permittivity tensor from cylindrical to Cartesian coordinates
# See: "Calculation of bending losses for highly confined modes of optical waveguides with transformation optics", Opt. Lett. 2012

import meep as mp
from meep import mpb
import numpy as np
from matplotlib import pyplot as plt

# Use constant-index while developing
#import SiPh_materials.SiPh_materials as materials

# ---
# Setup a simple technology definition
# ---

tech_params = {
	'BOX'	: None,
	'Si'	: None,
	'Si3N4'	: None,
	'BEOL'	: None,
	}

tech_params[ 'BOX' ] = {
	'model'		: mp.Medium( index = 1.4 ),
	'z_min'		: -0.200,
	'z_mid'		: -0.100,
	'z_max'		: 0.000,
	'thickness'	: 0.200,
	}

tech_params[ 'BEOL' ] = {
	'model'		: mp.Medium( index = 1.4 ),
	'z_min'		: 0.000,
	'z_mid'		: 2.000,
	'z_max'		: 4.000,
	'thickness'	: 4.000,
	}

tech_params[ 'Si' ] = {
	'model'		: mp.Medium( index = 3.5 ),
	'z_min'		: 0.000,
	'z_mid'		: 0.040,
	'z_max'		: 0.080,
	'thickness'	: 0.080,
	}

tech_params[ 'Si3N4' ] = {
	'model'		: mp.Medium( index = 2.0 ),
	'z_min'		: 0.080,
	'z_mid'		: 0.090,
	'z_max'		: 0.100,
	'thickness'	: 0.020,
	}

# ---
# Define ring and bus geometry parameters
# ---

ring_params = {
	'outer_radius'	: 5.000,
	'wg_width'		: 1.000,
	}

ring_params[ 'inner_radius' ] = ring_params[ 'outer_radius' ] - ring_params[ 'wg_width' ]

bus_params = {
	'gap'		: 0.050,
	'wg_width'	: 0.500,
}

bus_params[ 'inner_radius' ] = ring_params[ 'outer_radius' ] + bus_params[ 'gap' ]
bus_params[ 'outer_radius' ] = bus_params[ 'inner_radius' ] + bus_params[ 'wg_width' ]

# ---
# Define utility functions
# ---

# This is the radius that corresponds to u = 0 in the transformed coordinates
# Hardcoded for now
R_0 = 5

def coord_transform_radius_to_u( r_in, R_0 ):
	# r_in : radial location to transform
	# R_0 : radial location corresponding to u = 0
	return R_0 * np.log( r_in / R_0 )

def get_transformed_epsilon( loc, material, frequency ):
	u = loc[ 0 ]
	v = loc[ 1 ]
	w = loc[ 2 ]

	epsilon = material.epsilon( freq = frequency )[ 0, 0 ]	# Does not support anisotropic materials

	epsilon_transformed = epsilon * mp.Vector3( 1, np.exp( 2 * u / R_0 ), 1 )

	return mp.Medium( epsilon_diag = epsilon_transformed )

# 

Re: [Meep-discuss] Problem with Inverted Pyramid Structure at Small Absorption

2020-08-15 Thread J. Philip Haupt
I've tried increasing PML thickness (went up to 8 micron) and resolution 
(went up to 150). As for run time, I am using the decay factor, and have 
manually been terminating it when the reflectances exceed unity. I think 
the maximum time I've run for is around 3000 units.


On 2020-08-14 9:11 a.m., Ardavan Oskooi wrote:


For additional details regarding PMLs in Meep, see: 
https://meep.readthedocs.io/en/latest/Perfectly_Matched_Layer/.


As described in 
https://meep.readthedocs.io/en/latest/FAQ/#checking-convergence, you 
need to check the convergence by increasing the resolution, PML 
thickness, and run time (for Fourier spectra). Have you also tried 
doubling the run time?


On 8/13/20 17:06, J. Philip Haupt wrote:
I still haven't gotten this to work. It seems to work in the 
wavelength range 300-1000 nm (which is with different fits), but not 
1000-1200 nm (with fit shown in the previous email).


For what it's worth, my colleague got a converged result using 
Lumerical FDTD Solutions, specifically a "stretched coordinate" PML 
(SCPML). I have been trying to map the parameters in MEEP's PML class 
to the parameters used by Lumerical, but without much luck. Is there 
any documentation for how to change more "standard" PML parameters 
(what Lumerical calls layers (=thickness?), kappa, sigma, polynomial 
(which I assume = degree of pml_profile))? This would help me 
benchmark his results with MEEP.


Also, what does the mean_stretch parameter in meep.PML do? It is 
listed in the documentation 
 
but not explained.




___
meep-discuss mailing list
meep-discuss@ab-initio.mit.edu
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss