STYLE: use globalPath() instead of path()/".." for parallel

This commit is contained in:
Mark Olesen
2018-12-05 22:54:50 +01:00
parent d3a2544bfa
commit a199fef957
7 changed files with 53 additions and 89 deletions

View File

@ -195,26 +195,24 @@ Foam::label Foam::probes::prepare()
<< endl;
fileName probeDir;
fileName probeSubDir = name();
if (mesh_.name() != polyMesh::defaultRegion)
{
probeSubDir = probeSubDir/mesh_.name();
}
probeSubDir =
functionObject::outputPrefix/probeSubDir/mesh_.time().timeName();
if (Pstream::parRun())
{
// Put in undecomposed case
// (Note: gives problems for distributed data running)
probeDir = mesh_.time().path()/".."/probeSubDir;
}
else
{
probeDir = mesh_.time().path()/probeSubDir;
}
// Put in undecomposed case
// (Note: gives problems for distributed data running)
fileName probeDir =
(
mesh_.time().globalPath()
/ functionObject::outputPrefix
/ probeSubDir
/ mesh_.time().timeName()
);
probeDir.clean(); // Remove unneeded ".."
// ignore known fields, close streams for fields that no longer exist

View File

@ -97,16 +97,10 @@ Foam::sampledSets::sampledSets
interpolationScheme_(word::null),
writeFormat_(word::null)
{
const fileName relPath(functionObject::outputPrefix/name);
if (Pstream::parRun())
{
outputPath_ = mesh_.time().path()/".."/relPath;
}
else
{
outputPath_ = mesh_.time().path()/relPath;
}
outputPath_ =
(
mesh_.time().globalPath()/functionObject::outputPrefix/name
);
if (mesh_.name() != fvMesh::defaultRegion)
{
@ -136,16 +130,10 @@ Foam::sampledSets::sampledSets
interpolationScheme_(word::null),
writeFormat_(word::null)
{
const fileName relPath(functionObject::outputPrefix/name);
if (Pstream::parRun())
{
outputPath_ = mesh_.time().path()/".."/relPath;
}
else
{
outputPath_ = mesh_.time().path()/relPath;
}
outputPath_ =
(
mesh_.time().globalPath()/functionObject::outputPrefix/name
);
if (mesh_.name() != fvMesh::defaultRegion)
{