-
Notifications
You must be signed in to change notification settings - Fork 974
Fix volume names #2079
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Fix volume names #2079
Changes from all commits
Commits
Show all changes
94 commits
Select commit
Hold shift + click to select a range
19fc59d
fix volume names
bigfooted 9ef203f
Merge branch 'develop' into fix_volume_names
bigfooted 59a0f58
Merge branch 'develop' into fix_volume_names
bigfooted 627356e
Merge branch 'develop' into fix_volume_names
bigfooted 6ce0cce
Merge branch 'develop' into fix_volume_names
bigfooted 2a0e7db
Merge branch 'develop' into fix_volume_names
bigfooted 32ac2ea
Merge branch 'develop' into fix_volume_names
bigfooted 3b8bcd5
Merge branch 'develop' into fix_volume_names
bigfooted 4f87d14
Merge branch 'develop' into fix_volume_names
bigfooted 4269a4c
Merge branch 'develop' into fix_volume_names
bigfooted cdbcb43
Merge branch 'develop' into fix_volume_names
bigfooted 3fa684d
remove other last_of occurrences
bigfooted 92dacb0
Merge branch 'develop' into fix_volume_names
bigfooted 0e729fa
Merge branch 'develop' into fix_volume_names
bigfooted a251a58
Merge branch 'develop' into fix_volume_names
bigfooted df9aecb
Merge branch 'develop' into fix_volume_names
bigfooted cba0317
Merge branch 'develop' into fix_volume_names
bigfooted f4bf669
Merge branch 'develop' into fix_volume_names
bigfooted b119bcb
Merge branch 'develop' into fix_volume_names
bigfooted 6632ade
Merge branch 'develop' into fix_volume_names
bigfooted bde4228
Merge branch 'develop' into fix_volume_names
bigfooted 5c08794
Merge branch 'develop' into fix_volume_names
bigfooted a4f031e
Merge branch 'develop' into fix_volume_names
bigfooted 024a0a2
Merge branch 'develop' into fix_volume_names
bigfooted e351550
remove suffix from vandv
bigfooted 8318ebd
remove suffix from testcases
bigfooted 921d4d6
remove suffix from testcases
bigfooted 92cc9cc
remove suffix from testcases
bigfooted acb72b3
suffix in subfunctions
bigfooted 2bf51d2
update
bigfooted 4da323c
remove all file extensions
7113d68
Merge branch 'develop' into fix_volume_names
bigfooted 8ae468a
update config files
bigfooted 2881ccb
update multizone name
bigfooted 8c6a6be
remove su2 from mesh filename
bigfooted 37a8a2d
update with develop
bigfooted 9cff074
remove mesh file extension
bigfooted 27c555d
remove data file extension
bigfooted 77c71a6
Revert "remove data file extension"
bigfooted d3b7b61
Merge branch 'fix_volume_names' of https://github.com/su2code/su2 int…
bigfooted e316244
remove data file extension
bigfooted 4dcf57e
remove data file extension
bigfooted 6e0dd5b
switch branch for regression
bigfooted 0c46258
remove extension from adjoint restart files
bigfooted 9fb569a
remove some more extensions
bigfooted 1b2b471
remove some more extensions
bigfooted 68346ac
fix another extension
bigfooted 1468a9b
fix precommit
bigfooted 973705a
fix
bigfooted 8df7dbe
fix of_grad.dat and of_eval.dat
bigfooted 035e1c5
fix binary restart key
bigfooted 829e0c6
fix FEM prestretch
bigfooted 53b5865
Potential fix for code scanning alert no. 5394: Commented-out code
bigfooted fbabe33
Potential fix for code scanning alert no. 5403: Commented-out code
bigfooted e60eb4c
Potential fix for code scanning alert no. 5429: Redundant assignment
bigfooted 078bd4a
Potential fix for code scanning alert no. 5430: Comparison result is …
bigfooted dfd533a
final fix and cleanup
bigfooted 2fa6e1f
small fix for default_properties
bigfooted 505b824
small fix for default_properties
bigfooted b3d4008
small fix for default_properties
bigfooted 5c0c771
remove suffix from mesh_out
bigfooted 5677a38
put entire history filename construction into getconv_filename
bigfooted 6560ebb
put entire history filename construction into getconv_filename
bigfooted b06593c
clang-format
bigfooted 80aee33
type mismatch
bigfooted 36cecee
fix typo
bigfooted 239bd59
move dealing with extensions up to the getfile functions
bigfooted c11b8a8
precommit
bigfooted 623a74a
remove warning
bigfooted 07d6422
correct some extension
bigfooted 3318807
simplify adding leading zeroes
bigfooted 785edae
merge develop
bigfooted c603132
update FEA_Filename
bigfooted a84e5ea
update dynamics filename
bigfooted ed0df2f
remove unused variables
bigfooted 83895e7
Merge branch 'develop' into fix_volume_names
bigfooted 0afbbf5
remove unused code
bigfooted 4df129b
remove comment
bigfooted 1c3d897
Merge branch 'develop' into fix_volume_names
bigfooted 0483070
remove unused variables
bigfooted 153e682
cleanup
bigfooted 11ea770
temporary switch to develop version of tutorials
bigfooted 9c2b149
add an helper
pcarruscag 8304617
Update Common/include/CConfig.hpp
bigfooted 0da0934
Update Common/src/CConfig.cpp
bigfooted 62c904b
Update Common/include/CConfig.hpp
bigfooted c8664e7
Merge branch 'develop' into fix_volume_names
bigfooted b80cbf3
add pragma
bigfooted d9733c6
add suggestions from review
bigfooted 2522a3d
move reading flow.meta inside restart if-statement
bigfooted ffd5633
move regression back to develop
bigfooted ecc5a25
move regression back to develop
bigfooted 24cf84e
Potential fix for code scanning alert no. 5433: Unnecessary pass
bigfooted 69887ee
clang
bigfooted File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,6 +45,7 @@ | |
|
|
||
| #include "option_structure.hpp" | ||
| #include "containers/container_decorators.hpp" | ||
| #include "toolboxes/printing_toolbox.hpp" | ||
|
|
||
| #ifdef HAVE_CGNS | ||
| #include "cgnslib.h" | ||
|
|
@@ -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. */ | ||
|
|
@@ -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). | ||
|
|
@@ -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. | ||
|
|
@@ -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
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
|
|
@@ -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 | ||
|
|
@@ -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. | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.