33 Foam::functionObjectList::readFunctionsDict
41 typeIOobject<IOdictionary> functionsDict
51 if (functionsDict.headerOk())
57 return typeIOobject<IOdictionary>
69 bool Foam::functionObjectList::readDict()
72 updated_ = execution_;
80 if (IOdictionary::size())
82 PtrList<functionObject> newPtrs;
83 List<SHA1Digest> newDigs;
84 HashTable<label> newIndices;
88 const dictionary& functionsDict = *
this;
94 functionObject::dictionaryConstructorTablePtr_
97 newPtrs.setSize(functionsDict.size());
98 newDigs.setSize(functionsDict.size());
102 const word& key = iter().keyword();
104 if (!iter().isDict())
109 <<
"Entry " << key <<
" is not a dictionary" <<
endl;
115 const dictionary&
dict = iter().dict();
121 functionObject* objPtr = remove(key, oldIndex);
128 if (newDigs[nFunc] != digests_[oldIndex])
130 ok = objPtr->read(
dict) && ok;
143 autoPtr<functionObject> foPtr;
154 new functionObjects::timeControl(key, time_,
dict)
164 objPtr = foPtr.ptr();
175 newPtrs.set(nFunc, objPtr);
176 newIndices.insert(key, nFunc);
181 newPtrs.setSize(nFunc);
182 newDigs.setSize(nFunc);
187 digests_.transfer(newDigs);
188 indices_.transfer(newIndices);
207 functionObject* ptr = 0;
212 if (fnd != indices_.end())
242 execution_(execution),
256 <<
" found, the latter will be ignored." <<
endl;
276 region =
args[
"region"];
287 functionsDict.
clear();
339 functionsPtr->readDict();
378 bool ok = readDict();
384 if (
operator[](oi).executeAtStart())
386 ok = operator[](oi).execute() && ok;
387 ok = operator[](oi).write() && ok;
409 ok = operator[](oi).execute() && ok;
410 ok = operator[](oi).write() && ok;
431 ok = operator[](oi).end() && ok;
441 scalar result = vGreat;
452 result =
min(result,
operator[](oi).timeToNextAction());
462 scalar result = vGreat;
492 operator[](oi).movePoints(mesh);
504 operator[](oi).topoChange(map);
516 operator[](oi).mapMesh(map);
528 operator[](oi).distribute(map);
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
friend class iterator
Declare friendship with the iterator.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
fileName relativeObjectPath() const
Return complete relativePath + object name.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
bool set(const label) const
Is element set.
void clear()
Clear the PtrList, i.e. set size to zero deleting all the.
void transfer(PtrList< T > &)
Transfer the contents of the argument PtrList into this PtrList.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
const IOdictionary & controlDict() const
Return the control dict.
Extract command arguments and options from the supplied argc and argv parameters.
const string & commandLine() const
Return the command line string.
bool optionFound(const word &opt) const
Return true if the named option is found.
IStringStream optionLookup(const word &opt) const
Return an IStringStream from the named option.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
A list of keyword definitions, which are a keyword followed by any number of values (e....
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T, if not found return the given default.
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
void clear()
Clear the dictionary.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
bool merge(const dictionary &)
Merge entries from the given dictionary.
SHA1Digest digest() const
Return the SHA1 digest of the dictionary contents.
bool open(const fileName &libName, const bool verbose=true)
Open the named library, optionally with warnings if problems occur.
static fileName functionObjectDictPath
Default relative path to the directory structure.
List of function objects with start(), execute() and end() functions that is called for each object.
virtual ~functionObjectList()
Destructor.
virtual void distribute(const polyDistributionMap &)
Redistribute or update using the given distribution map.
virtual scalar maxDeltaT() const
Return the maximum time-step for stable operation.
virtual void movePoints(const polyMesh &mesh)
Update topology using the given map.
label findObjectID(const word &name) const
Find the ID of a given function object by name.
static autoPtr< functionObjectList > New(const argList &args, const Time &runTime)
Construct and return a functionObjectList for an application.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
bool start()
Called at the start of the time-loop.
functionObjectList(const Time &runTime, const bool execution=true)
Construct from Time and the execution setting.
void clear()
Clear the list of function objects.
scalar timeToNextAction()
Return the time to the next write.
bool execute()
Called at each ++ or += of the time-loop.
virtual void topoChange(const polyTopoChangeMap &map)
Update topology using the given map.
bool end()
Called when Time::run() determines that the time-loop exits.
virtual bool read()
Read and set the function objects if their data have changed.
Abstract base-class for Time/database functionObjects.
static autoPtr< functionObject > New(const word &name, const Time &, const dictionary &)
Select from dictionary, based on its "type" entry.
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Class containing mesh-to-mesh mapping information.
Mesh consisting of general polyhedral cells.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
bool headerOk()
Read and check header info.
virtual bool read()
Read object.
Templated form of IOobject providing type information for file reading and header type checking.
A class for handling words, derived from string.
static const word null
An empty word.
#define IOWarningInFunction(ios)
Report an IO warning using Foam::Warning.
#define WarningInFunction
Report a warning using Foam::Warning.
dlLibraryTable libs
Table of loaded dynamic libraries.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const bool)
Return a word representation of a bool.
bool readConfigFile(const word &configType, const string &argString, dictionary &parentDict, const fileName &configFilesPath, const word &configFilesDir, const Pair< string > &contextTypeAndValue, const word ®ion=word::null)
Read the specified configuration file.
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
Foam::argList args(argc, argv)