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;
189 headerClassName_(typeName),
196 registerObject_(registerObject),
197 globalObject_(
false),
200 if (objectRegistry::debug)
203 <<
"Constructing IOobject called " << name_
204 <<
" of type " << headerClassName_
223 headerClassName_(typeName),
230 registerObject_(registerObject),
231 globalObject_(globalObject),
234 if (objectRegistry::debug)
237 <<
"Constructing IOobject called " << name_
238 <<
" of type " << headerClassName_
255 headerClassName_(typeName),
262 registerObject_(registerObject),
263 globalObject_(globalObject),
266 if (!fileNameComponents(path, instance_, local_, name_))
269 <<
" invalid path specification" 273 if (objectRegistry::debug)
276 <<
"Constructing IOobject called " << name_
277 <<
" of type " << headerClassName_
290 headerClassName_(io.headerClassName_),
292 instance_(io.instance_),
297 registerObject_(io.registerObject_),
298 globalObject_(io.globalObject_),
299 objState_(io.objState_)
310 headerClassName_(io.headerClassName_),
312 instance_(io.instance_),
317 registerObject_(io.registerObject_),
318 globalObject_(io.globalObject_),
319 objState_(io.objState_)
353 if (i == word::npos || i == 0)
359 return name_.substr(i+1, word::npos);
368 if (i == word::npos || i == 0)
374 return name_.substr(0, i);
381 return time().rootPath();
387 if (instance().isAbsolute())
393 return rootPath()/caseName()/instance()/db_.dbDir()/local();
400 const word& instance,
405 return rootPath()/caseName()/instance/db_.dbDir()/local;
425 if (objState_ != GOOD)
428 <<
"Recurrent failure for object " << s
435 <<
"Broken object " << s << info() <<
endl;
445 headerClassName_ = io.headerClassName_;
447 instance_ = io.instance_;
451 globalObject_ = io.globalObject_;
452 objState_ = io.objState_;
fileCheckTypes
Enumeration defining the file checking options.
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 /), subsitute 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.