98#ifndef Foam_IOobject_H
99#define Foam_IOobject_H
169 static bool bannerEnabled_;
196 bool registerObject_;
205 unsigned char sizeofLabel_;
208 unsigned char sizeofScalar_;
224 const word& objectType,
234 const word& objectType,
270 return bannerEnabled_;
277 bool old(bannerEnabled_);
307 template<
class StringType>
320 const std::string& scope,
342 const word& ioName =
""
432 const Time&
time() const;
450 virtual
void rename(const word& newName)
553 const
word& typeName,
562 const
word& typeName,
589 const
bool checkType = true,
591 const
bool verbose = true
626 const
word& objectType,
677inline bool IOobject::isHeaderClass<void>()
const
684Ostream&
operator<<(Ostream&
os,
const InfoProxy<IOobject>& ip);
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
Defines the attributes of an object for which implicit objectRegistry management is supported,...
objectState
Enumeration defining the valid states of an IOobject.
const fileName & caseName() const
Return the Time::caseName()
bool isHeaderClass() const
Check if headerClassName() equals Type::typeName.
const word & name() const noexcept
Return the object name.
bool readHeader(Istream &is)
const Time & time() const
Return Time associated with the objectRegistry.
static bool bannerEnabled() noexcept
Status of output file banner.
bool isHeaderClassName() const
Same as isHeaderClass()
void warnNoRereading() const
Helper: warn that type does not support re-reading.
static Ostream & writeDivider(Ostream &os)
Write the standard file section divider.
readOption readOpt() const noexcept
The read option.
bool globalObject() const noexcept
Is object same for all processors?
virtual const dictionary * findMetaData() const noexcept
Return pointer to meta-data (if any) or nullptr.
unsigned scalarByteSize() const noexcept
The sizeof (scalar) in bytes, possibly read from the header.
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.
static Ostream & writeEndDivider(Ostream &os)
Write the standard end file divider.
fileCheckTypes
Enumeration defining the file checking options.
static Ostream & writeBanner(Ostream &os, const bool noSyntaxHint=false)
Write the standard OpenFOAM file/dictionary banner.
const objectRegistry & db() const noexcept
Return the local objectRegistry.
bool good() const noexcept
Did last readHeader() succeed?
bool bad() const noexcept
Did last readHeader() fail?
autoPtr< IOobject > clone(const objectRegistry ®istry) const
Clone resetting registry.
bool registerObject() const noexcept
Should object created with this IOobject be registered?
static word scopedName(const std::string &scope, const word &name)
Create scope:name or scope_name string.
static char scopeSeparator
Character for scoping object names (':' or '_')
fileName globalFilePath(const word &typeName, const bool search=true) const
Helper for filePath that searches up if in parallel.
bool hasHeaderClass() const noexcept
True if headerClassName() is non-empty (after reading)
void operator=(const IOobject &io)
Copy assignment, copies all values (except the registry)
IOobject(const IOobject &)=default
Copy construct.
static IOobject selectIO(const IOobject &io, const fileName &altFile, const word &ioName="")
Return the IOobject, but also consider an alternative file name.
static bool fileNameComponents(const fileName &path, fileName &instance, fileName &local, word &name)
Split path into instance, local, name components.
const fileName & local() const noexcept
Read access to local path component.
static void writeHeaderContent(Ostream &os, const IOobject &io, const word &objectType, const dictionary *metaDataDict=nullptr)
fileName objectRelPath() const
The object path relative to the root.
fileName localFilePath(const word &typeName, const bool search=true) const
Helper for filePath that searches locally.
word group() const
Return group (extension part of name)
IOstreamOption parseHeader(const dictionary &headerDict)
const fileName & instance() const noexcept
Read access to instance path component.
writeOption
Enumeration defining the write options.
TypeName("IOobject")
Declare type-name, virtual type (with debug switch)
static float fileModificationSkew
Time skew (seconds) for file modification checks.
static fileCheckTypes fileModificationChecking
Type of file modification checking.
virtual void rename(const word &newName)
Rename the object.
unsigned labelByteSize() const noexcept
The sizeof (label) in bytes, possibly read from the header.
static const Enum< fileCheckTypes > fileCheckTypesNames
Names for the fileCheckTypes.
fileName path() const
The complete path.
static word groupName(StringType base, const word &group)
Create dot-delimited name.group string.
autoPtr< IOobject > clone() const
Clone.
word member() const
Return member (name without the extension)
const fileName & rootPath() const
Return the Time::rootPath()
const string & note() const noexcept
Return the optional note.
virtual ~IOobject()=default
Destructor.
word & headerClassName() noexcept
Return non-constant access to the class name read from header.
static int maxFileModificationPolls
Max number of times to poll for file modification changes.
fileName objectPath() const
The complete path + object name.
bool writeHeader(Ostream &os) const
Write header with current type()
void setBad(const string &s)
Set the object state to bad.
writeOption writeOpt() const noexcept
The write option.
InfoProxy< IOobject > info() const
Return info proxy, for printing information to a stream.
readOption
Enumeration defining the read options.
The IOstreamOption is a simple container for options an IOstream can normally have.
A helper class for outputting values to Ostream.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
A class for handling file names.
Registry of regIOobjects.
A class for handling words, derived from Foam::string.
OBJstream os(runTime.globalPath()/outputName)
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
fileName typeFilePath(const IOobject &io, const bool search=true)
Template function for obtaining local or global filePath.
bool typeGlobal()
Template function for obtaining global vs. local status.
fileName search(const word &file, const fileName &directory)
Recursively search the given directory for the file.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.