IOobject Class Reference

Defines the attributes of an object for which implicit objectRegistry management is supported, and provides the infrastructure for performing stream I/O. More...

Inheritance diagram for IOobject:
[legend]
Collaboration diagram for IOobject:
[legend]

Public Types

enum  objectState : char { GOOD, BAD }
 Enumeration defining the valid states of an IOobject. More...
 
enum  readOption : char { MUST_READ, MUST_READ_IF_MODIFIED, READ_IF_PRESENT, NO_READ }
 Enumeration defining the read options. More...
 
enum  writeOption : char { AUTO_WRITE = 0, NO_WRITE = 1 }
 Enumeration defining the write options. More...
 
enum  fileCheckTypes : char { timeStamp, timeStampMaster, inotify, inotifyMaster }
 Enumeration defining the file checking options. More...
 

Public Member Functions

 TypeName ("IOobject")
 Declare type-name, virtual type (with debug switch) More...
 
 IOobject (const IOobject &)=default
 Copy construct. More...
 
virtual ~IOobject ()=default
 Destructor. More...
 
 IOobject (const word &name, const fileName &instance, const objectRegistry &registry, readOption r=NO_READ, writeOption w=NO_WRITE, bool registerObject=true, bool globalObject=false)
 Construct from name, instance, registry, io options. More...
 
 IOobject (const word &name, const fileName &instance, const fileName &local, const objectRegistry &registry, readOption r=NO_READ, writeOption w=NO_WRITE, bool registerObject=true, bool globalObject=false)
 Construct from name, instance, local, registry, io options. More...
 
 IOobject (const fileName &path, const objectRegistry &registry, readOption r=NO_READ, writeOption w=NO_WRITE, bool registerObject=true, bool globalObject=false)
 Construct from path, registry, io options. More...
 
 IOobject (const IOobject &io, const objectRegistry &registry)
 Copy construct, resetting registry. More...
 
 IOobject (const IOobject &io, const word &name)
 Copy construct, resetting name. More...
 
 IOobject (const IOobject &io, readOption, writeOption)
 Copy construct, resetting io options. More...
 
autoPtr< IOobjectclone () const
 Clone. More...
 
autoPtr< IOobjectclone (const objectRegistry &registry) const
 Clone resetting registry. More...
 
const objectRegistrydb () const noexcept
 Return the local objectRegistry. More...
 
const Timetime () const
 Return Time associated with the objectRegistry. More...
 
const wordname () const noexcept
 Return name. More...
 
const wordheaderClassName () const noexcept
 Return name of the class name read from header. More...
 
wordheaderClassName () noexcept
 Return non-constant access to the class name read from header. More...
 
const stringnote () const noexcept
 Return the optional note. More...
 
stringnote () noexcept
 Return non-constant access to the optional note. More...
 
virtual void rename (const word &newName)
 Rename. More...
 
bool registerObject () const noexcept
 Should object created with this IOobject be registered? More...
 
bool registerObject (bool on) noexcept
 Change registration preference, return previous value. More...
 
bool globalObject () const noexcept
 Is object same for all processors? More...
 
bool globalObject (bool on) noexcept
 Change global-object status, return previous value. More...
 
unsigned labelByteSize () const noexcept
 The sizeof (label) in bytes, possibly read from the header. More...
 
unsigned scalarByteSize () const noexcept
 The sizeof (scalar) in bytes, possibly read from the header. More...
 
bool isHeaderClassName (const word &clsName) const
 Test if headerClassName() equals the given class name. More...
 
template<class Type >
bool isHeaderClassName () const
 Test if headerClassName() equals Type::typeName. More...
 
virtual const dictionaryfindMetaData () const noexcept
 Return pointer to meta-data (if any) or nullptr. More...
 
readOption readOpt () const noexcept
 The read option. More...
 
readOption readOpt (readOption opt) noexcept
 Change the read option, return previous value. More...
 
writeOption writeOpt () const noexcept
 The write option. More...
 
writeOption writeOpt (writeOption opt) noexcept
 Change the write option, return previous value. More...
 
word group () const
 Return group (extension part of name) More...
 
word member () const
 Return member (name without the extension) More...
 
const fileNamerootPath () const
 
const fileNamecaseName () const
 
const fileNameinstance () const noexcept
 
fileNameinstance () noexcept
 
const fileNamelocal () const noexcept
 
fileName path () const
 The complete path. More...
 
fileName path (const word &instance, const fileName &local=fileName::null) const
 The complete path with alternative instance and local. More...
 
fileName objectPath () const
 The complete path + object name. More...
 
fileName objectRelPath () const
 The object path relative to the root. More...
 
fileName localFilePath (const word &typeName, const bool search=true) const
 Helper for filePath that searches locally. More...
 
fileName globalFilePath (const word &typeName, const bool search=true) const
 Helper for filePath that searches up if in parallel. More...
 
IOstreamOption parseHeader (const dictionary &headerDict)
 
bool readHeader (Istream &is)
 
bool readHeader (dictionary &headerDict, Istream &is)
 
template<class Type >
bool typeHeaderOk (const bool checkType=true, const bool search=true, const bool verbose=true)
 Read header (uses typeFilePath to find file) and check its info. More...
 
template<class Type >
void warnNoRereading () const
 Helper: warn that type does not support re-reading. More...
 
bool writeHeader (Ostream &os) const
 Write header with current type() More...
 
bool writeHeader (Ostream &os, const word &objectType) const
 Write header with override of type. More...
 
void writeHeader (dictionary &dict, IOstreamOption streamOpt) const
 
void writeHeader (dictionary &dict, const word &objectType, IOstreamOption streamOpt) const
 
bool good () const noexcept
 
bool bad () const noexcept
 
InfoProxy< IOobjectinfo () const
 Return info proxy. More...
 
void operator= (const IOobject &io)
 
readOptionreadOpt () noexcept
 Access to the read option. More...
 
writeOptionwriteOpt () noexcept
 Access to the write option. More...
 
boolregisterObject () noexcept
 Access to the register object option. More...
 
boolglobalObject () noexcept
 Access to the global object option. More...
 
