49 for (label i = 0; i < times.
size(); ++i)
51 if (timeVal <= times[i].
value())
62 const UList<instant>& times,
67 Pair<label>
range(start, -1);
69 for (label i = start+1; i < times.size(); ++i)
71 if (timeVal < times[i].value())
81 if (
range.first() < 0 ||
range.first() >= times.size())
84 return Pair<label>(-1, -1);
87 if (
range.first() < times.size()-1)
109 value() = std::atof(
name().c_str());
void size(const label n)
Older name for setAddressableSize.
static Pair< label > findRange(const UList< instant > ×, const scalar timeVal, const label start=-1)
Find lower/upper indices for given time value in list of instances (linear search) continuing after t...
static label findStart(const UList< instant > ×, const scalar timeVal)
Find and return index of given start time (linear search)
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
scalar value() const noexcept
The value (const access)
An ordered pair of two objects of type <T> with first() and second() elements.
const word & name() const noexcept
The name/key (const access)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
A class for handling words, derived from Foam::string.
instant()=default
Default construct, with value = 0 and empty name.
static const char *const typeName
The type name (eg, for pTraits)
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
A tuple of scalar value and key. The value often corresponds to a time value, thus the naming of the ...