mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: function objects - enabled 'fields' entry to use patterns for some objects
This commit is contained in:
@ -150,7 +150,8 @@ Foam::functionObjects::writeFile::writeFile
|
||||
fileName_("undefined"),
|
||||
filePtr_(),
|
||||
writePrecision_(IOstream::defaultPrecision()),
|
||||
writeToFile_(true)
|
||||
writeToFile_(true),
|
||||
writtenHeader_(false)
|
||||
{}
|
||||
|
||||
|
||||
@ -167,7 +168,8 @@ Foam::functionObjects::writeFile::writeFile
|
||||
fileName_(fileName),
|
||||
filePtr_(),
|
||||
writePrecision_(IOstream::defaultPrecision()),
|
||||
writeToFile_(true)
|
||||
writeToFile_(true),
|
||||
writtenHeader_(false)
|
||||
{
|
||||
read(dict);
|
||||
|
||||
@ -234,8 +236,13 @@ void Foam::functionObjects::writeFile::writeCommented
|
||||
const string& str
|
||||
) const
|
||||
{
|
||||
os << setw(1) << "#" << setw(1) << ' '
|
||||
<< setf(ios_base::left) << setw(charWidth() - 2) << str.c_str();
|
||||
os << setw(1) << "#";
|
||||
|
||||
if (str.size())
|
||||
{
|
||||
os << setw(1) << ' '
|
||||
<< setf(ios_base::left) << setw(charWidth() - 2) << str.c_str();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -255,8 +262,8 @@ void Foam::functionObjects::writeFile::writeHeader
|
||||
const string& str
|
||||
) const
|
||||
{
|
||||
os << setw(1) << "#" << setw(1) << ' '
|
||||
<< setf(ios_base::left) << setw(charWidth() - 2) << str.c_str() << nl;
|
||||
writeCommented(os, str);
|
||||
os << nl;
|
||||
}
|
||||
|
||||
|
||||
@ -267,4 +274,10 @@ void Foam::functionObjects::writeFile::writeTime(Ostream& os) const
|
||||
}
|
||||
|
||||
|
||||
void Foam::functionObjects::writeFile::writeBreak(Ostream& os) const
|
||||
{
|
||||
writeHeader(os, "===");
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -79,6 +79,9 @@ protected:
|
||||
//- Flag to enable/disable writing to file
|
||||
bool writeToFile_;
|
||||
|
||||
//- Flag to identify whether the header has been written
|
||||
bool writtenHeader_;
|
||||
|
||||
|
||||
// Protected Member Functions
|
||||
|
||||
@ -171,6 +174,9 @@ public:
|
||||
//- Write the current time to stream
|
||||
virtual void writeTime(Ostream& os) const;
|
||||
|
||||
//- Write a break marker to the stream
|
||||
virtual void writeBreak(Ostream& os) const;
|
||||
|
||||
//- Write a (commented) header property and value pair
|
||||
template<class Type>
|
||||
void writeHeaderValue
|
||||
|
||||
Reference in New Issue
Block a user