template<>
bool isHeaderClassName () const
 Specialization for void always returns true (no headerClassName check). More...
 
template<class StringType >
Foam::word groupName (StringType base, const word &group)
 

Static Public Member Functions

static bool bannerEnabled () noexcept
 Status of output file banner. More...
 
static bool bannerEnabled (bool on) noexcept
 Enable/disable an output file banner. More...
 
static bool fileNameComponents (const fileName &path, fileName &instance, fileName &local, word &name)
 Split path into instance, local, name components. More...
 
template<class StringType >
static word groupName (StringType base, const word &group)
 Create dot-delimited name.group string. More...
 
static word group (const word &name)
 Return group (extension part of name) More...
 
static word member (const word &name)
 Return member (name without the extension) More...
 
static word scopedName (const std::string &scope, const word &name)
 Create scope:name or scope_name string. More...
 
static IOobject selectIO (const IOobject &io, const fileName &altFile, const word &ioName="")
 Return the IOobject, but also consider an alternative file name. More...
 
static OstreamwriteBanner (Ostream &os, const bool noSyntaxHint=false)
 Write the standard OpenFOAM file/dictionary banner. More...
 
static OstreamwriteDivider (Ostream &os)
 Write the standard file section divider. More...
 
static OstreamwriteEndDivider (Ostream &os)
 Write the standard end file divider. More...
 

Static Public Attributes

static const Enum< fileCheckTypesfileCheckTypesNames
 Names for the fileCheckTypes. More...
 
static char scopeSeparator
 Character for scoping object names (':' or '_') More...
 
static fileCheckTypes fileModificationChecking
 Type of file modification checking. More...
 
static float fileModificationSkew
 Time skew (seconds) for file modification checks. More...
 
static int maxFileModificationPolls
 Max number of times to poll for file modification changes. More...
 

Protected Member Functions

void setBad (const string &s)
 Set the object state to bad. More...
 

Static Protected Member Functions

static void writeHeaderContent (Ostream &os, const IOobject &io, const word &objectType, const dictionary *metaDataDict=nullptr)
 
static void writeHeaderContent (dictionary &dict, const IOobject &io, const word &objectType, IOstreamOption streamOpt, const dictionary *metaDataDict=nullptr)
 

Detailed Description

Defines the attributes of an object for which implicit objectRegistry management is supported, and provides the infrastructure for performing stream I/O.

An IOobject is constructed with an object name, a class name, an instance path, a reference to a objectRegistry, and parameters determining its storage status.

Read options

Define what is done on object construction and explicit reads:

  • MUST_READ
    Object must be read from Istream on construction.
    Error if Istream does not exist or can't be read. Does not check timestamp or re-read.
  • MUST_READ_IF_MODIFIED
    Object must be read from Istream on construction.
    Error if Istream does not exist or can't be read. If object is registered its timestamp will be checked every timestep and possibly re-read.
  • READ_IF_PRESENT
    Read object from Istream if Istream exists, otherwise don't.
    Error only if Istream exists but can't be read. Does not check timestamp or re-read.
  • NO_READ
    Don't read
    Write options
    Define what is done on object destruction and explicit writes:
  • AUTO_WRITE
    Object is written automatically when requested to by the objectRegistry.
  • NO_WRITE
    No automatic write on destruction but can be written explicitly
    When serializing, the IOobject characteristics are typically written as a FoamFile header, which is a sub-dictionary with the following type of content:
Property Description Type Reqd Deflt
version The base format version float no 2.0
format The stream format (ascii/binary) word yes
arch The architecture string string no
note Descriptive note about the object string no
location The relative location of the object string no
class The type of the object word yes
object The name of the object word yes
Note
Specifying registered does not result in the IOobject itself being registered. It is only serves as guidance for a regIOobject using it.
See also
Foam::objectRegistry Foam::regIOobject
Source files

Definition at line 169 of file IOobject.H.

Member Enumeration Documentation

◆ objectState

enum objectState : char

Enumeration defining the valid states of an IOobject.

Enumerator
GOOD 
BAD 

Definition at line 176 of file IOobject.H.

◆ readOption

enum readOption : char

Enumeration defining the read options.

Enumerator
MUST_READ 
MUST_READ_IF_MODIFIED 
READ_IF_PRESENT 
NO_READ 

Definition at line 183 of file IOobject.H.

◆ writeOption

enum writeOption : char

Enumeration defining the write options.

Enumerator
AUTO_WRITE 
NO_WRITE 

Definition at line 192 of file IOobject.H.

◆ fileCheckTypes

enum fileCheckTypes : char

Enumeration defining the file checking options.

Enumerator
timeStamp 
timeStampMaster 
inotify 
inotifyMaster 

Definition at line 199 of file IOobject.H.

Constructor & Destructor Documentation

◆ IOobject() [1/7]

IOobject ( const IOobject )
default

Copy construct.

◆ ~IOobject()

virtual ~IOobject ( )
virtualdefault

Destructor.

◆ IOobject() [2/7]

IOobject ( const word name,
const fileName instance,
const objectRegistry registry,
readOption  r = NO_READ,
writeOption  w = NO_WRITE,
bool  registerObject = true,
bool  globalObject = false 
)

Construct from name, instance, registry, io options.

Definition at line 311 of file IOobject.C.

References Foam::expressions::patchExpr::debug, Foam::endl(), and InfoInFunction.

Here is the call graph for this function:

◆ IOobject() [3/7]

IOobject ( const word name,
const fileName instance,
const fileName local,
const objectRegistry registry,
readOption  r = NO_READ,
writeOption  w = NO_WRITE,
bool  registerObject = true,
bool  globalObject = false 
)

Construct from name, instance, local, registry, io options.

Definition at line 347 of file IOobject.C.

References Foam::expressions::patchExpr::debug, Foam::endl(), and InfoInFunction.

Here is the call graph for this function:

◆ IOobject() [4/7]

IOobject ( const fileName path,
const objectRegistry registry,
readOption  r = NO_READ,
writeOption  w = NO_WRITE,
bool  registerObject = true,
bool  globalObject = false 
)

Construct from path, registry, io options.

