|
40 | 40 | "from math import inf\n",
|
41 | 41 | "\n",
|
42 | 42 | "import gdsfactory as gf\n",
|
43 |
| - "import pyvista as pv\n", |
44 | 43 | "from gdsfactory.components.interdigital_capacitor_enclosed import (\n",
|
45 | 44 | " interdigital_capacitor_enclosed,\n",
|
46 | 45 | ")\n",
|
|
146 | 145 | ]
|
147 | 146 | },
|
148 | 147 | {
|
149 |
| - "cell_type": "code", |
150 |
| - "execution_count": null, |
| 148 | + "cell_type": "markdown", |
151 | 149 | "id": "8",
|
152 |
| - "metadata": { |
153 |
| - "lines_to_next_cell": 2 |
154 |
| - }, |
155 |
| - "outputs": [], |
156 |
| - "source": [ |
157 |
| - "# results = run_capacitive_simulation_elmer(\n", |
158 |
| - "# c,\n", |
159 |
| - "# layer_stack=layer_stack,\n", |
160 |
| - "# material_spec=material_spec,\n", |
161 |
| - "# n_processes=1,\n", |
162 |
| - "# element_order=1,\n", |
163 |
| - "# simulation_folder=Path(os.getcwd()) / \"temporary\",\n", |
164 |
| - "# mesh_parameters=dict(\n", |
165 |
| - "# background_tag=\"vacuum\",\n", |
166 |
| - "# background_padding=(0,) * 5 + (700,),\n", |
167 |
| - "# port_names=c.ports.keys(),\n", |
168 |
| - "# default_characteristic_length=200,\n", |
169 |
| - "# resolutions={\n", |
170 |
| - "# \"bw\": {\n", |
171 |
| - "# \"resolution\": 15,\n", |
172 |
| - "# },\n", |
173 |
| - "# \"substrate\": {\n", |
174 |
| - "# \"resolution\": 40,\n", |
175 |
| - "# },\n", |
176 |
| - "# \"vacuum\": {\n", |
177 |
| - "# \"resolution\": 40,\n", |
178 |
| - "# },\n", |
179 |
| - "# **{\n", |
180 |
| - "# f\"bw__{port}\": { # `__` is used as the layer–port delimiter for Elmer\n", |
181 |
| - "# \"resolution\": 20,\n", |
182 |
| - "# \"DistMax\": 30,\n", |
183 |
| - "# \"DistMin\": 10,\n", |
184 |
| - "# \"SizeMax\": 14,\n", |
185 |
| - "# \"SizeMin\": 3,\n", |
186 |
| - "# }\n", |
187 |
| - "# for port in c.ports\n", |
188 |
| - "# },\n", |
189 |
| - "# },\n", |
190 |
| - "# ),\n", |
191 |
| - "# )\n", |
192 |
| - "# display(results)" |
193 |
| - ] |
194 |
| - }, |
195 |
| - { |
196 |
| - "cell_type": "code", |
197 |
| - "execution_count": null, |
198 |
| - "id": "9", |
199 |
| - "metadata": { |
200 |
| - "lines_to_next_cell": 2 |
201 |
| - }, |
202 |
| - "outputs": [], |
| 150 | + "metadata": {}, |
203 | 151 | "source": [
|
| 152 | + "```python\n", |
| 153 | + "results = run_capacitive_simulation_elmer(\n", |
| 154 | + " c,\n", |
| 155 | + " layer_stack=layer_stack,\n", |
| 156 | + " material_spec=material_spec,\n", |
| 157 | + " n_processes=1,\n", |
| 158 | + " element_order=1,\n", |
| 159 | + " simulation_folder=Path(os.getcwd()) / \"temporary\",\n", |
| 160 | + " mesh_parameters=dict(\n", |
| 161 | + " background_tag=\"vacuum\",\n", |
| 162 | + " background_padding=(0,) * 5 + (700,),\n", |
| 163 | + " port_names=c.ports.keys(),\n", |
| 164 | + " default_characteristic_length=200,\n", |
| 165 | + " resolutions={\n", |
| 166 | + " \"bw\": {\n", |
| 167 | + " \"resolution\": 15,\n", |
| 168 | + " },\n", |
| 169 | + " \"substrate\": {\n", |
| 170 | + " \"resolution\": 40,\n", |
| 171 | + " },\n", |
| 172 | + " \"vacuum\": {\n", |
| 173 | + " \"resolution\": 40,\n", |
| 174 | + " },\n", |
| 175 | + " **{\n", |
| 176 | + " f\"bw__{port}\": { # `__` is used as the layer to port delimiter for Elmer\n", |
| 177 | + " \"resolution\": 20,\n", |
| 178 | + " \"DistMax\": 30,\n", |
| 179 | + " \"DistMin\": 10,\n", |
| 180 | + " \"SizeMax\": 14,\n", |
| 181 | + " \"SizeMin\": 3,\n", |
| 182 | + " }\n", |
| 183 | + " for port in c.ports\n", |
| 184 | + " },\n", |
| 185 | + " },\n", |
| 186 | + " ),\n", |
| 187 | + ")\n", |
| 188 | + "display(results)\n", |
| 189 | + "\n", |
204 | 190 | "if results.field_file_location:\n",
|
205 | 191 | " pv.start_xvfb()\n",
|
206 | 192 | " pv.set_jupyter_backend(\"trame\")\n",
|
|
212 | 198 | " p.show_grid()\n",
|
213 | 199 | " p.camera_position = \"xy\"\n",
|
214 | 200 | " p.enable_parallel_projection()\n",
|
215 |
| - " p.show()" |
| 201 | + " p.show()\n", |
| 202 | + "```" |
216 | 203 | ]
|
217 | 204 | },
|
218 | 205 | {
|
219 | 206 | "cell_type": "markdown",
|
220 |
| - "id": "10", |
| 207 | + "id": "9", |
221 | 208 | "metadata": {},
|
222 | 209 | "source": [
|
223 | 210 | "## Bibliography\n",
|
|
0 commit comments