MCPcopy Create free account
hub / github.com/NanoComp/meep / GDSII_vol

Function GDSII_vol

python/simulation.py:6221–6242  ·  view source on GitHub ↗

Returns a `mp.Volume` read from a GDSII file `fname` on layer number `layer` with `zmin` and `zmax` (default 0). This function is useful for creating a `FluxRegion` from a GDSII file as follows: ```python fr = mp.FluxRegion(volume=mp.GDSII_vol(fname, layer, zmin, zmax)) ```

(fname, layer, zmin, zmax)

Source from the content-addressed store, hash-verified

6219
6220
6221def GDSII_vol(fname, layer, zmin, zmax):
6222 """
6223 Returns a `mp.Volume` read from a GDSII file `fname` on layer number `layer` with
6224 `zmin` and `zmax` (default 0). This function is useful for creating a `FluxRegion`
6225 from a GDSII file as follows:
6226
6227 ```python
6228 fr = mp.FluxRegion(volume=mp.GDSII_vol(fname, layer, zmin, zmax))
6229 ```
6230 """
6231 meep_vol = mp.get_GDSII_volume(fname, layer, zmin, zmax)
6232 dims = meep_vol.dim + 1
6233 is_cyl = False
6234
6235 if dims == 4:
6236 # cylindrical
6237 dims = 2
6238 is_cyl = True
6239
6240 center, size = get_center_and_size(meep_vol)
6241
6242 return Volume(center, size, dims, is_cyl)
6243
6244
6245def GDSII_prisms(material, fname, layer=-1, zmin=0.0, zmax=0.0):

Callers

nothing calls this directly

Calls 2

get_center_and_sizeFunction · 0.85
VolumeClass · 0.85

Tested by

no test coverage detected