@@ -4932,11 +4932,7 @@ class CConfig {
49324932 */
49334933 bool GetInlet_Profile_From_File (void ) const { return Inlet_From_File; }
49344934
4935- /* !
4936- * \brief Get name of the input file for the specified inlet profile.
4937- * \return Name of the input file for the specified inlet profile.
4938- */
4939- string GetInlet_FileName (void ) const { return Inlet_Filename; }
4935+
49404936
49414937 /* !
49424938 * \brief Get name of the input file for the specified actuator disk.
@@ -5382,19 +5378,19 @@ class CConfig {
53825378 bool GetWrt_Volume_Overwrite (void ) const { return Wrt_Volume_Overwrite; }
53835379
53845380 /* !
5385- * \brief Provides the number of varaibles .
5381+ * \brief Provides the number of variables .
53865382 * \return Number of variables.
53875383 */
53885384 unsigned short GetnVar (void );
53895385
53905386 /* !
5391- * \brief Provides the number of varaibles .
5387+ * \brief Provides the number of variables .
53925388 * \return Number of variables.
53935389 */
53945390 unsigned short GetnZone (void ) const { return nZone; }
53955391
53965392 /* !
5397- * \brief Provides the number of varaibles .
5393+ * \brief Provides the number of variables .
53985394 * \return Number of variables.
53995395 */
54005396 unsigned short GetiZone (void ) const { return iZone; }
@@ -5454,20 +5450,83 @@ class CConfig {
54545450 * \brief Get name of the input grid.
54555451 * \return File name of the input grid.
54565452 */
5457- string GetMesh_FileName (void ) const { return Mesh_FileName; }
5453+ string GetMesh_FileName (void ) const {
5454+
5455+ /* --- we keep the original Mesh_FileName ---*/
5456+ string meshFilename = Mesh_FileName;
5457+
5458+ /* --- strip the extension, only if it is .su2 or .cgns ---*/
5459+ auto extIndex = meshFilename.rfind (" .su2" );
5460+ if (extIndex != std::string::npos) meshFilename.resize (extIndex);
5461+ extIndex = meshFilename.rfind (" .cgns" );
5462+ if (extIndex != std::string::npos) meshFilename.resize (extIndex);
5463+
5464+ cout << " mesh file format = " << GetMesh_FileFormat () << " , file = " << meshFilename<< endl;
5465+
5466+ switch (GetMesh_FileFormat ()) {
5467+ case SU2:
5468+ case RECTANGLE:
5469+ case BOX:
5470+ meshFilename += " .su2" ;
5471+ break ;
5472+ case CGNS_GRID:
5473+ meshFilename += " .cgns" ;
5474+ break ;
5475+ default :
5476+ SU2_MPI::Error (" Unrecognized mesh format specified!" , CURRENT_FUNCTION);
5477+ break ;
5478+ }
5479+
5480+ return meshFilename;
5481+ }
54585482
54595483 /* !
54605484 * \brief Get name of the output grid, this parameter is important for grid
54615485 * adaptation and deformation.
54625486 * \return File name of the output grid.
54635487 */
5464- string GetMesh_Out_FileName (void ) const { return Mesh_Out_FileName; }
5488+ string GetMesh_Out_FileName (void ) const {
5489+
5490+ /* --- we keep the original Mesh_Out_FileName ---*/
5491+ string meshFilename = Mesh_Out_FileName;
5492+
5493+ /* --- strip the extension, only if it is .su2 or .cgns ---*/
5494+ auto extIndex = meshFilename.rfind (" .su2" );
5495+ if (extIndex != std::string::npos) meshFilename.resize (extIndex);
5496+ extIndex = meshFilename.rfind (" .cgns" );
5497+ if (extIndex != std::string::npos) meshFilename.resize (extIndex);
5498+
5499+ // switch (Mesh_FileFormat) {
5500+ // case SU2:
5501+ // meshFilename += ".su2";
5502+ // case CGNS_GRID:
5503+ // meshFilename += ".cgns";
5504+ // default:
5505+ // SU2_MPI::Error("Unrecognized mesh format specified!", CURRENT_FUNCTION);
5506+ // break;
5507+ // }
5508+
5509+ return meshFilename;
5510+ }
54655511
54665512 /* !
54675513 * \brief Get the name of the file with the solution of the flow problem.
54685514 * \return Name of the file with the solution of the flow problem.
54695515 */
5470- string GetSolution_FileName (void ) const { return Solution_FileName; }
5516+ string GetSolution_FileName (void ) const {
5517+
5518+ /* --- we keep the original Solution_FileName ---*/
5519+ string solutionFilename = Solution_FileName;
5520+
5521+ /* --- strip the extension, only if it is .dat or .csv ---*/
5522+ auto extIndex = solutionFilename.rfind (" .dat" );
5523+ if (extIndex != std::string::npos) solutionFilename.resize (extIndex);
5524+ extIndex = solutionFilename.rfind (" .csv" );
5525+ if (extIndex != std::string::npos) solutionFilename.resize (extIndex);
5526+
5527+ /* --- return the stripped filename base, without extension. ---*/
5528+ return solutionFilename;
5529+ }
54715530
54725531 /* !
54735532 * \brief Get the name of the file with the solution of the adjoint flow problem
@@ -5505,7 +5564,7 @@ class CConfig {
55055564 * \brief Get the name of the file with the convergence history of the problem.
55065565 * \return Name of the file with convergence history of the problem.
55075566 */
5508- string GetConv_FileName (void ) const {
5567+ string GetHistory_FileName (void ) const {
55095568
55105569 /* --- we keep the original Conv_FileName ---*/
55115570 string historyFilename = Conv_FileName;
@@ -5516,8 +5575,9 @@ class CConfig {
55165575 extIndex = historyFilename.rfind (" .csv" );
55175576 if (extIndex != std::string::npos) historyFilename.resize (extIndex);
55185577
5519- /* --- Append the zone ID ---*/
5520- historyFilename = GetMultizone_FileName (historyFilename, GetiZone (), " " );
5578+ /* --- Multizone problems require the number of the zone to be appended. ---*/
5579+ if (GetMultizone_Problem ())
5580+ historyFilename = GetMultizone_FileName (historyFilename, GetiZone (), " " );
55215581
55225582 /* --- Append the restart iteration ---*/
55235583 if (GetTime_Domain () && GetRestart ()) {
@@ -5534,6 +5594,39 @@ class CConfig {
55345594 return historyFilename;
55355595 }
55365596
5597+ /* !
5598+ * \brief Get name of the input file for the specified inlet profile.
5599+ * \return Name of the input file for the specified inlet profile.
5600+ */
5601+ string GetInlet_FileName (void ) const {
5602+
5603+ /* --- we keep the original inlet profile filename ---*/
5604+ string inletProfileFilename = Inlet_Filename;
5605+
5606+ /* --- strip the extension, only if it is .dat or .csv ---*/
5607+ auto extIndex = inletProfileFilename.rfind (" .dat" );
5608+ if (extIndex != std::string::npos) inletProfileFilename.resize (extIndex);
5609+ extIndex = inletProfileFilename.rfind (" .csv" );
5610+ if (extIndex != std::string::npos) inletProfileFilename.resize (extIndex);
5611+
5612+ /* --- Multizone problems require the number of the zone to be appended. ---*/
5613+ if (GetMultizone_Problem ())
5614+ inletProfileFilename = GetMultizone_FileName (inletProfileFilename, GetiZone (), " " );
5615+
5616+ /* --- Modify file name for an unsteady restart ---*/
5617+ if (GetTime_Domain () && GetRestart ()) {
5618+ inletProfileFilename = GetUnsteady_FileName (inletProfileFilename, GetRestart_Iter (), " " );
5619+ }
5620+ /* --- Add the correct file extension depending on the file format ---*/
5621+ string ext = " .dat" ;
5622+
5623+ inletProfileFilename += ext;
5624+
5625+
5626+ return inletProfileFilename;
5627+ }
5628+
5629+
55375630 /* !
55385631 * \brief Get the Starting Iteration for the windowing approach
55395632 * in Sensitivity Analysis for period-averaged outputs, which oscillate.
0 commit comments