ENH: Consistency improvement for setting postProcessing directory name

This commit is contained in:
Andrew Heather
2018-02-27 14:37:05 +00:00
parent 853b9abb79
commit aec949d7cc
16 changed files with 71 additions and 40 deletions

View File

@ -10,6 +10,7 @@
#include "polyMeshTetDecomposition.H"
#include "surfaceWriter.H"
#include "checkTools.H"
#include "functionObject.H"
#include "vtkSurfaceWriter.H"
#include "writer.H"
@ -1020,7 +1021,7 @@ Foam::label Foam::checkGeometry
{
wr.write
(
"postProcessing",
functionObject::outputPrefix,
"src_" + tmName,
meshedSurfRef
(
@ -1074,7 +1075,7 @@ Foam::label Foam::checkGeometry
{
wr.write
(
"postProcessing",
functionObject::outputPrefix,
"tgt_" + tmName,
meshedSurfRef
(

View File

@ -41,6 +41,7 @@ License
#include "syncTools.H"
#include "globalIndex.H"
#include "PatchTools.H"
#include "functionObject.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -285,7 +286,7 @@ void Foam::mergeAndWrite
(
set.time().path()
/ (Pstream::parRun() ? ".." : "")
/ "postProcessing"
/ functionObject::outputPrefix
/ mesh.pointsInstance()
/ set.name()
);
@ -379,7 +380,7 @@ void Foam::mergeAndWrite
(
set.time().path()
/ (Pstream::parRun() ? ".." : "")
/ "postProcessing"
/ functionObject::outputPrefix
/ mesh.pointsInstance()
/ set.name()
);
@ -483,7 +484,7 @@ void Foam::mergeAndWrite
(
set.time().path()
/ (Pstream::parRun() ? ".." : "")
/ "postProcessing"
/ functionObject::outputPrefix
/ mesh.pointsInstance()
// set.name()
);

View File

@ -39,6 +39,7 @@ Description
#include "vtkSurfaceWriter.H"
#include "cyclicAMIPolyPatch.H"
#include "PatchTools.H"
#include "functionObject.H"
using namespace Foam;
@ -139,7 +140,7 @@ void writeWeights(const polyMesh& mesh)
mesh,
ami.tgtWeightsSum(),
cpp.neighbPatch(),
"postProcessing",
functionObject::outputPrefix,
"tgt",
tmName
);
@ -148,7 +149,7 @@ void writeWeights(const polyMesh& mesh)
mesh,
ami.srcWeightsSum(),
cpp,
"postProcessing",
functionObject::outputPrefix,
"src",
tmName
);

View File

@ -44,6 +44,7 @@ Description
#include "stringOps.H"
#include "timeSelector.H"
#include "IOobjectList.H"
#include "functionObject.H"
using namespace Foam;
@ -149,7 +150,7 @@ int main(int argc, char *argv[])
// Name/location for the output summary
const fileName outputName
{
"postProcessing",
functionObject::outputPrefix,
"profiling",
runTime.timeName(),
profilingFileName

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2017-2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -38,6 +38,7 @@ namespace Foam
bool Foam::functionObject::postProcess(false);
Foam::word Foam::functionObject::outputPrefix("postProcessing");
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2017-2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -172,6 +172,9 @@ public:
//- Global post-processing mode switch
static bool postProcess;
//- Directory prefix
static word outputPrefix;
//- Switch write log to Info
Switch log;

View File

@ -27,14 +27,10 @@ License
#include "Time.H"
#include "polyMesh.H"
#include "IFstream.H"
#include "functionObject.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
const Foam::word Foam::functionObjects::writeFile::outputPrefix
(
"postProcessing"
);
Foam::label Foam::functionObjects::writeFile::addChars = 8;
@ -56,11 +52,11 @@ Foam::fileName Foam::functionObjects::writeFile::baseFileDir() const
{
// Put in undecomposed case (Note: gives problems for
// distributed data running)
baseDir = baseDir/".."/outputPrefix;
baseDir = baseDir/".."/functionObject::outputPrefix;
}
else
{
baseDir = baseDir/outputPrefix;
baseDir = baseDir/functionObject::outputPrefix;
}
// Append mesh name if not default region

View File

@ -117,9 +117,6 @@ private:
public:
//- Directory prefix
static const word outputPrefix;
//- Additional characters for writing
static label addChars;

View File

@ -63,11 +63,11 @@ Foam::functionObjects::extractEulerianParticles::dictBaseFileDir() const
{
// Put in undecomposed case (Note: gives problems for
// distributed data running)
baseDir = baseDir/".."/"postProcessing";
baseDir = baseDir/".."/functionObject::outputPrefix;
}
else
{
baseDir = baseDir/"postProcessing";
baseDir = baseDir/functionObject::outputPrefix;
}
return baseDir;

View File

@ -647,8 +647,8 @@ bool Foam::functionObjects::streamLineBase::writeToFile()
fileName vtkPath
(
Pstream::parRun()
? time_.path()/".."/"postProcessing"/"sets"/name()
: time_.path()/"postProcessing"/"sets"/name()
? time_.path()/".."/functionObject::outputPrefix/"sets"/name()
: time_.path()/functionObject::outputPrefix/"sets"/name()
);
if (mesh_.name() != fvMesh::defaultRegion)
{

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015-2017 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015-2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -389,9 +389,17 @@ void Foam::functionObjects::runTimePostPro::scene::saveImage
const Time& runTime = obr_.time();
fileName prefix(Pstream::parRun() ?
runTime.path()/".."/"postProcessing"/name_/obr_.time().timeName() :
runTime.path()/"postProcessing"/name_/obr_.time().timeName());
const fileName relPath
(
functionObject::outputPrefix/name_/obr_.time().timeName()
);
fileName prefix
(
Pstream::parRun() ?
runTime.path()/".."/relPath
: runTime.path()/relPath
);
mkDir(prefix);

View File

@ -24,6 +24,7 @@ License
\*---------------------------------------------------------------------------*/
#include "CloudFunctionObject.H"
#include "functionObject.H"
// * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * //
@ -56,8 +57,13 @@ Foam::CloudFunctionObject<CloudType>::CloudFunctionObject
CloudSubModelBase<CloudType>(modelName, owner, dict, typeName, objectType),
outputDir_(owner.mesh().time().path())
{
const fileName relPath =
"postProcessing"/cloud::prefix/owner.name()/this->modelName();
const fileName relPath
(
functionObject::outputPrefix
/cloud::prefix
/owner.name()
/this->modelName()
);
if (Pstream::parRun())

View File

@ -24,6 +24,7 @@ License
\*---------------------------------------------------------------------------*/
#include "noiseModel.H"
#include "functionObject.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -143,7 +144,7 @@ Foam::fileName Foam::noiseModel::baseFileDir(const label dataseti) const
word datasetName("input" + Foam::name(dataseti));
baseDir =
baseDir.expand()
/"postProcessing"
/functionObject::outputPrefix
/"noise"
/outputPrefix_
/type()

View File

@ -202,7 +202,8 @@ Foam::label Foam::probes::prepare()
{
probeSubDir = probeSubDir/mesh_.name();
}
probeSubDir = "postProcessing"/probeSubDir/mesh_.time().timeName();
probeSubDir =
functionObject::outputPrefix/probeSubDir/mesh_.time().timeName();
if (Pstream::parRun())
{

View File

@ -97,18 +97,22 @@ Foam::sampledSets::sampledSets
interpolationScheme_(word::null),
writeFormat_(word::null)
{
const fileName relPath(functionObject::outputPrefix/name);
if (Pstream::parRun())
{
outputPath_ = mesh_.time().path()/".."/"postProcessing"/name;
outputPath_ = mesh_.time().path()/".."/relPath;
}
else
{
outputPath_ = mesh_.time().path()/"postProcessing"/name;
outputPath_ = mesh_.time().path()/relPath;
}
if (mesh_.name() != fvMesh::defaultRegion)
{
outputPath_ = outputPath_/mesh_.name();
}
outputPath_.clean(); // Remove unneeded ".."
read(dict);
@ -132,18 +136,22 @@ Foam::sampledSets::sampledSets
interpolationScheme_(word::null),
writeFormat_(word::null)
{
const fileName relPath(functionObject::outputPrefix/name);
if (Pstream::parRun())
{
outputPath_ = mesh_.time().path()/".."/"postProcessing"/name;
outputPath_ = mesh_.time().path()/".."/relPath;
}
else
{
outputPath_ = mesh_.time().path()/"postProcessing"/name;
outputPath_ = mesh_.time().path()/relPath;
}
if (mesh_.name() != fvMesh::defaultRegion)
{
outputPath_ = outputPath_/mesh_.name();
}
outputPath_.clean(); // Remove unneeded ".."
read(dict);

View File

@ -138,14 +138,17 @@ Foam::sampledSurfaces::sampledSurfaces
changedGeom_(),
formatter_(nullptr)
{
const fileName relPath(functionObject::outputPrefix/name);
if (Pstream::parRun())
{
outputPath_ = mesh_.time().path()/".."/"postProcessing"/name;
outputPath_ = mesh_.time().path()/".."/relPath;
}
else
{
outputPath_ = mesh_.time().path()/"postProcessing"/name;
outputPath_ = mesh_.time().path()/relPath;
}
outputPath_.clean(); // Remove unneeded ".."
read(dict);
@ -174,14 +177,17 @@ Foam::sampledSurfaces::sampledSurfaces
{
read(dict);
const fileName relPath(functionObject::outputPrefix/name);
if (Pstream::parRun())
{
outputPath_ = time_.path()/".."/"postProcessing"/name;
outputPath_ = time_.path()/".."/relPath;
}
else
{
outputPath_ = time_.path()/"postProcessing"/name;
outputPath_ = time_.path()/relPath;
}
outputPath_.clean(); // Remove unneeded ".."
read(dict);