55bool Foam::argList::argsMandatory_ =
true;
56bool Foam::argList::checkProcessorDirectories_ =
true;
73Foam::argList::initValidTables::initValidTables()
79 "Specify case directory to use (instead of cwd)"
85 "Additional library or library list to load"
86 " (can be used multiple times)",
94 "Specify the value of a registered debug switch."
95 " Default is 1 if the value is omitted."
96 " (Can be used multiple times)",
104 "Specify the value of a registered info switch."
105 " Default is 1 if the value is omitted."
106 " (Can be used multiple times)",
114 "Specify the value of a registered optimisation switch."
115 " Default is 1 if the value is omitted."
116 " (Can be used multiple times)",
120 argList::addBoolOption(
"parallel",
"Run in parallel");
121 validParOptions.set(
"parallel",
"");
126 "Subprocess root directories for distributed running",
139 "Use specified file for decomposePar dictionary"
144 "((host1 dir1) .. (hostN dirN))",
145 "Per-subprocess root directories for distributed running."
146 " The host specification can be a regex.",
152 "((host1 dir1) .. (hostN dirN))"
155 argList::addBoolOption
158 "Do not execute function objects",
166 "Override the file handler type",
174 "Name of the local world for parallel communication",
190 Pstream::addValidParOptions(validParOptions);
209 Info<<
"Hosts :\n(" <<
nl;
214 for (
const auto& str : hostProcs)
216 std::string curr(str.substr(0, str.rfind(
'.')));
223 Info<<
" (" << prev.c_str() <<
' ' << count <<
')' <<
nl;
227 prev = std::move(curr);
235 Info<<
" (" << prev.c_str() <<
' ' << count <<
')' <<
nl;
246void Foam::argList::checkITstream(
const ITstream& is,
const label index)
248 const label remaining = is.nRemainingTokens();
254 <<
"--> FOAM WARNING:" <<
nl
255 <<
"Argument " << index <<
" has "
256 << remaining <<
" excess tokens" <<
nl <<
nl;
262 <<
"--> FOAM WARNING:" <<
nl
263 <<
"Argument " << index <<
" had no tokens" <<
nl <<
nl;
268void Foam::argList::checkITstream(
const ITstream& is,
const word& optName)
270 const label remaining = is.nRemainingTokens();
276 <<
"--> FOAM WARNING:" <<
nl
277 <<
"Option -" << optName <<
" has "
278 << remaining <<
" excess tokens" <<
nl <<
nl;
284 <<
"--> FOAM WARNING:" <<
nl
285 <<
"Option -" << optName <<
" had no tokens" <<
nl <<
nl;
290void Foam::argList::raiseBadInput(
const word& optName)
const
295 <<
"Option -" << optName <<
" with invalid input" <<
nl
302 const string& argName,
306 validArgs.append(argName);
310 const label index = validArgs.size();
314 argUsage.erase(index);
318 argUsage.set(index, usage);
342 validOptions.set(optName, param);
345 optionUsage.set(optName, usage);
349 advancedOptions.set(optName);
356 if (advanced && validOptions.found(optName))
358 advancedOptions.set(optName);
362 advancedOptions.erase(optName);
370 std::pair<const char*,int> compat
373 validOptionsCompat.insert
376 std::pair<word,int>(optName, compat.second)
383 std::pair<const char*,int> compat,
387 ignoreOptionsCompat.insert
390 std::pair<bool,int>(expectArg, compat.second)
403 optionUsage.erase(optName);
407 optionUsage.set(optName, usage);
423 validOptions.erase(optName);
424 optionUsage.erase(optName);
425 advancedOptions.erase(optName);
431 argsMandatory_ =
false;
437 return argsMandatory_;
475 removeOption(
"noFunctionObjects");
479 ignoreOptionCompat({
"noFunctionObjects", 0},
false);
485 "withFunctionObjects",
486 "Execute functionObjects",
504 "Disable use of the controlDict libs entry",
512 removeOption(
"parallel");
513 removeOption(
"roots");
514 removeOption(
"decomposeParDict");
515 removeOption(
"hostRoots");
516 removeOption(
"world");
517 validParOptions.clear();
523 checkProcessorDirectories_ =
false;
529 for (
int i=1; i<argc; ++i)
531 if (argv[i] ==
'-' + postProcessOptionName)
561 if (
input.isAbsolute())
563 return input.relative(envGlobalPath(), caseTag);
577 if (!validOptionsCompat.empty())
579 const auto fnd = validOptionsCompat.cfind(optName.substr(1));
583 const auto& alt = fnd.val();
589 <<
"--> FOAM IOWarning :" <<
nl
590 <<
" Found [v" << alt.second <<
"] '"
591 << optName <<
"' instead of '-"
592 << alt.first <<
"' option"
599 return "-" + alt.first;
608int Foam::argList::optionIgnore(
const word& optName)
612 if (!ignoreOptionsCompat.empty())
614 const auto fnd = ignoreOptionsCompat.cfind(optName);
618 const auto& alt = fnd.val();
622 const int nskip = (alt.first ? 2 : 1);
628 <<
"--> FOAM IOWarning :" <<
nl
629 <<
" Ignoring [v" << alt.second <<
"] '-"
630 << optName << (nskip > 1 ?
" ARG" :
"")
646bool Foam::argList::regroupArgv(
int& argc,
char**& argv)
656 args_[0] = fileName(argv[0]);
657 for (
int argi = 1; argi < argc; ++argi)
659 if (strcmp(argv[argi],
"(") == 0)
664 else if (strcmp(argv[argi],
")") == 0)
672 args_[nArgs++] =
group;
678 args_[nArgs++] = argv[argi];
688 else if (argv[argi][0] ==
'-')
691 const char *optName = &argv[argi][1];
693 if (validOptions.found(optName))
696 args_[nArgs++] = argv[argi];
698 else if ((ignore = optionIgnore(optName)) > 0)
709 args_[nArgs++] = optionCompat(argv[argi]);
714 args_[nArgs++] = argv[argi];
721 args_[nArgs++] =
group;
726 std::string::size_type len = (nArgs-1);
727 for (
const auto&
s : args_)
733 commandLine_.reserve(len);
739void Foam::argList::setCasePaths()
743 const auto optIter = options_.cfind(
"case");
749 if (caseDir.empty() || caseDir ==
".")
753 options_.erase(
"case");
758 caseDir.toAbsolute();
769 rootPath_ = caseDir.path();
770 globalCase_ = caseDir.name();
777 setEnv(
"FOAM_CASE", caseDir,
true);
778 setEnv(
"FOAM_CASENAME", globalCase_,
true);
781 setEnv(
"FOAM_EXECUTABLE", executable_,
false);
802 for (
int argi = argc-2; argi > 0; --argi)
804 if (argv[argi][0] ==
'-')
806 const char *optName = &argv[argi][1];
808 if (strcmp(optName,
"fileHandler") == 0)
810 handlerType = argv[argi+1];
815 if (handlerType.empty())
818 if (handlerType.empty())
830 )().needsThreading();
835 for (
int argi = 1; argi < argc; ++argi)
837 if (argv[argi][0] ==
'-')
839 const char *optName = &argv[argi][1];
843 runControl_.
runPar(argc, argv, needsThread);
850 regroupArgv(argc, argv);
851 commandLine_ += args_[0];
857 int numDryRun = 0, numVerbose = 0;
861 for (
int argi = 1; argi < args_.size(); ++argi)
864 commandLine_ += args_[argi];
866 if (args_[argi][0] ==
'-')
868 const char *optName = &args_[argi][1];
873 <<
"Ignoring lone '-' on the command-line" <<
endl;
891 wantArg = !optIter.val().empty();
901 if (argi >= args_.size())
906 <<
"Error: option '-" << optName
907 <<
"' requires an argument" <<
nl <<
nl
908 <<
"See '" << executable_ <<
" -help' for usage"
915 commandLine_ += args_[argi];
921 if (strcmp(optName,
"lib") == 0)
927 else if (strcmp(optName,
"debug-switch") == 0)
935 else if (strcmp(optName,
"info-switch") == 0)
943 else if (strcmp(optName,
"opt-switch") == 0)
955 options_.set(optName, args_[argi]);
963 options_.insert(optName,
"");
968 if (strcmp(optName,
"dry-run") == 0)
972 else if (strcmp(optName,
"verbose") == 0)
983 args_[nArgs] = args_[argi];
990 runControl_.
dryRun(numDryRun);
991 runControl_.
verbose(numVerbose);
995 parse(checkArgs, checkOpts, initialise);
1008 runControl_(
args.runControl_),
1012 executable_(
args.executable_),
1013 rootPath_(
args.rootPath_),
1014 globalCase_(
args.globalCase_),
1016 commandLine_(
args.commandLine_)
1018 parse(checkArgs, checkOpts, initialise);
1036 bool quickExit =
false;
1039 if (options_.found(
"doc"))
1044 else if (options_.found(
"doc-source"))
1051 if (options_.found(
"help-full"))
1056 else if (options_.found(
"help-notes"))
1062 else if (options_.found(
"help"))
1067 else if (options_.found(
"help-man"))
1074 if (options_.found(
"help-compat"))
1087 if (!
check(checkArgs, checkOpts))
1123 <<
"Exec : " << commandLine_.c_str() <<
nl
1124 <<
"Date : " << dateString.c_str() <<
nl
1125 <<
"Time : " << timeString.c_str() <<
nl
1127 <<
"PID : " <<
pid() <<
nl;
1140 const auto space = build.find(
' ');
1141 if (space != std::string::npos)
1143 build.resize(space);
1155 libs().open(bannerEnabled());
1169 options_.lookup(
"fileHandler",
Foam::getEnv(
"FOAM_FILEHANDLER"))
1172 if (handlerType.empty())
1186 if (runControl_.parRun())
1199 fromSubproc >> procBuild >> hostMachine[proci] >> procPid;
1201 hostProcs[proci] = hostMachine[proci] +
"." +
name(procPid);
1209 <<
" but proc " << subproci <<
" is running "
1234 if (runControl_.parRun())
1247 bool adjustOpt =
false;
1251 source /=
"decomposeParDict";
1258 source = rootPath_/globalCase_/source;
1266 options_.set(
"decomposeParDict", source);
1271 label dictNProcs = -1;
1272 if (this->readListIfPresent(
"roots", roots))
1275 runControl_.distributed(
true);
1280 <<
"The -roots option must contain values"
1283 if (roots.
size() > 1)
1285 dictNProcs = roots.
size()+1;
1288 else if (options_.found(
"hostRoots"))
1290 source =
"-hostRoots";
1291 runControl_.distributed(
true);
1296 checkITstream(is,
"hostRoots");
1298 if (hostRoots.
empty())
1301 <<
"The -hostRoots option must contain values"
1307 for (
const auto& hostRoot : hostRoots)
1313 for (
const label matchi : matched)
1315 if (!roots[matchi].empty())
1318 <<
"Multiple matching roots for "
1319 << hostMachine[matchi] <<
" in "
1324 roots[matchi] = hostRoot.second();
1331 if (roots[hosti].empty())
1334 <<
"No matching roots for "
1335 << hostMachine[hosti] <<
" in "
1341 if (roots.
size() > 1)
1343 dictNProcs = roots.
size()+1;
1350 const bool useDefault = source.empty();
1353 source = rootPath_/globalCase_/
"system"/
"decomposeParDict";
1368 if (dictStream && dictStream->
good())
1371 bool nDomainsMandatory =
false;
1375 nDomainsMandatory =
true;
1376 runControl_.distributed(
true);
1382 <<
"WARNING: running distributed"
1383 <<
" but did not specify roots!" <<
nl;
1391 "numberOfSubdomains",
1403 <<
"WARNING: running without decomposeParDict "
1404 << this->relativePath(source) <<
nl;
1410 <<
"Cannot read decomposeParDict: "
1411 << this->relativePath(source) <<
nl
1421 <<
"Running parallel on single processor. This only"
1422 <<
" makes sense for multi-world simulation" <<
endl;
1429 if (roots.
size() == 1)
1435 if (dictNProcs <= 0)
1437 dictNProcs = roots.
size()+1;
1453 checkProcessorDirectories_
1459 << this->relativePath(source)
1460 <<
" specifies " << dictNProcs
1461 <<
" processors but job was started with "
1472 <<
"number of entries in roots "
1474 <<
" is not equal to the number of sub-processes "
1485 const bool hadCaseOpt = options_.found(
"case");
1488 options_.set(
"case", roots[subproci-1]/globalCase_);
1493 << args_ << options_
1494 << runControl_.distributed()
1495 << label(runControl_.dryRun())
1496 << label(runControl_.verbose());
1498 options_.erase(
"case");
1503 options_.set(
"case", rootPath_/globalCase_);
1512 checkProcessorDirectories_
1518 label nProcDirs = 0;
1523 rootPath_/globalCase_
1532 <<
"number of processor directories = "
1534 <<
" is not equal to the number of processors = "
1546 << args_ << options_
1547 << runControl_.distributed()
1548 << label(runControl_.dryRun())
1549 << label(runControl_.verbose());
1557 label numDryRun, numVerbose;
1566 >> args_ >> options_
1568 >> numDryRun >> numVerbose;
1570 runControl_.distributed(isDistributed);
1571 runControl_.dryRun(numDryRun);
1572 runControl_.verbose(numVerbose);
1585 case_ = globalCase_;
1592 case_ = globalCase_;
1596 if (runControl_.distributed())
1607 if (!writeHostsSwitch)
1620 Info<<
"Case : " << (rootPath_/globalCase_).c_str() <<
nl
1621 <<
"nProcs : " << nProcs <<
nl;
1623 if (runControl_.parRun())
1625 if (hostProcs.
size())
1627 if (writeHostsSwitch == 1)
1632 else if (writeHostsSwitch)
1635 Info<<
"Hosts :\n(" <<
nl;
1642 for (
const auto& str : hostProcs)
1644 Info<<
" " << str.c_str() <<
nl;
1651 Info<<
"Roots : " << roots <<
nl;
1653 Info<<
"Pstream initialized with:" <<
nl
1675 if (hostProcs.
size())
1694 Info<<
"fileModificationChecking : "
1695 <<
"Monitoring run-time modified files using "
1708 Info<<
" (fileModificationSkew "
1714 Info<<
" (fileModificationSkew "
1716 <<
", maxFileModificationPolls "
1723 <<
"Invalid setting for maxFileModificationPolls "
1730 Info<<
"allowSystemOperations : ";
1737 Info<<
"Disallowing";
1739 Info<<
" user-supplied system call operations" <<
nl
1763 for (
const word& optName : optionNames)
1765 if (options_.found(optName))
1776 std::initializer_list<word> optionNames
1780 for (
const word& optName : optionNames)
1782 if (options_.found(optName))
1797 || optName ==
"parallel"
1798 || optName ==
"roots"
1802 <<
"Option: '" << optName <<
"' is protected" <<
nl
1807 if (options_.found(optName) ? (options_[optName] != param) :
true)
1809 options_.set(optName, param);
1823 || optName ==
"parallel"
1824 || optName ==
"roots"
1825 || optName ==
"hostRoots"
1829 <<
"Option: '" << optName <<
"' is protected" <<
nl
1835 return options_.erase(optName);
1848 docExt.
replace(
".",
"_source.");
1853 for (
const fileName& dir : docDirs)
1856 if (dir.starts_with(
"http:") || dir.starts_with(
"https:"))
1858 url = dir/executable_ + docExt;
1867 ?
isFile(docFile.substr(7))
1871 url = std::move(docFile);
1879 <<
"No documentation found for " << executable_
1880 <<
", but you can use -help to display the usage\n" <<
endl;
1885 string docBrowser =
getEnv(
"FOAM_DOC_BROWSER");
1886 if (docBrowser.empty())
1888 docDict.
readEntry(
"docBrowser", docBrowser);
1892 if (docBrowser.find(
"%f") != std::string::npos)
1894 docBrowser.
replace(
"%f", url);
1898 docBrowser +=
" " + url;
1907 <<
" " << command <<
nl <<
endl;
1919 const label nargs = args_.size()-1;
1920 if (checkArgs && nargs != validArgs.size())
1923 <<
"Expected " << validArgs.size()
1924 <<
" arguments but found " << nargs <<
endl;
1932 const word& optName = iter.key();
1935 !validOptions.found(optName)
1936 && !validParOptions.found(optName)
1940 <<
"Invalid option: -" << optName <<
endl;
1950 <<
"See '" << executable_ <<
" -help' for usage"
1965 <<
": cannot open root directory " << rootPath()
1973 if (checkProcessorDirectories_ && pathDir.empty() &&
Pstream::master())
1979 <<
": cannot open case directory " <<
path()
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
Foam::argList::initValidTables dummyInitValidTables
An adapter for copying a list of C++ strings into a list of C-style strings for passing to C code tha...
A HashTable with keys but without contents that is similar to std::unordered_set.
A HashTable similar to std::unordered_map.
static Ostream & writeDivider(Ostream &os)
Write the standard file section divider.
static Ostream & writeBanner(Ostream &os, const bool noSyntaxHint=false)
Write the standard OpenFOAM file/dictionary banner.
static float fileModificationSkew
Time skew (seconds) for file modification checks.
static fileCheckTypes fileModificationChecking
Type of file modification checking.
static const Enum< fileCheckTypes > fileCheckTypesNames
Names for the fileCheckTypes.
static int maxFileModificationPolls
Max number of times to poll for file modification changes.
Input inter-processor communications stream.
An input stream of tokens.
static void disable() noexcept
Disallow JobInfo by forcing writeJobInfo (InfoSwitch) off.
void exit()
Job end with "exit" termination.
void write() const
Write job info to its file in the "running" jobs directory.
void stop()
Job end with "normal" termination.
Template class for non-intrusive linked lists.
void resize(const label len)
Adjust allocated size of list.
void clear()
Clear the list, i.e. set size to zero.
Output inter-processor communications stream.
int dryRun() const noexcept
Non-zero if set as 'dry-run'.
int verbose() const noexcept
Non-zero if set as 'verbose'.
void runPar(int &argc, char **&argv, bool needsThread)
Initialize Pstream for a parallel run.
label nProcs() const noexcept
Number of ranks associated with PstreamBuffers.
UPstream::rangeType subProcs() const noexcept
Range of sub-processes indices associated with PstreamBuffers.
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
bool good() const noexcept
True if the Switch represents a valid enumeration.
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
bool empty() const noexcept
True if the UList is empty (ie, size() is zero)
void size(const label n)
Older name for setAddressableSize.
static const Enum< commsTypes > commsTypeNames
Names of the communication types.
static bool floatTransfer
static constexpr int masterNo() noexcept
Process index of the master (always 0)
static int nProcsSimpleSum
Number of processors to change from linear to tree communication.
static int nPollProcInterfaces
Number of polling cycles in processor updates.
static const wordList & allWorlds() noexcept
All worlds.
static commsTypes defaultCommsType
Default commsType.
static bool & parRun() noexcept
Test if this a parallel run.
static const word & myWorld()
My world.
Extract command arguments and options from the supplied argc and argv parameters.
void parse(bool checkArgs, bool checkOpts, bool initialise)
static word postProcessOptionName
Standard name for the post-processing option.
static HashTable< string, label, Hash< label > > argUsage
Short description for program arguments.
static void noBanner()
Disable emitting the banner information.
static std::string::size_type usageMin
Min indentation when displaying usage (default: 20)
static void noFunctionObjects(bool addWithOption=false)
Remove '-noFunctionObjects' option and ignore any occurrences.
static HashTable< std::pair< word, int > > validOptionsCompat
A list of aliases for options.
static HashTable< string > validParOptions
A list of valid parallel options.
static void removeOption(const word &optName)
Remove option from validOptions and from optionUsage.
static std::string::size_type usageMax
Max screen width when displaying usage (default: 80)
bool unsetOption(const word &optName)
Unset option directly (use with caution)
static void addArgument(const string &argName, const string &usage="")
Append a (mandatory) argument to validArgs.
static bool bannerEnabled()
Banner status (enabled/disabled).
static fileName envGlobalPath()
Global case (directory) from environment variable.
static void noLibs()
Add the '-no-libs' command line option.
static void noJobInfo()
Suppress JobInfo, overriding controlDict setting.
static void addVerboseOption(const string &usage, bool advanced=false)
Enable a 'verbose' bool option, with usage information.
static void setAdvanced(const word &optName, bool advanced=true)
Set an existing option as being 'advanced' or normal.
bool check(bool checkArgs=argList::argsMandatory(), bool checkOpts=true) const
virtual ~argList()
Destructor.
static HashTable< string > optionUsage
Short description for validOptions.
static fileName envRelativePath(const fileName &input, const bool caseTag=false)
static bool argsMandatory()
Command arguments type (optional/mandatory).
static HashSet< string > advancedOptions
The "advanced" options are shown with -help-full (not with –help)
bool setOption(const word &optName, const string ¶m="")
Set option directly (use with caution)
static void addOptionCompat(const word &optName, std::pair< const char *, int > compat)
Specify an alias for the option name.
static void addDryRunOption(const string &usage, bool advanced=false)
Enable a 'dry-run' bool option, with usage information.
static void noCheckProcessorDirectories()
Remove checking of processor directories.
static SLList< string > notes
General usage notes.
bool checkRootCase() const
Check root path and case path.
void displayDoc(bool source=false) const
Display documentation in browser.
static void noMandatoryArgs()
Flag command arguments as being optional (non-mandatory)
static void addBoolOption(const word &optName, const string &usage="", bool advanced=false)
Add a bool option to validOptions with usage information.
static void noParallel()
Remove the parallel options.
static void addUsage(const word &optName, const string &usage)
Add option usage information to optionUsage.
static void addOption(const word &optName, const string ¶m="", const string &usage="", bool advanced=false)
Add an option to validOptions with usage information.
static HashTable< string > validOptions
A list of valid options.
static SLList< string > validArgs
A list of valid (mandatory) arguments.
static word envExecutable()
Name of the executable from environment variable.
static HashTable< std::pair< bool, int > > ignoreOptionsCompat
A list of options to ignore.
static void addNote(const string ¬e)
Add extra notes for the usage information.
static void ignoreOptionCompat(std::pair< const char *, int > compat, bool expectArg)
Specify an option to be ignored.
dlLibraryTable & libs() const noexcept
Mutable access to the loaded dynamic libraries.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
bool good() const noexcept
True if the managed pointer is non-null.
static std::string date()
static std::string clockTime()
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
entry * add(entry *entryPtr, bool mergeEntry=false)
Add a new entry.
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, bool mandatory=true) const
bool append(const fileName &libName)
Add to the list of names, but do not yet open.
static int allowSystemOperations
Flag if system operations are allowed.
virtual void write(Ostream &os, const bool withTitle=true) const
Print error message.
static bool warnAboutAge(const int version) noexcept
Test if an age warning should be emitted.
A class for handling file names.
static bool clean(std::string &str)
static std::string name(const std::string &str)
Return basename (part beyond last /), including its extension.
static bool isAbsolute(const std::string &str)
static word defaultFileHandler
Name of the default fileHandler.
static autoPtr< fileOperation > fileHandlerPtr_
Static fileOperation.
static bool postProcess
Global post-processing mode switch.
virtual void validate()
Validate the turbulence fields after construction.
std::ostream & stdStream()
Return std::ostream for output operations.
int myProcNo() const noexcept
Return processor number.
Lookup type of boundary radiation properties.
void setNamedValue(std::string name, int val, bool report=false)
Set named value, but also handle embedded 'name=value' syntax.
splitCell * master() const
bool starts_with(const std::string &s) const
True if string starts with the given prefix (cf. C++20)
string & replace(const std::string &s1, const std::string &s2, size_type pos=0)
bool set() const
Are all the vector set.
A class for handling words, derived from Foam::string.
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
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.
int infoSwitch(const char *name, const int deflt=0)
Lookup info switch or add default value.
simpleObjectRegistry & infoObjects()
Access to registered InfoSwitch objects.
dictionary & controlDict()
simpleObjectRegistry & optimisationObjects()
Access to registered OptimisationSwitch objects.
simpleObjectRegistry & debugObjects()
Access to registered DebugSwitch objects.
const std::string patch
OpenFOAM patch number as a std::string.
const std::string build
OpenFOAM build information as a std::string.
const std::string buildArch
void printBuildInfo(std::ostream &os, const bool full=true)
Print information about version, build, arch to output stream.
const std::string version
OpenFOAM version (name or stringified number) as a std::string.
Foam::SubStrings< StringType > splitSpace(const StringType &str)
Split string into sub-strings at whitespace (TAB, NL, VT, FF, CR, SPC)
string expand(const std::string &s, const HashTable< string > &mapping, const char sigil='$')
const fileOperation & fileHandler()
Get current file handler.
fileName cwd()
The physical or logical current working directory path name.
string getEnv(const std::string &envName)
Get environment value for given envName.
bool setEnv(const word &name, const std::string &value, const bool overwrite)
Set an environment variable, return true on success.
int system(const std::string &command, const bool bg=false)
Execute the specified command via the shell.
static Istream & input(Istream &is, IntRange< T > &range)
messageStream Info
Information stream (stdout output on master, null elsewhere)
static void check(const int retVal, const char *what)
labelList findMatchingStrings(const UnaryMatchPredicate &matcher, const UList< StringType > &input, const bool invert=false)
Extract list indices for all matches.
string userName()
Return the user's login name.
pid_t pgid()
Return the group PID of this process.
Ostream & endl(Ostream &os)
Add newline and flush stream.
string hostName()
Return the system's host name, as per hostname(1)
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.
pid_t ppid()
Return the parent PID of this process.
static void printHostsSubscription(const UList< string > &hostProcs)
pid_t pid()
Return the PID of this process.
int infoDetailLevel
Global for selective suppression of Info output.
bool isFile(const fileName &name, const bool checkGzip=true, const bool followLink=true)
Does the name exist as a FILE in the file system?
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
errorManipArg< error, int > exit(error &err, const int errNo=1)
bool isDir(const fileName &name, const bool followLink=true)
Does the name exist as a DIRECTORY in the file system?
constexpr char nl
The newline '\n' character (0x0a)
Foam::argList args(argc, argv)
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIters(container, iter)
Iterate across all elements of the container object with const access.
Operations on lists of strings.
propsDict readIfPresent("fields", acceptFields)