A List of scalarRange for selecting times. More...
Public Member Functions | |
timeSelector ()=default | |
timeSelector (const std::string &str) | |
bool | selected (const instant &value) const |
List< bool > | selected (const instantList ×) const |
instantList | select (const instantList ×) const |
void | inplaceSelect (instantList ×) const |
Static Public Member Functions | |
static void | addOptions (const bool constant=true, const bool withZero=false) |
static instantList | select (const instantList ×, const argList &args, const word &constantName="constant") |
static instantList | select0 (Time &runTime, const argList &args) |
static instantList | selectIfPresent (Time &runTime, const argList &args) |
A List of scalarRange for selecting times.
The timeSelector provides a convenient means of selecting multiple times. A typical use would be the following:
timeSelector::addOptions(); // add other options #include "setRootCase.H" #include "createTime.H" instantList timeDirs = timeSelector::select0(runTime, args); ... forAll(timeDirs, timei) { ... }
The result program would receive -time, -latestTime, -constant and -noZero options. The -constant option explicitly includes the constant/
directory in the time list and the -noZero option explicitly excludes the 0/
directory from the time list.
There may however also be many cases in which neither the constant/
directory nor the 0/
directory contain particularly relevant information. This might occur, for example, when post-processing results. In this case, addOptions is called with optional boolean arguments.
timeSelector::addOptions(false, true);
The first argument avoids adding the -constant option. The second argument adds an additional -withZero option and also prevents the 0/
directory from being included in the default time range and in the -latestTime selection.
Definition at line 88 of file timeSelector.H.
|
default |
|
explicit |
Definition at line 29 of file timeSelector.C.
Definition at line 37 of file timeSelector.C.
References scalarRanges::match(), and Instant< T >::value().
Referenced by timeSelector::select().
Foam::List< bool > selected | ( | const instantList & | times | ) | const |
Definition at line 43 of file timeSelector.C.
References TimePaths::findClosestTimeIndex(), forAll, Foam::name(), and range.
Foam::instantList select | ( | const instantList & | times | ) | const |
Definition at line 82 of file timeSelector.C.
References Foam::subset().
Referenced by timeSelector::select0().
void inplaceSelect | ( | instantList & | times | ) | const |
Definition at line 88 of file timeSelector.C.
References Foam::inplaceSubset().
Definition at line 95 of file timeSelector.C.
References argList::addBoolOption(), and argList::addOption().
Referenced by if().
|
static |
Definition at line 141 of file timeSelector.C.
References args, forAll, found, argList::found(), Foam::name(), timeSelector::selected(), Foam::subset(), and argList::validOptions.
|
static |
Definition at line 228 of file timeSelector.C.
References List::append(), args, TimePaths::constant(), Foam::endl(), runTime, timeSelector::select(), Time::setTime(), TimePaths::times(), and WarningInFunction.
Referenced by if().
|
static |
Definition at line 259 of file timeSelector.C.
References args, argList::found(), runTime, Time::timeName(), and dimensioned::value().
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.