121 string configDictString(
getEnv(
"FOAM_CONFIGDICT"));
122 if (!configDictString.empty())
134 IFstream ifs(configDictFiles[cdfi]);
141 "Cannot open configDict"
151 if (controlDictFiles.
size())
153 cout<<
"--> FOAM Warning: legacy controlDict"
154 " configuration files found:" <<
std::endl;
156 forAll(controlDictFiles, i)
158 cout<<
" " << controlDictFiles[i] <<
std::endl;
161 cout<<
" Please rename these files controlDict -> configDict"
167 IFstream ifs(controlDictFiles[cdfi]);
174 "Cannot open controlDict"
186 entry::disableFunctionEntries =
true;
197 const char* subDictName,
205 subDictName,
false,
false
208 if (!ePtr || !ePtr->
isDict())
210 cerr<<
"debug::switchSet(const char*, dictionary*&):\n"
211 <<
" Cannot find " << subDictName <<
" in dictionary "
218 subDictPtr = &ePtr->
dict();
252 <<
"Multiple defaults set for debug switch " <<
name
271 <<
"Multiple defaults set for info switch " <<
name
290 <<
"Multiple defaults set for optimisation switch " <<
name
303 const float defaultValue
325 const word& defaultValue
386 hashset -= configDictDebug;
390 hashset -= configDictInfo;
393 hashset = optSwitches;
394 hashset -= configDictOpt;
402 Info<<
"OptimisationSwitches" << optSwitches <<
endl;
420 const word&
name = iter().keyword();
422 const bool hasDefault = defaultSwitches.
found(
name);
424 const bool isDefault =
445 auto print = [&](
const char* heading,
const wordList& names)
460 "Switches with default values",
466 "Switches with non-default values",
472 "Switches without defaults",
504 "OptimisationSwitches",
#define forAll(list, i)
Loop across all elements in list.
#define forAllReverse(list, i)
Reverse loop across all elements in list.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
A HashTable with keys but without contents.
bool insert(const Key &key)
Insert a new entry.
List< Key > sortedToc() const
Return the table of contents as a sorted list.
static Stream & writeDivider(Stream &os)
Write the standard file section divider.
Input from memory buffer stream.
bool good() const
Return true if next operation might succeed.
void size(const label)
Override size to be inconsistent with allocated storage.
const fileName & name() const
Return the dictionary name.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
const entry * lookupEntryPtr(const word &, bool recursive, bool patternMatch) const
Find and return an entry data stream pointer if present.
T lookupOrAddDefault(const word &, const T &)
Find and return a T, if not found return the given.
const entry & lookupEntry(const word &, bool recursive, bool patternMatch) const
Find and return an entry data stream if present otherwise error.
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
wordList sortedToc() const
Return the sorted table of contents.
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.
A keyword and a list of tokens is an 'entry'.
virtual bool isDict() const
Return true if this entry is a dictionary.
virtual const dictionary & dict() const =0
Return dictionary if this entry is a dictionary.
A class for handling words, derived from string.
Template functions to aid in the implementation of demand driven data.
#define SafeFatalIOErrorInFunction(ios, msg)
Report an error message using Foam::FatalIOError.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Functions to search 'etc' directories for configuration files etc.
dictionary & switchSet(const char *subDictName, dictionary *&subDictPtr)
Internal function to lookup a sub-dictionary from configDict.
float floatOptimisationSwitch(const char *name, const float defaultValue=0)
Lookup optimisation switch or add default value.
dictionary * infoDefaultSwitchesPtr_(nullptr)
dictionary & configDict()
The central control dictionary.
dictionary * optimisationSwitchesPtr_(nullptr)
dictionary * debugSwitchesPtr_(nullptr)
dictionary & optimisationSwitches()
The OptimisationSwitches sub-dictionary in the central configDict.
dictionary * configDictPtr_(nullptr)
int debugSwitch(const char *name, const int defaultValue=0)
Lookup debug switch or add default value.
dictionary * optimisationDefaultSwitchesPtr_(nullptr)
int infoSwitch(const char *name, const int defaultValue=0)
Lookup info switch or add default value.
int optimisationSwitch(const char *name, const int defaultValue=0)
Lookup optimisation switch or add default value.
void listSwitches()
List debug switches.
dictionary * debugDefaultSwitchesPtr_(nullptr)
dictionary & infoDefaultSwitches()
deleteControlDictPtr deleteControlDictPtr_
dictionary & infoSwitches()
The InfoSwitches sub-dictionary in the central configDict.
const word wordOptimisationSwitch(const char *name, const word &defaultValue)
Lookup optimisation switch or add default value.
dictionary * infoSwitchesPtr_(nullptr)
dictionary & debugSwitches()
The DebugSwitches sub-dictionary in the central configDict.
dictionary & optimisationDefaultSwitches()
dictionary & debugDefaultSwitches()
errorManipArg< error, int > exit(error &err, const int errNo=1)
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void deleteDemandDrivenData(DataType *&dataPtr)
Ostream & incrIndent(Ostream &os)
Increment the indent level.
void listSwitches(const wordList &debugSwitches, const wordList &infoSwitches, const wordList &optSwitches, const bool unset)
void listSwitches(const word &name, const dictionary &switches, const dictionary &defaultSwitches)
string getEnv(const word &)
Return environment variable of given name.
fileNameList findEtcFiles(const fileName &, bool mandatory=false, bool findFirst=false)
Search for files from user/group/shipped directories.
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
Ostream & indent(Ostream &os)
Indent stream.