matthuszagh / pyems

High-level python interface to OpenEMS with automatic mesh generation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue with gcpw_sma_transition.py example

laberge1 opened this issue · comments

There are at least 2 issues with the gcpw_sma_transition.py example. The first is an incompatible parameter passed to the Microstrip structure. On line 65 of the example, "via_gap" is not a parameter defined. Commenting that line out allows the example to run, but then fails again with a mesh warning. See the output below. Running on Ubuntu 20.04 with Python 3.8.5.

usr/local/lib/python3.8/dist-packages/scipy/optimize/minpack.py:175: RuntimeWarning: The iteration is not making good progress, as measured by the
improvement from the last five Jacobian evaluations.
warnings.warn(msg, RuntimeWarning)
/usr/local/lib/python3.8/dist-packages/scipy/optimize/minpack.py:175: RuntimeWarning: The iteration is not making good progress, as measured by the
improvement from the last ten iterations.
warnings.warn(msg, RuntimeWarning)
/usr/local/lib/python3.8/dist-packages/pyems-0.1.0-py3.8.egg/pyems/mesh.py:219: RuntimeWarning: divide by zero encountered in long_scalars
/usr/local/lib/python3.8/dist-packages/pyems-0.1.0-py3.8.egg/pyems/mesh.py:669: UserWarning: Mesh line at pos 2.8798 for dimension 0 violates smoothness. Smoothness was set to 1.10 but this line creates a spacing with factor 1.13. For convenience the last three lines are: 2.8488, 2.8653 and 2.8798.
/usr/local/lib/python3.8/dist-packages/pyems-0.1.0-py3.8.egg/pyems/mesh.py:669: UserWarning: Mesh line at pos 2.9985 for dimension 0 violates smoothness. Smoothness was set to 1.10 but this line creates a spacing with factor 1.15. For convenience the last three lines are: 2.9672, 2.9817 and 2.9985.
/usr/local/lib/python3.8/dist-packages/pyems-0.1.0-py3.8.egg/pyems/mesh.py:669: UserWarning: Mesh line at pos 4.1464 for dimension 0 violates smoothness. Smoothness was set to 1.10 but this line creates a spacing with factor 1.11. For convenience the last three lines are: 4.0087, 4.0740 and 4.1464.
/usr/local/lib/python3.8/dist-packages/pyems-0.1.0-py3.8.egg/pyems/mesh.py:669: UserWarning: Mesh line at pos 4.7227 for dimension 0 violates smoothness. Smoothness was set to 1.10 but this line creates a spacing with factor 1.13. For convenience the last three lines are: 4.6425, 4.6850 and 4.7227.
/usr/local/lib/python3.8/dist-packages/pyems-0.1.0-py3.8.egg/pyems/mesh.py:669: UserWarning: Mesh line at pos 5.0278 for dimension 0 violates smoothness. Smoothness was set to 1.10 but this line creates a spacing with factor 1.10. For convenience the last three lines are: 4.9486, 4.9863 and 5.0278.
/usr/local/lib/python3.8/dist-packages/pyems-0.1.0-py3.8.egg/pyems/mesh.py:669: UserWarning: Mesh line at pos 5.5726 for dimension 0 violates smoothness. Smoothness was set to 1.10 but this line creates a spacing with factor 2.87. For convenience the last three lines are: 5.3842, 5.4329 and 5.5726.
/usr/local/lib/python3.8/dist-packages/pyems-0.1.0-py3.8.egg/pyems/mesh.py:669: UserWarning: Mesh line at pos 20.2366 for dimension 0 violates smoothness. Smoothness was set to 1.10 but this line creates a spacing with factor 4.21. For convenience the last three lines are: 20.0630, 20.2033 and 20.2366.
/usr/local/lib/python3.8/dist-packages/pyems-0.1.0-py3.8.egg/pyems/mesh.py:669: UserWarning: Mesh line at pos 0.8978 for dimension 1 violates smoothness. Smoothness was set to 1.50 but this line creates a spacing with factor 3.13. For convenience the last three lines are: 0.7155, 0.7596 and 0.8978.
/usr/local/lib/python3.8/dist-packages/pyems-0.1.0-py3.8.egg/pyems/mesh.py:669: UserWarning: Mesh line at pos 2.4183 for dimension 1 violates smoothness. Smoothness was set to 1.50 but this line creates a spacing with factor 7.62. For convenience the last three lines are: 2.2620, 2.4002 and 2.4183.
/usr/local/lib/python3.8/dist-packages/pyems-0.1.0-py3.8.egg/pyems/mesh.py:669: UserWarning: Mesh line at pos -2.1448 for dimension 2 violates smoothness. Smoothness was set to 1.50 but this line creates a spacing with factor 6.69. For convenience the last three lines are: -2.2933, -2.2740 and -2.1448.
/usr/local/lib/python3.8/dist-packages/pyems-0.1.0-py3.8.egg/pyems/mesh.py:669: UserWarning: Mesh line at pos -1.1691 for dimension 2 violates smoothness. Smoothness was set to 1.50 but this line creates a spacing with factor 1.81. For convenience the last three lines are: -1.3696, -1.2404 and -1.1691.
/usr/local/lib/python3.8/dist-packages/pyems-0.1.0-py3.8.egg/pyems/mesh.py:669: UserWarning: Mesh line at pos 1.1786 for dimension 2 violates smoothness. Smoothness was set to 1.50 but this line creates a spacing with factor 6.04. For convenience the last three lines are: 1.0131, 1.0366 and 1.1786.
/usr/local/lib/python3.8/dist-packages/pyems-0.1.0-py3.8.egg/pyems/mesh.py:669: UserWarning: Mesh line at pos 2.5433 for dimension 2 violates smoothness. Smoothness was set to 1.50 but this line creates a spacing with factor 7.77. For convenience the last three lines are: 2.3830, 2.5250 and 2.5433.
Traceback (most recent call last):
File "gcpw_sma_transition.py", line 196, in
mesh = Mesh(
File "/usr/local/lib/python3.8/dist-packages/pyems-0.1.0-py3.8.egg/pyems/mesh.py", line 594, in init
File "/usr/local/lib/python3.8/dist-packages/pyems-0.1.0-py3.8.egg/pyems/mesh.py", line 635, in generate_mesh
File "/usr/local/lib/python3.8/dist-packages/pyems-0.1.0-py3.8.egg/pyems/mesh.py", line 852, in _ensure_pml_structure_uniform
RuntimeError: ymax PML does not contain uniform structure. Offending coordinate is (4.859866322317939, -3.7949790761880777, 5.027818907946389)

Thanks for the issue. This should be fixed as of 88917f4. Feel free to reopen if you encounter any other issues with it!