Go to the documentation of this file.
54 bool Foam::argList::argsMandatory_ =
true;
55 bool Foam::argList::checkProcessorDirectories_ =
true;
72 Foam::argList::initValidTables::initValidTables()
78 "Specify case directory to use (instead of cwd)"
84 "Additional library or library list to load"
85 " (can be used multiple times)",
93 "Specify the value of a registered debug switch."
94 " Default is 1 if the value is omitted."
95 " (Can be used multiple times)",
103 "Specify the value of a registered info switch."
104 " Default is 1 if the value is omitted."
105 " (Can be used multiple times)",
113 "Specify the value of a registered optimisation switch (int/bool)."
114 " Default is 1 if the value is omitted."
115 " (Can be used multiple times)",
119 argList::addBoolOption(
"parallel",
"Run in parallel");
120 validParOptions.set(
"parallel",
"");
125 "Slave root directories for distributed running",
138 "Use specified file for decomposePar dictionary"
143 "((host1 dir1) .. (hostN dirN))",
144 "Per-host slave root directories for distributed running."
145 " The host specification can be a regex.",
151 "((host1 dir1) .. (hostN dirN))"
154 argList::addBoolOption
157 "Do not execute function objects",
165 "Override the file handler type",
173 "Name of the local world for parallel communication",
189 Pstream::addValidParOptions(validParOptions);
204 static inline constexpr
bool shouldWarnVersion(
const int version)
223 Info<<
"Hosts :" <<
nl <<
"(" <<
nl;
228 for (
const auto& str : slaveProcs)
230 std::string curr(str.substr(0, str.rfind(
'.')));
237 Info<<
" (" << prev.c_str() <<
" " <<
count <<
")" <<
nl;
241 prev = std::move(curr);
249 Info<<
" (" << prev.c_str() <<
" " <<
count <<
")" <<
nl;
260 void Foam::argList::checkITstream(
const ITstream& is,
const label index)
262 const label remaining = is.nRemainingTokens();
268 <<
"--> FOAM WARNING:" <<
nl
269 <<
"Argument " << index <<
" has "
270 << remaining <<
" excess tokens" <<
nl <<
nl;
276 <<
"--> FOAM WARNING:" <<
nl
277 <<
"Argument " << index <<
" had no tokens" <<
nl <<
nl;
282 void Foam::argList::checkITstream(
const ITstream& is,
const word& optName)
284 const label remaining = is.nRemainingTokens();
290 <<
"--> FOAM WARNING:" <<
nl
291 <<
"Option -" << optName <<
" has "
292 << remaining <<
" excess tokens" <<
nl <<
nl;
298 <<
"--> FOAM WARNING:" <<
nl
299 <<
"Option -" << optName <<
" had no tokens" <<
nl <<
nl;
304 void Foam::argList::raiseBadInput(
const word& optName)
const
309 <<
"Option -" << optName <<
" with invalid input" <<
nl
316 const string& argName,
320 validArgs.append(argName);
324 const label index = validArgs.size();
328 argUsage.erase(index);
332 argUsage.set(index, usage);
344 addOption(optName,
"", usage, advanced);
356 validOptions.set(optName, param);
359 optionUsage.set(optName, usage);
363 advancedOptions.set(optName);
370 if (advanced && validOptions.found(optName))
372 advancedOptions.set(optName);
376 advancedOptions.erase(optName);
384 std::pair<const char*,int> compat
387 validOptionsCompat.insert
390 std::pair<word,int>(optName, compat.second)
397 std::pair<const char*,int> compat,
401 ignoreOptionsCompat.insert
404 std::pair<bool,int>(expectArg, compat.second)
417 optionUsage.erase(optName);
421 optionUsage.set(optName, usage);
437 validOptions.erase(optName);
438 optionUsage.erase(optName);
439 advancedOptions.erase(optName);
445 argsMandatory_ =
false;
451 return argsMandatory_;
469 removeOption(
"noFunctionObjects");
473 ignoreOptionCompat({
"noFunctionObjects", 0},
false);
479 "withFunctionObjects",
480 "Execute functionObjects",
498 "Disable use of the controlDict libs entry",
506 removeOption(
"parallel");
507 removeOption(
"roots");
508 removeOption(
"decomposeParDict");
509 removeOption(
"hostRoots");
510 removeOption(
"world");
511 validParOptions.clear();
517 checkProcessorDirectories_ =
false;
523 for (
int i=1; i<argc; ++i)
525 if (argv[i] ==
'-' + postProcessOptionName)
550 if (!validOptionsCompat.empty())
552 const auto fnd = validOptionsCompat.cfind(optName.substr(1));
556 const auto& iter = *fnd;
558 if (shouldWarnVersion(iter.second))
561 <<
"--> FOAM IOWarning :" <<
nl
562 <<
" Found [v" << iter.second <<
"] '"
563 << optName <<
"' instead of '-"
564 << iter.first <<
"' option"
571 return "-" + iter.first;
580 int Foam::argList::optionIgnore(
const word& optName)
584 if (!ignoreOptionsCompat.empty())
586 const auto fnd = ignoreOptionsCompat.cfind(optName);
590 const auto& iter = *fnd;
594 const int nskip = (iter.first ? 2 : 1);
596 if (shouldWarnVersion(iter.second))
599 <<
"--> FOAM IOWarning :" <<
nl
600 <<
" Ignoring [v" << iter.second <<
"] '-"
601 << optName << (nskip > 1 ?
" ARG" :
"")
617 bool Foam::argList::regroupArgv(
int& argc,
char**& argv)
627 args_[0] = fileName(argv[0]);
628 for (
int argi = 1; argi < argc; ++argi)
630 if (strcmp(argv[argi],
"(") == 0)
635 else if (strcmp(argv[argi],
")") == 0)
643 args_[nArgs++] =
group;
649 args_[nArgs++] = argv[argi];
659 else if (argv[argi][0] ==
'-')
662 const char *optName = &argv[argi][1];
664 if (validOptions.found(optName))
667 args_[nArgs++] = argv[argi];
669 else if ((ignore = optionIgnore(optName)) > 0)
680 args_[nArgs++] = optionCompat(argv[argi]);
685 args_[nArgs++] = argv[argi];
692 args_[nArgs++] =
group;
698 for (
const auto&
s : args_)
704 commandLine_.reserve(len);
710 void Foam::argList::setCasePaths()
714 const auto optIter = options_.cfind(
"case");
721 if (caseDir.empty() || caseDir ==
".")
725 options_.erase(
"case");
730 caseDir.toAbsolute();
741 rootPath_ = caseDir.path();
742 globalCase_ = caseDir.name();
749 setEnv(
"FOAM_CASE", caseDir,
true);
750 setEnv(
"FOAM_CASENAME", globalCase_,
true);
753 setEnv(
"FOAM_EXECUTABLE", executable_,
false);
774 for (
int argi = argc-2; argi > 0; --argi)
776 if (argv[argi][0] ==
'-')
778 const char *optName = &argv[argi][1];
780 if (strcmp(optName,
"fileHandler") == 0)
782 handlerType = argv[argi+1];
787 if (handlerType.empty())
790 if (handlerType.empty())
802 )().needsThreading();
807 for (
int argi = 1; argi < argc; ++argi)
809 if (argv[argi][0] ==
'-')
811 const char *optName = &argv[argi][1];
813 if (validParOptions.found(optName))
815 parRunControl_.runPar(argc, argv, needsThread);
822 regroupArgv(argc, argv);
823 commandLine_ += args_[0];
830 for (
int argi = 1; argi < args_.size(); ++argi)
833 commandLine_ += args_[argi];
835 if (args_[argi][0] ==
'-')
837 const char *optName = &args_[argi][1];
842 <<
"Ignoring lone '-' on the command-line" <<
endl;
846 validOptions.lookup(optName,
"").size()
847 || validParOptions.lookup(optName,
"").size()
854 if (argi >= args_.size())
859 <<
"Error: option '-" << optName
860 <<
"' requires an argument" <<
nl <<
nl
861 <<
"See '" << executable_ <<
" -help' for usage"
868 commandLine_ += args_[argi];
870 if (strcmp(optName,
"lib") == 0)
874 libs().append(this->getList<fileName>(argi));
876 else if (strcmp(optName,
"debug-switch") == 0)
884 else if (strcmp(optName,
"info-switch") == 0)
892 else if (strcmp(optName,
"opt-switch") == 0)
904 options_.set(optName, args_[argi]);
912 options_.insert(optName,
"");
919 args_[nArgs] = args_[argi];
927 parse(checkArgs, checkOpts, initialise);
940 parRunControl_(
args.parRunControl_),
944 executable_(
args.executable_),
945 rootPath_(
args.rootPath_),
946 globalCase_(
args.globalCase_),
948 commandLine_(
args.commandLine_)
950 parse(checkArgs, checkOpts, initialise);
968 bool quickExit =
false;
971 if (options_.found(
"doc"))
978 options_.found(
"doc-source")
979 || options_.found(
"srcDoc")
987 if (options_.found(
"help-full"))
992 else if (options_.found(
"help-notes"))
998 else if (options_.found(
"help"))
1003 else if (options_.found(
"help-man"))
1010 if (options_.found(
"help-compat"))
1023 if (!check(checkArgs, checkOpts))
1057 <<
"Exec : " << commandLine_.c_str() <<
nl
1058 <<
"Date : " << dateString.c_str() <<
nl
1059 <<
"Time : " << timeString.c_str() <<
nl
1077 const auto space =
build.find(
' ');
1078 if (space != std::string::npos)
1080 build.resize(space);
1086 libs().open(bannerEnabled());
1100 options_.lookup(
"fileHandler",
Foam::getEnv(
"FOAM_FILEHANDLER"))
1103 if (handlerType.empty())
1117 if (parRunControl_.parRun())
1130 fromSlave >> slaveBuild >> slaveMachine[proci] >> slavePid;
1132 slaveProcs[proci] = slaveMachine[proci] +
"." +
name(slavePid);
1140 <<
"; slave " << proci <<
" is running version "
1165 if (parRunControl_.parRun())
1175 fileName source = rootPath_/globalCase_/
"system"/
"decomposeParDict";
1176 if (options_.found(
"decomposeParDict"))
1178 bool adjustOpt =
false;
1180 source = options_[
"decomposeParDict"];
1183 source /=
"decomposeParDict";
1190 source = rootPath_/globalCase_/source;
1198 options_.set(
"decomposeParDict", source);
1203 label dictNProcs = -1;
1204 if (this->readListIfPresent(
"roots", roots))
1206 parRunControl_.distributed(
true);
1208 if (roots.size() != 1)
1210 dictNProcs = roots.size()+1;
1213 else if (options_.found(
"hostRoots"))
1217 source =
"-hostRoots";
1218 ITstream is(source, options_[
"hostRoots"]);
1221 checkITstream(is,
"hostRoots");
1223 for (
const auto& hostRoot : hostRoots)
1229 for (
const label slavei : matched)
1231 if (!roots[slavei].empty())
1234 <<
"Slave " << slaveMachine[slavei]
1235 <<
" has multiple matching roots in "
1239 roots[slavei] = hostRoot.second();
1246 if (roots[slavei].empty())
1249 <<
"Slave " << slaveMachine[slavei]
1250 <<
" has no matching roots in "
1255 if (roots.size() != 1)
1257 dictNProcs = roots.size()+1;
1275 if (!decompDictStream || !decompDictStream->
good())
1278 <<
"Cannot read decomposeParDict from "
1286 decompDict.
readEntry(
"numberOfSubdomains", dictNProcs);
1290 <<
"Running parallel on single processor. This only"
1291 <<
" makes sense for multi-world simulation" <<
endl;
1297 parRunControl_.distributed(
true);
1304 if (roots.size() == 1)
1312 dictNProcs = roots.size()+1;
1328 checkProcessorDirectories_
1335 <<
" specifies " << dictNProcs
1336 <<
" processors but job was started with "
1348 <<
"number of entries in roots "
1350 <<
" is not equal to the number of slaves "
1361 const bool hadCaseOpt = options_.found(
"case");
1364 options_.set(
"case", roots[slave-1]/globalCase_);
1367 toSlave << args_ << options_ << roots.size();
1369 options_.erase(
"case");
1374 options_.set(
"case", rootPath_/globalCase_);
1383 checkProcessorDirectories_
1388 label nProcDirs = 0;
1393 rootPath_/globalCase_
1402 <<
"number of processor directories = "
1404 <<
" is not equal to the number of processors = "
1414 toSlave << args_ << options_ << roots.size();
1428 fromMaster >> args_ >> options_ >> nroots;
1430 parRunControl_.distributed(nroots);
1443 case_ = globalCase_;
1450 case_ = globalCase_;
1454 if (parRunControl_.distributed())
1465 if (!writeHostsSwitch)
1478 Info<<
"Case : " << (rootPath_/globalCase_).c_str() <<
nl
1479 <<
"nProcs : " << nProcs <<
endl;
1481 if (parRunControl_.parRun())
1483 if (slaveProcs.size())
1485 if (writeHostsSwitch == 1)
1493 Info<<
"Slaves : " << slaveProcs <<
nl;
1498 Info<<
"Roots : " << roots <<
nl;
1500 Info<<
"Pstream initialized with:" <<
nl
1522 if (slaveProcs.size())
1541 Info<<
"fileModificationChecking : "
1542 <<
"Monitoring run-time modified files using "
1561 Info<<
" (fileModificationSkew "
1567 Info<<
" (fileModificationSkew "
1569 <<
", maxFileModificationPolls "
1576 <<
"Invalid setting for maxFileModificationPolls "
1583 Info<<
"allowSystemOperations : ";
1590 Info<<
"Disallowing";
1592 Info<<
" user-supplied system call operations" <<
nl
1616 for (
const word& optName : optionNames)
1618 if (options_.found(optName))
1629 std::initializer_list<word> optionNames
1633 for (
const word& optName : optionNames)
1635 if (options_.found(optName))
1650 || optName ==
"parallel"
1651 || optName ==
"roots"
1655 <<
"Option: '" << optName <<
"' is protected" <<
nl
1660 if (options_.found(optName) ? (options_[optName] != param) :
true)
1662 options_.set(optName, param);
1676 || optName ==
"parallel"
1677 || optName ==
"roots"
1678 || optName ==
"hostRoots"
1682 <<
"Option: '" << optName <<
"' is protected" <<
nl
1688 return options_.erase(optName);
1701 docExt.
replace(
".",
"_source.");
1706 for (
const fileName& dir : docDirs)
1709 if (dir.starts_with(
"http:") || dir.starts_with(
"https:"))
1711 url = dir/executable_ + docExt;
1720 ?
isFile(docFile.substr(7))
1724 url = std::move(docFile);
1732 <<
"No documentation found for " << executable_
1733 <<
", but you can use -help to display the usage\n" <<
endl;
1738 string docBrowser =
getEnv(
"FOAM_DOC_BROWSER");
1739 if (docBrowser.empty())
1741 docDict.
readEntry(
"docBrowser", docBrowser);
1745 if (docBrowser.find(
"%f") != std::string::npos)
1747 docBrowser.
replace(
"%f", url);
1751 docBrowser +=
" " + url;
1760 <<
" " << command <<
nl <<
endl;
1772 const label nargs = args_.size()-1;
1773 if (checkArgs && nargs != validArgs.size())
1776 <<
"Expected " << validArgs.size()
1777 <<
" arguments but found " << nargs <<
endl;
1785 const word& optName = iter.key();
1788 !validOptions.found(optName)
1789 && !validParOptions.found(optName)
1793 <<
"Invalid option: -" << optName <<
endl;
1803 <<
"See '" << executable_ <<
" -help' for usage"
1818 <<
": cannot open root directory " << rootPath()
1826 if (checkProcessorDirectories_ && pathDir.empty() &&
Pstream::master())
1832 <<
": cannot open case directory " <<
path()
static SLList< string > validArgs
A list of valid (mandatory) arguments.
string & replace(const std::string &s1, const std::string &s2, size_type pos=0)
label count(const UList< word > &optionNames) const
Return how many of the specified options were used.
static void set(bool verbose=false)
Activate SIGFPE signal handler when FOAM_SIGFPE is set.
static void noBanner()
Disable emitting the banner information.
static bool writeJobInfo
Global value for writeJobInfo enabled.
static std::string::size_type usageMin
Min indentation when displaying usage (default: 20)
const std::string build
OpenFOAM build information as a std::string.
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
static constexpr int masterNo() noexcept
Process index of the master (always 0)
static void addUsage(const word &optName, const string &usage)
Add option usage information to optionUsage.
A class for handling words, derived from Foam::string.
Foam::argList::initValidTables dummyInitValidTables
static const Enum< fileCheckTypes > fileCheckTypesNames
Names for the fileCheckTypes.
static std::string::size_type usageMax
Max screen width when displaying usage (default: 80)
A class for handling file names.
static HashTable< std::pair< word, int > > validOptionsCompat
A list of aliases for options.
static fileName validate(const std::string &s, const bool doClean=true)
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
constexpr const char *const group
Group name for atomic constants.
static fileName envGlobalPath()
Global case (directory) from environment variable.
static autoPtr< fileOperation > fileHandlerPtr_
Static fileOperation.
static Ostream & writeBanner(Ostream &os, bool noHint=false)
Write the standard OpenFOAM file/dictionary banner.
Output inter-processor communications stream.
bool starts_with(const std::string &s) const
True if string starts with the given prefix (cf. C++20)
static HashTable< string > optionUsage
Short description for validOptions.
static float fileModificationSkew
static std::string name(const std::string &str)
Return basename (part beyond last /), including its extension.
int system(const std::string &command, const bool bg=false)
Execute the specified command via the shell.
static bool & parRun()
Test if this a parallel run, or allow modify access.
static fileCheckTypes fileModificationChecking
Type of file modification checking.
static int maxFileModificationPolls
static void addNote(const string ¬e)
Add extra notes for the usage information.
static bool master(const label communicator=worldComm)
Am I the master process.
static void addOptionCompat(const word &optName, std::pair< const char *, int > compat)
Specify an alias for the option name.
Extract command arguments and options from the supplied argc and argv parameters.
bool isFile(const fileName &name, const bool checkGzip=true, const bool followLink=true)
Does the name exist as a FILE in the file system?
const fileOperation & fileHandler()
Get current file handler.
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool setEnv(const word &name, const std::string &value, const bool overwrite)
Set an environment variable, return true on success.
static commsTypes defaultCommsType
Default commsType.
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Foam::SubStrings< StringType > splitSpace(const StringType &str)
Split string into sub-strings at whitespace (TAB, NL, VT, FF, CR, SPC)
static void noMandatoryArgs()
Flag command arguments as being optional (non-mandatory)
string getEnv(const std::string &envName)
Get environment value for given envName.
#define forAll(list, i)
Loop across all elements in list.
argList(int &argc, char **&argv, bool checkArgs=argList::argsMandatory(), bool checkOpts=true, bool initialise=true)
pid_t pgid()
Return the group PID of this process.
static int allowSystemOperations
Flag if system operations are allowed.
static void ignoreOptionCompat(std::pair< const char *, int > compat, bool expectArg)
Specify an option to be ignored.
void setNamedInt(std::string name, int val, bool report=false)
Set named value, but also handle embedded name=value syntax.
static void addArgument(const string &argName, const string &usage="")
Append a (mandatory) argument to validArgs.
string expand(const std::string &s, const HashTable< string, word, string::hash > &mapping, const char sigil='$')
int infoSwitch(const char *name, const int deflt=0)
Lookup info switch or add default value.
static void printHostsSubscription(const UList< string > &slaveProcs)
static autoPtr< fileOperation > New(const word &handlerType, bool verbose=false)
Select fileHandler-type.
Template class for non-intrusive linked lists.
static HashTable< string > validParOptions
A list of valid parallel options.
void parse(bool checkArgs, bool checkOpts, bool initialise)
static void noLibs()
Add the '-no-libs' command line option.
static void noFunctionObjects(bool addWithOption=false)
Remove '-noFunctionObjects' option and ignore any occurrences.
string userName()
Return the user's login name.
simpleObjectRegistry & optimisationObjects()
Access to registered OptimisationSwitch objects.
static rangeType subProcs(const label communicator=worldComm)
Range of process indices for sub-processes.
An input stream of tokens.
bool setOption(const word &optName, const string ¶m="")
Set option directly (use with caution)
static void noJobInfo()
Suppress JobInfo, overriding controlDict setting.
messageStream Info
Information stream (uses stdout - output is on the master only)
simpleObjectRegistry & debugObjects()
Access to registered DebugSwitch objects.
word name(const complex &c)
Return string representation of complex.
static bool floatTransfer
pid_t pid()
Return the PID of this process.
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
pid_t ppid()
Return the parent PID of this process.
static word postProcessOptionName
Standard name for the post-processing option.
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, bool mandatory=true) const
graph_traits< Graph >::vertices_size_type size_type
static void setAdvanced(const word &optName, bool advanced=true)
Set an existing option as being 'advanced' or normal.
static const Enum< commsTypes > commsTypeNames
Names of the communication types.
void resize(const label newSize)
Adjust allocated size of list.
static const word & myWorld()
My world.
static void noCheckProcessorDirectories()
Remove checking of processor directories.
static HashTable< string > validOptions
A list of valid options.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
simpleObjectRegistry & infoObjects()
Access to registered InfoSwitch objects.
static bool postProcess(int argc, char *argv[])
Return true if the post-processing option is specified.
static std::string date()
static word defaultFileHandler
Name of the default fileHandler.
static const wordList & allWorlds()
All worlds.
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.
labelList findStrings(const regExp &matcher, const UList< StringType > &input, const bool invert=false)
Return list indices for strings matching the regular expression.
int infoDetailLevel
Global for selective suppression of Info output.
static const fileName null
An empty fileName.
errorManipArg< error, int > exit(error &err, const int errNo=1)
const std::string version
OpenFOAM version (name or stringified number) as a std::string.
bool unsetOption(const word &optName)
Unset option directly (use with caution)
static int nProcsSimpleSum
static void addBoolOption(const word &optName, const string &usage="", bool advanced=false)
Add a bool option to validOptions with usage information.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
static HashSet< string > advancedOptions
The "advanced" options are shown with -help-full (not with –help)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
static void warnAboutAge(const char *what, const int version)
Emit warning on stderr about something being old.
static int myProcNo(const label communicator=worldComm)
Number of this process (starting from masterNo() = 0)
forAllConstIters(mixture.phases(), phase)
static bool argsMandatory()
Command arguments type (optional/mandatory).
const std::string patch
OpenFOAM patch number as a std::string.
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
static void set(bool verbose=false)
Activate SIGSEGV signal handler.
static Ostream & writeDivider(Ostream &os)
Write the standard file section divider.
const std::string buildArch
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
string hostName(const bool full=false)
Return the system's host name, as per hostname(1)
void clear()
Clear the list, i.e. set size to zero.
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
static SLList< string > notes
General usage notes.
bool checkRootCase() const
Check root path and case path.
static std::string clockTime()
static bool clean(std::string &str)
Cleanup filename.
fileName cwd()
The physical or logical current working directory path name.
Operations on lists of strings.
entry * add(entry *entryPtr, bool mergeEntry=false)
Add a new entry.
Input inter-processor communications stream.
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
static HashTable< std::pair< bool, int > > ignoreOptionsCompat
A list of options to ignore.
void write(Ostream &os, const bool includeTitle=true) const
Print error message.
dictionary & controlDict()
void printBuildInfo(std::ostream &os, const bool full=true)
Print information about version, build, arch to output stream.
static HashTable< string, label, Hash< label > > argUsage
Short description for program arguments.
bool check(bool checkArgs=argList::argsMandatory(), bool checkOpts=true) const
static void noParallel()
Remove the parallel options.
bool good() const
Return true if next operation might succeed.
static void set(bool verbose=false)
Activate SIGQUIT signal handler.
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
static bool bannerEnabled()
Banner status (enabled/disabled).
static void addOption(const word &optName, const string ¶m="", const string &usage="", bool advanced=false)
Add an option to validOptions with usage information.
Foam::argList args(argc, argv)
#define WarningInFunction
Report a warning using Foam::Warning.
static bool isAbsolute(const std::string &str)
Return true if string starts with a '/'.
virtual ~argList()
Destructor.
static label nProcs(const label communicator=worldComm)
Number of processes in parallel run, and 1 for serial run.
void displayDoc(bool source=false) const
Display documentation in browser.
static void set(bool verbose=false)
Activate SIGINT signal handler.
static void removeOption(const word &optName)
Remove option from validOptions and from optionUsage.
static int nPollProcInterfaces
Number of polling cycles in processor updates.
bool isDir(const fileName &name, const bool followLink=true)
Does the name exist as a DIRECTORY in the file system?
static void exit(int errNo=1)
Shutdown (finalize) MPI as required and exit program with errNo.
static autoPtr< fileOperationInitialise > New(const word &type, int &argc, char **&argv)
Select type.
An adapter for copying a list of C++ strings into a list of C-style strings for passing to C code tha...