functionObjects: Separated writeFile and logFiles (previously writeFiles) from regionFunctionObject
Now the functionality to write single graph files or log files (vs time) may be used in the creation of any form of functionObject, not just those relating to a mesh region.
This commit is contained in:
parent
076c4c6e82
commit
6f098748cc
@ -81,7 +81,6 @@ See also
|
||||
#include "noiseFFT.H"
|
||||
#include "argList.H"
|
||||
#include "Time.H"
|
||||
#include "writeFiles.H"
|
||||
#include "CSV.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
@ -222,7 +222,7 @@ $(dll)/codedBase/codedBase.C
|
||||
db/functionObjects/functionObject/functionObject.C
|
||||
db/functionObjects/functionObjectList/functionObjectList.C
|
||||
db/functionObjects/writeFile/writeFile.C
|
||||
db/functionObjects/writeFiles/writeFiles.C
|
||||
db/functionObjects/logFiles/logFiles.C
|
||||
db/functionObjects/timeControl/timeControl.C
|
||||
db/functionObjects/timeControl/timeControlFunctionObject.C
|
||||
db/functionObjects/regionFunctionObject/regionFunctionObject.C
|
||||
|
@ -23,18 +23,18 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "writeFiles.H"
|
||||
#include "logFiles.H"
|
||||
#include "Time.H"
|
||||
#include "IFstream.H"
|
||||
|
||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||
|
||||
void Foam::functionObjects::writeFiles::createFiles()
|
||||
void Foam::functionObjects::logFiles::createFiles()
|
||||
{
|
||||
if (Pstream::master())
|
||||
{
|
||||
const word startTimeName =
|
||||
obr_.time().timeName(obr_.time().startTime().value());
|
||||
fileObr_.time().timeName(fileObr_.time().startTime().value());
|
||||
|
||||
forAll(names_, i)
|
||||
{
|
||||
@ -49,7 +49,7 @@ void Foam::functionObjects::writeFiles::createFiles()
|
||||
IFstream is(outputDir/(fName + ".dat"));
|
||||
if (is.good())
|
||||
{
|
||||
fName = fName + "_" + obr_.time().timeName();
|
||||
fName = fName + "_" + fileObr_.time().timeName();
|
||||
}
|
||||
|
||||
filePtrs_.set(i, new OFstream(outputDir/(fName + ".dat")));
|
||||
@ -57,14 +57,13 @@ void Foam::functionObjects::writeFiles::createFiles()
|
||||
initStream(filePtrs_[i]);
|
||||
|
||||
writeFileHeader(i);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::functionObjects::writeFiles::resetNames(const wordList& names)
|
||||
void Foam::functionObjects::logFiles::resetNames(const wordList& names)
|
||||
{
|
||||
names_.clear();
|
||||
names_.append(names);
|
||||
@ -77,7 +76,7 @@ void Foam::functionObjects::writeFiles::resetNames(const wordList& names)
|
||||
}
|
||||
|
||||
|
||||
void Foam::functionObjects::writeFiles::resetName(const word& name)
|
||||
void Foam::functionObjects::logFiles::resetName(const word& name)
|
||||
{
|
||||
names_.clear();
|
||||
names_.append(name);
|
||||
@ -92,29 +91,13 @@ void Foam::functionObjects::writeFiles::resetName(const word& name)
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::functionObjects::writeFiles::writeFiles
|
||||
Foam::functionObjects::logFiles::logFiles
|
||||
(
|
||||
const word& name,
|
||||
const Time& time,
|
||||
const dictionary& dict,
|
||||
const word& prefix
|
||||
)
|
||||
:
|
||||
writeFile(name, time, dict, prefix),
|
||||
names_(),
|
||||
filePtrs_()
|
||||
{}
|
||||
|
||||
|
||||
Foam::functionObjects::writeFiles::writeFiles
|
||||
(
|
||||
const word& name,
|
||||
const objectRegistry& obr,
|
||||
const dictionary& dict,
|
||||
const word& prefix
|
||||
)
|
||||
:
|
||||
writeFile(name, obr, dict, prefix),
|
||||
writeFile(obr, prefix),
|
||||
names_(),
|
||||
filePtrs_()
|
||||
{}
|
||||
@ -122,19 +105,19 @@ Foam::functionObjects::writeFiles::writeFiles
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::functionObjects::writeFiles::~writeFiles()
|
||||
Foam::functionObjects::logFiles::~logFiles()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
const Foam::wordList& Foam::functionObjects::writeFiles::names() const
|
||||
const Foam::wordList& Foam::functionObjects::logFiles::names() const
|
||||
{
|
||||
return names_;
|
||||
}
|
||||
|
||||
|
||||
Foam::OFstream& Foam::functionObjects::writeFiles::file()
|
||||
Foam::OFstream& Foam::functionObjects::logFiles::file()
|
||||
{
|
||||
if (!Pstream::master())
|
||||
{
|
||||
@ -161,7 +144,7 @@ Foam::OFstream& Foam::functionObjects::writeFiles::file()
|
||||
}
|
||||
|
||||
|
||||
Foam::PtrList<Foam::OFstream>& Foam::functionObjects::writeFiles::files()
|
||||
Foam::PtrList<Foam::OFstream>& Foam::functionObjects::logFiles::files()
|
||||
{
|
||||
if (!Pstream::master())
|
||||
{
|
||||
@ -174,7 +157,7 @@ Foam::PtrList<Foam::OFstream>& Foam::functionObjects::writeFiles::files()
|
||||
}
|
||||
|
||||
|
||||
Foam::OFstream& Foam::functionObjects::writeFiles::file(const label i)
|
||||
Foam::OFstream& Foam::functionObjects::logFiles::file(const label i)
|
||||
{
|
||||
if (!Pstream::master())
|
||||
{
|
||||
@ -194,7 +177,7 @@ Foam::OFstream& Foam::functionObjects::writeFiles::file(const label i)
|
||||
}
|
||||
|
||||
|
||||
bool Foam::functionObjects::writeFiles::write()
|
||||
bool Foam::functionObjects::logFiles::write()
|
||||
{
|
||||
createFiles();
|
||||
|
@ -22,22 +22,23 @@ License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::functionObjects::writeFiles
|
||||
Foam::functionObjects::logFiles
|
||||
|
||||
Description
|
||||
functionObject base class for writing files
|
||||
functionObject base class for creating, maintaining and writing log
|
||||
files e.g. integrated of averaged field data vs time.
|
||||
|
||||
See also
|
||||
Foam::functionObject
|
||||
Foam::OutputFilterFunctionObject
|
||||
Foam::functionObjects::writeFile
|
||||
|
||||
SourceFiles
|
||||
functionObjectFiles.C
|
||||
logFiles.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef functionObjects_writeFiles_H
|
||||
#define functionObjects_writeFiles_H
|
||||
#ifndef functionObjects_logFiles_H
|
||||
#define functionObjects_logFiles_H
|
||||
|
||||
#include "writeFile.H"
|
||||
#include "OFstream.H"
|
||||
@ -51,14 +52,17 @@ namespace functionObjects
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class writeFiles Declaration
|
||||
Class logFiles Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class writeFiles
|
||||
class logFiles
|
||||
:
|
||||
public writeFile
|
||||
{
|
||||
// Private data
|
||||
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
//- File names
|
||||
wordList names_;
|
||||
@ -67,8 +71,6 @@ class writeFiles
|
||||
PtrList<OFstream> filePtrs_;
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
// Protected Member Functions
|
||||
|
||||
//- Create the output file
|
||||
@ -80,38 +82,35 @@ protected:
|
||||
//- Reset the list of names to a single name entry
|
||||
virtual void resetName(const word& name);
|
||||
|
||||
//- File header information
|
||||
virtual void writeFileHeader(const label i = 0) = 0;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
writeFiles(const writeFiles&);
|
||||
logFiles(const logFiles&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const writeFiles&);
|
||||
void operator=(const logFiles&);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from name, Time, dictionary and prefix
|
||||
writeFiles
|
||||
//- Construct from objectRegistry and prefix
|
||||
logFiles
|
||||
(
|
||||
const word& name,
|
||||
const Time& time,
|
||||
const dictionary& dict,
|
||||
const word& prefix
|
||||
);
|
||||
|
||||
//- Construct from name, objectRegistry, dictionary and prefix
|
||||
writeFiles
|
||||
(
|
||||
const word& name,
|
||||
const objectRegistry& obr,
|
||||
const dictionary& dict,
|
||||
const word& prefix
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~writeFiles();
|
||||
virtual ~logFiles();
|
||||
|
||||
|
||||
// Member Functions
|
||||
@ -119,12 +118,12 @@ public:
|
||||
//- Return const access to the names
|
||||
const wordList& names() const;
|
||||
|
||||
//- Return access to the file (if only 1)
|
||||
OFstream& file();
|
||||
|
||||
//- Return access to the files
|
||||
PtrList<OFstream>& files();
|
||||
|
||||
//- Return access to the file (if only 1)
|
||||
OFstream& file();
|
||||
|
||||
//- Return file 'i'
|
||||
OFstream& file(const label i);
|
||||
|
@ -26,7 +26,6 @@ License
|
||||
#include "writeFile.H"
|
||||
#include "Time.H"
|
||||
#include "polyMesh.H"
|
||||
#include "IOmanip.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
@ -49,7 +48,7 @@ void Foam::functionObjects::writeFile::initStream(Ostream& os) const
|
||||
|
||||
Foam::fileName Foam::functionObjects::writeFile::baseFileDir() const
|
||||
{
|
||||
fileName baseDir = obr_.time().path();
|
||||
fileName baseDir = fileObr_.time().path();
|
||||
|
||||
if (Pstream::parRun())
|
||||
{
|
||||
@ -63,9 +62,9 @@ Foam::fileName Foam::functionObjects::writeFile::baseFileDir() const
|
||||
}
|
||||
|
||||
// Append mesh name if not default region
|
||||
if (isA<polyMesh>(obr_))
|
||||
if (isA<polyMesh>(fileObr_))
|
||||
{
|
||||
const polyMesh& mesh = refCast<const polyMesh>(obr_);
|
||||
const polyMesh& mesh = refCast<const polyMesh>(fileObr_);
|
||||
if (mesh.name() != polyMesh::defaultRegion)
|
||||
{
|
||||
baseDir = baseDir/mesh.name();
|
||||
@ -78,14 +77,10 @@ Foam::fileName Foam::functionObjects::writeFile::baseFileDir() const
|
||||
|
||||
Foam::fileName Foam::functionObjects::writeFile::baseTimeDir() const
|
||||
{
|
||||
return baseFileDir()/prefix_/obr_.time().timeName();
|
||||
return baseFileDir()/prefix_/fileObr_.time().timeName();
|
||||
}
|
||||
|
||||
|
||||
void Foam::functionObjects::writeFile::writeFileHeader(const label i)
|
||||
{}
|
||||
|
||||
|
||||
Foam::Omanip<int> Foam::functionObjects::writeFile::valueWidth
|
||||
(
|
||||
const label offset
|
||||
@ -99,26 +94,11 @@ Foam::Omanip<int> Foam::functionObjects::writeFile::valueWidth
|
||||
|
||||
Foam::functionObjects::writeFile::writeFile
|
||||
(
|
||||
const word& name,
|
||||
const Time& runTime,
|
||||
const dictionary& dict,
|
||||
const word& prefix
|
||||
)
|
||||
:
|
||||
regionFunctionObject(name, runTime, dict),
|
||||
prefix_(prefix)
|
||||
{}
|
||||
|
||||
|
||||
Foam::functionObjects::writeFile::writeFile
|
||||
(
|
||||
const word& name,
|
||||
const objectRegistry& obr,
|
||||
const dictionary& dict,
|
||||
const word& prefix
|
||||
)
|
||||
:
|
||||
regionFunctionObject(name, obr, dict),
|
||||
fileObr_(obr),
|
||||
prefix_(prefix)
|
||||
{}
|
||||
|
||||
@ -171,7 +151,7 @@ void Foam::functionObjects::writeFile::writeHeader
|
||||
|
||||
void Foam::functionObjects::writeFile::writeTime(Ostream& os) const
|
||||
{
|
||||
os << setw(charWidth()) << obr_.time().timeName();
|
||||
os << setw(charWidth()) << fileObr_.time().timeName();
|
||||
}
|
||||
|
||||
|
||||
|
@ -28,19 +28,18 @@ Description
|
||||
functionObject base class for writing single files
|
||||
|
||||
See also
|
||||
Foam::regionFunctionObject
|
||||
Foam::functionObject
|
||||
Foam::functionObjects::logFiles
|
||||
|
||||
SourceFiles
|
||||
functionObjectFile.C
|
||||
writeFile.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef functionObjects_writeFile_H
|
||||
#define functionObjects_writeFile_H
|
||||
|
||||
#include "regionFunctionObject.H"
|
||||
#include "Time.H"
|
||||
#include "objectRegistry.H"
|
||||
#include "IOmanip.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -55,34 +54,22 @@ namespace functionObjects
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class writeFile
|
||||
:
|
||||
public regionFunctionObject
|
||||
{
|
||||
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
//- Reference to the region objectRegistry
|
||||
const objectRegistry& fileObr_;
|
||||
|
||||
//- Prefix
|
||||
const word prefix_;
|
||||
|
||||
|
||||
// Protected Member Functions
|
||||
private:
|
||||
|
||||
//- Initialise the output stream for writing
|
||||
virtual void initStream(Ostream& os) const;
|
||||
|
||||
//- Return the base directory for output
|
||||
virtual fileName baseFileDir() const;
|
||||
|
||||
//- Return the base directory for the current time value
|
||||
virtual fileName baseTimeDir() const;
|
||||
|
||||
//- File header information
|
||||
virtual void writeFileHeader(const label i = 0);
|
||||
|
||||
//- Return the value width when writing to stream with optional offset
|
||||
virtual Omanip<int> valueWidth(const label offset = 0) const;
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
writeFile(const writeFile&);
|
||||
@ -102,31 +89,32 @@ public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from name, Time, dictionary and prefix
|
||||
//- Construct from objectRegistry and prefix
|
||||
writeFile
|
||||
(
|
||||
const word& name,
|
||||
const Time& t,
|
||||
const dictionary& dict,
|
||||
const word& prefix
|
||||
);
|
||||
|
||||
//- Construct from name, objectRegistry, dictionary and prefix
|
||||
writeFile
|
||||
(
|
||||
const word& name,
|
||||
const objectRegistry& obr,
|
||||
const dictionary& dict,
|
||||
const word& prefix
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~writeFile();
|
||||
~writeFile();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Initialise the output stream for writing
|
||||
void initStream(Ostream& os) const;
|
||||
|
||||
//- Return the base directory for output
|
||||
fileName baseFileDir() const;
|
||||
|
||||
//- Return the base directory for the current time value
|
||||
fileName baseTimeDir() const;
|
||||
|
||||
//- Return the value width when writing to stream with optional offset
|
||||
Omanip<int> valueWidth(const label offset = 0) const;
|
||||
|
||||
//- Write a commented string to stream
|
||||
void writeCommented(Ostream& os, const string& str) const;
|
||||
|
||||
|
@ -103,7 +103,8 @@ Foam::functionObjects::fieldMinMax::fieldMinMax
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
writeFiles(name, runTime, dict, name),
|
||||
regionFunctionObject(name, runTime, dict),
|
||||
logFiles(obr_, name),
|
||||
location_(true),
|
||||
mode_(mdMag),
|
||||
fieldSet_()
|
||||
@ -129,7 +130,7 @@ Foam::functionObjects::fieldMinMax::~fieldMinMax()
|
||||
|
||||
bool Foam::functionObjects::fieldMinMax::read(const dictionary& dict)
|
||||
{
|
||||
writeFiles::read(dict);
|
||||
regionFunctionObject::read(dict);
|
||||
|
||||
location_ = dict.lookupOrDefault<Switch>("location", true);
|
||||
|
||||
@ -148,7 +149,7 @@ bool Foam::functionObjects::fieldMinMax::execute()
|
||||
|
||||
bool Foam::functionObjects::fieldMinMax::write()
|
||||
{
|
||||
writeFiles::write();
|
||||
logFiles::write();
|
||||
|
||||
if (!location_) writeTime(file());
|
||||
Log << type() << " " << name() << " write:" << nl;
|
||||
|
@ -67,8 +67,8 @@ Usage
|
||||
Output data is written to the file \<timeDir\>/fieldMinMax.dat
|
||||
|
||||
See also
|
||||
Foam::functionObject
|
||||
Foam::functionObjects::writeFiles
|
||||
Foam::functionObjects::regionFunctionObject
|
||||
Foam::functionObjects::logFiles
|
||||
|
||||
SourceFiles
|
||||
fieldMinMax.C
|
||||
@ -78,7 +78,8 @@ SourceFiles
|
||||
#ifndef functionObjects_fieldMinMax_H
|
||||
#define functionObjects_fieldMinMax_H
|
||||
|
||||
#include "writeFiles.H"
|
||||
#include "regionFunctionObject.H"
|
||||
#include "logFiles.H"
|
||||
#include "vector.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -94,7 +95,8 @@ namespace functionObjects
|
||||
|
||||
class fieldMinMax
|
||||
:
|
||||
public writeFiles
|
||||
public regionFunctionObject,
|
||||
public logFiles
|
||||
{
|
||||
public:
|
||||
|
||||
|
@ -49,7 +49,8 @@ Foam::functionObjects::fieldValue::fieldValue
|
||||
const word& valueType
|
||||
)
|
||||
:
|
||||
writeFiles(name, runTime, dict, name),
|
||||
regionFunctionObject(name, runTime, dict),
|
||||
logFiles(obr_, name),
|
||||
dict_(dict),
|
||||
regionName_(word::null),
|
||||
resultDict_(fileName("name"), dictionary::null)
|
||||
@ -67,7 +68,8 @@ Foam::functionObjects::fieldValue::fieldValue
|
||||
const word& valueType
|
||||
)
|
||||
:
|
||||
writeFiles(name, obr, dict, name),
|
||||
regionFunctionObject(name, obr, dict),
|
||||
logFiles(obr_, name),
|
||||
dict_(dict),
|
||||
regionName_(word::null),
|
||||
resultDict_(fileName("name"), dictionary::null)
|
||||
@ -88,7 +90,7 @@ Foam::functionObjects::fieldValue::~fieldValue()
|
||||
bool Foam::functionObjects::fieldValue::read(const dictionary& dict)
|
||||
{
|
||||
dict_ = dict;
|
||||
writeFiles::read(dict);
|
||||
regionFunctionObject::read(dict);
|
||||
|
||||
dict.lookup("fields") >> fields_;
|
||||
dict.lookup("writeFields") >> writeFields_;
|
||||
@ -105,7 +107,7 @@ bool Foam::functionObjects::fieldValue::execute()
|
||||
|
||||
bool Foam::functionObjects::fieldValue::write()
|
||||
{
|
||||
writeFiles::write();
|
||||
logFiles::write();
|
||||
|
||||
Log << type() << " " << name() << " write:" << nl;
|
||||
|
||||
|
@ -30,6 +30,11 @@ Group
|
||||
Description
|
||||
Base class for field value -based function objects.
|
||||
|
||||
See also
|
||||
Foam::functionObject
|
||||
Foam::functionObjects::regionFunctionObject
|
||||
Foam::functionObjects::logFiles
|
||||
|
||||
SourceFiles
|
||||
fieldValue.C
|
||||
|
||||
@ -38,7 +43,8 @@ SourceFiles
|
||||
#ifndef functionObjects_fieldValue_H
|
||||
#define functionObjects_fieldValue_H
|
||||
|
||||
#include "writeFiles.H"
|
||||
#include "regionFunctionObject.H"
|
||||
#include "logFiles.H"
|
||||
#include "Switch.H"
|
||||
#include "Field.H"
|
||||
|
||||
@ -59,7 +65,8 @@ namespace functionObjects
|
||||
|
||||
class fieldValue
|
||||
:
|
||||
public writeFiles
|
||||
public regionFunctionObject,
|
||||
public logFiles
|
||||
{
|
||||
|
||||
protected:
|
||||
|
@ -106,7 +106,8 @@ Foam::functionObjects::fieldValues::fieldValueDelta::fieldValueDelta
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
writeFiles(name, runTime, dict, name),
|
||||
regionFunctionObject(name, runTime, dict),
|
||||
logFiles(obr_, name),
|
||||
operation_(opSubtract),
|
||||
region1Ptr_(nullptr),
|
||||
region2Ptr_(nullptr)
|
||||
@ -135,7 +136,7 @@ bool Foam::functionObjects::fieldValues::fieldValueDelta::read
|
||||
const dictionary& dict
|
||||
)
|
||||
{
|
||||
writeFiles::read(dict);
|
||||
regionFunctionObject::read(dict);
|
||||
|
||||
region1Ptr_.reset
|
||||
(
|
||||
@ -166,7 +167,7 @@ bool Foam::functionObjects::fieldValues::fieldValueDelta::read
|
||||
|
||||
bool Foam::functionObjects::fieldValues::fieldValueDelta::write()
|
||||
{
|
||||
writeFiles::write();
|
||||
logFiles::write();
|
||||
|
||||
region1Ptr_->write();
|
||||
region2Ptr_->write();
|
||||
|
@ -65,7 +65,10 @@ Usage
|
||||
\endplaintable
|
||||
|
||||
See also
|
||||
Foam::fieldValue
|
||||
Foam::functionObject
|
||||
Foam::functionObject::fieldValue
|
||||
Foam::functionObjects::regionFunctionObject
|
||||
Foam::functionObjects::logFiles
|
||||
|
||||
SourceFiles
|
||||
fieldValueDelta.C
|
||||
@ -75,7 +78,8 @@ SourceFiles
|
||||
#ifndef functionObjects_fieldValueDelta_H
|
||||
#define functionObjects_fieldValueDelta_H
|
||||
|
||||
#include "writeFiles.H"
|
||||
#include "regionFunctionObject.H"
|
||||
#include "logFiles.H"
|
||||
#include "fieldValue.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -93,7 +97,8 @@ namespace fieldValues
|
||||
|
||||
class fieldValueDelta
|
||||
:
|
||||
public writeFiles
|
||||
public regionFunctionObject,
|
||||
public logFiles
|
||||
{
|
||||
public:
|
||||
//- Operation type enumeration
|
||||
|
@ -50,7 +50,7 @@ void Foam::functionObjects::histogram::writeGraph
|
||||
{
|
||||
const wordList fieldNames(1, fieldName);
|
||||
|
||||
fileName outputPath = baseTimeDir();
|
||||
fileName outputPath = file_.baseTimeDir();
|
||||
mkDir(outputPath);
|
||||
OFstream graphFile
|
||||
(
|
||||
@ -75,7 +75,8 @@ Foam::functionObjects::histogram::histogram
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
writeFile(name, runTime, dict, name)
|
||||
regionFunctionObject(name, runTime, dict),
|
||||
file_(obr_, name)
|
||||
{
|
||||
if (!isA<fvMesh>(obr_))
|
||||
{
|
||||
|
@ -59,6 +59,7 @@ Usage
|
||||
|
||||
See also
|
||||
Foam::functionObject
|
||||
Foam::functionObjects::regionFunctionObject
|
||||
Foam::functionObjects::writeFile
|
||||
|
||||
SourceFiles
|
||||
@ -69,8 +70,9 @@ SourceFiles
|
||||
#ifndef functionObjects_histogram_H
|
||||
#define functionObjects_histogram_H
|
||||
|
||||
#include "writer.H"
|
||||
#include "regionFunctionObject.H"
|
||||
#include "writeFile.H"
|
||||
#include "writer.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -85,10 +87,12 @@ namespace functionObjects
|
||||
|
||||
class histogram
|
||||
:
|
||||
public writeFile
|
||||
public regionFunctionObject
|
||||
{
|
||||
// Private data
|
||||
|
||||
writeFile file_;
|
||||
|
||||
//- Name of field
|
||||
word fieldName_;
|
||||
|
||||
|
@ -74,7 +74,7 @@ void Foam::functionObjects::regionSizeDistribution::writeGraph
|
||||
{
|
||||
const wordList valNames(1, valueName);
|
||||
|
||||
fileName outputPath = baseTimeDir();
|
||||
fileName outputPath = file_.baseTimeDir();
|
||||
mkDir(outputPath);
|
||||
|
||||
OFstream str(outputPath/formatterPtr_().getFileName(coords, valNames));
|
||||
@ -330,7 +330,8 @@ Foam::functionObjects::regionSizeDistribution::regionSizeDistribution
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
writeFile(name, runTime, dict, name),
|
||||
regionFunctionObject(name, runTime, dict),
|
||||
file_(obr_, name),
|
||||
alphaName_(dict.lookup("field")),
|
||||
patchNames_(dict.lookup("patches"))
|
||||
{
|
||||
|
@ -96,6 +96,7 @@ Usage
|
||||
|
||||
See also
|
||||
Foam::functionObject
|
||||
Foam::functionObjects::regionFunctionObject
|
||||
Foam::functionObjects::writeFile
|
||||
|
||||
SourceFiles
|
||||
@ -106,6 +107,7 @@ SourceFiles
|
||||
#ifndef functionObjects_regionSizeDistribution_H
|
||||
#define functionObjects_regionSizeDistribution_H
|
||||
|
||||
#include "regionFunctionObject.H"
|
||||
#include "writeFile.H"
|
||||
#include "writer.H"
|
||||
#include "Map.H"
|
||||
@ -130,10 +132,12 @@ namespace functionObjects
|
||||
|
||||
class regionSizeDistribution
|
||||
:
|
||||
public writeFile
|
||||
public regionFunctionObject
|
||||
{
|
||||
// Private data
|
||||
|
||||
writeFile file_;
|
||||
|
||||
//- Name of field
|
||||
word alphaName_;
|
||||
|
||||
|
@ -102,7 +102,8 @@ Foam::functionObjects::wallHeatFlux::wallHeatFlux
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
writeFiles(name, runTime, dict, name),
|
||||
regionFunctionObject(name, runTime, dict),
|
||||
logFiles(obr_, name),
|
||||
patchSet_()
|
||||
{
|
||||
if (!isA<fvMesh>(obr_))
|
||||
@ -147,7 +148,7 @@ Foam::functionObjects::wallHeatFlux::~wallHeatFlux()
|
||||
|
||||
bool Foam::functionObjects::wallHeatFlux::read(const dictionary& dict)
|
||||
{
|
||||
writeFiles::read(dict);
|
||||
regionFunctionObject::read(dict);
|
||||
|
||||
const fvMesh& mesh = refCast<const fvMesh>(obr_);
|
||||
const polyBoundaryMesh& pbm = mesh.boundaryMesh();
|
||||
@ -237,7 +238,7 @@ bool Foam::functionObjects::wallHeatFlux::execute()
|
||||
|
||||
bool Foam::functionObjects::wallHeatFlux::write()
|
||||
{
|
||||
writeFiles::write();
|
||||
logFiles::write();
|
||||
|
||||
const volScalarField& wallHeatFlux =
|
||||
obr_.lookupObject<volScalarField>(type());
|
||||
|
@ -54,7 +54,8 @@ Usage
|
||||
|
||||
See also
|
||||
Foam::functionObject
|
||||
Foam::functionObjects::writeFiles
|
||||
Foam::functionObjects::regionFunctionObject
|
||||
Foam::functionObjects::logFiles
|
||||
Foam::functionObjects::pressureTools
|
||||
Foam::functionObjects::timeControl
|
||||
|
||||
@ -66,7 +67,8 @@ SourceFiles
|
||||
#ifndef functionObjects_wallHeatFlux_H
|
||||
#define functionObjects_wallHeatFlux_H
|
||||
|
||||
#include "writeFiles.H"
|
||||
#include "regionFunctionObject.H"
|
||||
#include "logFiles.H"
|
||||
#include "volFieldsFwd.H"
|
||||
#include "surfaceFieldsFwd.H"
|
||||
#include "HashSet.H"
|
||||
@ -89,8 +91,10 @@ namespace functionObjects
|
||||
|
||||
class wallHeatFlux
|
||||
:
|
||||
public writeFiles
|
||||
public regionFunctionObject,
|
||||
public logFiles
|
||||
{
|
||||
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
@ -89,7 +89,8 @@ Foam::functionObjects::wallShearStress::wallShearStress
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
writeFiles(name, runTime, dict, name),
|
||||
regionFunctionObject(name, runTime, dict),
|
||||
logFiles(obr_, name),
|
||||
patchSet_()
|
||||
{
|
||||
if (!isA<fvMesh>(obr_))
|
||||
@ -139,7 +140,7 @@ Foam::functionObjects::wallShearStress::~wallShearStress()
|
||||
|
||||
bool Foam::functionObjects::wallShearStress::read(const dictionary& dict)
|
||||
{
|
||||
writeFiles::read(dict);
|
||||
regionFunctionObject::read(dict);
|
||||
|
||||
const fvMesh& mesh = refCast<const fvMesh>(obr_);
|
||||
const polyBoundaryMesh& pbm = mesh.boundaryMesh();
|
||||
@ -236,7 +237,7 @@ bool Foam::functionObjects::wallShearStress::execute()
|
||||
|
||||
bool Foam::functionObjects::wallShearStress::write()
|
||||
{
|
||||
writeFiles::write();
|
||||
logFiles::write();
|
||||
|
||||
const volVectorField& wallShearStress =
|
||||
obr_.lookupObject<volVectorField>(type());
|
||||
|
@ -65,7 +65,8 @@ Usage
|
||||
|
||||
See also
|
||||
Foam::functionObject
|
||||
Foam::functionObjects::writeFiles
|
||||
Foam::functionObjects::regionFunctionObject
|
||||
Foam::functionObjects::logFiles
|
||||
Foam::functionObjects::pressureTools
|
||||
Foam::functionObjects::timeControl
|
||||
|
||||
@ -77,7 +78,8 @@ SourceFiles
|
||||
#ifndef functionObjects_wallShearStress_H
|
||||
#define functionObjects_wallShearStress_H
|
||||
|
||||
#include "writeFiles.H"
|
||||
#include "regionFunctionObject.H"
|
||||
#include "logFiles.H"
|
||||
#include "volFieldsFwd.H"
|
||||
#include "HashSet.H"
|
||||
|
||||
@ -98,8 +100,10 @@ namespace functionObjects
|
||||
|
||||
class wallShearStress
|
||||
:
|
||||
public writeFiles
|
||||
public regionFunctionObject,
|
||||
public logFiles
|
||||
{
|
||||
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
@ -121,7 +121,8 @@ Foam::functionObjects::yPlus::yPlus
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
writeFiles(name, runTime, dict, name)
|
||||
regionFunctionObject(name, runTime, dict),
|
||||
logFiles(obr_, name)
|
||||
{
|
||||
if (!isA<fvMesh>(obr_))
|
||||
{
|
||||
@ -164,7 +165,7 @@ Foam::functionObjects::yPlus::~yPlus()
|
||||
|
||||
bool Foam::functionObjects::yPlus::read(const dictionary& dict)
|
||||
{
|
||||
writeFiles::read(dict);
|
||||
regionFunctionObject::read(dict);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -208,7 +209,7 @@ bool Foam::functionObjects::yPlus::write()
|
||||
|
||||
yPlus.write();
|
||||
|
||||
writeFiles::write();
|
||||
logFiles::write();
|
||||
|
||||
const volScalarField::Boundary& yPlusBf = yPlus.boundaryField();
|
||||
|
||||
|
@ -33,7 +33,8 @@ Description
|
||||
|
||||
See also
|
||||
Foam::functionObject
|
||||
Foam::functionObjects::writeFiles
|
||||
Foam::functionObjects::regionFunctionObject
|
||||
Foam::functionObjects::logFiles
|
||||
Foam::functionObjects::timeControl
|
||||
|
||||
SourceFiles
|
||||
@ -44,7 +45,8 @@ SourceFiles
|
||||
#ifndef functionObjects_yPlus_H
|
||||
#define functionObjects_yPlus_H
|
||||
|
||||
#include "writeFiles.H"
|
||||
#include "regionFunctionObject.H"
|
||||
#include "logFiles.H"
|
||||
#include "volFieldsFwd.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -65,7 +67,8 @@ namespace functionObjects
|
||||
|
||||
class yPlus
|
||||
:
|
||||
public writeFiles
|
||||
public regionFunctionObject,
|
||||
public logFiles
|
||||
{
|
||||
// Private Member Functions
|
||||
|
||||
|
@ -179,7 +179,7 @@ bool Foam::functionObjects::forceCoeffs::write()
|
||||
|
||||
if (Pstream::master())
|
||||
{
|
||||
writeFiles::write();
|
||||
logFiles::write();
|
||||
|
||||
scalar pDyn = 0.5*rhoRef_*magUInf_*magUInf_;
|
||||
|
||||
|
@ -529,7 +529,8 @@ Foam::functionObjects::forces::forces
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
writeFiles(name, runTime, dict, name),
|
||||
regionFunctionObject(name, runTime, dict),
|
||||
logFiles(obr_, name),
|
||||
force_(3),
|
||||
moment_(3),
|
||||
patchSet_(),
|
||||
@ -569,7 +570,8 @@ Foam::functionObjects::forces::forces
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
writeFiles(name, obr, dict, name),
|
||||
regionFunctionObject(name, obr, dict),
|
||||
logFiles(obr_, name),
|
||||
force_(3),
|
||||
moment_(3),
|
||||
patchSet_(),
|
||||
@ -612,7 +614,7 @@ Foam::functionObjects::forces::~forces()
|
||||
|
||||
bool Foam::functionObjects::forces::read(const dictionary& dict)
|
||||
{
|
||||
writeFiles::read(dict);
|
||||
regionFunctionObject::read(dict);
|
||||
|
||||
initialised_ = false;
|
||||
|
||||
@ -909,7 +911,7 @@ bool Foam::functionObjects::forces::write()
|
||||
|
||||
if (Pstream::master())
|
||||
{
|
||||
writeFiles::write();
|
||||
logFiles::write();
|
||||
|
||||
writeForces();
|
||||
|
||||
|
@ -101,7 +101,8 @@ Note
|
||||
|
||||
See also
|
||||
Foam::functionObject
|
||||
Foam::functionObjects::writeFiles
|
||||
Foam::functionObjects::regionFunctionObject
|
||||
Foam::functionObjects::logFiles
|
||||
Foam::functionObjects::timeControl
|
||||
Foam::forceCoeffs
|
||||
|
||||
@ -113,7 +114,8 @@ SourceFiles
|
||||
#ifndef functionObjects_forces_H
|
||||
#define functionObjects_forces_H
|
||||
|
||||
#include "writeFiles.H"
|
||||
#include "regionFunctionObject.H"
|
||||
#include "logFiles.H"
|
||||
#include "coordinateSystem.H"
|
||||
#include "volFieldsFwd.H"
|
||||
#include "HashSet.H"
|
||||
@ -131,8 +133,10 @@ namespace functionObjects
|
||||
|
||||
class forces
|
||||
:
|
||||
public writeFiles
|
||||
public regionFunctionObject,
|
||||
public logFiles
|
||||
{
|
||||
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
@ -25,6 +25,8 @@ License
|
||||
|
||||
#include "cloudInfo.H"
|
||||
#include "kinematicCloud.H"
|
||||
#include "dictionary.H"
|
||||
#include "PstreamReduceOps.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
@ -66,7 +68,8 @@ Foam::functionObjects::cloudInfo::cloudInfo
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
writeFiles(name, runTime, dict, name)
|
||||
regionFunctionObject(name, runTime, dict),
|
||||
logFiles(obr_, name)
|
||||
{
|
||||
read(dict);
|
||||
}
|
||||
@ -82,7 +85,9 @@ Foam::functionObjects::cloudInfo::~cloudInfo()
|
||||
|
||||
bool Foam::functionObjects::cloudInfo::read(const dictionary& dict)
|
||||
{
|
||||
writeFiles::resetNames(dict.lookup("clouds"));
|
||||
regionFunctionObject::read(dict);
|
||||
|
||||
logFiles::resetNames(dict.lookup("clouds"));
|
||||
|
||||
Info<< type() << " " << name() << ": ";
|
||||
if (names().size())
|
||||
@ -111,7 +116,7 @@ bool Foam::functionObjects::cloudInfo::execute()
|
||||
|
||||
bool Foam::functionObjects::cloudInfo::write()
|
||||
{
|
||||
writeFiles::write();
|
||||
logFiles::write();
|
||||
|
||||
forAll(names(), i)
|
||||
{
|
||||
|
@ -61,7 +61,8 @@ Usage
|
||||
|
||||
See also
|
||||
Foam::functionObject
|
||||
Foam::functionObjects::writeFiles
|
||||
Foam::functionObjects::regionFunctionObject
|
||||
Foam::functionObjects::logFiles
|
||||
|
||||
SourceFiles
|
||||
cloudInfo.C
|
||||
@ -71,7 +72,8 @@ SourceFiles
|
||||
#ifndef functionObjects_cloudInfo_H
|
||||
#define functionObjects_cloudInfo_H
|
||||
|
||||
#include "writeFiles.H"
|
||||
#include "regionFunctionObject.H"
|
||||
#include "logFiles.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -86,7 +88,8 @@ namespace functionObjects
|
||||
|
||||
class cloudInfo
|
||||
:
|
||||
public writeFiles
|
||||
public regionFunctionObject,
|
||||
public logFiles
|
||||
{
|
||||
protected:
|
||||
|
||||
|
@ -53,7 +53,8 @@ Foam::functionObjects::residuals::residuals
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
writeFiles(name, runTime, dict, name),
|
||||
regionFunctionObject(name, runTime, dict),
|
||||
logFiles(obr_, name),
|
||||
fieldSet_()
|
||||
{
|
||||
if (!isA<fvMesh>(obr_))
|
||||
@ -77,6 +78,8 @@ Foam::functionObjects::residuals::~residuals()
|
||||
|
||||
bool Foam::functionObjects::residuals::read(const dictionary& dict)
|
||||
{
|
||||
regionFunctionObject::read(dict);
|
||||
|
||||
dict.lookup("fields") >> fieldSet_;
|
||||
|
||||
return true;
|
||||
@ -114,7 +117,7 @@ bool Foam::functionObjects::residuals::execute()
|
||||
|
||||
bool Foam::functionObjects::residuals::write()
|
||||
{
|
||||
writeFiles::write();
|
||||
logFiles::write();
|
||||
|
||||
if (Pstream::master())
|
||||
{
|
||||
|
@ -51,7 +51,8 @@ Description
|
||||
|
||||
See also
|
||||
Foam::functionObject
|
||||
Foam::functionObjects::writeFiles
|
||||
Foam::functionObjects::regionFunctionObject
|
||||
Foam::functionObjects::logFiles
|
||||
Foam::functionObjects::timeControl
|
||||
|
||||
SourceFiles
|
||||
@ -62,7 +63,8 @@ SourceFiles
|
||||
#ifndef functionObjects_residuals_H
|
||||
#define functionObjects_residuals_H
|
||||
|
||||
#include "writeFiles.H"
|
||||
#include "regionFunctionObject.H"
|
||||
#include "logFiles.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -77,7 +79,8 @@ namespace functionObjects
|
||||
|
||||
class residuals
|
||||
:
|
||||
public writeFiles
|
||||
public regionFunctionObject,
|
||||
public logFiles
|
||||
{
|
||||
protected:
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user