Go to the documentation of this file.
57 { fileCheckTypes::timeStamp,
"timeStamp" },
58 { fileCheckTypes::timeStampMaster,
"timeStampMaster" },
59 { fileCheckTypes::inotify,
"inotify" },
60 { fileCheckTypes::inotifyMaster,
"inotifyMaster" },
67 fileCheckTypesNames.get
69 "fileModificationChecking",
79 class addfileModificationCheckingToOpt
85 addfileModificationCheckingToOpt
86 (
const addfileModificationCheckingToOpt&) =
delete;
89 (
const addfileModificationCheckingToOpt&) =
delete;
91 explicit addfileModificationCheckingToOpt(
const char*
name)
96 virtual ~addfileModificationCheckingToOpt() =
default;
111 addfileModificationCheckingToOpt addfileModificationCheckingToOpt_
113 "fileModificationChecking"
131 if (
path.starts_with(
"./") ||
path.starts_with(
"../"))
136 return fileNameComponents(absPath, instance, local,
name);
147 <<
" called with directory: " <<
path <<
endl;
152 const auto first =
path.find(
'/');
153 const auto last =
path.rfind(
'/');
156 auto nameLen =
path.size();
158 if (first == std::string::npos)
169 || (first == 2 &&
path[1] ==
':')
176 instance =
path.substr(0, last);
178 const std::string ending =
path.substr(last+1);
179 nameLen = ending.size();
186 instance =
path.substr(0, first);
191 local =
path.substr(first+1, last-first-1);
194 const std::string ending =
path.substr(last+1);
195 nameLen = ending.size();
200 if (!nameLen || nameLen !=
name.size())
203 <<
"has invalid word for name: \"" <<
name
204 <<
"\"\nwhile processing path: " <<
path <<
endl;
235 altPath /= io.
name();
260 const auto i =
name.rfind(
'.');
262 if (i == std::string::npos || i == 0)
267 return name.substr(i+1);
273 const auto i =
name.rfind(
'.');
275 if (i == std::string::npos || i == 0)
280 return name.substr(0, i);
297 headerClassName_(typeName),
304 registerObject_(registerObject),
305 globalObject_(
false),
307 labelByteSize_(
sizeof(label)),
308 scalarByteSize_(
sizeof(scalar))
313 <<
"Constructing IOobject called " << name_
314 <<
" of type " << headerClassName_
333 headerClassName_(typeName),
340 registerObject_(registerObject),
341 globalObject_(globalObject),
343 labelByteSize_(
sizeof(label)),
344 scalarByteSize_(
sizeof(scalar))
349 <<
"Constructing IOobject called " << name_
350 <<
" of type " << headerClassName_
367 headerClassName_(typeName),
374 registerObject_(registerObject),
375 globalObject_(globalObject),
377 labelByteSize_(
sizeof(label)),
378 scalarByteSize_(
sizeof(scalar))
380 if (!fileNameComponents(
path, instance_, local_, name_))
383 <<
" invalid path specification"
390 <<
"Constructing IOobject called " << name_
391 <<
" of type " << headerClassName_
404 headerClassName_(io.headerClassName_),
406 instance_(io.instance_),
411 registerObject_(io.registerObject_),
412 globalObject_(io.globalObject_),
413 objState_(io.objState_),
414 labelByteSize_(io.labelByteSize_),
415 scalarByteSize_(io.scalarByteSize_)
426 headerClassName_(io.headerClassName_),
428 instance_(io.instance_),
433 registerObject_(io.registerObject_),
434 globalObject_(io.globalObject_),
435 objState_(io.objState_),
436 labelByteSize_(io.labelByteSize_),
437 scalarByteSize_(io.scalarByteSize_)
457 return time().rootPath();
463 return time().caseName();
472 const auto first = instance().find(
'/');
478 || (first == 2 && instance()[1] ==
':')
486 return rootPath()/caseName()/instance()/db_.dbDir()/local();
492 const word& instance,
497 return rootPath()/caseName()/instance/db_.dbDir()/local;
503 const word& typeName,
514 const word& typeName,
525 if (objState_ != GOOD)
528 <<
"Recurrent failure for object " <<
s
535 <<
"Broken object " <<
s << info() <<
endl;
547 headerClassName_ = io.headerClassName_;
549 instance_ = io.instance_;
553 globalObject_ = io.globalObject_;
554 objState_ = io.objState_;
555 labelByteSize_ = io.labelByteSize_;
556 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
Control 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.
static char scopeSeparator
Character for scoping object names (':' or '_')
const fileOperation & fileHandler()
Get current file handler.
IOobject(const IOobject &)=default
Copy construct.
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.
int infoSwitch(const char *name, const int deflt=0)
Lookup info switch or add default value.
writeOption
Enumeration defining the write options.
bool registerObject() const
Should object created with this IOobject be registered?
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.
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?