Skip to content

Conversation

@bigfooted
Copy link
Contributor

@bigfooted bigfooted commented Jul 12, 2023

Proposed Changes

For volume names, we assume that the filename is filename.ext and we strip the extension using find_last_of('.')
But:

  1. This can lead to unwanted file stripping when you want the filename or folder to be volume.a
  2. We already mention in the documentation that the volume filename should be given without an extension

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

  • I am submitting my contribution to the develop branch.
  • My contribution generates no new compiler warnings (try with --warnlevel=3 when using meson).
  • My contribution is commented and consistent with SU2 style (https://su2code.github.io/docs_v7/Style-Guide/).
  • I have added a test case that demonstrates my contribution, if necessary.
  • I have updated appropriate documentation (Tutorials, Docs Page, config_template.cpp), if necessary.

@bigfooted
Copy link
Contributor Author

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.

@pcarruscag
Copy link
Member

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.

@bigfooted
Copy link
Contributor Author

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 pcarruscag changed the title fix volume names [WIP] fix volume names Jul 13, 2023
@bigfooted bigfooted changed the title [WIP] fix volume names Fix volume names Jul 14, 2025
@bigfooted
Copy link
Contributor Author

bigfooted commented Aug 24, 2025

@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.

@pcarruscag
Copy link
Member

I'll take a look when I can

Comment on lines 2435 to 2451
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);
}
Copy link
Member

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?

@pcarruscag
Copy link
Member

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:

WARNING: SU2 will use the STREAMWISE_PERIODIC_PRESSURE_DROP provided in the direct solution file: 241.878867596797

But worth checking, maybe it got broken at some point.

bigfooted and others added 10 commits August 26, 2025 07:37
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>
@bigfooted bigfooted linked an issue Aug 26, 2025 that may be closed by this pull request
@bigfooted bigfooted merged commit deece11 into develop Aug 26, 2025
37 checks passed
@bigfooted bigfooted deleted the fix_volume_names branch August 26, 2025 11:06
Comment on lines +5567 to +5570
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);
Copy link
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"PARAVIEW_MULTIBLOCK" issue with path that contains period

3 participants