Skip to content

Commit 32dcd85

Browse files
Apply suggestions from code review
Co-authored-by: Kürşat Yurt <57598663+kursatyurt@users.noreply.github.com>
1 parent 99fece9 commit 32dcd85

3 files changed

Lines changed: 9 additions & 13 deletions

File tree

SU2_CFD/include/drivers/CDriver.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,7 @@ class CDriver : public CDriverBase {
535535
* \param[in] rot_z - Value of Angular velocity about z-axes.
536536
*/
537537
void SetRotationRate(passivedouble rot_x, passivedouble rot_y, passivedouble rot_z);
538+
538539
/*!
539540
* \brief Set the moving wall marker rotation rates.
540541
* \param[in] iMaker - Index of moving wall marker.

SU2_CFD/src/python_wrapper_structure.cpp

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -168,18 +168,14 @@ void CDriver::SetRotationRate(passivedouble rot_x, passivedouble rot_y, passived
168168
}
169169

170170
void CDriver::SetMarkerRotationRate(unsigned short iMarker, passivedouble rot_x, passivedouble rot_y, passivedouble rot_z) {
171-
for (iZone = 0; iZone < nZone; iZone++) {
172-
config_container[iZone]->SetMarkerRotationRate(iMarker, 0, rot_x);
173-
config_container[iZone]->SetMarkerRotationRate(iMarker, 1, rot_y);
174-
config_container[iZone]->SetMarkerRotationRate(iMarker, 2, rot_z);
175-
}
171+
config_container[selected_zone]->SetMarkerRotationRate(iMarker, 0, rot_x);
172+
config_container[selected_zone]->SetMarkerRotationRate(iMarker, 1, rot_y);
173+
config_container[selected_zone]->SetMarkerRotationRate(iMarker, 2, rot_z);
176174
}
177175

178176
void CDriver::SetMarkerTranslationRate(unsigned short iMarker, passivedouble vel_x, passivedouble vel_y, passivedouble vel_z) {
179-
for (iZone = 0; iZone < nZone; iZone++) {
180-
config_container[iZone]->SetMarkerTranslationRate(iMarker, 0, vel_x);
181-
config_container[iZone]->SetMarkerTranslationRate(iMarker, 1, vel_y);
182-
config_container[iZone]->SetMarkerTranslationRate(iMarker, 2, vel_z);
183-
}
177+
config_container[selected_zone]->SetMarkerTranslationRate(iMarker, 0, vel_x);
178+
config_container[selected_zone]->SetMarkerTranslationRate(iMarker, 1, vel_y);
179+
config_container[selected_zone]->SetMarkerTranslationRate(iMarker, 2, vel_z);
184180
}
185181

TestCases/py_wrapper/rotating_cylinder/run.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@
1313

1414
SU2Driver = pysu2.CSinglezoneDriver("spinning_cylinder.cfg",1, comm)
1515

16-
for i in range(n_of_steps):
17-
18-
SU2Driver.SetMarkerRotationRate(0,0,0,rotation_vector[n_of_steps-i-1])
16+
for i, rate in enumerate(rotation_vector):
17+
SU2Driver.SetMarkerRotationRate(0,0,0,rate)
1918
SU2Driver.Preprocess(i)
2019
SU2Driver.Run()
2120
SU2Driver.Postprocess()

0 commit comments

Comments
 (0)