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 "
199 <<
setw(39) << toc[i]
217 Info<<
"Tables of type " << tableName <<
endl;
229 Info<<
"Table " << tableName <<
" not found" <<
endl;
236 int main(
int argc,
char *argv[])
246 "Load only the core libOpenFOAM.so library by default"
252 "'(\"lib1.so\" ... \"libN.so\")'",
253 "Pre-load additional libraries"
266 "Load libraries associated with specified solver"
272 "List libraries as they are loaded"
278 "List all available debug, info and optimisation switches"
284 "List the contents of all the run-time selection tables"
290 "List the run-time selection table names"
297 "List the contents of the specified table"
304 "List the tables containing the given name"
310 "List scalar field boundary conditions (fvPatchField<scalar>)"
316 "List vector field boundary conditions (fvPatchField<vector>)"
322 "List functionObjects"
346 libs.
open(
"lib" + solverName +
".so");
349 const string libDir(
getEnv(
"FOAM_LIBBIN"));
358 Info <<
"Loading libraries:" <<
nl;
362 if (libNames[i].ext() ==
"so")
366 Info <<
" " << libNames[i].c_str() <<
nl;
412 if (nameRe.match(iter2.key()))
414 unsortedNames.
insert(iter2.key());
419 names = unsortedNames.
toc();
435 const word& baseType = iter.key();
436 const word& baseTypeName = iter().first();
440 if (!baseTypeNameTables.
found(baseTypeName))
449 baseTypeNameTables[baseTypeName].
insert
457 if (baseTypeNameTables.
size())
465 else if (toc.size() > 1)
474 baseTypeNameTables[toc[i]].size() == 1
475 && toc[i] == baseTypeNameTables[toc[i]].begin().key()
479 <<
setw(39) << toc[i]
480 <<
' ' << baseTypeNameTables[toc[i]].
begin()()
487 baseTypeNameTables[toc[i]].sortedToc()
494 <<
setf(ios_base::left)
495 <<
setw(39) << tocc[j]
496 <<
' ' << baseTypeNameTables[toc[i]][tocc[j]]
526 Info<<
"Scalar boundary conditions:" <<
endl;
527 printToC(
"fvPatchScalarField");
533 Info<<
"vector boundary conditions:" <<
endl;
534 printToC(
"fvPatchVectorField");
541 printToC(
"functionObject");
555 printToC(
"fvConstraint");
568 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)