Uses fileNameComponents() to split path into components. A path that starts with a '/' is regarded as a file system path. Paths starting with either './' or '../' are relative to current working directory (and replaced with absolute equivalents). All other paths are considered to be relative to the case.

Definition at line 384 of file IOobject.C.

References Foam::expressions::patchExpr::debug, Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, InfoInFunction, and path().

Here is the call graph for this function:

◆ IOobject() [5/7]

IOobject ( const IOobject io,
const objectRegistry registry 
)

Copy construct, resetting registry.

Definition at line 426 of file IOobject.C.

◆ IOobject() [6/7]

IOobject ( const IOobject io,
const word name 
)

Copy construct, resetting name.

Definition at line 449 of file IOobject.C.

◆ IOobject() [7/7]

IOobject ( const IOobject io,
readOption  ro,
writeOption  wo 
)

Copy construct, resetting io options.

Definition at line 472 of file IOobject.C.

Member Function Documentation

◆ writeHeaderContent() [1/2]

void writeHeaderContent ( Ostream os,
const IOobject io,
const word objectType,
const dictionary metaDataDict = nullptr 
)
staticprotected

Helper: write content for FoamFile IOobject header with optional meta information.

Definition at line 155 of file IOobjectWriteHeader.C.

References Foam::foamVersion::buildArch, IOobject::db(), objectRegistry::dbDir(), IOstreamOption::format(), IOobject::instance(), IOobject::local(), IOobject::name(), IOobject::note(), os(), IOstreamOption::version(), dictionary::writeEntry(), and Foam::writeHeaderEntry().

Referenced by IOobject::writeHeader().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeHeaderContent() [2/2]

void writeHeaderContent ( dictionary dict,
const IOobject io,
const word objectType,
IOstreamOption  streamOpt,
const dictionary metaDataDict = nullptr 
)
staticprotected

Helper: write dictionary content for FoamFile header with optional meta information.

Definition at line 194 of file IOobjectWriteHeader.C.

References dictionary::add(), Foam::foamVersion::buildArch, IOobject::db(), objectRegistry::dbDir(), dict, IOstreamOption::format(), IOobject::instance(), IOobject::local(), IOobject::name(), IOobject::note(), dictionary::set(), and IOstreamOption::version().

Here is the call graph for this function:

◆ setBad()

void setBad ( const string s)
protected

Set the object state to bad.

Definition at line 590 of file IOobject.C.

References Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, InfoInFunction, messageStream::level, and s.

Here is the call graph for this function:

◆ TypeName()

TypeName ( "IOobject"  )

Declare type-name, virtual type (with debug switch)

◆ bannerEnabled() [1/2]

static bool bannerEnabled ( )
inlinestaticnoexcept

Status of output file banner.

Definition at line 315 of file IOobject.H.

Referenced by decomposedBlockData::writeHeader(), IOobject::writeHeader(), and collatedFileOperation::writeObject().

Here is the caller graph for this function:

◆ bannerEnabled() [2/2]

static bool bannerEnabled ( bool  on)
inlinestaticnoexcept

Enable/disable an output file banner.

Returns
the previous value

Definition at line 322 of file IOobject.H.

◆ fileNameComponents()

bool fileNameComponents ( const fileName path,
fileName instance,
fileName local,
word name 
)
static

Split path into instance, local, name components.

The splitting behaviour is as follows:

 input       | instance   | local | name
 ----------- | ---------- | ----- | ----
 a           |            |       | a
 a/b         | a          |       | b
 a/b/c/d     | a          | b/c   | d
 /a/b/c      | /a/b       |       | c
 ./a/b/c     | PWD/a/b    |       | c
 ../a/b/c    | PWD/../a/b |       | c
 a/b/        | ERROR      |       |

where PWD is the Foam::cwd() current working directory

Definition at line 147 of file IOobject.C.

References fileName::clean(), Foam::cwd(), Foam::endl(), Foam::isDir(), Foam::name(), path(), Foam::stringOps::validate(), and WarningInFunction.

Here is the call graph for this function:

◆ groupName() [1/2]

static word groupName ( StringType  base,
const word group 
)
inlinestatic

Create dot-delimited name.group string.

An empty group is ignored.

