-
Notifications
You must be signed in to change notification settings - Fork 913
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
Fix volume names #2079
Conversation
|
There are some other find_last_of lines as well, if all filenames are supposed to be given without any file extension, then these should all be removed. |
|
In principle sounds good, it will probably break lots of cases, optimization scripts and what not. We'll see, we are not leaving this inconsistent though, all or nothing. |
I agree. |
|
@pcarruscag For some reason, one of the tutorials testcases fails because of changed residuals, even though it does not fail on my local machine (produces same residuals as develop) and the testcase does not make use of a restart file or any other file except the mesh. I am a bit at a loss as to what to do here. |
|
I'll take a look when I can |
| auto fileName = config->GetBreakdown_FileName(); | ||
| if (unsteady) { | ||
| const auto lastindex = fileName.find_last_of('.'); | ||
| const auto ext = fileName.substr(lastindex, fileName.size()); | ||
| fileName = fileName.substr(0, lastindex); | ||
| fileName = config->GetFilename(fileName, ext, curTimeIter); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still seems wrong, where is the current iteration being appended now?
|
Can you do a diff on the entire screen output for the failing case? develop vs your branch? I think this case uses the metadata file, it seems to be ok based on this: But worth checking, maybe it got broken at some point. |
Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com>
Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com>
Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
| 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); |
There was a problem hiding this comment.
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
Proposed Changes
For volume names, we assume that the filename is filename.ext and we strip the extension using find_last_of('.')
But:
What we do in the PR:
filenames that have multiple possible extensions (csv/dat or cgns/su2) are not required to have their extension in the config file. However, if the correct extension is provided, this will be stripped internally so it is easy to append iteration numbers, zone numbers etc. This means that when the expected filetype is solution.csv but the user provides solution.dat, then the .dat extension will not be stripped but seen as part of the 'base' or 'prefix'. When iterations are added, the new filename will be solution.dat_001.csv.
Related Work
Issue: #2074
PR Checklist