@@ -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-
57+ unsigned long 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. */
@@ -227,7 +227,7 @@ class CDriverBase {
227227 SU2_MPI::Error (" Initial coordinates are only available with DEFORM_MESH= YES" , CURRENT_FUNCTION);
228228 }
229229 auto * coords =
230- const_cast <su2activematrix*>(solver_container[ZONE_0 ][INST_0][MESH_0][MESH_SOL]->GetNodes ()->GetMesh_Coord ());
230+ const_cast <su2activematrix*>(solver_container[selected_iZone ][INST_0][MESH_0][MESH_SOL]->GetNodes ()->GetMesh_Coord ());
231231 return CPyWrapperMatrixView (*coords, " InitialCoordinates" , true );
232232 }
233233
@@ -241,7 +241,7 @@ class CDriverBase {
241241 if (iMarker >= GetNumberMarkers ()) SU2_MPI::Error (" Marker index exceeds size." , CURRENT_FUNCTION);
242242
243243 auto * coords =
244- const_cast <su2activematrix*>(solver_container[ZONE_0 ][INST_0][MESH_0][MESH_SOL]->GetNodes ()->GetMesh_Coord ());
244+ const_cast <su2activematrix*>(solver_container[selected_iZone ][INST_0][MESH_0][MESH_SOL]->GetNodes ()->GetMesh_Coord ());
245245 return CPyWrapperMarkerMatrixView (*coords, main_geometry->vertex [iMarker], main_geometry->GetnVertex (iMarker),
246246 " MarkerInitialCoordinates" , true );
247247 }
@@ -530,6 +530,17 @@ class CDriverBase {
530530 main_geometry->SetCustomBoundaryHeatFlux (iMarker, iVertex, WallHeatFlux);
531531 }
532532
533+
534+ /* !
535+ * \brief Selects zone to be used for Driver operation
536+ * \param[in] iZone - Zone identifier.
537+ */
538+ inline void SelectZone (unsigned long iZone) {
539+ selected_iZone = iZone;
540+ main_geometry = geometry_container[selected_iZone][INST_0][MESH_0];
541+ main_config = config_container[selected_iZone];
542+ }
543+
533544 /* !
534545 * \brief Get the wall normal heat flux at a vertex on a specified marker of the flow or heat solver.
535546 * \note This can be the output of a heat or flow solver in a CHT setting.
@@ -677,7 +688,7 @@ class CDriverBase {
677688 if (iMarker < std::numeric_limits<unsigned short >::max () && iMarker > GetNumberMarkers ()) {
678689 SU2_MPI::Error (" Marker index exceeds size." , CURRENT_FUNCTION);
679690 }
680- auto * solver = solver_container[ZONE_0 ][INST_0][MESH_0][iSolver];
691+ auto * solver = solver_container[selected_iZone ][INST_0][MESH_0][iSolver];
681692 if (solver == nullptr ) SU2_MPI::Error (" The selected solver does not exist." , CURRENT_FUNCTION);
682693 return solver;
683694 }
0 commit comments