Referenced by phaseSystem::addField(), phaseChange::addToDriftRate(), alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField::calcAlphat(), nutkFilmWallFunctionFvPatchScalarField::calcNut(), nutkWallFunctionFvPatchScalarField::calcNut(), nutUWallFunctionFvPatchScalarField::calcNut(), nutUTabulatedWallFunctionFvPatchScalarField::calcNut(), nutkRoughWallFunctionFvPatchScalarField::calcNut(), nutUBlendedWallFunctionFvPatchScalarField::calcNut(), nutUSpaldingWallFunctionFvPatchScalarField::calcNut(), atmNutUWallFunctionFvPatchScalarField::calcNut(), atmNutkWallFunctionFvPatchScalarField::calcNut(), atmNutWallFunctionFvPatchScalarField::calcNut(), nutkFilmWallFunctionFvPatchScalarField::calcUTau(), nutUBlendedWallFunctionFvPatchScalarField::calcUTau(), nutUSpaldingWallFunctionFvPatchScalarField::calcUTau(), nutUWallFunctionFvPatchScalarField::calcYPlus(), turbulentDispersionModel::continuousTurbulence(), populationBalanceModel::continuousTurbulence(), powerLaw::correct(), Maxwell< BasicTurbulenceModel >::correct(), DarcyForchheimer::correct(), limitTemperature::correct(), solidification::correct(), Gosman::D(), Burns::D(), Maxwell< BasicTurbulenceModel >::devRhoReff(), phasePressureModel::devRhoReff(), kineticTheoryModel::devRhoReff(), phaseSystem::dmdt(), SpalartAllmaras< BasicTurbulenceModel >::epsilon(), phaseSystem::fillFields(), kOmegaSSTLM< BasicTurbulenceModel >::Flength(), kOmegaSSTLM< BasicTurbulenceModel >::Fonset(), phaseSystem::foundBlendedSubModel(), phaseSystem::foundSubModel(), kOmegaSSTLM< BasicTurbulenceModel >::Fthetat(), phaseSystem::generatePairsAndSubModels(), IDDESDelta::IDDESDelta(), WALE< BasicTurbulenceModel >::k(), Smagorinsky< BasicTurbulenceModel >::k(), SpalartAllmaras< BasicTurbulenceModel >::k(), continuousGasKEqn< BasicTurbulenceModel >::liquidTurbulence(), continuousGasKEpsilon< BasicTurbulenceModel >::liquidTurbulence(), phaseSystem::lookupBlendedSubModel(), twoPhaseSystem::lookupSubModel(), phaseSystem::lookupSubModel(), Stokes< BasicTurbulenceModel >::nuEff(), generalizedNewtonian< BasicMomentumTransportModel >::nuEff(), continuousGasKEpsilon< BasicTurbulenceModel >::nuEff(), LESModel< BasicTurbulenceModel >::nuEff(), RASModel< EddyDiffusivity< phaseCompressibleTurbulenceModel > >::nuEff(), Stokes< BasicTurbulenceModel >::nut(), generalizedNewtonian< BasicMomentumTransportModel >::nut(), SpalartAllmaras< BasicTurbulenceModel >::omega(), phaseForces::phaseForces(), basicThermo::phasePropertyName(), populationBalanceModel::populationBalanceModel(), phasePressureModel::R(), continuousGasKEpsilon< BasicTurbulenceModel >::R(), kineticTheoryModel::R(), BilgerMixtureFraction::read(), sampledSurfaces::read(), kOmegaSSTLM< BasicTurbulenceModel >::ReThetac(), kOmegaSSTLM< BasicTurbulenceModel >::ReThetat0(), continuousGasKEpsilon< BasicTurbulenceModel >::rhoEff(), fixedShearStressFvPatchVectorField::updateCoeffs(), JohnsonJacksonParticleSlipFvPatchVectorField::updateCoeffs(), JohnsonJacksonParticleThetaFvPatchScalarField::updateCoeffs(), totalFlowRateAdvectiveDiffusiveFvPatchScalarField::updateCoeffs(), alphatWallFunctionFvPatchScalarField::updateCoeffs(), convectiveHeatTransferFvPatchScalarField::updateCoeffs(), wallHeatTransferFvPatchScalarField::updateCoeffs(), alphatFilmWallFunctionFvPatchScalarField::updateCoeffs(), turbulentMixingLengthFrequencyInletFvPatchScalarField::updateCoeffs(), alphatJayatillekeWallFunctionFvPatchScalarField::updateCoeffs(), turbulentMixingLengthDissipationRateInletFvPatchScalarField::updateCoeffs(), kLowReWallFunctionFvPatchScalarField::updateCoeffs(), atmAlphatkWallFunctionFvPatchScalarField::updateCoeffs(), porousBafflePressureFvPatchField< Type >::updateCoeffs(), epsilonWallFunctionFvPatchScalarField::updateCoeffs(), omegaWallFunctionFvPatchScalarField::updateCoeffs(), alphatWallBoilingWallFunctionFvPatchScalarField::updateCoeffs(), epsilonWallFunctionFvPatchScalarField::updateWeightedCoeffs(), omegaWallFunctionFvPatchScalarField::updateWeightedCoeffs(), nutkFilmWallFunctionFvPatchScalarField::yPlus(), nutLowReWallFunctionFvPatchScalarField::yPlus(), nutkWallFunctionFvPatchScalarField::yPlus(), nutUWallFunctionFvPatchScalarField::yPlus(), nutUTabulatedWallFunctionFvPatchScalarField::yPlus(), nutUBlendedWallFunctionFvPatchScalarField::yPlus(), nutUSpaldingWallFunctionFvPatchScalarField::yPlus(), and nutURoughWallFunctionFvPatchScalarField::yPlus().

◆ group() [1/2]

Foam::word group ( const word name)
static

Return group (extension part of name)

Definition at line 282 of file IOobject.C.

References IOobject::name(), and word::null.

Here is the call graph for this function:

◆ member() [1/2]

Foam::word member ( const word name)
static

Return member (name without the extension)

Definition at line 295 of file IOobject.C.

References Foam::name().

Here is the call graph for this function:

◆ scopedName()

Foam::word scopedName ( const std::string &  scope,
const word name 
)
inlinestatic

Create scope:name or scope_name string.

An empty scope is ignored.

Definition at line 47 of file IOobjectI.H.

References Foam::name().

Referenced by solverInfo::createResidualField(), turbulenceFields::initialise(), multiRegion::read(), turbulenceFields::read(), functionObject::scopedName(), lduMatrix::setResidualField(), turbulenceFields::write(), and electricPotential::write().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ selectIO()

Foam::IOobject selectIO ( const IOobject io,
const fileName altFile,
const word ioName = "" 
)
static

Return the IOobject, but also consider an alternative file name.

Parameters
ioThe expected IOobject to use
altFileAlternative fileName (ignored if empty).
ioNameThe alternative name for the IOobject when the altFile resolves to a directory.
Note
If the alternative fileName is a non-empty string, it defines the location but uses all other properties of the expected IOobject. The location may be an absolute or a relative path. If it corresponds to a directory, the name of the expected IOobject will be used in its resolution. This expected name can provided via the ioName parameter.

Definition at line 238 of file IOobject.C.

References IOobject::db(), string::expand(), IOobject::globalObject(), Foam::isDir(), IOobject::name(), IOobject::readOpt(), IOobject::registerObject(), and IOobject::writeOpt().

Referenced by decompositionModel::selectIO().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clone() [1/2]

autoPtr<IOobject> clone ( ) const
inline

Clone.

Definition at line 468 of file IOobject.H.

References autoPtr< T >::New().

Referenced by searchableSurface::iNew::operator()(), polyMesh::readUpdate(), and searchableSurfaces::searchableSurfaces().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clone() [2/2]

autoPtr<IOobject> clone ( const objectRegistry registry) const
inline

Clone resetting registry.

Definition at line 474 of file IOobject.H.

References autoPtr< T >::New().

Here is the call graph for this function:

◆ db()

◆ time()

◆ name()

