setupEM 0.10.1__tar.gz → 0.10.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. {setupem-0.10.1/src/setupEM.egg-info → setupem-0.10.2}/PKG-INFO +20 -2
  2. setupem-0.10.2/README.md +329 -0
  3. {setupem-0.10.1 → setupem-0.10.2}/README_pypi.md +18 -0
  4. {setupem-0.10.1 → setupem-0.10.2}/pyproject.toml +1 -1
  5. {setupem-0.10.1 → setupem-0.10.2}/src/setupEM/__init__.py +1 -1
  6. {setupem-0.10.1 → setupem-0.10.2}/src/setupEM/field_viewer.py +159 -7
  7. {setupem-0.10.1 → setupem-0.10.2}/src/setupEM/result_viewer.py +444 -6
  8. {setupem-0.10.1 → setupem-0.10.2}/src/setupEM/setupEM.py +282 -22
  9. {setupem-0.10.1 → setupem-0.10.2}/src/setupEM/setup_common.py +8 -0
  10. {setupem-0.10.1 → setupem-0.10.2/src/setupEM.egg-info}/PKG-INFO +20 -2
  11. {setupem-0.10.1 → setupem-0.10.2}/src/setupEM.egg-info/SOURCES.txt +1 -0
  12. {setupem-0.10.1 → setupem-0.10.2}/src/setupEM.egg-info/requires.txt +1 -1
  13. {setupem-0.10.1 → setupem-0.10.2}/LICENSE +0 -0
  14. {setupem-0.10.1 → setupem-0.10.2}/setup.cfg +0 -0
  15. {setupem-0.10.1 → setupem-0.10.2}/src/setupEM/__main__.py +0 -0
  16. {setupem-0.10.1 → setupem-0.10.2}/src/setupEM/data/SG13CMOS5L_200um.xml +0 -0
  17. {setupem-0.10.1 → setupem-0.10.2}/src/setupEM/data/SG13G2_100um.xml +0 -0
  18. {setupem-0.10.1 → setupem-0.10.2}/src/setupEM/data/SG13G2_200um.xml +0 -0
  19. {setupem-0.10.1 → setupem-0.10.2}/src/setupEM/data/SG13G2_FEM_200um.xml +0 -0
  20. {setupem-0.10.1 → setupem-0.10.2}/src/setupEM/data/SG13G2_FEM_200um_passi3D.xml +0 -0
  21. {setupem-0.10.1 → setupem-0.10.2}/src/setupEM/data/SG13G2_nosub.xml +0 -0
  22. {setupem-0.10.1 → setupem-0.10.2}/src/setupEM/gds_hierarchy_scan.py +0 -0
  23. {setupem-0.10.1 → setupem-0.10.2}/src/setupEM/layout_preview.py +0 -0
  24. {setupem-0.10.1 → setupem-0.10.2}/src/setupEM/momentum_import.py +0 -0
  25. {setupem-0.10.1 → setupem-0.10.2}/src/setupEM/palace_results.py +0 -0
  26. {setupem-0.10.1 → setupem-0.10.2}/src/setupEM/setupThermal.py +0 -0
  27. {setupem-0.10.1 → setupem-0.10.2}/src/setupEM/simplify_gds.py +0 -0
  28. {setupem-0.10.1 → setupem-0.10.2}/src/setupEM/stackupEditor.py +0 -0
  29. {setupem-0.10.1 → setupem-0.10.2}/src/setupEM/stackup_writer.py +0 -0
  30. {setupem-0.10.1 → setupem-0.10.2}/src/setupEM/thermal_results.py +0 -0
  31. {setupem-0.10.1 → setupem-0.10.2}/src/setupEM.egg-info/dependency_links.txt +0 -0
  32. {setupem-0.10.1 → setupem-0.10.2}/src/setupEM.egg-info/entry_points.txt +0 -0
  33. {setupem-0.10.1 → setupem-0.10.2}/src/setupEM.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: setupEM
3
- Version: 0.10.1
3
+ Version: 0.10.2
4
4
  Summary: Python tool for configuration of gds2palace workflow with GUI.
5
5
  Author-email: Volker Muehlhaus <volker@muehlhaus.com>
6
6
  License-Expression: GPL-3.0-or-later
@@ -10,7 +10,7 @@ Project-URL: Changelog, https://github.com/VolkerMuehlhaus/setupEM/blob/main/doc
10
10
  Requires-Python: >=3.9
11
11
  Description-Content-Type: text/markdown
12
12
  License-File: LICENSE
13
- Requires-Dist: gds2palace>=0.7.0
13
+ Requires-Dist: gds2palace>=0.8.0
14
14
  Requires-Dist: gds_prepare_for_EM>=1.2.0
15
15
  Requires-Dist: PySide6
16
16
  Requires-Dist: shiboken6
@@ -38,8 +38,26 @@ https://github.com/VolkerMuehlhaus/setupEM
38
38
 
39
39
  ## Recent changes
40
40
 
41
+ # What's New - September 30, 2026
42
+
43
+ The **Adaptive mesh refinement (AMR)** group on the Mesh and Boundaries tab is now called **Solver & Adaptive Mesh Refinement (AMR)** and has a new Palace linear solver setting, shown with **Show advanced configuration** = **Yes**.
44
+
45
+ **Complex coarse solve** (default **Yes** for every model, set in **Preferences > Palace**) lets Palace's direct coarse solver factorize the full complex system instead of only its real part. With **No** (Palace's own default), some models don't converge at some frequencies and get wrong S-parameters there: a D-band line failed at 170 GHz, and an inductor failed at 2.4 GHz with 1.1 nH instead of 2.5 nH, while it converged at 0.1 and 10 GHz. With **Yes** both converged in 1-31 iterations and ran 3.5-6x faster. Models that already converge give identical results in about the same or less time. The cost is peak RAM, depending on the model 1.0-1.6x at order 2 and 1.5-1.9x at order 1; the AMR RAM estimate includes this.
46
+
47
+ **Maximum solver iterations** (400) and **Solver tolerance** (1e-6) can now be changed too, in **Preferences > Palace**. These settings require gds2palace v0.8.0 or later and are hidden with an older version. setupEM module installation now requires gds2palace v0.8.0 or later, which also restores the dielectric loss tangent in Palace models that had been deleted by mistake.
48
+
49
+ **Conformal AMR (experimental)** is a new advanced setting in the **Solver & Adaptive Mesh Refinement (AMR)** group (default **No**, set in **Preferences > Palace**). With AMR iterations > 0, it switches Palace from its default nonconformal (hanging-node) mesh refinement to conformal refinement (gds2palace `settings['adaptive_mesh_conformal']`). In the test cases so far it converged in fewer AMR iterations (D-band balun: 2 iterations instead of 4, in half the time), but the mesh cell count grows faster per iteration.
50
+
51
+ setupEM now warns when Palace's linear solver does **not converge**: Palace carries on and writes S-parameters for that frequency anyway, but they are unreliable. Each case gets a ⚠ warning in the Log panel with its frequency, and all of them are listed again at the end of the run.
52
+
53
+ # What's New - September 29, 2026
54
+
55
+ The built-in **3D field viewer** now shows frequencies instead of bare numbers: the **Cycle** picker of a multi-frequency Palace field dump lists e.g. "6 GHz (cycle 1)", and Palace's extra error-indicator dump is listed as "geometry" right away. For Elmer (EM), each result file in the **Result File** picker shows its frequency, e.g. "fields_t0002.vtu - 7.5 GHz". The cycle number is kept in the label, so it still matches `field_viewer.py --cycle <N>`.
56
+
41
57
  # What's New - September 26, 2026
42
58
 
59
+ **Result Viewer**: new frequency **Marker** that reads out all curves at the same frequency, shown on the plots and in a table below. Set it by clicking a plot, typing a frequency or using the Left/Right arrow keys; right-click a plot to jump to the (next) min/max.
60
+
43
61
  The **AMR maximum DOF** setting now shows an estimate of the RAM that Palace will need at that mesh size, both on the Mesh tab and in Preferences > Palace. The estimate is based on existing Palace results (about 12 GB per million DOF, up to 15 GB). On the Mesh tab, it turns into a warning when the worst case exceeds the **"Stop Palace if memory exceeds"** limit.
44
62
 
45
63
  **Stackup Preview**: three or more layers at the same height (e.g. resistor sheets on top of Activ) are now drawn side by side instead of on top of each other, via labels sit near the upper end of the via, and sheet resistance labels show the correct unit (e.g. RHIGH: Rs=1360 Ω, was shown as 1360000 mΩ).
@@ -0,0 +1,329 @@
1
+ # Python GUI for gds2palace
2
+
3
+ ![Intro](./doc/png/setupEM_banner.png)
4
+
5
+ ## What's New
6
+
7
+ Reserved PEC/AIR stackup materials, Layout Preview, Results viewer, Model Fit, built-in 3D field viewer, GDSII Layout Simplification, XML Stackup Editor, setupThermal for Elmer thermal simulation.
8
+
9
+ See [CHANGES.md](doc/CHANGES.md) for details.
10
+
11
+ ## Video Tutorial
12
+
13
+ https://www.youtube.com/playlist?list=PLQ6NbZzeLAVU
14
+
15
+ ## SetupEM
16
+
17
+ [gds2palace](https://github.com/VolkerMuehlhaus/gds2palace_ihp_sg13g2) enables an **RFIC FEM simulation** workflow where GDSII layout files are simulated using the [Palace FEM solver by AWS](https://awslabs.github.io/palace/stable/). setupEM provides a Python-based **graphical user interface** to configure and run gds2palace, instead of creating the simulation model code manually, and also start simulation in Palace.
18
+
19
+ When you install setupEM, the gds2palace workflow is automatically installed in the background. This enables **creating a simulation model** for AWS Palace. To actually **run the simulation**, you need to have AWS Palace installed, as described below. Palace installation is **not** done automatically!
20
+
21
+ The setupEM package now includes setupThermal also, which is the equivalent of setupEM for thermal models using [Elmer](https://www.elmerfem.org/blog/). To run a thermal model in Elmer, you need to have Elmer installed. Elmer installation is **not** done automatically!
22
+
23
+ An overview of the SetupEM user interface is given below in chapter "Using setupEM"
24
+
25
+ Two more external tools are used by parts of the workflow, and are not installed automatically:
26
+
27
+ - [ParaView](https://www.paraview.org/) — optional, for viewing field-dump output (Palace/Elmer EM) and Elmer thermal result files with ParaView itself instead of the built-in 3D field viewer (see [3D Field Viewer](#3d-field-viewer) below). Not required: the built-in viewer needs nothing extra installed and is the default.
28
+ - An MPI implementation — only needed for multi-process Elmer runs (the Elmer solver settings' multithreading option). Use OpenMPI or MPICH on Linux/macOS; on Windows, install [Microsoft MPI](https://learn.microsoft.com/en-us/message-passing-interface/microsoft-mpi) (setupEM checks for this and shows a download link if it's missing).
29
+
30
+
31
+ ## Installing the AWS Palace FEM solver engine
32
+ **setupEM** creates and runs simulation models for the AWS Palace FEM solver engine. The underlying solver **AWS Palace** can be installed in multiple ways. For a smooth interaction with the gds2palace workflow, it is recommended to create some scripts that help running the model and convert the Palace results to SnP Touchstone files.
33
+
34
+ For development of this workflow, Palace was installed using the Singularity/Apptainer installation method. This was rather simple and straightforward, even with no knowledge about container usage. The resulting apptainer file palace.sif can be integrated very easily in a Linux system like the Ubuntu 24.04 system used here, and can then be moved to other Linux machines using simple copy of the container file. The script to start Palace from the apptainer is included in the scripts directory in this repository.
35
+
36
+ Notes on installing the Palace solver using **apptainer** container manager:
37
+ [Installing Palace using Apptainer](https://github.com/VolkerMuehlhaus/gds2palace_ihp_sg13g2/blob/main/doc/building-palace-apptainer.md)
38
+
39
+ Using the spack package manager, Palace can also be created from source with a few simple commands. All tools required by the build process will be downloaded and installed automatically by spack, so you can sit and watch while your system builds the software.
40
+
41
+ Notes in compiling Palace using the **spack package manager for Linux**:
42
+ [Installing Palace using spack](https://github.com/VolkerMuehlhaus/gds2palace_ihp_sg13g2/blob/main/doc/building-palace-spack.md)
43
+
44
+ You can use any of the installation methods described on the AWS Palace web site. The gds2palace workflow does not change, it only creates the input files for Palace and does not care how you installed Palace, or on what platform you run the actual Palace simulation from these model files. To start Palace from setupEM, a wrapper script **run_palace** is used, and this is where you point to your actual installation (even remote copy & remote simulation is possible).
45
+
46
+
47
+ # Installation of setupEM (including gds2palace workflow files)
48
+ As a Python program that uses the Qt library, setupEM works on Linux, Windows, MacOS and other platforms. The Palace solver itself is designed for Linux systems, but can you install it using the Windows Subsystem for Linux (WSL). Palace also works well on MacOS, installed using spack.
49
+
50
+ To install setupEM, activate the Python venv where you want to install.
51
+
52
+ Documentation for the gds2palace workflow assumes that you have created a Python venv
53
+ named "palace" in ~/venv/palace and installed the gds2palace module there.
54
+
55
+ If you follow these instructions, you now need to activate that venv and then install setupEM and dependencies via PyPI:
56
+ ```
57
+ source ~/venv/palace/bin/activate
58
+ pip install setupEM
59
+ ```
60
+
61
+ Later, if you want to upgrade to the latest version, you can do
62
+ ```
63
+ pip install setupEM --upgrade
64
+ ```
65
+
66
+
67
+
68
+ ## Missing libraries on installation
69
+ If you see this error message when trying to run setupEM:
70
+
71
+ ```
72
+ qt.qpa.plugin: From 6.5.0, xcb-cursor0 or libxcb-cursor0 is needed to load the Qt xcb platform plugin. qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
73
+ ```
74
+
75
+ you need to install additional Qt libraries:
76
+
77
+ ```
78
+ sudo apt update
79
+ sudo apt install libxcb-cursor0 libxcb-xinerama0 libxcb-xkb1 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-render0 libxcb-shape0 libxcb-shm0 libxcb-sync1 libxcb-xfixes0 libxcb-xinput0 libxcb-xv0 libxcb-util1 libxkbcommon-x11-0
80
+ ```
81
+
82
+ ## Dependencies
83
+ The setupEM module also installs these dependencies:
84
+ - gds2palace
85
+ - gds_prepare_for_EM
86
+ - PySide6
87
+ - shiboken6
88
+ - scipy
89
+ - requests
90
+ - scikit-rf
91
+ - matplotlib
92
+ - numpy
93
+ - gdspy
94
+ - meshio
95
+ - pyvista
96
+ - pyvistaqt
97
+
98
+ ---
99
+
100
+ # Using setupEM for S-Parameter simulation
101
+ To start setupEM, open a terminal window and activate the venv where you installed the setupEM module. Then with the venv activated, you can simply type setupEM to start the module main program.
102
+
103
+ <img src="./doc/png/start.png" alt="start" width="700">
104
+
105
+ The package now includes setupThermal also, which is the equivalent of setupEM for thermal models using gds2palace with the [Elmer](https://www.elmerfem.org/blog/) solver. With the venv activated, you can simply type setupThermal to start the Thermal GUI.
106
+
107
+ AWS Palace is not used/required in thermal workflow, although we use the same gds2palace package.
108
+
109
+
110
+ ## User Interface
111
+
112
+ The user interface of setupEM is organized in multiple tabs, which guide you through the model setup and simulation process. Behind the scenes, the setupEM user interface creates Python model code for gds2palace, and you can check the resulting code on the "Code" tab.
113
+
114
+ Colors in the user interface: In setupEM, **yellow** input fields always require your attention, whereas **white** fields can often be left to default values.
115
+
116
+ ## Input Files
117
+ On this tab, you configure input files:
118
+ - GDSII layout file that provides geometry information and
119
+ - XML file that provides stackup information.
120
+
121
+ The fields for GDSII and XML file support drag & drop or you can use the Browse... buttons.
122
+
123
+ Some pre-processing of the layout is also defined here: You can specify a distance (in micron) which is used for **via array merging**, to speed up simulation by replacing many individual vias with one large via box.
124
+
125
+ <img src="./doc/png/inputfiles1.png" alt="input files" width="700">
126
+
127
+ Using the "Show stackup" button, you can visualize the stackup and see material information. Note that XML files for FEM simulation in Palace
128
+ are different in some details (e.g. MIM) from XML used for the openEMS flow. This is because each stackup is optimized
129
+ for the specific simulation method. Using the openEMS stackup for gds2palace might result in errors durining meshing,
130
+ using the Palace stackup for openEMS might result in slower simulation.
131
+
132
+ <img src="./doc/png/showstackup1.png" alt="stackup" width="750">
133
+
134
+ Dielectric materials are color coded, to easily identify different permittivities. For metal layers, sheet resistance and thickness and distance to other layers is displayed.
135
+
136
+ <img src="./doc/png/showstackup3.png" alt="stackup" width="750">
137
+
138
+ ## Frequencies
139
+ On this tab, you configure the frequency range for simulation. Palace is configured to use an **adaptive frequency sweep**, so that dense sweeps with many points
140
+ are created from a limited number of EM simulations. However, in general, more frequency points will take more simulation time.
141
+
142
+ If you want/need to simulate **specific fixed frequencies**, you can enter them in the "fpoint" field.
143
+
144
+ If you want/need to add specific fixed frequencies and **store the resulting fields to disk for visualization in Paraview**, you can enter them in the "fdump" field instead. All these frequency lists will be combined before simulation.
145
+
146
+ <img src="./doc/png/frequencies1.png" alt="frequencies" width="750">
147
+
148
+ FEM simulation can't simulate at 0 Hz DC, but in setupEM you can specify start frequency 0 and the workflow will handle this behind the scenes: instead of 0 Hz, two low frequency points of 10 MHz and 20 MHz will be simulated, and the data will be extrapolated to 0 Hz in postprocessing.
149
+
150
+ ## Ports
151
+ As explained in the [gds2palace documentation](https://github.com/VolkerMuehlhaus/gds2palace_ihp_sg13g2/blob/main/doc/gds2palace_workflow_userguide.pdf), ports are created by drawing rectangles on special layers to the GDSII file. For in-plane ports these must be rectangles, for via ports it must be lines (box with zero size in x or y direction). In setupEM, you then map the source layer for each of these ports, and define direction and target layer(s). Direction matters for polarity if multiple ports are connected to the same ground.
152
+
153
+ In the upper part of the tab, you make your settings and then need to apply to the port list below.
154
+
155
+ <img src="./doc/png/ports1.png" alt="ports" width="700">
156
+
157
+ Palace does not evaluate the port voltage parameter, but we use it internally to specify if ports are "active" during S-parameter simulation. To get the full S-parameters, all ports must be simulated with non-zero voltage, which means that all ports are excited one after another. If you want to simulate only selected excitations, for faster total simulation time, you can set ports to zero voltage. In that case, you will **not** get full S-parameters data and the missing paths are set to 0 in the output file.
158
+
159
+ <img src="./doc/png/ports2.png" alt="ports" width="700">
160
+
161
+ # Mesh and Boundaries
162
+
163
+ On this tab, you control the mesh used for FEM simulation, which has an effect on simulation time and accuracy. Finer mesh is more accurate, because it can model the actual fields in more detail, but it takes more time to solve.
164
+
165
+ Parameter "Mesh refinement at the edges" does what the name says, this is parameter "refined_cellsize" in gds2palace code. This is the mesh size used along the edges of polygons. If the actual geometry is smaller than this value, local mesh size will result from geometry dimensions, so this value does **not** specify a lower limit for global mesh size (as done in the IHP gds2openEMS flow). In many cases, a value of 2 or 5 microns will give great results for IHP SG13G2 simulation models. For physically small layouts, you might go down to 1µm, but small details will be included anyway, no matter what your setting is.
166
+
167
+ **In the FEM workflow, we model conductors using surface impedance on the side walls, and don't need to mesh into skin effect. This is different from the IHP openEMS workflow (gds2openEMS) where solid conductors are modelled and refined_cellsize is used to (partially) mesh into skin effect! For this gds2palace FEM flow, that is not the case, and we can use much larger mesh cell size.**
168
+
169
+ <img src="./doc/png/mesh1.png" alt="mesh" width="700">
170
+
171
+ Parameter "Mesh cell maximum size absolute" works in combination with the cells/wavelength value, the mesh will use the lower of these two dimensions.
172
+
173
+ Parameter "Mesh basis function" is an expert setting that controls the order of FEM basis function, with three levels: "faster, less accurate" (order 1), "recommended" (order 2, the default), and "slower, most accurate" (order 3, Palace only - not available in Elmer mode, since Elmer has no cubic-order solver). Use the default "recommended" setting unless you specifically want a faster, less accurate run, or need the extra accuracy of order 3.
174
+
175
+ Parameter "Adaptive mesh iterations" does what the name says: Palace offers adaptive mesh refinement (AMR) but if we use mesh basis function order 2 ("recommended") with mesh refinement of 2 micron or so, the initial mesh is usually fine enough and we don't need AMR. Starting from a coarse mesh plus AMR usually takes more simulation time than going for a finer initial mesh without AMR. If you experience something different, your feedback and example is much appreciated! When AMR iterations is non-zero, "AMR goal" (relative error tolerance) and "AMR maximum DOF" control when Palace stops refining, whichever limit is hit first - the defaults rarely need changing.
176
+
177
+ For the boundary conditions, absorbing boundary and pefect electric conductor are supported at the present time. You can specify the oversize of the dielectric layers from the metal drawing, and the additional layer of air that srrounds everything. **Both these distances must NOT be zero, otherwise you will get mesh errors!**
178
+
179
+ # Create model
180
+
181
+ Here, you sepcify the target directory where your Python model code and simulation results are stored. You also need to specify a model name, the default is the name of the GDSII file but you can change this value.
182
+
183
+ The buttons are used top down: You can first preview the resulting model geometry, then create the mesh (and inspect in gmsh viewer if you wish). Close the gmsh window after each step.
184
+
185
+ <img src="./doc/png/createmodel1.png" alt="create" width="700">
186
+
187
+ <img src="./doc/png/createmodel2.png" alt="create" width="700">
188
+
189
+ To start simulation, use the "Run palace" button. If you are on Linux, this will start Palace using script "run_sim". If you are on Windows, this will start the Linux Subsystem for Windows (WSL) and open a command prompt in the simulation directory.
190
+
191
+ If the output directory already has results from a previous run, you are asked whether to delete or keep them before starting - default is to delete, so a rerun with different settings doesn't leave stale results mixed in with the new ones.
192
+
193
+ <img src="./doc/png/createmodel3.png" alt="create" width="700">
194
+
195
+ To start simulation on Linux, it is required that you have configured a script "run_sim" as described in the [gds2palace documentation](https://github.com/VolkerMuehlhaus/gds2palace_ihp_sg13g2/blob/main/doc/gds2palace_workflow_userguide.pdf). You can find a template [here](https://github.com/VolkerMuehlhaus/gds2palace_ihp_sg13g2/tree/main/scripts) in the gds2palace repository.
196
+
197
+ To start simulation on Windows from the WSL terminal, type
198
+ ```
199
+ ./run_sim
200
+ ```
201
+
202
+ To **create Touchstone SnP output** from simulation results, please have a look at the scripts directory. Script "combine_snp" runs Python code "combine_extend_snp.py", which scans your directories (working directory and below) and converts simulation results to Touchstone file format. Supported input file format: Palace and Elmer S-parameter data.
203
+
204
+ ## Result Viewer
205
+
206
+ Once you have Touchstone SnP results, click **View Results...** on the Create Model tab to open the built-in **Result Viewer** - no need to run the standalone `plot_snp.py` script by hand.
207
+
208
+ <img src="./doc/png/resultviewer_button.png" alt="view results button" width="700">
209
+
210
+ The Result Viewer recursively scans the Target Directory for `.sNp` Touchstone files and lists them in a tree, grouped by the folder each file came from. Check individual files to overlay them, or check/uncheck a whole run's group entry to select or deselect every file below it at once.
211
+ The **Include _dc files** / **Include _deembedded files** checkboxes filter out DC-extrapolated and de-embedded variants created by `combine_extend_snp.py`, so you can start with just the raw result and bring in the others only when needed.
212
+
213
+ <img src="./doc/png/resultviewer1.png" alt="result viewer" width="750">
214
+
215
+ Pick which S-parameters to plot from the S-Parameters grid.
216
+ Checking files across several runs, or a whole run group, overlays all of them at once:
217
+
218
+ <img src="./doc/png/resultviewer2.png" alt="result viewer multi-file overlay" width="750">
219
+
220
+ For reflection parameters (S11, S22, ...), the Display panel can switch to a **Smith chart** or a **zoomed Smith chart** instead of dB+phase.
221
+
222
+ <img src="./doc/png/resultviewer3.png" alt="result viewer smith chart" width="750">
223
+
224
+ The matplotlib toolbar above the plot (pan/zoom/save as PNG) works as usual. A file with only a single simulated frequency point is marked with a dot instead of a line, since there is nothing to draw a line between.
225
+
226
+ Result Viewer can also be run standalone, without the full setupEM GUI, either directly (`python result_viewer.py [target_dir]`) or via the `resultViewer` console script installed with the package.
227
+
228
+ ## Model Fit
229
+
230
+ Click **Model Fit...** on the Create Model tab (next to **View Results...**) to extract a lumped-element netlist from the current run's S-parameter result, using [snp2le](https://github.com/iic-jku/snp2le) - an external, open-source tool, not part of setupEM.
231
+
232
+ <img src="./doc/png/resultviewer_button.png" alt="model fit button" width="700">
233
+
234
+ If snp2le isn't installed, setupEM offers to install it for you via pip:
235
+
236
+ <img src="./doc/png/modelfit1.png" alt="snp2le not installed" width="350">
237
+
238
+ Choosing **Install** runs `pip install snp2le` in the Log panel and, once it succeeds, continues automatically - no need to click Model Fit a second time. Choosing **Cancel** logs the manual install command and the project link instead.
239
+
240
+ Once snp2le is available, Model Fit locates the raw (not `_dc`, not `_deembedded`) Touchstone result file for the current run and launches the snp2le GUI in that file's directory. snp2le's GUI has no command-line option to preload a file, so the exact path is printed to the Log panel - load it via snp2le's own file picker:
241
+
242
+ <img src="./doc/png/modelfit2.png" alt="snp2le starting" width="700">
243
+
244
+ If no raw result file exists yet (no simulation has been run), Model Fit shows a warning instead of starting snp2le - run a simulation first.
245
+
246
+ ## 3D Field Viewer
247
+
248
+ Once field-dump results are available (Palace: set `fdump`; Elmer: enable field dump), click **View fields (...)...** on the Create Model tab to open them - the "..." in the label shows which viewer it opens, **Built-in** or **ParaView**, per the setting described below.
249
+
250
+ <img src="./doc/png/fieldviewer1.png" alt="3D field viewer" width="750">
251
+
252
+ The built-in viewer has a single, axis-aligned clip plane (X/Y/Z + a position slider, shown in µm) to see a cross-section through the model, rather than a free-orientation drag-widget - **Find max.** jumps the plane straight to the largest value of the currently selected field along that axis. Standard CAD/ParaView-style **+X/-X/+Y/-Y/+Z/-Z** buttons snap the camera to look straight down each axis; the clip plane's kept side follows whichever of these you last used for its axis, so the exposed cut face always faces the camera instead of occasionally showing the model's untouched exterior surface.
253
+
254
+ The **Field** panel picks which array to color by, defaulting to E-field magnitude (log color scale) for Palace and Elmer-as-EM-solver mode, or temperature (linear) for Elmer thermal - the Min/Max fields let you override the color range manually, with a button to reset back to the data's own range. **Display** controls opacity (to see a hotspot through the surrounding material without losing the outer shape as context) and a mesh-edge overlay. If more than one equally-valid result file exists (e.g. Palace's main "driven" field dump and its separate "driven_boundary" one), a **Result File** picker lets you choose between them instead of guessing.
255
+
256
+ For a vector array (E/B-field, Poynting vector `S`, ...), **Show arrows** overlays direction arrows on top of the color, auto-scaled from the field's own magnitude on a log scale so both weak and strong regions stay visible instead of only the single hottest point - the **Arrow size** slider (0.5% steps) scales them to taste, and also controls how densely they're packed in, since smaller arrows can sit closer together than large ones without turning into a solid block.
257
+
258
+ <img src="./doc/png/fieldviewer2.png" alt="3D field viewer, vector arrows on the Poynting vector S" width="750">
259
+
260
+ Choose which viewer **View fields (...)...** opens - **Built-in** (default, needs nothing else installed) or **ParaView** - on **Preferences > Viewer**. If ParaView is selected but not found on your system, setupEM/setupThermal fall back to the built-in viewer automatically, with a message in the Log panel.
261
+
262
+ <img src="./doc/png/preferences_viewer1.png" alt="3D field viewer preference" width="500">
263
+
264
+ Also runnable standalone, without the full setupEM/setupThermal GUI, either directly (`python field_viewer.py <file_path> [--source palace|elmer_em|elmer_thermal]`) or via the `fieldViewer` console script installed with the package.
265
+
266
+ ## Code
267
+ Behind the scenes, the setupEM user interface created Python model code for gds2palace, and you can check the resulting code on the "Code" tab.
268
+
269
+ <img src="./doc/png/code1.png" alt="code" width="700">
270
+
271
+ ## File menu
272
+ In the setupEM File menu, you can save and load simulation configurations, and you can also save and load a user defined "Default Config" configuration. This includes the choice of simulation target directory and all other settings. Configurations are stored in a JSON file with file extension ".simcfg". The "Default Config" will be stored to the user home diretory.
273
+
274
+ Using "File > Import from *.py model", you can load settings from existing simulation model code, e.g. the examples included in the gds2palace repository. This import is based on detecting known keywords, with or without the settings[] syntax, and also works for openEMS Python models. Note that openEMS substrates model the MIM differently, and parameter "refined_cellsize" will usually be smaller in openEMS simulation, so you need to adjust these settings.
275
+
276
+ If you are on the "Code" tab, you can also export the Python model code using "File > Export to *.py model". This option is only required if you want to save the model code **without** running it. Buttons "Create mesh and model file" and "Run Palace" on the "Create Model" tab will also save the model code to the target directory, and run it from there.
277
+
278
+ "File > Preferences..." lets you change the built-in defaults that a brand-new/blank field starts out showing (e.g. fstart/fstop, mesh refinement, dielectric oversize margin), saved per-user and independent of any project file.
279
+
280
+ <img src="./doc/png/filemenu1.png" alt="file" width="700">
281
+
282
+
283
+ ## Help menu and Version Check
284
+
285
+ In the Help menu, you can find links to relevant documentation pages. Also, there is an item Help > Version Information that gives information on your installed versions of **gds2palace** and **setupEM** and the latest version that are available online.
286
+
287
+ <img src="./doc/png/version1.png" alt="version" width="700">
288
+
289
+
290
+ To upgrade gds2palace and its user interface setupEM to the latest version, do
291
+ ```
292
+ pip install gds2palace --upgrade
293
+ pip install setupEM --upgrade
294
+ ```
295
+
296
+ # KLayout Integration
297
+
298
+ <img src="./doc/png/klayout1.png" alt="klayout" width="700">
299
+
300
+ setupEM can be launched directly from **KLayout** through a helper script that you can download here:
301
+
302
+ https://github.com/VolkerMuehlhaus/setupEM/blob/main/src/scripts/klayout_setupEM.py
303
+
304
+ ## Usage on Linux
305
+
306
+ Download and save `klayout_setupEM.py` somewhere, e.g. `~/scripts`
307
+
308
+ If you then start KLayout using this script, a new menu item is available: Tools > setupEM
309
+
310
+ ```bash
311
+ #!/bin/bash
312
+ /usr/bin/klayout -e -rm ~/scripts/klayout_setupEM.py $1 $2 $3
313
+ ```
314
+
315
+
316
+ ## Desktop Shortcut (Windows)
317
+
318
+ 1. Right-click → **New → Shortcut**
319
+ 2. Set target:
320
+
321
+ ```text
322
+ "<Path to KLayout>\klayout_app.exe" -e -rm "<Path to script>\klayout_setupEM.py"
323
+ ```
324
+
325
+ 3. Name it e.g. **setupEM via KLayout**
326
+
327
+ # License
328
+
329
+ This project is licensed under the GNU General Public License v3.0 or later (GPL-3.0-or-later) - see [LICENSE](./LICENSE) for the full text.
@@ -11,8 +11,26 @@ https://github.com/VolkerMuehlhaus/setupEM
11
11
 
12
12
  ## Recent changes
13
13
 
14
+ # What's New - September 30, 2026
15
+
16
+ The **Adaptive mesh refinement (AMR)** group on the Mesh and Boundaries tab is now called **Solver & Adaptive Mesh Refinement (AMR)** and has a new Palace linear solver setting, shown with **Show advanced configuration** = **Yes**.
17
+
18
+ **Complex coarse solve** (default **Yes** for every model, set in **Preferences > Palace**) lets Palace's direct coarse solver factorize the full complex system instead of only its real part. With **No** (Palace's own default), some models don't converge at some frequencies and get wrong S-parameters there: a D-band line failed at 170 GHz, and an inductor failed at 2.4 GHz with 1.1 nH instead of 2.5 nH, while it converged at 0.1 and 10 GHz. With **Yes** both converged in 1-31 iterations and ran 3.5-6x faster. Models that already converge give identical results in about the same or less time. The cost is peak RAM, depending on the model 1.0-1.6x at order 2 and 1.5-1.9x at order 1; the AMR RAM estimate includes this.
19
+
20
+ **Maximum solver iterations** (400) and **Solver tolerance** (1e-6) can now be changed too, in **Preferences > Palace**. These settings require gds2palace v0.8.0 or later and are hidden with an older version. setupEM module installation now requires gds2palace v0.8.0 or later, which also restores the dielectric loss tangent in Palace models that had been deleted by mistake.
21
+
22
+ **Conformal AMR (experimental)** is a new advanced setting in the **Solver & Adaptive Mesh Refinement (AMR)** group (default **No**, set in **Preferences > Palace**). With AMR iterations > 0, it switches Palace from its default nonconformal (hanging-node) mesh refinement to conformal refinement (gds2palace `settings['adaptive_mesh_conformal']`). In the test cases so far it converged in fewer AMR iterations (D-band balun: 2 iterations instead of 4, in half the time), but the mesh cell count grows faster per iteration.
23
+
24
+ setupEM now warns when Palace's linear solver does **not converge**: Palace carries on and writes S-parameters for that frequency anyway, but they are unreliable. Each case gets a ⚠ warning in the Log panel with its frequency, and all of them are listed again at the end of the run.
25
+
26
+ # What's New - September 29, 2026
27
+
28
+ The built-in **3D field viewer** now shows frequencies instead of bare numbers: the **Cycle** picker of a multi-frequency Palace field dump lists e.g. "6 GHz (cycle 1)", and Palace's extra error-indicator dump is listed as "geometry" right away. For Elmer (EM), each result file in the **Result File** picker shows its frequency, e.g. "fields_t0002.vtu - 7.5 GHz". The cycle number is kept in the label, so it still matches `field_viewer.py --cycle <N>`.
29
+
14
30
  # What's New - September 26, 2026
15
31
 
32
+ **Result Viewer**: new frequency **Marker** that reads out all curves at the same frequency, shown on the plots and in a table below. Set it by clicking a plot, typing a frequency or using the Left/Right arrow keys; right-click a plot to jump to the (next) min/max.
33
+
16
34
  The **AMR maximum DOF** setting now shows an estimate of the RAM that Palace will need at that mesh size, both on the Mesh tab and in Preferences > Palace. The estimate is based on existing Palace results (about 12 GB per million DOF, up to 15 GB). On the Mesh tab, it turns into a warning when the worst case exceeds the **"Stop Palace if memory exceeds"** limit.
17
35
 
18
36
  **Stackup Preview**: three or more layers at the same height (e.g. resistor sheets on top of Activ) are now drawn side by side instead of on top of each other, via labels sit near the upper end of the via, and sheet resistance labels show the correct unit (e.g. RHIGH: Rs=1360 Ω, was shown as 1360000 mΩ).
@@ -12,7 +12,7 @@ authors = [
12
12
  { name = "Volker Muehlhaus", email = "volker@muehlhaus.com" }
13
13
  ]
14
14
  dependencies = [
15
- "gds2palace>=0.7.0",
15
+ "gds2palace>=0.8.0",
16
16
  "gds_prepare_for_EM>=1.2.0",
17
17
  "PySide6",
18
18
  "shiboken6",
@@ -24,4 +24,4 @@ A Python tool for EM setup using gds2palace.
24
24
  from .setupEM import main
25
25
 
26
26
  __all__ = ["main"]
27
- __version__ = "0.10.1"
27
+ __version__ = "0.10.2"