42 "caseDicts/postProcessing" 54 functionObject* ptr = 0;
59 if (fnd != indices_.
end())
64 ptr = this->
set(oldIndex, 0).ptr();
76 void Foam::functionObjectList::listDir
87 if (foFiles[
f].ext().
empty())
89 foMap.insert(foFiles[
f]);
99 listDir(dir/foDirs[fd], foMap);
113 listDir(etcDirs[ed], foMap);
117 <<
"Available configured functionObjects:" 139 dictFile =
search(funcName, etcDirs[i]);
140 if (!dictFile.empty())
153 const string& funcNameArgs,
166 word funcName(funcNameArgs);
172 bool namedArg =
false;
180 word::const_iterator iter = funcNameArgs.begin();
181 iter != funcNameArgs.end();
191 funcName = funcNameArgs(start, i - start);
196 else if (c ==
',' || c ==
')')
207 funcNameArgs(start, i - start)
216 string::validate<word>(funcNameArgs(start, i - start))
233 argName = string::validate<word>(funcNameArgs(start, i - start));
247 <<
"Cannot find functionObject file " << funcName <<
endl;
254 ISstream& fileStream = fileStreamPtr();
259 if (funcsDict.
found(funcName) && funcsDict.
isDict(funcName))
261 funcDictPtr = &funcsDict.
subDict(funcName);
269 if (args.
size() == 1)
271 funcDict.
set(
"field", args[0]);
272 funcDict.
set(
"fields", args);
273 requiredFields.
insert(args[0]);
275 else if (args.
size() > 1)
277 funcDict.
set(
"fields", args);
278 requiredFields.
insert(args);
280 else if (funcDict.
found(
"field"))
284 else if (funcDict.
found(
"fields"))
294 namedArgs[i].
first() +
' ' + namedArgs[i].second() +
';' 302 funcDict.
set(
"region", region);
307 funcArgsDict.
add(string::validate<word>(funcNameArgs), funcDict);
308 functionsDict.
merge(funcArgsDict);
316 Foam::functionObjectList::functionObjectList
327 execution_(execution),
332 Foam::functionObjectList::functionObjectList
343 parentDict_(parentDict),
344 execution_(execution),
371 region = args[
"region"];
431 functionsPtr->start();
458 if (
operator[](objectI).
name() == name)
477 updated_ = execution_ =
false;
549 ok =
operator[](objectI).adjustTimeStep() && ok;
560 updated_ = execution_;
587 <<
"'functions' entry is not a dictionary" 593 const_cast<Time&
>(time_).libs().open
597 functionObject::dictionaryConstructorTablePtr_
600 newPtrs.
setSize(functionsDict.size());
601 newDigs.
setSize(functionsDict.size());
605 const word& key = iter().keyword();
607 if (!iter().isDict())
612 <<
"Entry " << key <<
" is not a dictionary" <<
endl;
621 newDigs[nFunc] = dict.
digest();
631 if (newDigs[nFunc] != digests_[oldIndex])
633 ok = objPtr->
read(dict) && ok;
654 dict.
found(
"writeControl")
655 || dict.
found(
"outputControl")
676 <<
"Caught FatalError " << err <<
nl <<
endl;
683 objPtr = foPtr.
ptr();
694 newPtrs.
set(nFunc, objPtr);
695 newIndices.
insert(key, nFunc);
706 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 occurences 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.
SHA1Digest digest() const
Return the SHA1 digest of the dictionary contents.
errorManipArg< error, int > exit(error &err, const int errNo=1)
static iteratorEnd end()
iteratorEnd set to beyond the end of any HashTable
void off()
Switch the function objects off.
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.
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.
bool adjustTimeStep()
Called at the end of Time::adjustDeltaT() if adjustTime is true.
T * ptr()
Return object pointer for reuse.
Abstract base-class for Time/database function objects.
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.
void reset(T *=0)
If object pointer already set, delete object and set to given.
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 fileName findDict(const word &funcName)
Search for functionObject dictionary file in.
static const word null
An empty word.
~functionObjectList()
Destructor.
const fileOperation & fileHandler()
Get current file handler.
List of function objects with start(), execute() and end() functions that is called for each object...
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.
bool isFile(const fileName &, const bool checkGzip=true, const bool followLink=true)
Does the name exist as a FILE in the file system?
virtual bool read(const dictionary &)
Read and set the function object if its data have changed.
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
void set(T *)
Set pointer to that given.
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 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.
fileNameList readDir(const fileName &, const fileName::Type=fileName::FILE, const bool filtergz=true, const bool followLink=true)
Read a directory and return the entries as a string list.
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.
void dontThrowExceptions()
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.