Skip to content

Commit 7331adb

Browse files
authored
Apply suggestions from code review
1 parent 5d90c34 commit 7331adb

4 files changed

Lines changed: 24 additions & 19 deletions

File tree

Common/include/CConfig.hpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5943,9 +5943,10 @@ class CConfig {
59435943
* \brief Set the translation rate of the marker.
59445944
* \param[in] iDim - spatial component
59455945
* \param[in] val - translational velocity
5946-
* \return Translational velocity of the mesh.
59475946
*/
5948-
void SetMarkerTranslation_Rate(unsigned short iMarkerMoving, unsigned short iDim, su2double val) const { MarkerTranslation_Rate[3*iMarkerMoving + iDim] = val;}
5947+
void SetMarkerTranslationRate(unsigned short iMarkerMoving, unsigned short iDim, su2double val) {
5948+
MarkerTranslation_Rate[3 * iMarkerMoving + iDim] = val;
5949+
}
59495950

59505951
/*!
59515952
* \brief Get the rotation rate of the mesh.
@@ -5969,14 +5970,16 @@ class CConfig {
59695970
* \return Rotation velocity of the marker.
59705971
*/
59715972
su2double GetMarkerRotationRate(unsigned short iMarkerMoving, unsigned short iDim) const { return MarkerRotation_Rate[3*iMarkerMoving + iDim];}
5973+
59725974
/*!
59735975
* \brief Set the rotation rate of the marker.
5974-
* \param[in] iMarkerMoving - Index of the moving marker (as specified in Marker_Moving)
5976+
* \param[in] iMarkerMoving - Index of the moving marker (as specified in Marker_Moving)
59755977
* \param[in] iDim - spatial component
59765978
* \param[in] val - Rotational velocity
5977-
59785979
*/
5979-
void SetMarkerRotation_Rate(unsigned short iMarkerMoving, unsigned short iDim, su2double val) const { MarkerRotation_Rate[3*iMarkerMoving + iDim] = val;}
5980+
void SetMarkerRotation_Rate(unsigned short iMarkerMoving, unsigned short iDim, su2double val) {
5981+
MarkerRotation_Rate[3 * iMarkerMoving + iDim] = val;
5982+
}
59805983

59815984
/*!
59825985
* \brief Get the pitching rate of the mesh.

SU2_CFD/include/drivers/CDriver.hpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -542,15 +542,16 @@ class CDriver : public CDriverBase {
542542
* \param[in] rot_y - Value of Angular velocity about y-axes.
543543
* \param[in] rot_z - Value of Angular velocity about z-axes.
544544
*/
545-
void SetMarkerRotationRate(short int iMarker, passivedouble rot_x, passivedouble rot_y, passivedouble rot_z);
546-
/*!
547-
* \brief Set the moving wall marker rotation rates.
545+
void SetMarkerRotationRate(unsigned short iMarker, passivedouble rot_x, passivedouble rot_y, passivedouble rot_z);
546+
547+
/*!
548+
* \brief Set the moving wall marker translation rates.
548549
* \param[in] iMaker - Index of moving wall marker.
549-
* \param[in] vel_x - Value of velocity about x-axes.
550-
* \param[in] vel_y - Value of velocity about y-axes.
551-
* \param[in] vel_z - Value of velocity about z-axes.
550+
* \param[in] vel_x - Value of velocity along x-axis.
551+
* \param[in] vel_y - Value of velocity along y-axis.
552+
* \param[in] vel_z - Value of velocity along z-axis.
552553
*/
553-
void SetMarkerTranslationRate(short int iMarker, passivedouble vel_x, passivedouble vel_y, passivedouble vel_z);
554+
void SetMarkerTranslationRate(unsigned short iMarker, passivedouble vel_x, passivedouble vel_y, passivedouble vel_z);
554555

555556
/// \}
556557
};

SU2_CFD/src/iteration/CIteration.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,6 @@ void CIteration::SetGrid_Movement(CGeometry** geometry, CSurfaceMovement* surfac
8888
}
8989

9090
break;
91-
92-
9391
}
9492

9593
if (config->GetSurface_Movement(AEROELASTIC) || config->GetSurface_Movement(AEROELASTIC_RIGID_MOTION) || config->GetSurface_Movement(MOVING_WALL)) {
@@ -114,9 +112,10 @@ void CIteration::SetGrid_Movement(CGeometry** geometry, CSurfaceMovement* surfac
114112

115113
grid_movement->UpdateMultiGrid(geometry, config);
116114
}
117-
if(config->GetSurface_Movement(MOVING_WALL)){
118-
geometry[MESH_0]->SetWallVelocity(config, true);
119-
115+
if (config->GetSurface_Movement(MOVING_WALL)) {
116+
for (auto iMGlevel = 0u; iMGlevel <= config->GetnMGLevels(); iMGlevel++) {
117+
geometry[iMGlevel]->SetWallVelocity(config, iMGlevel == 0u);
118+
}
120119
}
121120

122121
}

SU2_CFD/src/python_wrapper_structure.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,14 +166,16 @@ void CDriver::SetRotationRate(passivedouble rot_x, passivedouble rot_y, passived
166166
config_container[iZone]->SetRotation_Rate(2, rot_z);
167167
}
168168
}
169-
void CDriver::SetMarkerRotationRate(short int iMarker, passivedouble rot_x, passivedouble rot_y, passivedouble rot_z){
169+
170+
void CDriver::SetMarkerRotationRate(unsigned short iMarker, passivedouble rot_x, passivedouble rot_y, passivedouble rot_z) {
170171
for (iZone = 0; iZone < nZone; iZone++) {
171172
config_container[iZone]->SetMarkerRotation_Rate(iMarker, 0, rot_x);
172173
config_container[iZone]->SetMarkerRotation_Rate(iMarker, 1, rot_y);
173174
config_container[iZone]->SetMarkerRotation_Rate(iMarker, 2, rot_z);
174175
}
175176
}
176-
void CDriver::SetMarkerTranslationRate(short int iMarker, passivedouble vel_x, passivedouble vel_y, passivedouble vel_z){
177+
178+
void CDriver::SetMarkerTranslationRate(unsigned short iMarker, passivedouble vel_x, passivedouble vel_y, passivedouble vel_z) {
177179
for (iZone = 0; iZone < nZone; iZone++) {
178180
config_container[iZone]->SetMarkerTranslation_Rate(iMarker, 0, vel_x);
179181
config_container[iZone]->SetMarkerTranslation_Rate(iMarker, 1, vel_y);

0 commit comments

Comments
 (0)