Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
19fc59d
fix volume names
bigfooted Jul 9, 2023
9ef203f
Merge branch 'develop' into fix_volume_names
bigfooted Jul 12, 2023
59a0f58
Merge branch 'develop' into fix_volume_names
bigfooted Jul 19, 2023
627356e
Merge branch 'develop' into fix_volume_names
bigfooted Jul 25, 2023
6ce0cce
Merge branch 'develop' into fix_volume_names
bigfooted Jul 26, 2023
2a0e7db
Merge branch 'develop' into fix_volume_names
bigfooted Aug 8, 2023
32ac2ea
Merge branch 'develop' into fix_volume_names
bigfooted Aug 18, 2023
3b8bcd5
Merge branch 'develop' into fix_volume_names
bigfooted Aug 21, 2023
4f87d14
Merge branch 'develop' into fix_volume_names
bigfooted Aug 25, 2023
4269a4c
Merge branch 'develop' into fix_volume_names
bigfooted Aug 29, 2023
cdbcb43
Merge branch 'develop' into fix_volume_names
bigfooted Sep 15, 2023
3fa684d
remove other last_of occurrences
bigfooted Sep 21, 2023
92dacb0
Merge branch 'develop' into fix_volume_names
bigfooted Oct 26, 2023
0e729fa
Merge branch 'develop' into fix_volume_names
bigfooted Nov 17, 2023
a251a58
Merge branch 'develop' into fix_volume_names
bigfooted Feb 7, 2024
df9aecb
Merge branch 'develop' into fix_volume_names
bigfooted Feb 15, 2024
cba0317
Merge branch 'develop' into fix_volume_names
bigfooted Feb 27, 2024
f4bf669
Merge branch 'develop' into fix_volume_names
bigfooted Mar 5, 2024
b119bcb
Merge branch 'develop' into fix_volume_names
bigfooted Apr 4, 2024
6632ade
Merge branch 'develop' into fix_volume_names
bigfooted Apr 24, 2024
bde4228
Merge branch 'develop' into fix_volume_names
bigfooted May 14, 2024
5c08794
Merge branch 'develop' into fix_volume_names
bigfooted Jun 4, 2024
a4f031e
Merge branch 'develop' into fix_volume_names
bigfooted Jul 10, 2024
024a0a2
Merge branch 'develop' into fix_volume_names
bigfooted Aug 8, 2024
e351550
remove suffix from vandv
bigfooted Aug 8, 2024
8318ebd
remove suffix from testcases
bigfooted Aug 8, 2024
921d4d6
remove suffix from testcases
bigfooted Aug 8, 2024
92cc9cc
remove suffix from testcases
bigfooted Aug 8, 2024
acb72b3
suffix in subfunctions
bigfooted Aug 9, 2024
2bf51d2
update
bigfooted Feb 19, 2025
4da323c
remove all file extensions
Feb 25, 2025
7113d68
Merge branch 'develop' into fix_volume_names
bigfooted Mar 9, 2025
8ae468a
update config files
bigfooted Mar 9, 2025
2881ccb
update multizone name
bigfooted Mar 9, 2025
8c6a6be
remove su2 from mesh filename
bigfooted May 12, 2025
37a8a2d
update with develop
bigfooted May 18, 2025
9cff074
remove mesh file extension
bigfooted May 19, 2025
27c555d
remove data file extension
bigfooted May 21, 2025
77c71a6
Revert "remove data file extension"
bigfooted May 21, 2025
d3b7b61
Merge branch 'fix_volume_names' of https://github.com/su2code/su2 int…
bigfooted May 21, 2025
e316244
remove data file extension
bigfooted May 24, 2025
4dcf57e
remove data file extension
bigfooted May 24, 2025
6e0dd5b
switch branch for regression
bigfooted May 25, 2025
0c46258
remove extension from adjoint restart files
bigfooted May 26, 2025
9fb569a
remove some more extensions
bigfooted Jun 3, 2025
1b2b471
remove some more extensions
bigfooted Jun 10, 2025
68346ac
fix another extension
bigfooted Jun 12, 2025
1468a9b
fix precommit
bigfooted Jun 12, 2025
973705a
fix
bigfooted Jun 13, 2025
8df7dbe
fix of_grad.dat and of_eval.dat
bigfooted Jun 13, 2025
035e1c5
fix binary restart key
bigfooted Jun 13, 2025
829e0c6
fix FEM prestretch
bigfooted Jun 13, 2025
53b5865
Potential fix for code scanning alert no. 5394: Commented-out code
bigfooted Jun 13, 2025
fbabe33
Potential fix for code scanning alert no. 5403: Commented-out code
bigfooted Jun 13, 2025
e60eb4c
Potential fix for code scanning alert no. 5429: Redundant assignment
bigfooted Jun 13, 2025
078bd4a
Potential fix for code scanning alert no. 5430: Comparison result is …
bigfooted Jun 13, 2025
dfd533a
final fix and cleanup
bigfooted Jun 13, 2025
2fa6e1f
small fix for default_properties
bigfooted Jun 14, 2025
505b824
small fix for default_properties
bigfooted Jun 14, 2025
b3d4008
small fix for default_properties
bigfooted Jun 14, 2025
5c0c771
remove suffix from mesh_out
bigfooted Jun 15, 2025
5677a38
put entire history filename construction into getconv_filename
bigfooted Jun 17, 2025
6560ebb
put entire history filename construction into getconv_filename
bigfooted Jun 17, 2025
b06593c
clang-format
bigfooted Jun 17, 2025
80aee33
type mismatch
bigfooted Jun 17, 2025
36cecee
fix typo
bigfooted Jun 19, 2025
239bd59
move dealing with extensions up to the getfile functions
bigfooted Jun 26, 2025
c11b8a8
precommit
bigfooted Jun 27, 2025
623a74a
remove warning
bigfooted Jun 27, 2025
07d6422
correct some extension
bigfooted Jun 28, 2025
3318807
simplify adding leading zeroes
bigfooted Jun 28, 2025
785edae
merge develop
bigfooted Jun 29, 2025
c603132
update FEA_Filename
bigfooted Jun 29, 2025
a84e5ea
update dynamics filename
bigfooted Jun 29, 2025
ed0df2f
remove unused variables
bigfooted Jun 30, 2025
83895e7
Merge branch 'develop' into fix_volume_names
bigfooted Jul 7, 2025
0afbbf5
remove unused code
bigfooted Aug 19, 2025
4df129b
remove comment
bigfooted Aug 19, 2025
1c3d897
Merge branch 'develop' into fix_volume_names
bigfooted Aug 19, 2025
0483070
remove unused variables
bigfooted Aug 19, 2025
153e682
cleanup
bigfooted Aug 24, 2025
11ea770
temporary switch to develop version of tutorials
bigfooted Aug 24, 2025
9c2b149
add an helper
pcarruscag Aug 26, 2025
8304617
Update Common/include/CConfig.hpp
bigfooted Aug 26, 2025
0da0934
Update Common/src/CConfig.cpp
bigfooted Aug 26, 2025
62c904b
Update Common/include/CConfig.hpp
bigfooted Aug 26, 2025
c8664e7
Merge branch 'develop' into fix_volume_names
bigfooted Aug 26, 2025
b80cbf3
add pragma
bigfooted Aug 26, 2025
d9733c6
add suggestions from review
bigfooted Aug 26, 2025
2522a3d
move reading flow.meta inside restart if-statement
bigfooted Aug 26, 2025
ffd5633
move regression back to develop
bigfooted Aug 26, 2025
ecc5a25
move regression back to develop
bigfooted Aug 26, 2025
24cf84e
Potential fix for code scanning alert no. 5433: Unnecessary pass
bigfooted Aug 26, 2025
69887ee
clang
bigfooted Aug 26, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
153 changes: 132 additions & 21 deletions Common/include/CConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@

