Repository navigation
Fix STATION function names in SU2_PY: SU2_GEO numbers stations from 1 - #2934
Closed
nikita-ageev wants to merge 5 commits into
Closed
nikita-ageev wants to merge 5 commits into
nikita-ageev wants to merge 5 commits into
Conversation
SU2_GEO writes STATION1_* ... STATIONn_* for the stations in GEO_LOCATION_STATIONS, while optnames_geo listed STATION0_* ... STATION19_*. STATION20_* was therefore rejected by SU2.eval.func/grad as an unknown function name, and STATION0_* is never written.
bigfooted
approved these changes
Oct 8, 2026
joshkellyjak
requested changes
Oct 9, 2026
| # see SU2_GEO.cpp, so the names cover stations 1 to 20. | ||
| PerStation = [] | ||
| for i in range(20): | ||
| for i in range(1, 21): |
Contributor
There was a problem hiding this comment.
Why a 20-cap? Can we remove the cap in SU2_PY?
Address review comment: instead of listing STATION1_* ... STATION20_*, match the per-station names with a regex (is_optname_geo), since SU2_GEO does not limit the number of GEO_LOCATION_STATIONS.
bigfooted
added a commit
that referenced
this pull request
Oct 10, 2026
…spaces) (#2935) ## Proposed Changes `SU2_PY/SU2/run/interface.py` builds the command as `os.path.join(SU2_RUN, "SU2_CFD") + " config_CFD.cfg"` and runs it with `shell=True`. The executable path is quoted only on Windows (`quote = '"' if sys.platform == "win32" else ""`), so on Linux/macOS any SU2_PY script (shape_optimization.py, parallel_computation.py, ...) fails if `SU2_RUN` contains a space. This PR moves the quoting into `build_command`: the first word of the command is joined with `SU2_RUN` and quoted (`shlex.quote` on POSIX, double quotes on Windows as before), the callers pass plain `"SU2_CFD config_CFD.cfg"` strings. The quoted path is then inserted into the MPI template as before (`mpirun -n %i %s`, `srun`, `SU2_MPI_COMMAND`). The module-level `quote` variable is removed; it was not used outside `interface.py`. Reproduction on macOS, `SU2_RUN=".../su2 bin"`, `shape_opt_euler_py` from serial_regression.py: ``` before: Command = /.../su2 bin/SU2_CFD config_CFD.cfg SU2 process returned error '127' /bin/sh: /.../su2: No such file or directory after: Command = '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/.../su2 bin/SU2_CFD' config_CFD.cfg optimization runs to the end ``` With the change and `SU2_RUN` containing a space, `history_project.csv` and the optimizer output of `shape_opt_euler_py` are identical to develop with a `SU2_RUN` without spaces. The MPI path was checked with `NUMBER_PART=2`: `mpirun -n 2 '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/.../su2 bin/SU2_CFD' config_CFD.cfg` runs with 2 ranks. The Windows branch produces the same string as before. ## Related Work None found. Separate from #2934 (also SU2_PY). ## PR Checklist - [X] I am submitting my contribution to the develop branch. - [X] My contribution generates no new compiler warnings (try with --warnlevel=3 when using meson). - [X] My contribution is commented and consistent with SU2 style (https://su2code.github.io/docs_v7/Style-Guide/). - [X] I used the pre-commit hook to prevent dirty commits and used `pre-commit run --all` to format old commits. - [X] I have added a test case that demonstrates my contribution, if necessary. — Not necessary: the change only affects how the executable path is quoted; `shape_opt_euler_py` passes unchanged, and the reproduction above (SU2_RUN with a space) fails before and passes after. - [X] I have updated appropriate documentation (Tutorials, Docs Page, config_template.cpp), if necessary. — Not necessary: no user-facing option changed. Co-authored-by: Nijso <bigfootedrockmidget@hotmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Small fix, see the diff.