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;
84 HashTable<label> newIndices;
88 const dictionary& functionsDict = *
this;
91 << relativeObjectPath().c_str() <<
endl;
93 printDictionary print(functionsDict);
99 functionObject::dictionaryConstructorTablePtr_
102 newPtrs.setSize(functionsDict.size());
103 newDigs.setSize(functionsDict.size());
107 const word& key = iter().keyword();
109 if (!iter().isDict())
114 <<
"Entry " << key <<
" is not a dictionary" <<
endl;
120 const dictionary&
dict = iter().dict();
126 functionObject* objPtr = remove(key, oldIndex);
133 if (newDigs[nFunc] != digests_[oldIndex])
135 ok = objPtr->read(
dict) && ok;
148 autoPtr<functionObject> foPtr;
159 new functionObjects::timeControl(key, time_,
dict)
169 objPtr = foPtr.ptr();
180 newPtrs.set(nFunc, objPtr);
181 newIndices.insert(key, nFunc);
186 newPtrs.setSize(nFunc);
187 newDigs.setSize(nFunc);
192 digests_.transfer(newDigs);
193 indices_.transfer(newIndices);
212 functionObject* ptr = 0;
217 if (fnd != indices_.end())
247 execution_(execution),
261 <<
" found, the latter will be ignored." <<
endl;
292 functionsDict.
clear();
344 functionsPtr->readDict();
383 bool ok = readDict();
389 if (
operator[](oi).executeAtStart())
391 ok = operator[](oi).execute() && ok;
392 ok = operator[](oi).write() && ok;
414 ok = operator[](oi).execute() && ok;
415 ok = operator[](oi).write() && ok;
436 ok = operator[](oi).end() && ok;
446 scalar result = vGreat;
457 result =
min(result,
operator[](oi).timeToNextAction());
467 scalar result = vGreat;
497 operator[](oi).movePoints(
mesh);
509 operator[](oi).topoChange(map);
521 operator[](oi).mapMesh(map);
533 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 keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
T lookupOrDefault(const word &, const T &) 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.
Motion of the mesh specified as a list of pointMeshMovers.
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.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
#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.
const fvMesh & region(const dictionary &dict)
Cast the give dictionary to the corresponding region fvMesh.
dimensioned< Type > min(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
Ostream & indentOrNl(Ostream &os)
Indent stream or add newline if indent level == 0.
static const label labelMin
bool readConfigFile(const word &configType, const Tuple2< string, label > &argString, dictionary &parentDict, const fileName &configFilesPath, const word &configFilesDir, const word ®ion=word::null, const string &command=string::null)
Read the specified configuration file.
Foam::argList args(argc, argv)