Go to the documentation of this file.
46 { fileCheckTypes::timeStamp,
"timeStamp" },
47 { fileCheckTypes::timeStampMaster,
"timeStampMaster" },
48 { fileCheckTypes::inotify,
"inotify" },
49 { fileCheckTypes::inotifyMaster,
"inotifyMaster" },
56 fileCheckTypesNames.get
58 "fileModificationChecking",
68 class addfileModificationCheckingToOpt
74 addfileModificationCheckingToOpt
75 (
const addfileModificationCheckingToOpt&) =
delete;
78 (
const addfileModificationCheckingToOpt&) =
delete;
80 explicit addfileModificationCheckingToOpt(
const char*
name)
85 virtual ~addfileModificationCheckingToOpt() =
default;
100 addfileModificationCheckingToOpt addfileModificationCheckingToOpt_
102 "fileModificationChecking"
120 if (
path.starts_with(
"./") ||
path.starts_with(
"../"))
125 return fileNameComponents(absPath, instance, local,
name);
136 <<
" called with directory: " <<
path <<
endl;
141 const auto first =
path.find(
'/');
142 const auto last =
path.rfind(
'/');
145 auto nameLen =
path.size();
147 if (first == std::string::npos)
158 || (first == 2 &&
path[1] ==
':')
165 instance =
path.substr(0, last);
167 const std::string ending =
path.substr(last+1);
168 nameLen = ending.size();
175 instance =
path.substr(0, first);
180 local =
path.substr(first+1, last-first-1);
183 const std::string ending =
path.substr(last+1);
184 nameLen = ending.size();
189 if (!nameLen || nameLen !=
name.size())
192 <<
"has invalid word for name: \"" <<
name
193 <<
"\"\nwhile processing path: " <<
path <<
endl;
224 altPath /= io.
name();
249 const auto i =
name.rfind(
'.');
251 if (i == std::string::npos || i == 0)
256 return name.substr(i+1);
262 const auto i =
name.rfind(
'.');
264 if (i == std::string::npos || i == 0)
269 return name.substr(0, i);
286 headerClassName_(typeName),
293 registerObject_(registerObject),
294 globalObject_(
false),
296 labelByteSize_(
sizeof(
label)),
297 scalarByteSize_(
sizeof(scalar))
302 <<
"Constructing IOobject called " << name_
303 <<
" of type " << headerClassName_
322 headerClassName_(typeName),
329 registerObject_(registerObject),
330 globalObject_(globalObject),
332 labelByteSize_(
sizeof(
label)),
333 scalarByteSize_(
sizeof(scalar))
338 <<
"Constructing IOobject called " << name_
339 <<
" of type " << headerClassName_
356 headerClassName_(typeName),
363 registerObject_(registerObject),
364 globalObject_(globalObject),
366 labelByteSize_(
sizeof(
label)),
367 scalarByteSize_(
sizeof(scalar))
369 if (!fileNameComponents(
path, instance_, local_, name_))
372 <<
" invalid path specification"
379 <<
"Constructing IOobject called " << name_
380 <<
" of type " << headerClassName_
393 headerClassName_(io.headerClassName_),
395 instance_(io.instance_),
400 registerObject_(io.registerObject_),
401 globalObject_(io.globalObject_),
402 objState_(io.objState_),
403 labelByteSize_(io.labelByteSize_),
404 scalarByteSize_(io.scalarByteSize_)
415 headerClassName_(io.headerClassName_),
417 instance_(io.instance_),
422 registerObject_(io.registerObject_),
423 globalObject_(io.globalObject_),
424 objState_(io.objState_),
425 labelByteSize_(io.labelByteSize_),
426 scalarByteSize_(io.scalarByteSize_)
446 return time().rootPath();
452 return time().caseName();
461 if (instance().starts_with(
'/'))
466 return rootPath()/caseName()/instance()/db_.dbDir()/local();
472 const word& instance,
477 return rootPath()/caseName()/instance/db_.dbDir()/local;
483 const word& typeName,
494 const word& typeName,
505 if (objState_ != GOOD)
508 <<
"Recurrent failure for object " <<
s
515 <<
"Broken object " <<
s << info() <<
endl;
527 headerClassName_ = io.headerClassName_;
529 instance_ = io.instance_;
533 globalObject_ = io.globalObject_;
534 objState_ = io.objState_;
535 labelByteSize_ = io.labelByteSize_;
536 scalarByteSize_ = io.scalarByteSize_;
int debug
Static debugging option.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
#define InfoInFunction
Report an information message using Foam::Info.
fileCheckTypes
Enumeration defining the file checking options.
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
const word & name() const
Return name.
fileName localFilePath(const word &typeName, const bool search=true) const
Helper for filePath that searches locally.
A class for handling words, derived from Foam::string.
static const Enum< fileCheckTypes > fileCheckTypesNames
Names for the fileCheckTypes.
A class for handling file names.
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))
const fileName & rootPath() const
const Time & time() const
Return time.
thermo validate(args.executable(), "h")
static int level
Controls the output verbosity of messageStream.
static fileCheckTypes fileModificationChecking
Type of file modification checking.
virtual fileName filePath(const bool checkGlobal, const IOobject &, const word &typeName, const bool search=true) const =0
Search for an object. checkGlobal : also check undecomposed case.
const fileOperation & fileHandler()
Get current file handler.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const Time & time() const
Return time.
const objectRegistry & db() const
Return the local objectRegistry.
Registry of regIOobjects.
writeOption
Enumeration defining the write options.
bool registerObject() const
Should object created with this IOobject be registered?
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
writeOption writeOpt() const
The write option.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
word name(const complex &c)
Return string representation of complex.
const fileName & caseName() const
bool globalObject() const
Is object same for all processors?
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.
static void writeData(Ostream &os, const Type &val)
fileName globalFilePath(const word &typeName, const bool search=true) const
Helper for filePath that searches up if in parallel.
errorManipArg< error, int > exit(error &err, const int errNo=1)
void operator=(const IOobject &io)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
IOobject(const word &name, const fileName &instance, const objectRegistry ®istry, readOption r=NO_READ, writeOption w=NO_WRITE, bool registerObject=true)
Construct from name, instance, registry, io options.
word member() const
Return member (name without the extension)
readOption readOpt() const
The read option.
string & expand(const bool allowEmpty=false)
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
fileName search(const word &file, const fileName &directory)
Recursively search the given directory for the file.
static const word null
An empty word.
word group() const
Return group (extension part of name)
void setBad(const string &s)
Set the object state to bad.
static bool clean(std::string &str)
Cleanup filename.
fileName cwd()
The physical or logical current working directory path name.
readOption
Enumeration defining the read options.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
fileName path() const
The complete path.
dictionary & optimisationSwitches()
The OptimisationSwitches sub-dictionary in the central controlDict(s).
EnumType read(Istream &is) const
Read a word from Istream and return the corresponding enumeration.
defineTypeNameAndDebug(combustionModel, 0)
#define WarningInFunction
Report a warning using Foam::Warning.
void addOptimisationObject(const char *name, simpleRegIOobject *obj)
Register optimisation switch read/write object.
Abstract base class for registered object with I/O. Used in debug symbol registration.
bool isDir(const fileName &name, const bool followLink=true)
Does the name exist as a DIRECTORY in the file system?