const Foam::word & name ( ) const
inlinenoexcept

Return name.

Definition at line 65 of file IOobjectI.H.

Referenced by IOobjectList::add(), exprDriver::addContextObject(), snappyLayerDriver::addLayers(), exprResultGlobals::addValue(), collatedFileOperation::appendObject(), setsToFaceZone::applyToSet(), attachPolyTopoChanger::attach(), meshRefinement::balance(), faBoundaryMesh::checkDefinition(), polyBoundaryMesh::checkDefinition(), objectRegistry::checkIn(), objectRegistry::checkOut(), polyBoundaryMesh::checkParallelSync(), faceZone::checkParallelSync(), refinementFeatures::checkSizes(), objectRegistry::classesImpl(), meshObject::clear(), objectRegistry::clear(), meshObject::clearUpto(), wallBoiling::correct(), IOobjectList::countImpl(), objectRegistry::countImpl(), IOobjectList::countTypeImpl(), objectRegistry::countTypeImpl(), fvMeshTools::createDummyFvMeshFiles(), distributedTriSurfaceMesh::distributedTriSurfaceMesh(), removeRegisteredObject::execute(), fileOperation::exists(), masterUncollatedFileOperation::exists(), uncollatedFileOperation::filePathInfo(), masterUncollatedFileOperation::filePathInfo(), localPointRegion::findDuplicateFacePairs(), refinementSurfaces::findInside(), fileOperation::findInstance(), masterUncollatedFileOperation::findInstance(), coupleGroupIdentifier::findOtherPatchID(), genericPatchFieldBase::genericFatalSolveError(), GeometricField< Type, fvPatchField, volMesh >::GeometricField(), exprResultGlobals::get(), exprResultGlobals::getNamespace(), IOobject::group(), hexRef8Data::hexRef8Data(), injectionModelList::info(), transferModelList::info(), dynamicRefineFvMesh::init(), readFields::loadAndStore(), fvExpressionField::loadAndStore(), Foam::loadPointField(), masterUncollatedFileOperation::localObjectPath(), objectRegistry::lookupClass(), mappedPatchBase::lookupMesh(), objectRegistry::lookupObjectPtr(), objectRegistry::lookupObjectRefPtr(), voxelMeshSearch::makeMesh(), Foam::MapConsistentSubMesh(), meshObject::movePoints(), baseIOdictionary::name(), objectRegistry::namesImpl(), objectRegistry::namesTypeImpl(), simplifiedDynamicFvMeshBase::New(), dynamicFvMesh::New(), fvMeshTools::newMesh(), sampledPatch::patchIDs(), patchInjection::patchInjection(), PatchPostProcessing< CloudType >::PatchPostProcessing(), pointConstraints::pointConstraints(), pointMesh::pointMesh(), probes::prepare(), genericPatchFieldBase::processEntry(), rawIOField< Type >::rawIOField(), wallHeatFlux::read(), wallShearStress::read(), masterUncollatedFileOperation::read(), decomposedBlockData::readBlocks(), uncollatedFileOperation::readStream(), masterUncollatedFileOperation::readStream(), polyMesh::readUpdate(), faFieldReconstructor::reconstructFaAreaField(), faFieldReconstructor::reconstructFaEdgeField(), pointFieldReconstructor::reconstructField(), fvFieldReconstructor::reconstructFvSurfaceField(), fvFieldReconstructor::reconstructFvVolumeField(), fvFieldReconstructor::reconstructFvVolumeInternalField(), triSurfaceMesh::regions(), IOobjectList::remove(), exprDriver::removeContextObject(), exprResultGlobals::removeValue(), genericPatchFieldBase::reportMissingEntry(), Time::run(), IOobject::selectIO(), refinementSurfaces::setMinLevelFields(), removeFaces::setRefinement(), surfaceZonesInfo::surfaceZonesInfo(), surfMesh::surfMesh(), hexRef8Data::sync(), triSurfaceMesh::triSurfaceMesh(), MPPICParcel< ParcelType >::trackingData::updateAverages(), KinematicParcel< ParcelType >::trackingData::updateAverages(), mappedFlowRateFvPatchVectorField::updateCoeffs(), filmPyrolysisRadiativeCoupledMixedFvPatchScalarField::updateCoeffs(), humidityTemperatureCoupledMixedFvPatchScalarField::updateCoeffs(), topoBitSet::updateLabels(), topoBoolSet::updateLabels(), topoSet::updateLabels(), meshObject::updateMesh(), motionSmootherAlgo::updateMesh(), IOobject::warnNoRereading(), writeObjects::write(), MeshedSurfaceProxy< Face >::write(), ObukhovLength::write(), PDRblock::writeBlockMeshDict(), meshToMeshMethod::writeConnectivity(), boundaryRegion::writeDict(), cellTable::writeDict(), mappedPatchBase::writeDict(), fieldExtents::writeFileHeader(), decomposedBlockData::writeHeader(), IOobject::writeHeaderContent(), collatedFileOperation::writeObject(), and regionFunctionObject::writeObject().

◆ headerClassName() [1/2]

◆ headerClassName() [2/2]

Foam::word & headerClassName ( )
inlinenoexcept

Return non-constant access to the class name read from header.

Definition at line 89 of file IOobjectI.H.

◆ note() [1/2]

const Foam::string & note ( ) const
inlinenoexcept

Return the optional note.

Definition at line 95 of file IOobjectI.H.

Referenced by uncollatedFileOperation::read(), masterUncollatedFileOperation::read(), decomposedBlockData::readBlocks(), masterUncollatedFileOperation::readHeader(), edgeMeshFormat::write(), decomposedBlockData::writeData(), boundaryRegion::writeDict(), cellTable::writeDict(), decomposedBlockData::writeHeader(), and IOobject::writeHeaderContent().

Here is the caller graph for this function:

◆ note() [2/2]

Foam::string & note ( )
inlinenoexcept

Return non-constant access to the optional note.

Definition at line 101 of file IOobjectI.H.

◆ rename()

virtual void rename ( const word newName)
inlinevirtual

Rename.

Reimplemented in objectRegistry, and regIOobject.

Definition at line 506 of file IOobject.H.

