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

[BUG] Error when writing SU2 boundary data #1429

Open
vtpasquale opened this issue Aug 8, 2023 · 0 comments
Open

[BUG] Error when writing SU2 boundary data #1429

vtpasquale opened this issue Aug 8, 2023 · 0 comments

Comments

@vtpasquale
Copy link

Describe the bug
Trying to roundtrip the stock .su2 file fails

To Reproduce
This is the example mesh file: https://su2code.github.io/docs_files/square.su2

Running this code

import meshio
m = meshio.read("square.su2")
m.write("square_rt.su2")`

Results in this error

    File ~/.local/lib/python3.10/site-packages/meshio/su2/_su2.py:340 in write
    for index, (cell_type, data) in enumerate(mesh.cells):

    TypeError: cannot unpack non-iterable CellBlock object

Diagnose
I may ask you to cut and paste the output of the following command.

pip freeze | grep meshio
meshio==5.3.4

To Fix
I replaced line 340 with these three lines:

            for index, cell in enumerate(mesh.cells):
                cell_type = cell.type
                data = cell.data

I'll submit a pull request from my fork.

@vtpasquale vtpasquale changed the title [BUG] [BUG] Error when writing SU2 boundary data Aug 8, 2023
vtpasquale added a commit to vtpasquale/meshio that referenced this issue Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant