mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Decided upon the format case{region}.OpenFOAM for denoting regions (paraview)
Pro: Good delimitation. Good visual distinction. No confusion with normal
cases, since '{}' characters are excluded by !word::valid()
Con: Possible quoting issues when creating directly instead of via paraFoam,
but seemed to work fine with bash TAB completion.
This commit is contained in:
@ -247,15 +247,20 @@ Foam::vtkPV3Foam::vtkPV3Foam
|
||||
setEnv("FOAM_CASE", fullCasePath, true);
|
||||
}
|
||||
|
||||
// get the caseName, and look for '=regionName' in it
|
||||
// we could also be more stringent and insist that the
|
||||
// prefix match the directory name, etc ..
|
||||
fileName caseName(fileName(FileName).lessExt());
|
||||
// look for 'case{region}.OpenFOAM'
|
||||
// could be stringent and insist the prefix match the directory name...
|
||||
// Note: cannot use fileName::name() due to the embedded '{}'
|
||||
string caseName(fileName(FileName).lessExt());
|
||||
string::size_type beg = caseName.find_last_of("/{");
|
||||
string::size_type end = caseName.find('}', beg);
|
||||
|
||||
string::size_type delimiter = caseName.find("=");
|
||||
if (delimiter != string::npos)
|
||||
if
|
||||
(
|
||||
beg != string::npos && caseName[beg] == '{'
|
||||
&& end != string::npos && end == caseName.size()-1
|
||||
)
|
||||
{
|
||||
meshRegion_ = caseName.substr(delimiter+1);
|
||||
meshRegion_ = caseName.substr(beg+1, end-beg-1);
|
||||
|
||||
// some safety
|
||||
if (!meshRegion_.size())
|
||||
|
||||
Reference in New Issue
Block a user