Go to the documentation of this file.
34 inline void Foam::argList::readList(ITstream& is, List<T>& list)
83 return rootPath()/caseName();
89 return rootPath()/globalCaseName();
99 return input.relative(globalPath(), caseTag);
105 return parRunControl_.distributed();
111 return parRunControl_;
153 return options_.found(optName);
159 return ITstream(optName, options_[optName]);
167 template<>
inline int32_t argList::get<int32_t>(
const label index)
const
172 template<>
inline int64_t argList::get<int64_t>(
const label index)
const
177 template<>
inline float argList::get<float>(
const label index)
const
179 return Foam::readFloat(args_[index]);
182 template<>
inline double argList::get<double>(
const label index)
const
184 return Foam::readDouble(args_[index]);
188 template<>
inline int32_t argList::get<int32_t>(
const word& optName)
const
193 template<>
inline int64_t argList::get<int64_t>(
const word& optName)
const
198 template<>
inline float argList::get<float>(
const word& optName)
const
200 return Foam::readFloat(options_[optName]);
203 template<>
inline double argList::get<double>(
const word& optName)
const
205 return Foam::readDouble(options_[optName]);
210 inline string argList::get<Foam::string>(
const label index)
const
216 inline word argList::get<Foam::word>(
const label index)
const
222 inline fileName argList::get<Foam::fileName>(
const label index)
const
229 inline string argList::get<Foam::string>(
const word& optName)
const
231 return options_[optName];
235 inline word argList::get<Foam::word>(
const word& optName)
const
237 return options_[optName];
241 inline fileName argList::get<Foam::fileName>(
const word& optName)
const
243 return options_[optName];
258 checkITstream(is, index);
267 ITstream is(optName, options_[optName]);
272 checkITstream(is, optName);
287 return get<T>(optName);
303 val = get<T>(optName);
319 if (readIfPresent<T>(optName, val))
337 checkITstream(is, index);
352 if (mandatory ||
found(optName))
354 ITstream is(optName, options_[optName]);
358 checkITstream(is, optName);
374 ITstream is(optName, options_[optName]);
378 checkITstream(is, optName);
387 template<
class T,
class Predicate>
392 const Predicate& pred,
396 if (readIfPresent<T>(optName, val))
400 raiseBadInput(optName);
408 <<
"Option -" << optName <<
" not specified" <<
nl
416 template<
class T,
class Predicate>
421 const Predicate& pred
424 return readCheck<T>(optName, val, pred,
false);
428 template<
class T,
class Predicate>
432 const Predicate& pred
436 readCheck<T>(optName, val, pred,
true);
441 template<
class T,
class Predicate>
446 const Predicate& pred
452 if (readCheck<T>(optName, val, pred,
false))
471 return options_[optName];
A table of dynamically loaded libraries.
A class for handling words, derived from Foam::string.
A class for handling file names.
T getOrDefault(const word &optName, const T &deflt) const
Get a value from the named option if present, or return default.
const HashTable< string > & options() const
Return options.
const stringList & args() const
Return arguments.
bool readListIfPresent(const word &optName, List< T > &list) const
A class for handling character strings derived from std::string.
T get(const label index) const
Get a value from the argument at index.
bool readIfPresent(const word &optName, T &val) const
Read a value from the named option if present.
const fileName & rootPath() const
Return root path.
bool readCheck(const word &optName, T &val, const Predicate &pred, bool mandatory=true) const
Read the named option and check its validity.
const ParRunControl & parRunControl() const
Return the ParRunControl.
ITstream lookup(const word &optName) const
Return an input stream from the named option.
const word & executable() const
Name of executable without the path.
An input stream of tokens.
word name(const complex &c)
Return string representation of complex.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
bool readCheckIfPresent(const word &optName, T &val, const Predicate &pred) const
Read the named option if present and check its validity.
fileName path() const
Return the full path to the (processor local) case.
int32_t readInt32(Istream &is)
Read int32_t from stream.
T getCheck(const word &optName, const Predicate &pred) const
Get a value from the named option with additional checking.
errorManipArg< error, int > exit(error &err, const int errNo=1)
label size() const noexcept
The number of arguments.
fileName globalPath() const
Return the full path to the global case.
static Istream & input(Istream &is, IntRange< T > &range)
dlLibraryTable & libs() const
Mutable access to the loaded dynamic libraries.
const string & commandLine() const
The command line options and arguments concatenated as a string.
List< T > getList(const label index) const
Get a List of values from the argument at index.
Helper class for initializing parallel jobs from the command arguments. Also handles cleanup of paral...
const fileName & caseName() const
Return case name (parallel run) or global case (serial run)
const string & operator[](const label index) const
The string corresponding to the argument index.
T getCheckOrDefault(const word &optName, const T &deflt, const Predicate &pred) const
const fileName & globalCaseName() const
Return global case name.
fileName relativePath(const fileName &input, const bool caseTag=false) const
bool found(const word &optName) const
Return true if the named option is found.
int64_t readInt64(Istream &is)
Read int64_t from stream.