mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Cloud function objects - updated output folder
This commit is contained in:
@ -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"
|
||||
|
||||
@ -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;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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_,
|
||||
|
||||
@ -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()
|
||||
|
||||
Reference in New Issue
Block a user