Go to the documentation of this file.
67 struct deleteControlDictPtr
69 ~deleteControlDictPtr()
77 debugSwitchesPtr_ =
nullptr;
78 infoSwitchesPtr_ =
nullptr;
79 optimisationSwitchesPtr_ =
nullptr;
84 deleteControlDictPtr deleteControlDictPtr_;
111 return eptr->
get<
T>();
145 if (!controlDictPtr_)
147 string controlDictString(
Foam::getEnv(
"FOAM_CONTROLDICT"));
148 if (!controlDictString.empty())
151 IStringStream is(controlDictString);
152 controlDictPtr_ =
new dictionary(is);
157 controlDictPtr_ =
new dictionary();
160 IFstream is(controlDictFiles[i]);
167 "Cannot open controlDict"
170 controlDictPtr_->merge(dictionary(is));
175 return *controlDictPtr_;
181 const char* subDictName,
189 if (!eptr || !eptr->
isDict())
192 <<
"debug::switchSet(const char*, dictionary*&):\n"
193 <<
" Cannot find " << subDictName <<
" in dictionary "
200 subDictPtr = &(eptr->
dict());
209 return switchSet(
"DebugSwitches", debugSwitchesPtr_);
215 return switchSet(
"InfoSwitches", infoSwitchesPtr_);
221 return switchSet(
"OptimisationSwitches", optimisationSwitchesPtr_);
293 if (!debugObjectsPtr_)
298 return *debugObjectsPtr_;
304 if (!infoObjectsPtr_)
309 return *infoObjectsPtr_;
315 if (!optimisationObjectsPtr_)
320 return *optimisationObjectsPtr_;
326 if (!dimensionSetObjectsPtr_)
331 return *dimensionSetObjectsPtr_;
337 if (!dimensionedConstantObjectsPtr_)
342 return *dimensionedConstantObjectsPtr_;
354 const char *
const message,
362 list.writeList(
Info, -1) <<
nl;
400 printStatus(
"Unset DebugSwitches", hashed.sortedToc());
408 printStatus(
"Unset InfoSwitches", hashed.sortedToc());
414 hashed = optSwitches;
416 printStatus(
"Unset OptimisationSwitches", hashed.sortedToc());
int debug
Static debugging option.
A keyword and a list of tokens is an 'entry'.
dictionary & debugSwitches()
The DebugSwitches sub-dictionary in the central controlDict(s).
A keyword and a list of tokens comprise a primitiveEntry. A primitiveEntry can be read,...
void listRegisteredOptimisationSwitches(const bool unset=false)
List optimisation switches.
void listRegisteredDebugSwitches(const bool unset=false)
List debug switches.
Input from file stream, using an ISstream.
int debugSwitch(const char *name, const int deflt=0)
Lookup debug switch or add default value.
Template functions to aid in the implementation of demand driven data.
virtual bool isDict() const noexcept
Return true if this entry is a dictionary.
void listRegisteredInfoSwitches(const bool unset=false)
List info switches.
void listDebugSwitches(const bool unset=false)
List debug switches.
void append(const T &val)
Append an element at the end of the list.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void unset(List< bool > &bools, const labelRange &range)
Unset the specified range 'on' in a boolList.
static T getOrAdd(dictionary &dict, const char *name, const T deflt)
string getEnv(const std::string &envName)
Get environment value for given envName.
static void printStatus(const char *const message, const wordList &list)
int infoSwitch(const char *name, const int deflt=0)
Lookup info switch or add default value.
void deleteDemandDrivenData(DataPtr &dataPtr)
simpleObjectRegistry & optimisationObjects()
Access to registered OptimisationSwitch objects.
static void listSwitches(const wordList &debugSwitches, const wordList &infoSwitches, const wordList &optSwitches, const bool unset)
messageStream Info
Information stream (stdout output on master, null elsewhere)
simpleObjectRegistry & debugObjects()
Access to registered DebugSwitch objects.
void listOptimisationSwitches(const bool unset=false)
List optimisation switches.
runTime controlDict().readEntry("adjustTimeStep"
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
fileNameList findEtcFiles(const fileName &name, const bool mandatory=false, unsigned short location=0777, const bool findFirst=false)
Search for files from user/group/other etc locations.
simpleObjectRegistry & dimensionSetObjects()
Access to registered DimensionSets objects.
bool unset(const Key &key)
Unset the specified key - same as erase.
void append(const word &keyword, T *)
Add at tail of dictionary.
int optimisationSwitch(const char *name, const int deflt=0)
Lookup optimisation switch or add default value.
bool notNull(const T *ptr)
True if ptr is not a pointer (of type T) to the nullObject.
#define SafeFatalIOErrorInFunction(ios, msg)
Report an error message using Foam::FatalIOError.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
void addDimensionedConstantObject(const char *name, simpleRegIOobject *)
Register DimensionedConstant read/write object.
simpleObjectRegistry & infoObjects()
Access to registered InfoSwitch objects.
simpleObjectRegistry & dimensionedConstantObjects()
Access to registered DimensionedConstants objects.
dictionary & infoSwitches()
The InfoSwitches sub-dictionary in the central controlDict(s).
virtual const dictionary & dict() const =0
Return dictionary, if entry is a dictionary.
T * find(const word &keyword)
Find and return an entry, nullptr on failure.
errorManipArg< error, int > exit(error &err, const int errNo=1)
void listInfoSwitches(const bool unset=false)
List info switches.
List< fileName > fileNameList
A List of fileNames.
Functions to search 'etc' directories for configuration files etc.
float floatOptimisationSwitch(const char *name, const float deflt=0)
Lookup optimisation switch or add default value.
void listRegisteredSwitches(const bool unset=false)
List registered debug/info/optimisation switches.
void addDebugObject(const char *name, simpleRegIOobject *obj)
Register debug switch read/write object.
void listSwitches(const bool unset=false)
List debug/info/optimisation switches.
static Ostream & writeDivider(Ostream &os)
Write the standard file section divider.
entry * findEntry(const word &keyword, enum keyType::option matchOpt=keyType::REGEX)
Find for an entry (non-const access) with the given keyword.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
#define forAllReverse(list, i)
Reverse loop across all elements in list.
entry * add(entry *entryPtr, bool mergeEntry=false)
Add a new entry.
void addDimensionSetObject(const char *name, simpleRegIOobject *obj)
Register DimensionSets read/write object.
dictionary & controlDict()
dictionary & optimisationSwitches()
The OptimisationSwitches sub-dictionary in the central controlDict(s).
void addInfoObject(const char *name, simpleRegIOobject *obj)
Register info switch read/write object.
void addOptimisationObject(const char *name, simpleRegIOobject *obj)
Register optimisation switch read/write object.
static void appendNamedEntry(simpleObjectRegistry &obr, const char *name, simpleRegIOobject *obj)
Abstract base class for registered object with I/O. Used in debug symbol registration.
dictionary & switchSet(const char *subDictName, dictionary *&subDictPtr)
Internal function to lookup a sub-dictionary from controlDict.
Object registry for simpleRegIOobject. Maintains ordering.