Go to the documentation of this file.
73 const regExp matcher(
"processors?[0-9]+(_[0-9]+-[0-9]+)?");
75 bool isProcessorDir(
const string& dir)
80 && (dir ==
"processors" || matcher.
match(dir))
87 int main(
int argc,
char *argv[])
91 "List times using the timeSelector,"
92 " or use to remove selected time directories"
102 "List times from processor0/ directory"
107 "Remove selected time directories"
112 "Report progress of -rm option"
118 const bool removeFiles(
args.
found(
"rm"));
136 <<
"No processor* directories found"
159 const label nTimes = timeDirs.size();
184 <<
"Removing " << nTimes
185 <<
" times in " << procDirs.size()
186 <<
" processor directories" <<
endl;
190 if (procDirs.empty())
203 <<
" [" << (nTimes - timei) <<
'/' << nTimes <<
']'
207 for (
const fileName& procDir : procDirs)
218 <<
"Removing " << nTimes
219 <<
" time directories" <<
endl;
230 <<
" [" << (nTimes - timei) <<
'/' << nTimes <<
']'
241 for (
const instant& t : timeDirs)
static void noBanner()
Disable emitting the banner information.
static autoPtr< T > New(Args &&... args)
Construct autoPtr of T with forwarding arguments.
void inplaceSubsetList(ListType &input, const UnaryPredicate &pred, const bool invert=false)
Inplace subset of the list when predicate is true.
A class for handling words, derived from Foam::string.
A class for handling file names.
bool starts_with(const std::string &s) const
True if string starts with the given prefix (cf. C++20)
static void addNote(const string ¬e)
Add extra notes for the usage information.
instantList select(const instantList ×) const
Select a list of Time values that are within the ranges.
const fileOperation & fileHandler()
Get current file handler.
Ostream & endl(Ostream &os)
Add newline and flush stream.
messageStream InfoErr
Information stream (uses stderr - output is on the master only)
const fileName & rootPath() const
Return root path.
Ostream & flush(Ostream &os)
Flush stream.
static void noFunctionObjects(bool addWithOption=false)
Remove '-noFunctionObjects' option and ignore any occurrences.
bool match(const std::string &text) const
Test for equality.
static void noJobInfo()
Suppress JobInfo, overriding controlDict setting.
messageStream Info
Information stream (uses stdout - output is on the master only)
virtual label nProcs(const fileName &dir, const fileName &local="") const
Get number of processor directories/results. Used for e.g.
instantList times() const
Search the case for valid time directories.
Wrapper around C++11 regular expressions.
fileName path() const
Return the full path to the (processor local) case.
static void disable()
Disallow profiling by forcing the InfoSwitch off.
errorManipArg< error, int > exit(error &err, const int errNo=1)
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.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
bool rmDir(const fileName &directory, const bool silent=false)
Remove a directory and its contents (optionally silencing warnings)
static void addOptions(const bool constant=true, const bool withZero=false)
Add timeSelector options to argList::validOptions.
#define forAllReverse(list, i)
Reverse loop across all elements in list.
const fileName & caseName() const
Return case name (parallel run) or global case (serial run)
Various functions to operate on Lists.
An instant of time. Contains the time value and name.
static void noParallel()
Remove the parallel options.
Foam::argList args(argc, argv)
fileNameList readDir(const fileName &directory, const fileName::Type type=fileName::FILE, const bool filtergz=true, const bool followLink=true)
Read a directory and return the entries as a fileName List.
bool found(const word &optName) const
Return true if the named option is found.