Referenced by nearWallFields::createFields(), searchableCone::findLine(), searchableCone::findLineAll(), searchableCone::findLineAny(), dynamicMotionSolverListFvMesh::init(), points0MotionSolver::points0IO(), decomposedBlockData::readBlocks(), regIOobject::rename(), faMeshReconstructor::writeAddressing(), and faMeshReconstructor::writeMesh().

Here is the caller graph for this function:

◆ registerObject() [1/3]

bool registerObject ( ) const
inlinenoexcept

Should object created with this IOobject be registered?

Definition at line 107 of file IOobjectI.H.

Referenced by Foam::loadPointField(), regIOobject::regIOobject(), IOobject::selectIO(), motionSolver::stealRegistration(), and blockMesh::topology().

Here is the caller graph for this function:

◆ registerObject() [2/3]

bool registerObject ( bool  on)
inlinenoexcept

Change registration preference, return previous value.

Definition at line 113 of file IOobjectI.H.

◆ globalObject() [1/3]

bool globalObject ( ) const
inlinenoexcept

Is object same for all processors?

Definition at line 121 of file IOobjectI.H.

Referenced by uncollatedFileOperation::read(), masterUncollatedFileOperation::read(), and IOobject::selectIO().

Here is the caller graph for this function:

◆ globalObject() [2/3]

bool globalObject ( bool  on)
inlinenoexcept

Change global-object status, return previous value.

Definition at line 127 of file IOobjectI.H.

◆ labelByteSize()

unsigned labelByteSize ( ) const
inlinenoexcept

The sizeof (label) in bytes, possibly read from the header.

Definition at line 135 of file IOobjectI.H.

◆ scalarByteSize()

unsigned scalarByteSize ( ) const
inlinenoexcept

The sizeof (scalar) in bytes, possibly read from the header.

Definition at line 141 of file IOobjectI.H.

◆ isHeaderClassName() [1/3]

bool isHeaderClassName ( const word clsName) const
inline

Test if headerClassName() equals the given class name.

Definition at line 149 of file IOobjectI.H.

Referenced by IOobjectList::cfindObject(), IOobjectList::countTypeImpl(), IOobjectList::lookupClassTypeImpl(), and IOobjectList::namesTypeImpl().

Here is the caller graph for this function:

◆ isHeaderClassName() [2/3]

bool isHeaderClassName ( ) const
inline

Test if headerClassName() equals Type::typeName.

Definition at line 156 of file IOobjectI.H.

◆ findMetaData()

const Foam::dictionary * findMetaData ( ) const
virtualnoexcept

Return pointer to meta-data (if any) or nullptr.

Reimplemented in regIOobject.

Definition at line 33 of file IOobjectMetaData.C.

Referenced by decomposedBlockData::writeExtraHeaderContent(), and decomposedBlockData::writeHeader().

Here is the caller graph for this function:

◆ readOpt() [1/3]

◆ readOpt() [2/3]

Foam::IOobject::readOption readOpt ( readOption  opt)
inlinenoexcept

Change the read option, return previous value.

Definition at line 171 of file IOobjectI.H.

◆ writeOpt() [1/3]

Foam::IOobject::writeOption writeOpt ( ) const
inlinenoexcept

The write option.

Definition at line 179 of file IOobjectI.H.

Referenced by nearWallFields::createFields(), dynamicMotionSolverListFvMesh::init(), PDRblock::innerMesh(), objectRegistry::objectRegistry(), IOobject::selectIO(), surfMesh::setWriteOption(), and writeObjects::write().

Here is the caller graph for this function:

◆ writeOpt() [2/3]

Foam::IOobject::writeOption writeOpt ( writeOption  opt)
inlinenoexcept

Change the write option, return previous value.

Definition at line 186 of file IOobjectI.H.

◆ group() [2/2]

Foam::word group ( ) const
inline

Return group (extension part of name)

Definition at line 71 of file IOobjectI.H.

References word::ext().

Here is the call graph for this function:

◆ member() [2/2]

Foam::word member ( ) const
inline

Return member (name without the extension)

Definition at line 77 of file IOobjectI.H.

References word::lessExt().

Referenced by kineticGasEvaporation< Thermo, OtherThermo >::Kexp(), and kineticGasEvaporation< Thermo, OtherThermo >::kineticGasEvaporation().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rootPath()

const Foam::fileName & rootPath ( ) const

Definition at line 499 of file IOobject.C.

Referenced by uncollatedFileOperation::filePathInfo(), masterUncollatedFileOperation::filePathInfo(), masterUncollatedFileOperation::localObjectPath(), and fileOperation::processorsCasePath().

Here is the caller graph for this function:

◆ caseName()

const Foam::fileName & caseName ( ) const

Definition at line 505 of file IOobject.C.

Referenced by uncollatedFileOperation::filePathInfo(), masterUncollatedFileOperation::filePathInfo(), and masterUncollatedFileOperation::localObjectPath().

Here is the caller graph for this function:

◆ instance() [1/2]

◆ instance() [2/2]

Foam::fileName & instance ( )
inlinenoexcept

Definition at line 202 of file IOobjectI.H.

◆ local()

◆ path() [1/2]

Foam::fileName path ( ) const

The complete path.

Definition at line 511 of file IOobject.C.

Referenced by searchableSurfaces::checkIntersection(), uncollatedFileOperation::filePathInfo(), masterUncollatedFileOperation::localObjectPath(), fileOperation::readObjects(), refinementHistory::removeFiles(), motionSmootherAlgo::setDisplacement(), surfMesh::surfMesh(), collatedFileOperation::writeObject(), and Time::writeObject().

Here is the caller graph for this function:

◆ path() [2/2]

Foam::fileName path ( const word instance,
const fileName local = fileName::null 
) const

The complete path with alternative instance and local.

Definition at line 535 of file IOobject.C.

◆ objectPath()

Foam::fileName objectPath ( ) const
inline

The complete path + object name.

Definition at line 214 of file IOobjectI.H.

References Foam::name(), and path().

