63 class deleteControlDictPtr
67 deleteControlDictPtr()
70 ~deleteControlDictPtr()
78 debugSwitchesPtr_ =
nullptr;
79 infoSwitchesPtr_ =
nullptr;
80 optimisationSwitchesPtr_ =
nullptr;
85 deleteControlDictPtr deleteControlDictPtr_;
98 string controlDictString(
getEnv(
"FOAM_CONTROLDICT"));
99 if (!controlDictString.empty())
111 IFstream ifs(controlDictFiles[cdfi]);
118 "Cannot open controlDict" 126 return *controlDictPtr_;
132 const char* subDictName,
140 subDictName,
false,
false 143 if (!ePtr || !ePtr->
isDict())
145 cerr<<
"debug::switchSet(const char*, dictionary*&):\n" 146 <<
" Cannot find " << subDictName <<
" in dictionary " 153 subDictPtr = &ePtr->
dict();
162 return switchSet(
"DebugSwitches", debugSwitchesPtr_);
168 return switchSet(
"InfoSwitches", infoSwitchesPtr_);
174 return switchSet(
"OptimisationSwitches", optimisationSwitchesPtr_);
182 name, defaultValue,
false,
false 191 name, defaultValue,
false,
false 200 name, defaultValue,
false,
false 208 const float defaultValue
213 name, defaultValue,
false,
false 340 if (!debugObjectsPtr_)
345 return *debugObjectsPtr_;
351 if (!infoObjectsPtr_)
356 return *infoObjectsPtr_;
362 if (!optimisationObjectsPtr_)
367 return *optimisationObjectsPtr_;
373 if (!dimensionSetObjectsPtr_)
378 return *dimensionSetObjectsPtr_;
384 if (!dimensionedConstantObjectsPtr_)
389 return *dimensionedConstantObjectsPtr_;
433 hashset -= controlDictDebug;
437 hashset -= controlDictInfo;
440 hashset = optSwitches;
441 hashset -= controlDictOpt;
447 Info<<
"DebugSwitches" << debugSwitches <<
endl;
448 Info<<
"InfoSwitches" << infoSwitches <<
endl;
449 Info<<
"OptimisationSwitches" << optSwitches <<
endl;
string getEnv(const word &)
Return environment variable of given name.
Abstract base class for registered object with I/O. Used in debug symbol registration.
A HashTable with keys but without contents.
void addInfoObject(const char *name, simpleRegIOobject *obj)
Register info switch read/write object.
const entry * lookupEntryPtr(const word &, bool recursive, bool patternMatch) const
Find and return an entry data stream pointer if present.
float floatOptimisationSwitch(const char *name, const float defaultValue=0)
Lookup optimisation switch or add default value.
errorManipArg< error, int > exit(error &err, const int errNo=1)
dictionary & switchSet(const char *subDictName, dictionary *&subDictPtr)
Internal function to lookup a sub-dictionary from controlDict.
A list of keyword definitions, which are a keyword followed by any number of values (e...
T lookupOrAddDefault(const word &, const T &, bool recursive=false, bool patternMatch=true)
Find and return a T, if not found return the given.
static Stream & writeDivider(Stream &os)
Write the standard file section divider.
Ostream & endl(Ostream &os)
Add newline and flush stream.
#define forAllReverse(list, i)
Reverse loop across all elements in list.
int optimisationSwitch(const char *name, const int defaultValue=0)
Lookup optimisation switch or add default value.
virtual const dictionary & dict() const =0
Return dictionary if this entry is a dictionary.
const T * lookupPtr(const word &) const
Find and return an entry if present, otherwise return nullptr.
void append(const word &, T *)
Add at tail of dictionary.
simpleObjectRegistry & debugObjects()
Get access to registered debug switch objects.
bool good() const
Return true if next operation might succeed.
int infoSwitch(const char *name, const int defaultValue=0)
Lookup info switch or add default value.
simpleObjectRegistry & optimisationObjects()
Get access to registered optimisation switch objects.
fileNameList findEtcFiles(const fileName &, bool mandatory=false, bool findFirst=false)
Search for files from user/group/shipped directories.
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
void addDimensionedConstantObject(const char *name, simpleRegIOobject *)
Register DimensionedConstant read/write object.
const fileName & name() const
Return the dictionary name.
Functions to search 'etc' directories for configuration files etc.
dictionary & infoSwitches()
The InfoSwitches sub-dictionary in the central controlDict.
void append(const T &)
Append an element at the end of the list.
int debugSwitch(const char *name, const int defaultValue=0)
Lookup debug switch or add default value.
void listSwitches(const bool unset)
List debug switches.
virtual bool isDict() const
Return true if this entry is a dictionary.
void listRegisteredSwitches(const bool unset)
List registered debug switches.
simpleObjectRegistry & infoObjects()
Get access to registered info switch objects.
simpleObjectRegistry & dimensionSetObjects()
Get access to registered dimensionSets switch objects.
Template functions to aid in the implementation of demand driven data.
Object registry for simpleRegIOobject. Maintains ordering.
Input from memory buffer stream.
simpleObjectRegistry & dimensionedConstantObjects()
Get access to registered dimensionedConstant switch objects.
List< Key > sortedToc() const
Return the table of contents as a sorted list.
bool merge(const dictionary &)
Merge entries from the given dictionary.
dictionary & optimisationSwitches()
The OptimisationSwitches sub-dictionary in the central controlDict.
void addDimensionSetObject(const char *name, simpleRegIOobject *obj)
Register DimensionSets read/write object.
void addOptimisationObject(const char *name, simpleRegIOobject *obj)
Register optimisation switch read/write object.
dictionary & debugSwitches()
The DebugSwitches sub-dictionary in the central controlDict.
void addDebugObject(const char *name, simpleRegIOobject *obj)
Register debug switch read/write object.
dictionary & controlDict()
The central control dictionary.
void deleteDemandDrivenData(DataPtr &dataPtr)
wordList sortedToc() const
Return the sorted table of contents.
A keyword and a list of tokens is an 'entry'.
#define SafeFatalIOErrorInFunction(ios, msg)
Report an error message using Foam::FatalIOError.