70 struct deleteControlDictPtr
72 ~deleteControlDictPtr()
80 debugSwitchesPtr_ =
nullptr;
81 infoSwitchesPtr_ =
nullptr;
82 optimisationSwitchesPtr_ =
nullptr;
87 deleteControlDictPtr deleteControlDictPtr_;
114 return eptr->
get<
T>();
148 if (!controlDictPtr_)
150 string controlDictString(
Foam::getEnv(
"FOAM_CONTROLDICT"));
151 if (!controlDictString.empty())
154 IStringStream is(controlDictString);
163 IFstream is(controlDictFiles[i]);
170 "Cannot open controlDict" 178 return *controlDictPtr_;
184 const char* subDictName,
190 subDictPtr =
controlDict().findDict(subDictName, keyType::LITERAL);
195 <<
"debug::switchSet(const char*, dictionary*&):\n" 196 <<
" Cannot find " << subDictName <<
" in dictionary " 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,
415 hashed = optSwitches;
Abstract base class for registered object with I/O. Used in debug symbol registration.
void listRegisteredInfoSwitches(const bool unset=false)
List info switches.
void listRegisteredOptimisationSwitches(const bool unset=false)
List optimisation switches.
void addInfoObject(const char *name, simpleRegIOobject *obj)
Register info switch read/write object.
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 a number of values (eg...
void append(const T &val)
Append an element at the end of the list.
static void printStatus(const char *const message, const wordList &list)
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.
static void listSwitches(const wordList &debugSwitches, const wordList &infoSwitches, const wordList &optSwitches, const bool unset)
constexpr char nl
The newline '\n' character (0x0a)
int debugSwitch(const char *name, const int deflt=0)
Lookup debug switch or add default value.
Ostream & endl(Ostream &os)
Add newline and flush stream.
static Ostream & writeDivider(Ostream &os)
Write the standard file section divider.
void append(const word &k, T *ptr)
Add to back of dictionary.
entry * add(entry *entryPtr, bool mergeEntry=false)
Add a new entry.
simpleObjectRegistry & debugObjects()
Access to registered DebugSwitch objects.
string getEnv(const std::string &envName)
Get environment value for given envName.
void listDebugSwitches(const bool unset=false)
List debug switches.
int infoSwitch(const char *name, const int deflt=0)
Lookup info switch or add default value.
simpleObjectRegistry & optimisationObjects()
Access to registered OptimisationSwitch objects.
void unset(List< bool > &bools, const labelUList &locations)
Unset the listed locations (assign 'false').
A keyword and a list of tokens comprise a primitiveEntry. A primitiveEntry can be read...
Ostream & writeList(Ostream &os, const label shortLen=0) const
Write List, with line-breaks in ASCII when length exceeds shortLen.
void addDimensionedConstantObject(const char *name, simpleRegIOobject *)
Register DimensionedConstant read/write object.
static void appendNamedEntry(simpleObjectRegistry &obr, const char *name, simpleRegIOobject *obj)
bool unset(const Key &key)
Unset the specified key - same as erase.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Functions to search 'etc' directories for configuration files etc.
dictionary & infoSwitches()
The InfoSwitches sub-dictionary in the central controlDict(s).
void listInfoSwitches(const bool unset=false)
List info switches.
T get() const
Get a T from the stream, FatalIOError if the number of tokens is incorrect.
runTime controlDict().readEntry("adjustTimeStep"
The central control dictionary, the contents of which are either taken directly from the FOAM_CONTROL...
int optimisationSwitch(const char *name, const int deflt=0)
Lookup optimisation switch or add default value.
int debug
Static debugging option.
void listOptimisationSwitches(const bool unset=false)
List optimisation switches.
simpleObjectRegistry & infoObjects()
Access to registered InfoSwitch objects.
Input from file stream as an ISstream, normally using std::ifstream for the actual input...
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
simpleObjectRegistry & dimensionSetObjects()
Access to registered DimensionSets objects.
void listSwitches(const bool unset=false)
List debug/info/optimisation switches.
Template functions to aid in the implementation of demand driven data.
float floatOptimisationSwitch(const char *name, const float deflt=0)
Lookup optimisation switch or add default value.
Object registry for simpleRegIOobject. Maintains ordering.
bool notNull(const T *ptr) noexcept
True if ptr is not a pointer (of type T) to the nullObject.
simpleObjectRegistry & dimensionedConstantObjects()
Access to registered DimensionedConstants objects.
List< Key > sortedToc() const
The table of contents (the keys) in sorted order.
const entry * findEntry(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find an entry (const access) with the given keyword.
T * find(const word &keyword)
Find and return an entry, nullptr on failure.
List< label > sortedToc(const UList< bool > &bools)
Return the (sorted) values corresponding to 'true' entries.
messageStream Info
Information stream (stdout output on master, null elsewhere)
dictionary & optimisationSwitches()
The OptimisationSwitches sub-dictionary in the central controlDict(s).
static T getOrAdd(dictionary &dict, const char *name, const T deflt)
#define forAllReverse(list, i)
Reverse loop across all elements in list.
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(s).
void addDebugObject(const char *name, simpleRegIOobject *obj)
Register debug switch read/write object.
List< fileName > fileNameList
List of fileName.
void listRegisteredSwitches(const bool unset=false)
List registered debug/info/optimisation switches.
dictionary & controlDict()
The central control dictionary, the contents of which are either taken directly from the FOAM_CONTROL...
void deleteDemandDrivenData(DataPtr &dataPtr)
void listRegisteredDebugSwitches(const bool unset=false)
List debug switches.
A keyword and a list of tokens is an 'entry'.
#define SafeFatalIOErrorInFunction(ios, msg)
Report an error message using Foam::FatalIOError.