#include "option_structure.hpp"
#include "containers/container_decorators.hpp"
#include "toolboxes/printing_toolbox.hpp"

#ifdef HAVE_CGNS
#include "cgnslib.h"
Expand Down Expand Up @@ -358,7 +359,6 @@ class CConfig {
su2double BEM_blade_angle; /*!< \brief Propeller blade angle.*/
string BEM_prop_filename; /*!< \brief Propeller filename.*/
unsigned short ActDiskBem_Frequency; /*!< \brief Frequency of updating actuator disk with BEM. */
bool History_File_Append_Flag; /*!< \brief Flag to append history file.*/
su2double *ActDisk_DeltaPress; /*!< \brief Specified pressure delta for actuator disk. */
su2double *ActDisk_DeltaTemp; /*!< \brief Specified temperature delta for actuator disk. */
su2double *ActDisk_TotalPressRatio; /*!< \brief Specified tot. pres. ratio for actuator disk. */
Expand Down Expand Up @@ -2276,7 +2276,22 @@ class CConfig {
* \brief Get the name of the file with the element properties for structural problems.
* \return Name of the file with the element properties of the structural problem.
*/
string GetFEA_FileName(void) const { return FEA_FileName; }
string GetFEA_FileName(void) const {
string FEAFilename = FEA_FileName;

/*--- strip the extension if it is present, only if it is .dat ---*/
PrintingToolbox::TrimExtension(".dat", FEAFilename);

/*--- If multizone, append zone name ---*/
if (Multizone_Problem)
FEAFilename = GetMultizone_FileName(FEAFilename, GetiZone(), "");

/*--- Add the extension again ---*/
FEAFilename += ".dat";

/*--- return the stripped filename base, without extension. ---*/
return FEAFilename;
}

/*!
* \brief Determine if advanced features are used from the element-based FEA analysis (experimental feature).
Expand Down Expand Up @@ -5021,12 +5036,6 @@ class CConfig {
*/
bool GetInlet_Profile_From_File(void) const { return Inlet_From_File; }

/*!
* \brief Get name of the input file for the specified inlet profile.
* \return Name of the input file for the specified inlet profile.
*/
string GetInlet_FileName(void) const { return Inlet_Filename; }

/*!
* \brief Get name of the input file for the specified actuator disk.
* \return Name of the input file for the specified actuator disk.
Expand Down Expand Up @@ -5549,20 +5558,70 @@ class CConfig {
* \brief Get name of the input grid.
* \return File name of the input grid.
*/
string GetMesh_FileName(void) const { return Mesh_FileName; }
string GetMesh_FileName(void) const {

/*--- we keep the original Mesh_FileName ---*/
string meshFilename = Mesh_FileName;

/*--- strip the extension, only if it is .su2 or .cgns ---*/
auto extIndex = meshFilename.rfind(".su2");
if (extIndex != std::string::npos) meshFilename.resize(extIndex);
extIndex = meshFilename.rfind(".cgns");
if (extIndex != std::string::npos) meshFilename.resize(extIndex);
Comment on lines +5567 to +5570
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the TrimExtension helper so it could be used everywhere you trim extensions


switch (GetMesh_FileFormat()) {
case SU2:
case RECTANGLE:
case BOX:
meshFilename += ".su2";
break;
case CGNS_GRID:
meshFilename += ".cgns";
break;
default:
SU2_MPI::Error("Unrecognized mesh format specified!", CURRENT_FUNCTION);
break;
}

return meshFilename;
}

/*!
* \brief Get name of the output grid, this parameter is important for grid
* adaptation and deformation.
* \return File name of the output grid.
*/
string GetMesh_Out_FileName(void) const { return Mesh_Out_FileName; }
string GetMesh_Out_FileName(void) const {

/*--- we keep the original Mesh_Out_FileName ---*/
string meshFilename = Mesh_Out_FileName;

/*--- strip the extension, only if it is .su2 or .cgns ---*/
auto extIndex = meshFilename.rfind(".su2");
if (extIndex != std::string::npos) meshFilename.resize(extIndex);
extIndex = meshFilename.rfind(".cgns");
if (extIndex != std::string::npos) meshFilename.resize(extIndex);

return meshFilename;
}

/*!
* \brief Get the name of the file with the solution of the flow problem.
* \return Name of the file with the solution of the flow problem.
*/
string GetSolution_FileName(void) const { return Solution_FileName; }
string GetSolution_FileName(void) const {
/*--- we keep the original Solution_FileName ---*/
string solutionFilename = Solution_FileName;

/*--- strip the extension, only if it is .dat or .csv ---*/
auto extIndex = solutionFilename.rfind(".dat");
if (extIndex != std::string::npos) solutionFilename.resize(extIndex);
extIndex = solutionFilename.rfind(".csv");
if (extIndex != std::string::npos) solutionFilename.resize(extIndex);

/*--- return the stripped filename base, without extension. ---*/
return solutionFilename;
}

/*!
* \brief Get the name of the file with the solution of the adjoint flow problem
Expand Down Expand Up @@ -5600,7 +5659,68 @@ class CConfig {
* \brief Get the name of the file with the convergence history of the problem.
* \return Name of the file with convergence history of the problem.
*/
string GetConv_FileName(void) const { return Conv_FileName; }
string GetHistory_FileName(void) const {

/*--- we keep the original Conv_FileName ---*/
string historyFilename = Conv_FileName;

/*--- strip the extension, only if it is .dat or .csv ---*/
auto extIndex = historyFilename.rfind(".dat");
if (extIndex != std::string::npos) historyFilename.resize(extIndex);
extIndex = historyFilename.rfind(".csv");
if (extIndex != std::string::npos) historyFilename.resize(extIndex);

/*--- Multizone problems require the number of the zone to be appended. ---*/
if (GetMultizone_Problem())
historyFilename = GetMultizone_FileName(historyFilename, GetiZone(), "");

/*--- Append the restart iteration ---*/
if (GetTime_Domain() && GetRestart()) {
historyFilename = GetUnsteady_FileName(historyFilename, GetRestart_Iter(), "");
}

/*--- Add the correct file extension depending on the file format ---*/
string hist_ext = ".csv";
if (GetTabular_FileFormat() == TAB_OUTPUT::TAB_TECPLOT) hist_ext = ".dat";

/*--- Append the extension ---*/
historyFilename += hist_ext;

return historyFilename;
}

/*!
* \brief Get name of the input file for the specified inlet profile.
* \return Name of the input file for the specified inlet profile.
*/
string GetInlet_FileName(void) const {

/*--- we keep the original inlet profile filename ---*/
string inletProfileFilename = Inlet_Filename;

/*--- strip the extension, only if it is .dat or .csv ---*/
auto extIndex = inletProfileFilename.rfind(".dat");
if (extIndex != std::string::npos) inletProfileFilename.resize(extIndex);
extIndex = inletProfileFilename.rfind(".csv");
if (extIndex != std::string::npos) inletProfileFilename.resize(extIndex);

/*--- Multizone problems require the number of the zone to be appended. ---*/
if (GetMultizone_Problem())
inletProfileFilename = GetMultizone_FileName(inletProfileFilename, GetiZone(), "");

/*--- Modify file name for an unsteady restart ---*/
if (GetTime_Domain() && GetRestart()) {
inletProfileFilename = GetUnsteady_FileName(inletProfileFilename, GetRestart_Iter(), "");
}
/*--- Add the correct file extension depending on the file format ---*/
string ext = ".dat";

inletProfileFilename += ext;


return inletProfileFilename;
}


/*!
* \brief Get the Starting Iteration for the windowing approach
Expand Down Expand Up @@ -5651,15 +5771,6 @@ class CConfig {
*/
string GetMultizone_FileName(string val_filename, int val_iZone, const string& ext) const;

/*!
* \brief Append the zone index to the restart or the solution files.
* \param[in] val_filename - the base filename.
* \param[in] val_iZone - the zone ID.
* \param[in] ext - the filename extension.
* \return Name of the restart file for the flow variables.
*/
string GetMultizone_HistoryFileName(string val_filename, int val_iZone, const string& ext) const;

/*!
* \brief Append the instance index to the restart or the solution files.
* \param[in] val_filename - the base filename.
Expand Down
14 changes: 14 additions & 0 deletions Common/include/toolboxes/printing_toolbox.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
* License along with SU2. If not, see <http://www.gnu.org/licenses/>.
*/

#pragma once

#include <iostream>
#include <iomanip>
#include <cstdint>
Expand Down Expand Up @@ -287,4 +289,16 @@ inline std::string StringToUpperCase(const std::string& str) {
return upp_str;
}

/*!
* \brief Trim an extension from a name.
* \param[in] - extension we want to remove.
* \param[in,out] - string we want to trim.
*/
inline void TrimExtension(const std::string& ext, std::string& name) {
const auto extIndex = name.rfind(ext);
if (extIndex != std::string::npos && extIndex + ext.size() == name.size()) {
name.resize(extIndex);
}
}

} // namespace PrintingToolbox
Loading
Loading