Referenced by collatedFileOperation::appendObject(), surfaceFormatsCore::checkFile(), hexRef8::consistentSlowRefinement2(), uncollatedFileOperation::dirPath(), masterUncollatedFileOperation::dirPath(), fileOperation::exists(), masterUncollatedFileOperation::exists(), uncollatedFileOperation::filePath(), masterUncollatedFileOperation::filePath(), uncollatedFileOperation::filePathInfo(), masterUncollatedFileOperation::filePathInfo(), masterUncollatedFileOperation::findInstance(), genericPatchFieldBase::genericFatalSolveError(), hexRef8::hexRef8(), meshRefinement::mergePatchFacesUndo(), fileOperation::objectPath(), genericPatchFieldBase::processEntry(), collatedFileOperation::processorsDir(), rawIOField< Type >::rawIOField(), uncollatedFileOperation::read(), masterUncollatedFileOperation::read(), uncollatedFileOperation::readHeader(), masterUncollatedFileOperation::readHeader(), uncollatedFileOperation::readObjects(), fileOperation::readObjects(), masterUncollatedFileOperation::readObjects(), uncollatedFileOperation::readStream(), masterUncollatedFileOperation::readStream(), genericPatchFieldBase::reportMissingEntry(), hexRef8::setUnrefinement(), surfZoneIOList::surfZoneIOList(), syncObjects::sync(), triSurfaceMesh::triSurfaceMesh(), PDRblock::writeBlockMeshDict(), boundaryRegion::writeDict(), cellTable::writeDict(), collatedFileOperation::writeObject(), triSurfaceMesh::writeObject(), fileOperation::writeObject(), distributedTriSurfaceMesh::writeObject(), and masterUncollatedFileOperation::writeObject().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ objectRelPath()

Foam::fileName objectRelPath ( ) const

The object path relative to the root.

Definition at line 545 of file IOobject.C.

References Foam::name().

Here is the call graph for this function:

◆ localFilePath()

Foam::fileName localFilePath ( const word typeName,
const bool  search = true 
) const

Helper for filePath that searches locally.

When search is false, simply use the current instance, otherwise search previous instances.

Definition at line 569 of file IOobject.C.

References Foam::fileHandler(), fileOperation::filePath(), and Foam::search().

Referenced by surfaceFormatsCore::checkFile(), distributedTriSurfaceMesh::distributedTriSurfaceMesh(), surfaceFormatsCore::findFile(), triSurfaceMesh::triSurfaceMesh(), and Foam::typeFilePath().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ globalFilePath()

Foam::fileName globalFilePath ( const word typeName,
const bool  search = true 
) const

Helper for filePath that searches up if in parallel.

When search is false, simply use the current instance, otherwise search previous instances.

Definition at line 580 of file IOobject.C.

References Foam::fileHandler(), fileOperation::filePath(), and Foam::search().

Referenced by surfaceFormatsCore::checkFile(), GlobalIOField< vector >::filePath(), extendedFeatureEdgeMesh::filePath(), surfaceFormatsCore::findFile(), triSurfaceMesh::triSurfaceMesh(), Foam::typeFilePath(), and Foam::typeFilePath< IOMap< dictionary > >().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parseHeader()

Foam::IOstreamOption parseHeader ( const dictionary headerDict)

Parse 'FoamFile' header contents and set the IOobject characteristics and return the stream characteristics.

Definition at line 35 of file IOobjectReadHeader.C.

References IOstreamOption::format(), dictionary::get(), Foam::foamVersion::labelByteSize(), dictionary::readIfPresent(), Foam::foamVersion::scalarByteSize(), and IOstreamOption::version().

Here is the call graph for this function:

◆ readHeader() [1/2]

bool readHeader ( Istream is)

Read header ('FoamFile' dictionary) and set the IOobject and stream characteristics.

Definition at line 165 of file IOobjectReadHeader.C.

Referenced by extendedEdgeMeshFormat::read(), edgeMeshFormat::read(), decomposedBlockData::read(), masterUncollatedFileOperation::read(), decomposedBlockData::readBlock(), decomposedBlockData::readBlocks(), decomposedBlockData::readHeader(), uncollatedFileOperation::readStream(), masterUncollatedFileOperation::readStream(), and decomposedBlockData::writeData().

Here is the caller graph for this function:

◆ readHeader() [2/2]

bool readHeader ( dictionary headerDict,
Istream is 
)

Read header (the 'FoamFile' dictionary) and set the IOobject and stream characteristics.

Saves the header content in the given dictionary.

Definition at line 73 of file IOobjectReadHeader.C.

References Foam::expressions::patchExpr::debug, Foam::endl(), Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, IOstreamOption::format(), IOstream::good(), Foam::Info, InfoInFunction, IOWarningInFunction, token::isWord(), IOstream::lineNumber(), Foam::name(), IOstream::name(), Foam::nl, dictionary::read(), IOstream::relativeName(), SeriousIOErrorInFunction, IOstream::setLabelByteSize(), IOstream::setScalarByteSize(), IOstreamOption::version(), and Foam::writeHeader().

Here is the call graph for this function:

◆ typeHeaderOk()

bool typeHeaderOk ( const bool  checkType = true,
const bool  search = true,
const bool  verbose = true 
)

Read header (uses typeFilePath to find file) and check its info.

Optionally checks headerClassName against the type-name. When search is false, simply use the current instance, otherwise search previous instances.

Definition at line 39 of file IOobjectTemplates.C.

References Foam::endl(), Foam::fileHandler(), fileOperation::readHeader(), Foam::search(), and WarningInFunction.

Referenced by fieldToCell::applyToSet(), fvMeshTools::createDummyFvMeshFiles(), fileOperation::exists(), topoSet::findIOobject(), hexRef8::hexRef8(), hexRef8Data::hexRef8Data(), PatchCollisionDensity< CloudType >::PatchCollisionDensity(), points0MotionSolver::points0IO(), Foam::preservePatchTypes(), pyrolysisChemistryModel< CompType, SolidThermo, GasThermo >::pyrolysisChemistryModel(), extendedEdgeMeshFormat::read(), edgeMeshFormat::read(), particle< Type >::readFields(), fieldAverage::restoreWindowFieldsType(), sensitivitySurface::smoothSensitivities(), and TDACChemistryModel< CompType, ThermoType >::TDACChemistryModel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ warnNoRereading()

