41 "caseDicts/postProcessing" 53 functionObject* ptr = 0;
58 if (fnd != indices_.
end())
63 ptr = this->
set(oldIndex, 0).ptr();
75 void Foam::functionObjectList::listDir
86 if (foFiles[
f].ext().
empty())
88 foMap.insert(foFiles[
f]);
98 listDir(dir/foDirs[fd], foMap);
112 listDir(etcDirs[ed], foMap);
116 <<
"Available configured functionObjects:" 124 const word& funcName,
145 dictFile =
search(funcName, etcDirs[i]);
146 if (!dictFile.empty())
159 const word& funcName,
185 const string& funcNameArgs,
198 word funcName(funcNameArgs);
204 bool namedArg =
false;
212 word::const_iterator iter = funcNameArgs.begin();
213 iter != funcNameArgs.end();
223 funcName = funcNameArgs(start, i - start);
228 else if (c ==
',' || c ==
')')
239 funcNameArgs(start, i - start)
248 string::validate<word>(funcNameArgs(start, i - start))
265 argName = string::validate<word>(funcNameArgs(start, i - start));
279 <<
"Cannot find functionObject file " << funcName <<
endl;
286 ISstream& fileStream = fileStreamPtr();
288 dictionary funcsDict(funcName, functionsDict, fileStream);
291 if (funcsDict.
found(funcName) && funcsDict.
isDict(funcName))
293 funcDictPtr = &funcsDict.
subDict(funcName);
301 if (args.
size() == 1)
303 funcDict.
set(
"field", args[0]);
304 funcDict.
set(
"fields", args);
305 requiredFields.
insert(args[0]);
307 else if (args.
size() > 1)
309 funcDict.
set(
"fields", args);
310 requiredFields.
insert(args);
312 else if (funcDict.
found(
"field"))
316 else if (funcDict.
found(
"fields"))
326 namedArgs[i].
first() +
' ' + namedArgs[i].second() +
';' 334 funcDict.
set(
"region", region);
338 const word funcNameArgsWord = string::validate<word>(funcNameArgs);
340 funcArgsDict.
add(funcNameArgsWord, funcDict);
341 functionsDict.
merge(funcArgsDict);
361 execution_(execution),
377 parentDict_(parentDict),
378 execution_(execution),
405 region = args[
"region"];
465 functionsPtr->start();
492 if (
operator[](objectI).
name() == name)
511 updated_ = execution_ =
false;
592 if (names.
size() > 1)
595 for (
label i = 1; i < names.size(); ++ i)
609 scalar result = vGreat;
631 updated_ = execution_;
658 <<
"'functions' entry is not a dictionary" 664 const_cast<Time&
>(time_).libs().open
668 functionObject::dictionaryConstructorTablePtr_
671 newPtrs.
setSize(functionsDict.size());
672 newDigs.
setSize(functionsDict.size());
676 const word& key = iter().keyword();
678 if (!iter().isDict())
683 <<
"Entry " << key <<
" is not a dictionary" <<
endl;
692 newDigs[nFunc] = dict.
digest();
702 if (newDigs[nFunc] != digests_[oldIndex])
704 ok = objPtr->
read(dict) && ok;
725 dict.
found(
"writeControl")
726 || dict.
found(
"outputControl")
747 <<
"Caught FatalError " << err <<
nl <<
endl;
754 objPtr = foPtr.
ptr();
765 newPtrs.
set(nFunc, objPtr);
766 newIndices.
insert(key, nFunc);
777 digests_.transfer(newDigs);
bool read()
Read and set the function objects if their data have changed.
A HashTable with keys but without contents.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
#define forAll(list, i)
Loop across all elements in list.
string expand(const string &, const HashTable< string, word, string::hash > &mapping, const char sigil='$')
Expand occurrences of variables according to the mapping.
static bool readFunctionObject(const string &funcNameArgs0, dictionary &functionsDict, HashSet< word > &requiredFields, const word ®ion=word::null)
Read the specified functionObject configuration dictionary parsing.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
A class for handling file names.
const entry * lookupEntryPtr(const word &, bool recursive, bool patternMatch) const
Find and return an entry data stream pointer if present.
bool set(const label) const
Is element set.
functionObjectList(const Time &runTime, const bool execution=true)
Construct from Time and the execution setting.
SHA1Digest digest() const
Return the SHA1 digest of the dictionary contents.
errorManipArg< error, int > exit(error &err, const int errNo=1)
void reset(T *=nullptr)
If object pointer already set, delete object and set to given.
static iteratorEnd end()
iteratorEnd set to beyond the end of any HashTable
void off()
Switch the function objects off.
scalar timeToNextWrite()
Return the time to the next write.
A list of keyword definitions, which are a keyword followed by any number of values (e...
A 2-tuple for storing two objects of different types.
static void list()
Print a list of functionObject configuration files in.
bool isFile(const fileName &, const bool checkVariants=true, const bool followLink=true)
Does the name exist as a file in the file system?
void size(const label)
Override size to be inconsistent with allocated storage.
static const dictionary null
Null dictionary.
static const fileName null
An empty fileName.
static bool New(dictionary &parentDict, Istream &)
Construct from Istream and insert into dictionary.
const T & operator[](const label) const
Return element const reference.
bool empty() const
Return true if the UPtrList is empty (ie, size() is zero)
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool optionFound(const word &opt) const
Return true if the named option is found.
virtual const dictionary & dict() const =0
Return dictionary if this entry is a dictionary.
void on()
Switch the function objects on.
void transfer(HashTable< T, Key, Hash > &)
Transfer the contents of the argument table into this table.
T * ptr()
Return object pointer for reuse.
Abstract base-class for Time/database function objects.
static fileName findRegionDict(const word &funcPath, const word ®ion=word::null)
Search for functionObject dictionary file for given region.
bool insert(const Key &key)
Insert a new entry.
A keyword and a list of tokens is a 'dictionaryEntry'.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
bool start()
Called at the start of the time-loop.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
bool isDict(const word &) const
Check if entry is a sub-dictionary.
bool add(entry *, bool mergeEntry=false)
Add a new entry.
bool erase(const iterator &)
Erase a hashedEntry specified by given iterator.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
Class to handle errors and exceptions in a simple, consistent stream-based manner.
bool insert(const Key &, const T &newElmt)
Insert a new hashedEntry.
iterator find(const Key &)
Find and return an iterator set at the hashedEntry.
bool execute()
Called at each ++ or += of the time-loop.
const fileName & name() const
Return the dictionary name.
A class for handling words, derived from string.
Functions to search 'etc' directories for configuration files etc.
Extract command arguments and options from the supplied argc and argv parameters. ...
void clear()
Clear all entries from table.
void append(const T &)
Append an element at the end of the list.
static const word null
An empty word.
~functionObjectList()
Destructor.
const fileOperation & fileHandler()
Get current file handler.
fileNameList readDir(const fileName &, const fileType=fileType::file, const bool filterVariants=true, const bool followLink=true)
Read a directory and return the entries as a string list.
graph_traits< Graph >::vertices_size_type size_type
bool valid() const
Return true if the autoPtr valid (ie, the pointer is set)
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
void setSize(const label)
Reset size of PtrList. If extending the PtrList, new entries are.
virtual bool isDict() const
Return true if this entry is a dictionary.
virtual bool read(const dictionary &)
Read and set the function object if its data have changed.
void set(T *)
Set pointer to that given.
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
word name(const complex &)
Return a string representation of a complex.
void clear()
Clear the list of function objects.
List< word > wordList
A List of words.
void setSize(const label)
Reset size of List.
bool setTimeStep()
Override the time-step value.
bool status() const
Return the execution status (on/off) of the function objects.
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
#define WarningInFunction
Report a warning using Foam::Warning.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Input from memory buffer stream.
List< Key > sortedToc() const
Return the table of contents as a sorted list.
const dimensionedScalar c
Speed of light in a vacuum.
void transfer(PtrList< T > &)
Transfer the contents of the argument PtrList into this PtrList.
static autoPtr< functionObject > New(const word &name, const Time &, const dictionary &)
Select from dictionary, based on its "type" entry.
const dictionary & controlDict() const
void set(entry *)
Assign a new entry, overwrite any existing entry.
void clear()
Clear the PtrList, i.e. set size to zero deleting all the.
bool merge(const dictionary &)
Merge entries from the given dictionary.
fileName search(const word &file, const fileName &directory)
Recursively search the given directory for the file.
#define IOWarningInFunction(ios)
Report an IO warning using Foam::Warning.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Mesh consisting of general polyhedral cells.
label findObjectID(const word &name) const
Find the ID of a given function object by name.
void updateMesh(const mapPolyMesh &mpm)
Update for changes of mesh.
static autoPtr< functionObjectList > New(const argList &args, const Time &runTime, dictionary &controlDict, HashSet< word > &requiredFields)
Construct and return a functionObjectList for an application.
friend class iterator
Declare friendship with the iterator.
Foam::argList args(argc, argv)
void movePoints(const polyMesh &mesh)
Update for changes of mesh.
List< fileName > fileNameList
A List of fileNames.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
static fileName functionObjectDictPath
Default relative path to the directory structure.
bool end()
Called when Time::run() determines that the time-loop exits.
A keyword and a list of tokens is an 'entry'.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
static fileName findDict(const word &funcName, const word ®ion=word::null)
Search for functionObject dictionary file for given region.
void dontThrowExceptions()
fileName path(UMean.rootPath()/UMean.caseName()/functionObjects::writeFile::outputPrefix/"graphs"/UMean.instance())
IStringStream optionLookup(const word &opt) const
Return an IStringStream from the named option.
fileNameList findEtcDirs(const fileName &local=fileName::null)
Search for directories from user/group/shipped directories.
T & first()
Return reference to the first element of the list.