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:" 138 dictFile =
search(funcName, etcDirs[i]);
139 if (!dictFile.empty())
152 const string& funcNameArgs,
165 word funcName(funcNameArgs);
171 bool namedArg =
false;
179 word::const_iterator iter = funcNameArgs.begin();
180 iter != funcNameArgs.end();
190 funcName = funcNameArgs(start, i - start);
195 else if (c ==
',' || c ==
')')
206 funcNameArgs(start, i - start)
215 string::validate<word>(funcNameArgs(start, i - start))
232 argName = string::validate<word>(funcNameArgs(start, i - start));
246 <<
"Cannot find functionObject file " << funcName <<
endl;
255 if (funcsDict.
found(funcName) && funcsDict.
isDict(funcName))
257 funcDictPtr = &funcsDict.
subDict(funcName);
265 if (args.
size() == 1)
267 funcDict.
set(
"field", args[0]);
268 funcDict.
set(
"fields", args);
269 requiredFields.
insert(args[0]);
271 else if (args.
size() > 1)
273 funcDict.
set(
"fields", args);
274 requiredFields.
insert(args);
276 else if (funcDict.
found(
"field"))
280 else if (funcDict.
found(
"fields"))
290 namedArgs[i].
first() +
' ' + namedArgs[i].second() +
';' 298 funcDict.
set(
"region", region);
303 funcArgsDict.
add(string::validate<word>(funcNameArgs), funcDict);
304 functionsDict.
merge(funcArgsDict);
312 Foam::functionObjectList::functionObjectList
323 execution_(execution),
328 Foam::functionObjectList::functionObjectList
339 parentDict_(parentDict),
340 execution_(execution),
367 region = args[
"region"];
427 functionsPtr->start();
454 if (
operator[](objectI).
name() == name)
473 updated_ = execution_ =
false;
545 ok =
operator[](objectI).adjustTimeStep() && ok;
556 updated_ = execution_;
583 <<
"'functions' entry is not a dictionary" 589 const_cast<Time&
>(time_).libs().open
593 functionObject::dictionaryConstructorTablePtr_
601 const word& key = iter().keyword();
603 if (!iter().isDict())
608 <<
"Entry " << key <<
" is not a dictionary" <<
endl;
617 newDigs[nFunc] = dict.
digest();
627 if (newDigs[nFunc] != digests_[oldIndex])
629 ok = objPtr->
read(dict) && ok;
650 dict.
found(
"writeControl")
651 || dict.
found(
"outputControl")
672 <<
"Caught FatalError " << err <<
nl <<
endl;
679 objPtr = foPtr.
ptr();
690 newPtrs.
set(nFunc, objPtr);
691 newIndices.
insert(key, nFunc);
702 digests_.transfer(newDigs);
bool read()
Read and set the function objects if their data have changed.
A HashTable with keys but without contents.
#define forAll(list, i)
Loop across all elements in list.
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.
errorManipArg< error, int > exit(error &err, const int errNo=1)
label findObjectID(const word &name) const
Find the ID of a given function object by name.
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.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
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.
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
static const fileName null
An empty fileName.
bool isDict(const word &) const
Check if entry is a sub-dictionary.
static bool New(dictionary &parentDict, Istream &)
Construct from Istream and insert into dictionary.
bool isFile(const fileName &, const bool checkGzip=true)
Does the name exist as a FILE in the file system?
Ostream & endl(Ostream &os)
Add newline and flush stream.
const entry * lookupEntryPtr(const word &, bool recursive, bool patternMatch) const
Find and return an entry data stream pointer if present.
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.
label size() const
Return number of elements in list.
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 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...
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.
bool optionFound(const word &opt) const
Return true if the named option is found.
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.
string expand(const string &, const HashTable< string, word, string::hash > &mapping, const char sigil= '$')
Expand occurences of variables according to the mapping.
bool set(const label) const
Is element set.
static const word null
An empty word.
~functionObjectList()
Destructor.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
List of function objects with start(), execute() and end() functions that is called for each object...
graph_traits< Graph >::vertices_size_type size_type
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
bool valid() const
Return true if the autoPtr valid (ie, the pointer is set).
void setSize(const label)
Reset size of PtrList. If extending the PtrList, new entries are.
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.
const T & operator[](const label) const
Return element const reference.
void setSize(const label)
Reset size of List.
bool empty() const
Return true if the UPtrList is empty (ie, size() is zero)
#define WarningInFunction
Report a warning using Foam::Warning.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
bool status() const
Return the execution status (on/off) of the function objects.
Input from memory buffer stream.
List< Key > sortedToc() const
Return the table of contents as a sorted list.
SHA1Digest digest() const
Return the SHA1 digest of the dictionary contents.
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.
IStringStream optionLookup(const word &opt) const
Return an IStringStream from the named option.
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.
const dictionary & controlDict() const
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...
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
fileNameList readDir(const fileName &, const fileName::Type=fileName::FILE, const bool filtergz=true)
Read a directory and return the entries as a string list.
static fileName functionObjectDictPath
Default relative path to the directory structure.
bool end()
Called when Time::run() determines that the time-loop exits.
virtual bool isDict() const
Return true if this entry is a dictionary.
A keyword and a list of tokens is an 'entry'.
void dontThrowExceptions()
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
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.