fix(SU2_CFD,SU2_PY,Common): Fix typos, code style, and safety guards #2660
+16
−16
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.
Proposed Changes
This PR addresses code quality issues across the SU2 codebase:
Typo Fixes (Comment-only)
CEulerSolver.cpp(4 occurrences)Python Code Style (PEP8)
type(x) == listwithisinstance(x, list)ingradients.pyandfunctions.pyC++ Safety Improvements
Add zero-distance guard in
CHeatSolver.cpp(lines 640, 671)/distto/fmax(dist, EPS)to prevent potential division by zeroRemove redundant
1.0*multiplication inCRadP1Solver.cpp(lines 323, 397)C++ Bug Fixes (Common)
Fix float literal in
CSysMatrix.cpp(line 160)(nPointDomain + 1.0)to(nPointDomain + 1)for GPU array allocationRemove redundant
1.0*inwall_model.cpp(line 374)Related Work
No related issues. This is a cleanup PR to improve code quality and robustness.
PR Checklist
Impact