Base class for writing single files from the function objects. More...
Public Member Functions | |
| writeFile (const objectRegistry &obr, const fileName &prefix, const word &name="undefined", const bool writeToFile=true) | |
| Construct from objectRegistry, prefix, fileName. More... | |
| writeFile (const objectRegistry &obr, const fileName &prefix, const word &name, const dictionary &dict, const bool writeToFile=true) | |
| writeFile (const writeFile &wf) | |
| Construct copy. More... | |
| virtual | ~writeFile ()=default |
| Destructor. More... | |
| virtual bool | read (const dictionary &dict) |
| Read. More... | |
| virtual OFstream & | file () |
| Return access to the file (if only 1) More... | |
| virtual bool | writeToFile () const |
| Flag to allow writing to file. More... | |
| virtual bool | canWriteHeader () const |
| Flag to allow writing the header. More... | |
| virtual label | charWidth () const |
| Return width of character stream output. More... | |
| virtual void | writeCommented (Ostream &os, const string &str) const |
| Write a commented string to stream. More... | |
| virtual void | writeTabbed (Ostream &os, const string &str) const |
| Write a tabbed string to stream. More... | |
| virtual void | writeHeader (Ostream &os, const string &str) const |
| Write a commented header to stream. More... | |
| virtual void | writeCurrentTime (Ostream &os) const |
| Write the current time to stream. More... | |
| virtual void | writeBreak (Ostream &os) const |
| Write a break marker to the stream. More... | |
| template<class Type > | |
| void | writeHeaderValue (Ostream &os, const string &property, const Type &value) const |
| Write a (commented) header property and value pair. More... | |
Static Public Attributes | |
| static label | addChars = 8 |
| Additional characters for writing. More... | |
Protected Member Functions | |
| void | initStream (Ostream &os) const |
| Initialise the output stream for writing. More... | |
| fileName | baseFileDir () const |
| Return the base directory for output. More... | |
| fileName | baseTimeDir () const |
| Return the base directory for the current time value. More... | |
| virtual autoPtr< OFstream > | createFile (const word &name, scalar timeValue) const |
| Return autoPtr to a new file for a given time. More... | |
| virtual autoPtr< OFstream > | createFile (const word &name) const |
| Return autoPtr to a new file using the simulation start time. More... | |
| virtual void | resetFile (const word &name) |
| Reset internal file pointer to new file with new name. More... | |
| Omanip< int > | valueWidth (const label offset=0) const |
| Return the value width when writing to stream with optional offset. More... | |
| void | operator= (const writeFile &)=delete |
| No copy assignment. More... | |
Protected Attributes | |
| const objectRegistry & | fileObr_ |
| Reference to the region objectRegistry. More... | |
| const fileName | prefix_ |
| Prefix. More... | |
| word | fileName_ |
| Name of file. More... | |
| autoPtr< OFstream > | filePtr_ |
| File pointer. More... | |
| label | writePrecision_ |
| Write precision. More... | |
| bool | writeToFile_ |
| Flag to enable/disable writing to file. More... | |
| bool | updateHeader_ |
| bool | writtenHeader_ |
| Flag to identify whether the header has been written. More... | |
| bool | useUserTime_ |
| scalar | startTime_ |
| Start time value. More... | |
Base class for writing single files from the function objects.
<userDefinedSubDictName1>
{
// Mandatory and other optional entries
...
// Optional (inherited) entries (runtime modifiable)
writePrecision 8;
writeToFile true;
useUserTime true;
}
where the entries mean:
| Property | Description | Type | Req'd | Dflt |
|---|---|---|---|---|
writePrecision | Number of decimal points | label | no | <system dflt> |
writeToFile | Flag to produce text file output | bool | no | true |
useUserTime | Flag to use user time, e.g. degrees | bool | no | true |
Definition at line 106 of file writeFile.H.
| writeFile | ( | const objectRegistry & | obr, |
| const fileName & | prefix, | ||
| const word & | name = "undefined", |
||
| const bool | writeToFile = true |
||
| ) |
Construct from objectRegistry, prefix, fileName.
Definition at line 172 of file writeFile.C.
| writeFile | ( | const objectRegistry & | obr, |
| const fileName & | prefix, | ||
| const word & | name, | ||
| const dictionary & | dict, | ||
| const bool | writeToFile = true |
||
| ) |
Construct from objectRegistry, prefix, fileName and read options from dictionary
Definition at line 193 of file writeFile.C.
References dict, and Foam::read().
Construct copy.
Definition at line 156 of file writeFile.C.
|
virtualdefault |
Destructor.
|
protected |
Initialise the output stream for writing.
Definition at line 42 of file writeFile.C.
References writeFile::charWidth(), Ostream::precision(), Foam::scientific(), IOstream::setf(), Ostream::width(), and writeFile::writePrecision_.
Referenced by logFiles::createFiles().
|
protected |
Return the base directory for output.
Definition at line 50 of file writeFile.C.
References fileName::clean(), polyMesh::defaultRegion, mesh, and functionObject::outputPrefix.
|
protected |
Return the base directory for the current time value.
Definition at line 77 of file writeFile.C.
|
protectedvirtual |
Return autoPtr to a new file for a given time.
Definition at line 84 of file writeFile.C.
References Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, IOstream::good(), UPstream::master(), Foam::mkDir(), Foam::name(), autoPtr< T >::reset(), timeName, and Time::timeName().
Referenced by logFiles::createFiles(), and forceCoeffs::createFiles().
|
protectedvirtual |
Return autoPtr to a new file using the simulation start time.
Definition at line 129 of file writeFile.C.
References Foam::name().
|
protectedvirtual |
Reset internal file pointer to new file with new name.
Definition at line 138 of file writeFile.C.
Referenced by logFiles::resetName().
|
protected |
Return the value width when writing to stream with optional offset.
Definition at line 146 of file writeFile.C.
References Foam::setw().
|
protecteddelete |
No copy assignment.
|
virtual |
Read.
Reimplemented in surfaceFieldValue, actuationDiskSource, volFieldValue, fluxSummary, sizeDistribution, fieldValue, radialActuationDiskSource, wallHeatFlux, timeInfo, cloudInfo, specieReactionRates< ChemistryModelType >, STDMD, stabilityBlendingFactor, regionSizeDistribution, forces, extractEulerianParticles, forceCoeffs, momentum, Curle, fieldMinMax, interfaceHeight, fieldValueDelta, fieldExtents, blendingFactor, particleDistribution, histogram, valueAverage, reactionsSensitivityAnalysis< chemistryType >, continuityError, wallShearStress, AMIWeights, DESModelRegions, solverInfo, yPlus, energySpectrum, and sixDoFRigidBodyState.
Definition at line 214 of file writeFile.C.
References IOstream::defaultPrecision(), dict, MinMax< T >::ge(), and UPstream::master().
Referenced by logFiles::logFiles(), cloudInfo::read(), timeInfo::read(), energySpectrum::read(), yPlus::read(), DESModelRegions::read(), AMIWeights::read(), wallHeatFlux::read(), fieldValue::read(), wallShearStress::read(), continuityError::read(), valueAverage::read(), histogram::read(), particleDistribution::read(), blendingFactor::read(), fieldExtents::read(), fieldMinMax::read(), sizeDistribution::read(), fluxSummary::read(), momentum::read(), extractEulerianParticles::read(), forces::read(), regionSizeDistribution::read(), and stabilityBlendingFactor::read().
|
virtual |
Return access to the file (if only 1)
Definition at line 237 of file writeFile.C.
References FatalErrorInFunction, and Foam::Snull.
Referenced by solverInfo::updateSolverInfo(), fieldValueDelta::write(), solverInfo::writeFileHeader(), and fieldMinMax::writeFileHeader().
|
virtual |
Flag to allow writing to file.
Definition at line 254 of file writeFile.C.
Referenced by forceCoeffs::createFiles().
|
virtual |
Flag to allow writing the header.
Definition at line 260 of file writeFile.C.
|
virtual |
Return width of character stream output.
Definition at line 266 of file writeFile.C.
Referenced by writeFile::initStream().
Write a commented string to stream.
Definition at line 273 of file writeFile.C.
References Foam::setf(), and Foam::setw().
Referenced by cloudInfo::writeFileHeader(), timeInfo::writeFileHeader(), sixDoFRigidBodyState::writeFileHeader(), energySpectrum::writeFileHeader(), solverInfo::writeFileHeader(), DESModelRegions::writeFileHeader(), AMIWeights::writeFileHeader(), volRegion::writeFileHeader(), wallHeatFlux::writeFileHeader(), wallShearStress::writeFileHeader(), continuityError::writeFileHeader(), valueAverage::writeFileHeader(), fieldExtents::writeFileHeader(), blendingFactor::writeFileHeader(), and fieldMinMax::writeFileHeader().
Write a tabbed string to stream.
Definition at line 289 of file writeFile.C.
References Foam::setw(), and Foam::tab.
Referenced by cloudInfo::writeFileHeader(), timeInfo::writeFileHeader(), DESModelRegions::writeFileHeader(), AMIWeights::writeFileHeader(), wallHeatFlux::writeFileHeader(), wallShearStress::writeFileHeader(), valueAverage::writeFileHeader(), fieldExtents::writeFileHeader(), blendingFactor::writeFileHeader(), and fieldMinMax::writeFileHeader().
Write a commented header to stream.
Definition at line 299 of file writeFile.C.
References Foam::nl.
Referenced by cloudInfo::writeFileHeader(), sixDoFRigidBodyState::writeFileHeader(), energySpectrum::writeFileHeader(), solverInfo::writeFileHeader(), DESModelRegions::writeFileHeader(), AMIWeights::writeFileHeader(), wallHeatFlux::writeFileHeader(), wallShearStress::writeFileHeader(), continuityError::writeFileHeader(), valueAverage::writeFileHeader(), fieldExtents::writeFileHeader(), blendingFactor::writeFileHeader(), and fieldMinMax::writeFileHeader().
|
virtual |
Write the current time to stream.
Definition at line 309 of file writeFile.C.
References Foam::setw(), and Time::timeName().
Referenced by fieldValueDelta::write().
|
virtual |
Write a break marker to the stream.
Definition at line 322 of file writeFile.C.
References Foam::writeHeader().
Referenced by solverInfo::writeFileHeader(), fieldExtents::writeFileHeader(), and fieldMinMax::writeFileHeader().
Write a (commented) header property and value pair.
Definition at line 32 of file writeFileTemplates.C.
References Foam::nl, Foam::setf(), and Foam::setw().
Referenced by sixDoFRigidBodyState::writeFileHeader(), volRegion::writeFileHeader(), and fieldExtents::writeFileHeader().
|
protected |
Reference to the region objectRegistry.
Definition at line 113 of file writeFile.H.
Referenced by logFiles::createFiles().
|
protected |
Prefix.
Definition at line 116 of file writeFile.H.
|
protected |
Name of file.
Definition at line 119 of file writeFile.H.
File pointer.
Definition at line 122 of file writeFile.H.
|
protected |
|
protected |
Flag to enable/disable writing to file.
Definition at line 128 of file writeFile.H.
|
protected |
Flag to update the header, e.g. on mesh changes. Default is true.
Definition at line 132 of file writeFile.H.
|
protected |
Flag to identify whether the header has been written.
Definition at line 135 of file writeFile.H.
Referenced by solverInfo::writeFileHeader(), fieldExtents::writeFileHeader(), and fieldMinMax::writeFileHeader().
|
protected |
Flag to use the specified user time, e.g. CA deg instead of seconds. Default = true
Definition at line 139 of file writeFile.H.
|
protected |
Start time value.
Definition at line 142 of file writeFile.H.
|
static |
Additional characters for writing.
Definition at line 183 of file writeFile.H.