70struct deleteControlDictPtr
72 ~deleteControlDictPtr()
80 debugSwitchesPtr_ =
nullptr;
81 infoSwitchesPtr_ =
nullptr;
82 optimisationSwitchesPtr_ =
nullptr;
87deleteControlDictPtr deleteControlDictPtr_;
114 return eptr->
get<
T>();
125 simpleObjectRegistry& obr,
127 simpleRegIOobject* obj
130 simpleObjectRegistryEntry* ptr = obr.find(
name);
148 if (!controlDictPtr_)
150 string controlDictString(
Foam::getEnv(
"FOAM_CONTROLDICT"));
151 if (!controlDictString.empty())
170 "Cannot open controlDict"
178 return *controlDictPtr_;
184 const char* subDictName,
195 <<
"debug::switchSet(const char*, dictionary*&):\n"
196 <<
" Cannot find " << subDictName <<
" in dictionary "
198 << std::endl << std::endl;
222 return switchSet(
"OptimisationSwitches", optimisationSwitchesPtr_);
294 if (!debugObjectsPtr_)
299 return *debugObjectsPtr_;
305 if (!infoObjectsPtr_)
310 return *infoObjectsPtr_;
316 if (!optimisationObjectsPtr_)
321 return *optimisationObjectsPtr_;
327 if (!dimensionSetObjectsPtr_)
332 return *dimensionSetObjectsPtr_;
338 if (!dimensionedConstantObjectsPtr_)
343 return *dimensionedConstantObjectsPtr_;
355 const char *
const message,
399 hashed = debugSwitches;
407 hashed = infoSwitches;
415 hashed = optSwitches;
void append(const word &k, T *ptr)
Add to back of dictionary.
T * find(const word &keyword)
Find and return an entry, nullptr on failure.
bool unset(const Key &key)
Unset the specified key - same as erase.
List< Key > sortedToc() const
The table of contents (the keys) in sorted order.
Input from file stream as an ISstream, normally using std::ifstream for the actual input.
static Ostream & writeDivider(Ostream &os)
Write the standard file section divider.
bool good() const noexcept
True if next operation might succeed.
Input from string buffer, using a ISstream. Always UNCOMPRESSED.
void append(const T &val)
Append an element at the end of the list.
static const List< word > & null() noexcept
Ostream & writeList(Ostream &os, const label shortLen=0) const
Write List, with line-breaks in ASCII when length exceeds shortLen.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
const dictionary * findDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary pointer if present (and it is a dictionary) otherwise return nullptr...
A keyword and a list of tokens is an 'entry'.
T get() const
Get a T from the stream, FatalIOError if the number of tokens is incorrect.
A keyword and a list of tokens comprise a primitiveEntry. A primitiveEntry can be read,...
Object registry for simpleRegIOobject. Maintains ordering.
Abstract base class for registered object with I/O. Used in debug symbol registration.
runTime controlDict().readEntry("adjustTimeStep"
Template functions to aid in the implementation of demand driven data.
#define SafeFatalIOErrorInFunction(ios, msg)
Report an error message using Foam::FatalIOError.
Functions to search 'etc' directories for configuration files etc.
Namespace for handling debugging switches.
dictionary & switchSet(const char *subDictName, dictionary *&subDictPtr)
Internal function to lookup a sub-dictionary from controlDict.
int infoSwitch(const char *name, const int deflt=0)
Lookup info switch or add default value.
void listDebugSwitches(const bool unset=false)
List debug switches.
int debugSwitch(const char *name, const int deflt=0)
Lookup debug switch or add default value.
void addDebugObject(const char *name, simpleRegIOobject *obj)
Register debug switch read/write object.
void listSwitches(const bool unset=false)
List debug/info/optimisation switches.
void listRegisteredOptimisationSwitches(const bool unset=false)
List optimisation switches.
simpleObjectRegistry & infoObjects()
Access to registered InfoSwitch objects.
simpleObjectRegistry & dimensionSetObjects()
Access to registered DimensionSets objects.
float floatOptimisationSwitch(const char *name, const float deflt=0)
Lookup optimisation switch or add default value.
void addDimensionedConstantObject(const char *name, simpleRegIOobject *)
Register DimensionedConstant read/write object.
simpleObjectRegistry & dimensionedConstantObjects()
Access to registered DimensionedConstants objects.
dictionary & optimisationSwitches()
The OptimisationSwitches sub-dictionary in the central controlDict(s).
void listRegisteredSwitches(const bool unset=false)
List registered debug/info/optimisation switches.
void listRegisteredDebugSwitches(const bool unset=false)
List debug switches.
void addOptimisationObject(const char *name, simpleRegIOobject *obj)
Register optimisation switch read/write object.
void listOptimisationSwitches(const bool unset=false)
List optimisation switches.
void addInfoObject(const char *name, simpleRegIOobject *obj)
Register info switch read/write object.
dictionary & controlDict()
The central control dictionary, the contents of which are either taken directly from the FOAM_CONTROL...
void listRegisteredInfoSwitches(const bool unset=false)
List info switches.
simpleObjectRegistry & optimisationObjects()
Access to registered OptimisationSwitch objects.
dictionary & infoSwitches()
The InfoSwitches sub-dictionary in the central controlDict(s).
void listInfoSwitches(const bool unset=false)
List info switches.
simpleObjectRegistry & debugObjects()
Access to registered DebugSwitch objects.
int optimisationSwitch(const char *name, const int deflt=0)
Lookup optimisation switch or add default value.
void addDimensionSetObject(const char *name, simpleRegIOobject *obj)
Register DimensionSets read/write object.
dictionary & debugSwitches()
The DebugSwitches sub-dictionary in the central controlDict(s).
string getEnv(const std::string &envName)
Get environment value for given envName.
List< word > wordList
List of word.
static void appendNamedEntry(simpleObjectRegistry &obr, const char *name, simpleRegIOobject *obj)
HashSet< word, Hash< word > > wordHashSet
A HashSet of words, uses string hasher.
List< fileName > fileNameList
List of fileName.
messageStream Info
Information stream (stdout output on master, null elsewhere).
static void listSwitches(const wordList &debugSwitches, const wordList &infoSwitches, const wordList &optSwitches, const bool unset)
static void printStatus(const char *const message, const wordList &list)
static T getOrAdd(dictionary &dict, const char *name, const T deflt)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
bool notNull(const T *ptr) noexcept
True if ptr is not a pointer (of type T) to the nullObject.
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.
void deleteDemandDrivenData(DataPtr &dataPtr)
constexpr char nl
The newline '\n' character (0x0a).
#define forAllReverse(list, i)
Reverse loop across all elements in list.