mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: simplify use of case-relative paths
- provide relativePath() for argList and for Time.
These are relative to the case globalPath().
Eg,
Info<< "output: " << runTime.relativePath(outputFile) << nl;
This commit is contained in:
@ -786,7 +786,7 @@ bool Foam::functionObjects::streamLineBase::writeToFile()
|
||||
propsDict.add
|
||||
(
|
||||
"file",
|
||||
scalarVtkFile.relative(time_.globalPath(), true)
|
||||
time_.relativePath(scalarVtkFile, true)
|
||||
);
|
||||
setProperty(fieldName, propsDict);
|
||||
}
|
||||
@ -798,7 +798,7 @@ bool Foam::functionObjects::streamLineBase::writeToFile()
|
||||
propsDict.add
|
||||
(
|
||||
"file",
|
||||
vectorVtkFile.relative(time_.globalPath(), true)
|
||||
time_.relativePath(vectorVtkFile, true)
|
||||
);
|
||||
setProperty(fieldName, propsDict);
|
||||
}
|
||||
|
||||
@ -238,7 +238,7 @@ bool Foam::functionObjects::dataCloud::write()
|
||||
if (writeCloud(outputName, cloudName))
|
||||
{
|
||||
Log << " cloud : "
|
||||
<< outputName.relative(time_.globalPath()) << endl;
|
||||
<< time_.relativePath(outputName) << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -318,13 +318,12 @@ bool Foam::functionObjects::vtkCloud::writeCloud
|
||||
// }
|
||||
// }
|
||||
|
||||
// Shorten file name to be case-local and use "<case>" shortcut
|
||||
// to make the content relocatable
|
||||
// Case-local file name with "<case>" to make relocatable
|
||||
dictionary propsDict;
|
||||
propsDict.add
|
||||
(
|
||||
"file",
|
||||
file.relative(time_.globalPath(), true)
|
||||
time_.relativePath(file, true)
|
||||
);
|
||||
propsDict.add("fields", written);
|
||||
|
||||
@ -503,7 +502,7 @@ bool Foam::functionObjects::vtkCloud::write()
|
||||
if (writeCloud(outputName, cloudName))
|
||||
{
|
||||
Log << " cloud : "
|
||||
<< outputName.relative(time_.globalPath()) << endl;
|
||||
<< time_.relativePath(outputName) << endl;
|
||||
|
||||
if (Pstream::master())
|
||||
{
|
||||
|
||||
@ -380,7 +380,7 @@ bool Foam::functionObjects::vtkWrite::write()
|
||||
);
|
||||
|
||||
Info<< " Internal : "
|
||||
<< internalWriter->output().relative(time_.globalPath())
|
||||
<< time_.relativePath(internalWriter->output())
|
||||
<< endl;
|
||||
|
||||
// No sub-block for internal
|
||||
@ -432,7 +432,7 @@ bool Foam::functionObjects::vtkWrite::write()
|
||||
);
|
||||
|
||||
Info<< " Boundaries: "
|
||||
<< writer->output().relative(time_.globalPath()) << nl;
|
||||
<< time_.relativePath(writer->output()) << nl;
|
||||
|
||||
|
||||
writer->writeTimeValue(timeValue);
|
||||
@ -497,7 +497,7 @@ bool Foam::functionObjects::vtkWrite::write()
|
||||
);
|
||||
|
||||
Info<< " Boundary : "
|
||||
<< writer->output().relative(time_.globalPath()) << nl;
|
||||
<< time_.relativePath(writer->output()) << nl;
|
||||
|
||||
writer->writeTimeValue(timeValue);
|
||||
writer->writeGeometry();
|
||||
|
||||
Reference in New Issue
Block a user