131 using namespace Foam;
149 const word& baseType = iter.key();
150 const word& baseTypeName = iter().first();
152 if (!baseTypeNameToC.
found(baseTypeName))
161 if (!baseTypeNameToC[baseTypeName].
found(baseType))
163 baseTypeNameToC[baseTypeName].
insert
171 return baseTypeNameToC;
175 void printToC(
const word& tableName)
186 Info<<
"Contents of table " << tableName;
190 Info<<
", base type "
198 Info<<
" " <<
setf(ios_base::left) <<
setw(40) << toc[i]
216 Info<<
"Tables of type " << tableName <<
endl;
228 Info<<
"Table " << tableName <<
" not found" <<
endl;
235 int main(
int argc,
char *argv[])
245 "Load only the core libOpenFOAM.so library by default"
251 "'(\"lib1.so\" ... \"libN.so\")'",
252 "Pre-load additional libraries"
265 "Load libraries associated with specified solver"
271 "List libraries as they are loaded"
277 "List all available debug, info and optimisation switches"
283 "List the contents of all the run-time selection tables"
289 "List the run-time selection table names"
296 "List the contents of the specified table"
303 "List the tables containing the given name"
309 "List scalar field boundary conditions (fvPatchField<scalar>)"
315 "List vector field boundary conditions (fvPatchField<vector>)"
321 "List functionObjects"
345 libs.
open(
"lib" + solverName +
".so");
348 const string libDir(
getEnv(
"FOAM_LIBBIN"));
357 Info <<
"Loading libraries:" <<
nl;
361 if (libNames[i].ext() ==
"so")
365 Info <<
" " << libNames[i].c_str() <<
nl;
411 if (nameRe.match(iter2.key()))
413 unsortedNames.
insert(iter2.key());
418 names = unsortedNames.
toc();
434 const word& baseType = iter.key();
435 const word& baseTypeName = iter().first();
439 if (!baseTypeNameTables.
found(baseTypeName))
448 baseTypeNameTables[baseTypeName].
insert
456 if (baseTypeNameTables.
size())
464 else if (toc.size() > 1)
473 baseTypeNameTables[toc[i]].size() == 1
474 && toc[i] == baseTypeNameTables[toc[i]].begin().key()
478 << toc[i] << baseTypeNameTables[toc[i]].
begin()()
485 baseTypeNameTables[toc[i]].sortedToc()
492 <<
setf(ios_base::left) <<
setw(40) << tocc[j]
493 << baseTypeNameTables[toc[i]][tocc[j]]
523 Info<<
"Scalar boundary conditions:" <<
endl;
524 printToC(
"fvPatchScalarField");
530 Info<<
"vector boundary conditions:" <<
endl;
531 printToC(
"fvPatchVectorField");
538 printToC(
"functionObject");
552 printToC(
"fvConstraint");
565 Info<<
"Run-time selection tables:" <<
nl;
Istream and Ostream manipulators taking arguments.
#define forAll(list, i)
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.
An STL-conforming hash table.
List< Key > sortedToc() const
Return the table of contents as a sorted list.
List< Key > toc() const
Return the table of contents.
iterator begin()
Iterator set to the beginning of the HashTable.
label size() const
Return number of elements in table.
bool insert(const Key &, const T &newElmt)
Insert a new hashedEntry.
bool found(const Key &) const
Return true if hashedEntry is found in table.
static void clear()
Clear the options table.
Extract command arguments and options from the supplied argc and argv parameters.
static void addOption(const word &opt, const string ¶m="", const string &usage="")
Add to an option to validOptions with usage information.
static void addBoolOption(const word &opt, const string &usage="")
Add to a bool option to validOptions with usage information.
bool optionFound(const word &opt) const
Return true if the named option is found.
bool optionReadIfPresent(const word &opt, T &) const
Read a value from the named option if present.
bool checkRootCase() const
Check root path and case path.
bool open(const fileName &libName, const bool verbose=true)
Open the named library, optionally with warnings if problems occur.
static int disableFunctionEntries
void exit(const int errNo=1)
Exit : can be called for any error to exit program.
A wordRe is a word, but can also have a regular expression for matching words.
bool isPattern() const
Should be treated as a match rather than a literal string?
A class for handling words, derived from string.
static const word null
An empty word.
int main(int argc, char *argv[])
runTimeSelectionToCType runTimeSelectionToC
Run-time selectable objects.
void listSwitches()
List debug switches.
bool enableRunTimeSelectionToC
Switch to enable runTimeSelectionToC collection and caching.
dlLibraryTable libs
Table of loaded dynamic libraries.
Smanip< ios_base::fmtflags > setf(const ios_base::fmtflags flags)
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const bool)
Return a word representation of a bool.
Omanip< int > setw(const int i)
labelList second(const UList< labelPair > &p)
labelList first(const UList< labelPair > &p)
string getEnv(const word &)
Return environment variable of given name.
fileNameList readDir(const fileName &, const fileType=fileType::file, const bool filterVariants=true, const bool followLink=true)
Read a directory and return the entries as a string list.
Foam::argList args(argc, argv)