Skip to content
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

Update gdsfactory850 #435

Merged
merged 3 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions gplugins/fdtdz/get_ports_fdtdz.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def plot_mode(
port=c.ports["o1"],
epsilon=epsilon,
xmin=c.dxmin,
ymin=c.ymin,
ymin=c.dymin,
nm_per_pixel=nm_per_pixel,
port_extent_xy=1,
)
Expand All @@ -238,7 +238,7 @@ def plot_mode(
epsilon_port=epsilon_port,
excitation=excitation,
xmin=c.dxmin,
ymin=c.ymin,
ymin=c.dymin,
zmin=zmin,
nm_per_pixel=1000,
figsize=(11, 4),
Expand Down
2 changes: 1 addition & 1 deletion gplugins/fdtdz/get_sparameters_fdtdz.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def get_sparameters_fdtdz(
port=component.ports[portname],
epsilon=epsilon,
xmin=component_extended.dxmin,
ymin=component_extended.ymin,
ymin=component_extended.dymin,
nm_per_pixel=nm_per_pixel,
port_extent_xy=port_margin,
)
Expand Down
4 changes: 2 additions & 2 deletions gplugins/gmeep/get_simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@ def get_simulation(
cell_thickness = tpml + zmargin_bot + t_core + zmargin_top + tpml if is_3d else 0

cell_size = mp.Vector3(
component.xsize + 2 * tpml,
component.ysize + 2 * tpml,
component.dxsize + 2 * tpml,
component.dysize + 2 * tpml,
cell_thickness,
)

Expand Down
4 changes: 2 additions & 2 deletions gplugins/gmeep/meep_adjoint_optimization.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ def get_meep_adjoint_optimizer(
Vector3(*cell_size)
if cell_size
else Vector3(
c.xsize + 2 * sim.boundary_layers[0].thickness,
c.ysize + 2 * sim.boundary_layers[0].thickness,
c.dxsize + 2 * sim.boundary_layers[0].thickness,
c.dysize + 2 * sim.boundary_layers[0].thickness,
cell_thickness,
)
)
Expand Down
2 changes: 1 addition & 1 deletion gplugins/gmsh/xyz_mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def xyz_mesh(
background_remeshing_file: .pos file to use as a remeshing field. Overrides resolutions if not None.
"""
if port_names:
mesh_component = component.copy()
mesh_component = component.dup()
mesh_component.add_ports(component.ports)
component = get_component_with_net_layers(
component=mesh_component,
Expand Down
4 changes: 2 additions & 2 deletions gplugins/klayout/get_density.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,8 @@ def component_test_density1():
small_rect.dx += 10
small_rect.dy += 10
small_rect2 = c << gf.components.rectangle(size=(25, 25), layer=(2, 0))
small_rect2.dymax = 100 - small_rect2.ysize
small_rect2.dxmax = large_rect.dxmax - small_rect2.xsize
small_rect2.dymax = 100 - small_rect2.dysize
small_rect2.dxmax = large_rect.dxmax - small_rect2.dxsize
# c.write_gds(PATH.test_data / "test_gds_density1.gds")
return c

Expand Down
4 changes: 2 additions & 2 deletions gplugins/klayout/tests/test_density.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ def component_test_density1():
large_rect = c << gf.components.rectangle(size=(100, 150), layer=(1, 0))
_small_rect = c << gf.components.rectangle(size=(50, 50), layer=(2, 0))
small_rect2 = c << gf.components.rectangle(size=(25, 25), layer=(2, 0))
small_rect2.dymax = 100 - small_rect2.ysize
small_rect2.dxmax = large_rect.dxmax - small_rect2.xsize
small_rect2.dymax = 100 - small_rect2.dysize
small_rect2.dxmax = large_rect.dxmax - small_rect2.dxsize
return c


Expand Down
2 changes: 1 addition & 1 deletion gplugins/lumerical/write_sparameters_lumerical.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ def write_sparameters_lumerical(
logger.info(f"Writing Sparameters to {filepath_npz.absolute()!r}")
x_min = (component_extended.dxmin - xmargin) * 1e-6
x_max = (component_extended.dxmax + xmargin) * 1e-6
y_min = (component_extended.ymin - ymargin) * 1e-6
y_min = (component_extended.dymin - ymargin) * 1e-6
y_max = (component_extended.dymax + ymargin) * 1e-6

layers_thickness = [
Expand Down
6 changes: 3 additions & 3 deletions gplugins/sentaurus/sde.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def initialize_sde(
else:
xmin = component.dxmin
xmax = component.dxmax
ymin = component.ymin
ymin = component.dymin
ymax = component.dymax

# Initialize
Expand Down Expand Up @@ -287,8 +287,8 @@ def write_sde(
component=test_straight, domain=[[0, -4], [0, 4], [length, 4], [length, -4]]
)

yp = (test_component.dymax + test_component.ymin) / 2 + test_component.ysize / 2
ym = (test_component.dymax + test_component.ymin) / 2 - test_component.ysize / 2
yp = (test_component.dymax + test_component.dymin) / 2 + test_component.dysize / 2
ym = (test_component.dymax + test_component.dymin) / 2 - test_component.dysize / 2

WAFER_STACK.layers["substrate"].material = "Silicon"
WAFER_STACK.layers["substrate"].thickness = 1
Expand Down
16 changes: 8 additions & 8 deletions gplugins/sentaurus/sprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def initialize_sprocess(
else:
xmin = component.dxmin
xmax = component.dxmax
ymin = component.ymin
ymin = component.dymin
ymax = component.dymax

# Initial z-mesh from waferstack and resolutions
Expand Down Expand Up @@ -587,19 +587,19 @@ def cut_tdr(
component=test_straight, domain=[[0, -4], [0, 4], [length, 4], [length, -4]]
)

yp = (test_component.dymax + test_component.ymin) / 2 + test_component.ysize / 2
ym = (test_component.dymax + test_component.ymin) / 2 - test_component.ysize / 2
yp = (test_component.dymax + test_component.dymin) / 2 + test_component.dysize / 2
ym = (test_component.dymax + test_component.dymin) / 2 - test_component.dysize / 2
c.add_port(
name="e1",
center=(length / 2, yp),
width=test_component.ysize / 2,
width=test_component.dysize / 2,
orientation=0,
layer=LAYER.VIAC,
)
c.add_port(
name="e2",
center=(length / 2, ym),
width=test_component.ysize / 2,
width=test_component.dysize / 2,
orientation=0,
layer=LAYER.VIAC,
)
Expand All @@ -624,8 +624,8 @@ def cut_tdr(
)

contact_str = f"""contact name=cathode aluminum silicon xlo=0.0 xhi=0.2 ylo=0.0 yhi=1 zlo=0 zhi=0
contact name=anode aluminum silicon xlo=0.0 xhi=0.2 ylo={c.ysize-1:1.3f} yhi={c.ysize:1.3f} zlo=0 zhi=0
contact name=substrate box silicon xlo=4.2 xhi=4.3 ylo=0.0 yhi={c.ysize:1.3f} zlo=0 zhi=0
contact name=anode aluminum silicon xlo=0.0 xhi=0.2 ylo={c.dysize-1:1.3f} yhi={c.dysize:1.3f} zlo=0 zhi=0
contact name=substrate box silicon xlo=4.2 xhi=4.3 ylo=0.0 yhi={c.dysize:1.3f} zlo=0 zhi=0
"""

write_sprocess(
Expand All @@ -634,7 +634,7 @@ def cut_tdr(
layermap=LAYER,
process=get_process(),
xsection_bounds=(
((test_component.dxmin + test_component.dxmax) / 2, test_component.ymin),
((test_component.dxmin + test_component.dxmax) / 2, test_component.dymin),
((test_component.dxmin + test_component.dxmax) / 2, test_component.dymax),
),
save_directory="./sprocess/",
Expand Down
30 changes: 15 additions & 15 deletions notebooks/fdtdz_01.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@
" y=None,\n",
" z=-0.1,\n",
" xmin=c.dxmin,\n",
" ymin=c.ymin,\n",
" ymin=c.dymin,\n",
" zmin=zmin,\n",
" nm_per_pixel=nm_per_pixel,\n",
" figsize=(11, 4),\n",
Expand All @@ -238,7 +238,7 @@
" y=None,\n",
" z=0.05,\n",
" xmin=c.dxmin,\n",
" ymin=c.ymin,\n",
" ymin=c.dymin,\n",
" zmin=zmin,\n",
" nm_per_pixel=nm_per_pixel,\n",
" figsize=(11, 4),\n",
Expand All @@ -250,7 +250,7 @@
" y=None,\n",
" z=0.11,\n",
" xmin=c.dxmin,\n",
" ymin=c.ymin,\n",
" ymin=c.dymin,\n",
" zmin=zmin,\n",
" nm_per_pixel=nm_per_pixel,\n",
" figsize=(11, 4),\n",
Expand All @@ -262,7 +262,7 @@
" y=None,\n",
" z=0.5,\n",
" xmin=c.dxmin,\n",
" ymin=c.ymin,\n",
" ymin=c.dymin,\n",
" zmin=zmin,\n",
" nm_per_pixel=nm_per_pixel,\n",
" figsize=(11, 4),\n",
Expand All @@ -274,7 +274,7 @@
" y=None,\n",
" z=0.75,\n",
" xmin=c.dxmin,\n",
" ymin=c.ymin,\n",
" ymin=c.dymin,\n",
" zmin=zmin,\n",
" nm_per_pixel=nm_per_pixel,\n",
" figsize=(11, 4),\n",
Expand Down Expand Up @@ -302,7 +302,7 @@
" y=None,\n",
" z=None,\n",
" xmin=c.dxmin,\n",
" ymin=c.ymin,\n",
" ymin=c.dymin,\n",
" zmin=zmin,\n",
" nm_per_pixel=nm_per_pixel,\n",
" figsize=(11, 4),\n",
Expand All @@ -314,7 +314,7 @@
" y=None,\n",
" z=None,\n",
" xmin=c.dxmin,\n",
" ymin=c.ymin,\n",
" ymin=c.dymin,\n",
" zmin=zmin,\n",
" nm_per_pixel=nm_per_pixel,\n",
" figsize=(11, 4),\n",
Expand All @@ -326,7 +326,7 @@
" y=-5,\n",
" z=None,\n",
" xmin=c.dxmin,\n",
" ymin=c.ymin,\n",
" ymin=c.dymin,\n",
" zmin=zmin,\n",
" nm_per_pixel=nm_per_pixel,\n",
" figsize=(11, 4),\n",
Expand All @@ -338,7 +338,7 @@
" y=-3,\n",
" z=None,\n",
" xmin=c.dxmin,\n",
" ymin=c.ymin,\n",
" ymin=c.dymin,\n",
" zmin=zmin,\n",
" nm_per_pixel=nm_per_pixel,\n",
" figsize=(11, 4),\n",
Expand All @@ -350,7 +350,7 @@
" y=-1.5,\n",
" z=None,\n",
" xmin=c.dxmin,\n",
" ymin=c.ymin,\n",
" ymin=c.dymin,\n",
" zmin=zmin,\n",
" nm_per_pixel=nm_per_pixel,\n",
" figsize=(11, 4),\n",
Expand All @@ -362,7 +362,7 @@
" y=0,\n",
" z=None,\n",
" xmin=c.dxmin,\n",
" ymin=c.ymin,\n",
" ymin=c.dymin,\n",
" zmin=zmin,\n",
" nm_per_pixel=nm_per_pixel,\n",
" figsize=(11, 4),\n",
Expand Down Expand Up @@ -395,7 +395,7 @@
" port=c.ports[\"o1\"],\n",
" epsilon=epsilon,\n",
" xmin=c.dxmin,\n",
" ymin=c.ymin,\n",
" ymin=c.dymin,\n",
" nm_per_pixel=nm_per_pixel,\n",
" port_extent_xy=1,\n",
")\n",
Expand All @@ -405,7 +405,7 @@
" epsilon_port=epsilon_port,\n",
" excitation=excitation,\n",
" xmin=c.dxmin,\n",
" ymin=c.ymin,\n",
" ymin=c.dymin,\n",
" zmin=zmin,\n",
" nm_per_pixel=nm_per_pixel,\n",
" figsize=(20, 6),\n",
Expand All @@ -416,7 +416,7 @@
" port=c.ports[\"o2\"],\n",
" epsilon=epsilon,\n",
" xmin=c.dxmin,\n",
" ymin=c.ymin,\n",
" ymin=c.dymin,\n",
" nm_per_pixel=nm_per_pixel,\n",
" port_extent_xy=1,\n",
")\n",
Expand All @@ -426,7 +426,7 @@
" epsilon_port=epsilon_port,\n",
" excitation=excitation,\n",
" xmin=c.dxmin,\n",
" ymin=c.ymin,\n",
" ymin=c.dymin,\n",
" zmin=zmin,\n",
" nm_per_pixel=nm_per_pixel,\n",
" figsize=(20, 6),\n",
Expand Down
24 changes: 17 additions & 7 deletions notebooks/palace_01_electrostatic.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
"\n",
"import gdsfactory as gf\n",
"import pyvista as pv\n",
"from gdsfactory.components.interdigital_capacitor_enclosed import (\n",
" interdigital_capacitor_enclosed,\n",
"from gdsfactory.components.interdigital_capacitor import (\n",
" interdigital_capacitor,\n",
")\n",
"from gdsfactory.generic_tech import LAYER, get_generic_pdk\n",
"from gdsfactory.technology import LayerStack\n",
Expand Down Expand Up @@ -104,12 +104,10 @@
"outputs": [],
"source": [
"simulation_box = [[-200, -200], [200, 200]]\n",
"c = gf.Component(\"capacitance_palace\")\n",
"cap = c << interdigital_capacitor_enclosed(\n",
" metal_layer=LAYER.WG, gap_layer=LAYER.DEEPTRENCH, enclosure_box=simulation_box\n",
")\n",
"c = gf.Component()\n",
"cap = c << interdigital_capacitor()\n",
"c.add_ports(cap.ports)\n",
"substrate = gf.components.bbox(bbox=simulation_box, layer=LAYER.WAFER)\n",
"substrate = gf.components.bbox(c, layer=LAYER.WAFER)\n",
"c << substrate\n",
"c.plot()"
]
Expand Down Expand Up @@ -241,6 +239,18 @@
"display_name": "base",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.5"
}
},
"nbformat": 4,
Expand Down
Loading
Loading