void warnNoRereading ( ) const

Helper: warn that type does not support re-reading.

Definition at line 88 of file IOobjectTemplates.C.

References Foam::endl(), IOobject::MUST_READ_IF_MODIFIED, IOobject::name(), IOobject::readOpt(), and WarningInFunction.

Here is the call graph for this function:

◆ writeBanner()

Foam::Ostream & writeBanner ( Ostream os,
const bool  noSyntaxHint = false 
)
static

Write the standard OpenFOAM file/dictionary banner.

Optionally without editor syntax hint (eg, for logs)

Definition at line 76 of file IOobjectWriteHeader.C.

References Foam::foamVersion::api, and os().

Referenced by argList::parse(), decomposedBlockData::writeHeader(), and IOobject::writeHeader().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeDivider()

Foam::Ostream & writeDivider ( Ostream os)
static

Write the standard file section divider.

Definition at line 132 of file IOobjectWriteHeader.C.

References os().

Referenced by Foam::listSwitches(), argList::parse(), writeDictionary::write(), decomposedBlockData::writeHeader(), and IOobject::writeHeader().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeEndDivider()

Foam::Ostream & writeEndDivider ( Ostream os)
static

Write the standard end file divider.

Definition at line 142 of file IOobjectWriteHeader.C.

References os().

Referenced by MeshedSurfaceProxy< Face >::write(), PDRblock::writeBlockMeshDict(), decomposedBlockData::writeData(), collatedFileOperation::writeObject(), fileOperation::writeObject(), and masterUncollatedFileOperation::writeObject().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeHeader() [1/4]

bool writeHeader ( Ostream os) const

Write header with current type()

Definition at line 277 of file IOobjectWriteHeader.C.

References os(), and Foam::type().

Referenced by PDRblock::blockMeshDict(), edgeMeshFormat::write(), interpolationLookUpTable< scalar >::write(), MeshedSurfaceProxy< Face >::write(), decomposedBlockData::writeBlockEntry(), PDRblock::writeBlockMeshDict(), boundaryRegion::writeDict(), cellTable::writeDict(), IOobject::writeHeader(), collatedFileOperation::writeObject(), fileOperation::writeObject(), and masterUncollatedFileOperation::writeObject().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeHeader() [2/4]

bool writeHeader ( Ostream os,
const word objectType 
) const

Write header with override of type.

Definition at line 236 of file IOobjectWriteHeader.C.

References IOobject::bannerEnabled(), Ostream::beginBlock(), Ostream::endBlock(), Foam::endl(), IOstream::good(), IOstream::info(), InfoInFunction, Foam::nl, os(), IOobject::writeBanner(), IOobject::writeDivider(), and IOobject::writeHeaderContent().

Here is the call graph for this function:

◆ writeHeader() [3/4]

void writeHeader ( dictionary dict,
IOstreamOption  streamOpt 
) const

Write header into a dictionary with current type() and given output format

Definition at line 302 of file IOobjectWriteHeader.C.

References dict, Foam::type(), and IOobject::writeHeader().

Here is the call graph for this function:

◆ writeHeader() [4/4]

void writeHeader ( dictionary dict,
const word objectType,
IOstreamOption  streamOpt 
) const

Write header into a dictionary with override of type and given output format

Definition at line 284 of file IOobjectWriteHeader.C.

References dict, and IOobject::writeHeaderContent().

Here is the call graph for this function:

◆ good()

bool good ( ) const
inlinenoexcept

Definition at line 222 of file IOobjectI.H.

Referenced by topoSet::topoSet().

Here is the caller graph for this function:

◆ bad()

bool bad ( ) const
inlinenoexcept

Definition at line 228 of file IOobjectI.H.

◆ info()

◆ operator=()

void operator= ( const IOobject io)

Definition at line 611 of file IOobject.C.

Referenced by regIOobject::operator=().

Here is the caller graph for this function:

◆ readOpt() [3/3]

readOption& readOpt ( )
inlinenoexcept

Access to the read option.

Deprecated:
(2021-03) - use readOpt(readOption)

Definition at line 704 of file IOobject.H.

◆ writeOpt() [3/3]

writeOption& writeOpt ( )
inlinenoexcept

Access to the write option.

Deprecated:
(2021-03) - use writeOpt(writeOption)

Definition at line 708 of file IOobject.H.

◆ registerObject() [3/3]

bool& registerObject ( )
inlinenoexcept

Access to the register object option.

Deprecated:
(2021-03) - use registerObject(bool)

Definition at line 712 of file IOobject.H.

◆ globalObject() [3/3]

bool& globalObject ( )
inlinenoexcept

Access to the global object option.

Deprecated:
(2021-03) - use globalObject(bool)

Definition at line 716 of file IOobject.H.

◆ isHeaderClassName() [3/3]

bool isHeaderClassName ( ) const
inline

Specialization for void always returns true (no headerClassName check).

Definition at line 722 of file IOobject.H.

◆ groupName() [2/2]

Foam::word groupName ( StringType  base,
const word group 
)
inline

Definition at line 32 of file IOobjectI.H.

References Foam::constant::atomic::group.

Member Data Documentation

◆ fileCheckTypesNames

const Foam::Enum< Foam::IOobject::fileCheckTypes > fileCheckTypesNames
static

Names for the fileCheckTypes.

Definition at line 208 of file IOobject.H.

Referenced by argList::parse().

◆ scopeSeparator

char scopeSeparator
static

Character for scoping object names (':' or '_')

Change with caution.

Definition at line 300 of file IOobject.H.

Referenced by dsmcFields::write().

◆ fileModificationChecking

◆ fileModificationSkew

float fileModificationSkew
static

Time skew (seconds) for file modification checks.

Definition at line 306 of file IOobject.H.

Referenced by argList::parse().

◆ maxFileModificationPolls

int maxFileModificationPolls
static

Max number of times to poll for file modification changes.

Definition at line 309 of file IOobject.H.

Referenced by argList::parse().


The documentation for this class was generated from the following files: