Metadata-Version: 2.4
Name: gds2palace
Version: 0.8.0
Summary: Create AWS Palace model from RFIC GDSII layout file
Author-email: Volker Muehlhaus <volker@muehlhaus.com>
License-Expression: GPL-3.0-or-later
Project-URL: Homepage, https://github.com/VolkerMuehlhaus/gds2palace_ihp_sg13g2
Project-URL: Repository, https://github.com/VolkerMuehlhaus/gds2palace_ihp_sg13g2
Project-URL: Changelog, https://github.com/VolkerMuehlhaus/gds2palace_ihp_sg13g2/blob/main/doc/CHANGES.md
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: gdspy>1.6.0
Requires-Dist: gmsh
Requires-Dist: numpy
Requires-Dist: shapely>=2.0
Dynamic: license-file

# Create AWS Palace FEM Models from GDSII layout files

![Intro](https://raw.githubusercontent.com/VolkerMuehlhaus/gds2palace_ihp_sg13g2/main/doc/png/gds2palace_ihp_800.png)

The files provided here enable RFIC FEM simulation using AWS Palace from GDSII layouts created in [IHP SG13G2](https://github.com/IHP-GmbH/IHP-Open-PDK) RFIC technology. 

Palace, is an open-source, parallel finite element code for full-wave 3D electromagnetic simulations. It can be scaled from single computer to large high performance simulation clusters and cloud-based computing.  
https://awslabs.github.io/palace/stable/  

In addition to AWS Palace, gds2palace can also generate models for [Elmer FEM](https://www.elmerfem.org/), as an additional workflow option for EM (S-parameter) simulation as well as steady-state thermal simulation. See [CHANGES.md](https://raw.githubusercontent.com/VolkerMuehlhaus/gds2palace_ihp_sg13g2/main/doc/CHANGES.md) for this and other recent additions.

The gds2palace workflow in this repository is pre-configured for GDSII layout files in the [IHP SG13G2 Open PDK.](https://github.com/IHP-GmbH/IHP-Open-PDK)
Special thanks to IHP and the public funded German project FMD-QNC (16ME0831) https://www.elektronikforschung.de/projekte/fmd-qnc for financial support, which has contributed to this work.

## Install

    pip install gds2palace

**Full documentation, installation guide, and usage walkthrough:**
https://github.com/VolkerMuehlhaus/gds2palace_ihp_sg13g2

## Recent changes

## 0.8.0 (30 September 2026)
`settings['complex_coarse_solve']` is a new option, **enabled by default**: Palace's sparse direct coarse solver factorizes the full complex system instead of only its real part. Before, some models did not converge at some frequencies and got wrong S-parameters there, without an obvious error (for example a D-band line at 170 GHz, and an inductor at 2.4 GHz with 1.1 nH instead of 2.5 nH). With the new default these models converge, and many models simulate faster. Models that already converged give the same results. The cost is more peak RAM: 1.0-1.6x at order 2 and 1.5-1.9x at order 1. Set it to `False` only if a model doesn't fit into memory, and then check the Palace output for `did NOT converge`.

`settings['solver_maxits']` (default 400) and `settings['solver_tol']` (default 1e-6) set the Palace linear solver's iteration limit and tolerance.

**Bugfix:** the dielectric loss tangent (`DielectricLossTangent` in the XML stackup) was not written to the Palace model since v0.4.1, so all dielectrics were simulated as lossless. The IHP SG13G2 stackups use lossless dielectrics and are not affected; lossy PCB substrates (e.g. RO4003, RO4350B) are. Elmer model generation also works again with Python versions before 3.12.

## 0.7.0 (25-26 September 2026)
`settings['fill_factor_correction']` is a new option for improved accuracy when using via array merging (`merge_polygon_size > 0`). Merging fills the gaps between vias with via material, so the merged via block has a larger cross section and lower resistance than the real via array. With this option, each merged via polygon's conductivity is multiplied by its fill factor (original via area / merged polygon area). It applies to Palace and to Elmer (EM and thermal) and is not active by default.

**API change:** `gds_polygon.is_via` and the `is_via` parameter of `all_polygons_list.add_rectangle()`/`add_polygon()` were removed: they were never set when reading GDSII and never used. Scripts that pass `is_via=` to these functions need to drop that argument.

## 0.6.0 (22-23 September 2026)
`settings['filled_metals']` is a new option for Palace: volume meshing inside conductors instead of a surface impedance on the conductor surfaces. This gives more accurate conductor loss at low frequency, where the skin depth is no longer small compared to the conductor cross section. It is not the recommended default, because it needs more RAM and simulation time.

`settings['adaptive_mesh_conformal']` is a new experimental option (default `False`) for conformal instead of non-conformal (hanging node) adaptive mesh refinement.

`combine_extend_snp.py` now handles an interrupted Palace run (e.g. stopped by a memory limit): missing S-parameters are written as `0.0 dB / 0 deg` with a warning, instead of crashing or writing invalid Touchstone data.

Full history: [CHANGES.md](https://github.com/VolkerMuehlhaus/gds2palace_ihp_sg13g2/blob/main/doc/CHANGES.md)

---

**Note:** the `gds2palace` PyPI package itself only requires:

- gdspy>1.6.0
- gmsh
- numpy
- shapely>=2.0

(Other Python modules mentioned above are only needed to run the example/model scripts in this repository, not to use the installed package.)
