57 fileCheckTypesNames.read
61 "fileModificationChecking" 98 "fileModificationChecking" 121 <<
" called with directory: " << path <<
endl;
129 instance = path.substr(0, last);
132 name.string::operator=(path.substr(last+1));
138 if (first == string::npos)
143 name.string::operator=(
path);
147 instance = path.substr(0, first);
153 local = path.substr(first+1, last-first-1);
157 name.string::operator=(path.substr(last+1));
163 if (name.empty() || string::stripInvalid<word>(
name))
166 <<
"has invalid word for name: \"" << name
167 <<
"\"\nwhile processing path: " << path <<
endl;
180 if (i == word::npos || i == 0)
186 return name.substr(i+1, word::npos);
195 if (i == word::npos || i == 0)
201 return name.substr(0, i);
219 headerClassName_(typeName),
226 registerObject_(registerObject),
227 globalObject_(
false),
230 if (objectRegistry::debug)
233 <<
"Constructing IOobject called " << name_
234 <<
" of type " << headerClassName_
253 headerClassName_(typeName),
260 registerObject_(registerObject),
261 globalObject_(globalObject),
264 if (objectRegistry::debug)
267 <<
"Constructing IOobject called " << name_
268 <<
" of type " << headerClassName_
285 headerClassName_(typeName),
292 registerObject_(registerObject),
293 globalObject_(globalObject),
296 if (!fileNameComponents(path, instance_, local_, name_))
299 <<
" invalid path specification" 303 if (objectRegistry::debug)
306 <<
"Constructing IOobject called " << name_
307 <<
" of type " << headerClassName_
320 headerClassName_(io.headerClassName_),
322 instance_(io.instance_),
327 registerObject_(io.registerObject_),
328 globalObject_(io.globalObject_),
329 objState_(io.objState_)
340 headerClassName_(io.headerClassName_),
342 instance_(io.instance_),
347 registerObject_(io.registerObject_),
348 globalObject_(io.globalObject_),
349 objState_(io.objState_)
387 return member(name_);
393 return time().rootPath();
399 if (instance().isAbsolute())
405 return rootPath()/caseName()/instance()/db_.dbDir()/local();
412 const word& instance,
417 return rootPath()/caseName()/instance/db_.dbDir()/local;
437 if (objState_ != GOOD)
440 <<
"Recurrent failure for object " << s
447 <<
"Broken object " << s << info() <<
endl;
457 headerClassName_ = io.headerClassName_;
459 instance_ = io.instance_;
463 globalObject_ = io.globalObject_;
464 objState_ = io.objState_;
fileCheckTypes
Enumeration defining the file checking options.
const char *const group
Group name for atomic constants.
Abstract base class for registered object with I/O. Used in debug symbol registration.
writeOption
Enumeration defining the write options.
static bool fileNameComponents(const fileName &path, fileName &instance, fileName &local, word &name)
Split path into instance, local, name components.
A class for handling file names.
addfileModificationCheckingToOpt(const char *name)
errorManipArg< error, int > exit(error &err, const int errNo=1)
void operator=(const IOobject &)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
virtual void readData(Foam::Istream &is)
Read.
string caseName() const
Return file name (part beyond last /), substitute for FOAM_CASE.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
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.
Ostream & endl(Ostream &os)
Add newline and flush stream.
word member() const
Return member (name without the extension)
virtual ~IOobject()
Destructor.
word group() const
Return group (extension part of name)
readOption
Enumeration defining the read options.
Initialise the NamedEnum HashTable from the static list of names.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
fileName path() const
Return complete path.
fileName localFilePath(const word &typeName) const
Helper for filePath that searches locally.
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().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))
bool isAbsolute() const
Return true if file name is absolute.
bool isDir(const fileName &, const bool followLink=true)
Does the name exist as a DIRECTORY in the file system?
A class for handling words, derived from string.
void setBad(const string &)
Set the object state to bad.
fileName globalFilePath(const word &typeName) const
Helper for filePath that searches up if in parallel.
static const word null
An empty word.
virtual fileName filePath(const bool checkGlobal, const IOobject &, const word &typeName) const =0
Search for an object. checkGlobal : also check undecomposed case.
const fileOperation & fileHandler()
Get current file handler.
graph_traits< Graph >::vertices_size_type size_type
An Ostream is an abstract base class for all output systems (streams, files, token lists...
addfileModificationCheckingToOpt addfileModificationCheckingToOpt_("fileModificationChecking")
const Time & time() const
Return time.
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
defineTypeNameAndDebug(combustionModel, 0)
static fileCheckTypes fileModificationChecking
Type of file modification checking.
word name(const complex &)
Return a string representation of a complex.
virtual void writeData(Foam::Ostream &os) const
Write.
const fileName & rootPath() const
static const NamedEnum< fileCheckTypes, 4 > fileCheckTypesNames
#define WarningInFunction
Report a warning using Foam::Warning.
const Time & time() const
Return time.
Enum read(Istream &) const
Read a word from Istream and return the corresponding.
dictionary & optimisationSwitches()
The OptimisationSwitches sub-dictionary in the central controlDict.
virtual ~addfileModificationCheckingToOpt()
Registry of regIOobjects.
const objectRegistry & db() const
Return the local objectRegistry.
void addOptimisationObject(const char *name, simpleRegIOobject *obj)
Register optimisation switch read/write object.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
const fileName & caseName() const
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
#define InfoInFunction
Report an information message using Foam::Info.