ENH: Cloud function objects - updated output folder

This commit is contained in:
andy
2014-01-20 12:15:34 +00:00
parent 8f776987df
commit 2357b2cd91
5 changed files with 27 additions and 18 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -79,7 +79,8 @@ Foam::CloudFunctionObject<CloudType>::CloudFunctionObject
const CloudFunctionObject<CloudType>& ppm
)
:
CloudSubModelBase<CloudType>(ppm)
CloudSubModelBase<CloudType>(ppm),
outputDir_(ppm.outputDir_)
{}
@ -156,6 +157,13 @@ const Foam::fileName& Foam::CloudFunctionObject<CloudType>::outputDir() const
}
template<class CloudType>
Foam::fileName Foam::CloudFunctionObject<CloudType>::outputTimeDir() const
{
return outputDir_/this->owner().time().timeName();
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "CloudFunctionObjectNew.C"

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -174,6 +174,9 @@ public:
//- Return the output path
const fileName& outputDir() const;
//- Return the output time path
fileName outputTimeDir() const;
};

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -51,7 +51,7 @@ void Foam::FacePostProcessing<CloudType>::makeLogFile
if (Pstream::master())
{
// Create directory if does not exist
mkDir(this->outputDir());
mkDir(this->outputTimeDir());
// Open new file at start up
outputFilePtr_.set
@ -59,7 +59,7 @@ void Foam::FacePostProcessing<CloudType>::makeLogFile
zoneI,
new OFstream
(
this->outputDir()/(type() + '_' + zoneName + ".dat")
this->outputTimeDir()/(type() + '_' + zoneName + ".dat")
)
);
@ -202,7 +202,7 @@ void Foam::FacePostProcessing<CloudType>::write()
writer->write
(
this->outputDir()/time.timeName(),
this->outputTimeDir(),
fZone.name(),
allPoints,
allFaces,
@ -213,7 +213,7 @@ void Foam::FacePostProcessing<CloudType>::write()
writer->write
(
this->outputDir()/time.timeName(),
this->outputTimeDir(),
fZone.name(),
allPoints,
allFaces,

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -52,12 +52,12 @@ void Foam::ParticleCollector<CloudType>::makeLogFile
if (Pstream::master())
{
// Create directory if does not exist
mkDir(this->outputDir());
mkDir(this->outputTimeDir());
// Open new file at start up
outputFilePtr_.reset
(
new OFstream(this->outputDir()/(type() + ".dat"))
new OFstream(this->outputTimeDir()/(type() + ".dat"))
);
outputFilePtr_()
@ -461,7 +461,7 @@ void Foam::ParticleCollector<CloudType>::write()
writer->write
(
this->outputDir()/time.timeName(),
this->outputTimeDir(),
"collector",
points_,
faces_,
@ -472,7 +472,7 @@ void Foam::ParticleCollector<CloudType>::write()
writer->write
(
this->outputDir()/time.timeName(),
this->outputTimeDir(),
"collector",
points_,
faces_,

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -68,16 +68,14 @@ void Foam::PatchPostProcessing<CloudType>::write()
{
const fvMesh& mesh = this->owner().mesh();
fileName outputDir = this->outputDir()/mesh.time().timeName();
// Create directory if it doesn't exist
mkDir(outputDir);
mkDir(this->outputTimeDir());
const word& patchName = mesh.boundaryMesh()[patchIDs_[i]].name();
OFstream patchOutFile
(
outputDir/patchName + ".post",
this->outputTimeDir()/patchName + ".post",
IOstream::ASCII,
IOstream::currentVersion,
mesh.time().writeCompression()