Skip to content

Commit b83b4bb

Browse files
authored
Apply suggestions from code review
1 parent fdc15e0 commit b83b4bb

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

SU2_CFD/include/drivers/CDriverBase.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class CDriverBase {
5454
UsedTime; /*!< \brief Elapsed time between Start and Stop point of the timer. */
5555

5656
unsigned long TimeIter;
57-
unsigned long selected_iZone = ZONE_0; /*!< \brief Selected zone for the driver. Defaults to ZONE_0 */
57+
unsigned short selected_iZone = ZONE_0; /*!< \brief Selected zone for the driver. Defaults to ZONE_0 */
5858
unsigned short iMesh, /*!< \brief Iterator on mesh levels. */
5959
iZone, /*!< \brief Iterator on zones. */
6060
nZone, /*!< \brief Total number of zones in the problem. */
@@ -530,12 +530,12 @@ class CDriverBase {
530530
main_geometry->SetCustomBoundaryHeatFlux(iMarker, iVertex, WallHeatFlux);
531531
}
532532

533-
534533
/*!
535534
* \brief Selects zone to be used for Driver operation
536535
* \param[in] iZone - Zone identifier.
537536
*/
538-
inline void SelectZone(unsigned long iZone) {
537+
inline void SelectZone(unsigned short iZone) {
538+
if (iZone >= nZone) SU2_MPI::Error("Zone index out of range", CURRENT_FUNCTION);
539539
selected_iZone = iZone;
540540
main_geometry = geometry_container[selected_iZone][INST_0][MESH_0];
541541
main_config = config_container[selected_iZone];

0 commit comments

Comments
 (0)