consistency update

- OSspecific: chmod() -> chMod(), even although it's not used anywhere

- ListOps get subset() and inplaceSubset() templated on BoolListType

- added UList<bool>::operator[](..) const specialization.
  Returns false (actually pTraits<bool>::zero) for out-of-range elements.
  This lets us use List<bool> with lazy evaluation and no noticeable
  change in performance.

- use rcIndex() and fcIndex() wherever possible.
  Could check if branching or modulus is faster for fcIndex().

- UList and FixedList get 'const T* cdata() const' and 'T* data()' members.
  Similar to the STL front() and std::string::data() methods, they return a
  pointer to the first element without needing to write '&myList[0]', recast
  begin() or violate const-ness.
This commit is contained in:
Mark Olesen
2009-02-06 20:43:09 +01:00
parent 603364e1e3
commit 69918f23c5
55 changed files with 363 additions and 233 deletions

View File

@ -31,11 +31,7 @@ License
// * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(Time, 0);
}
defineTypeNameAndDebug(Foam::Time, 0);
template<>
const char* Foam::NamedEnum<Foam::Time::stopAtControls, 4>::names[] =
@ -100,9 +96,11 @@ void Foam::Time::adjustDeltaT()
void Foam::Time::setControls()
{
// default is to resume calculation from "latestTime"
word startFrom("latestTime");
controlDict_.readIfPresent("startFrom", startFrom);
word startFrom = controlDict_.lookupOrDefault<word>
(
"startFrom",
"latestTime"
);
if (startFrom == "startTime")
{
@ -421,7 +419,7 @@ Foam::instant Foam::Time::findClosestTime(const scalar t) const
label nearestIndex = -1;
scalar deltaT = GREAT;
for (label i=1; i<times.size(); i++)
for (label i=1; i < times.size(); i++)
{
scalar diff = mag(times[i].value() - t);
if (diff < deltaT)