STYLE: add parameter names for Time.H (doxygen)

- consistent use of watchIndex vs watchFd
This commit is contained in:
Mark Olesen
2017-04-19 09:34:27 +02:00
parent da6e90de63
commit befb49af10
2 changed files with 59 additions and 54 deletions

View File

@ -321,7 +321,7 @@ void Foam::Time::setControls()
} }
void Foam::Time::setMonitoring(bool forceProfiling) void Foam::Time::setMonitoring(const bool forceProfiling)
{ {
const dictionary* profilingDict = controlDict_.subDictPtr("profiling"); const dictionary* profilingDict = controlDict_.subDictPtr("profiling");
@ -750,18 +750,15 @@ const Foam::fileName& Foam::Time::getFile(const label watchIndex) const
} }
Foam::fileMonitor::fileState Foam::Time::getState Foam::fileMonitor::fileState Foam::Time::getState(const label watchIndex) const
(
const label watchFd
) const
{ {
return monitorPtr_().getState(watchFd); return monitorPtr_().getState(watchIndex);
} }
void Foam::Time::setUnmodified(const label watchFd) const void Foam::Time::setUnmodified(const label watchIndex) const
{ {
monitorPtr_().setUnmodified(watchFd); monitorPtr_().setUnmodified(watchIndex);
} }
@ -908,13 +905,13 @@ Foam::dimensionedScalar Foam::Time::endTime() const
bool Foam::Time::run() const bool Foam::Time::run() const
{ {
bool running = value() < (endTime_ - 0.5*deltaT_); bool isRunning = value() < (endTime_ - 0.5*deltaT_);
if (!subCycling_) if (!subCycling_)
{ {
// Only execute when the condition is no longer true // Only execute when the condition is no longer true
// ie, when exiting the control loop // ie, when exiting the control loop
if (!running && timeIndex_ != startTimeIndex_) if (!isRunning && timeIndex_ != startTimeIndex_)
{ {
// Ensure functionObjects execute on last time step // Ensure functionObjects execute on last time step
// (and hence write uptodate functionObjectProperties) // (and hence write uptodate functionObjectProperties)
@ -928,7 +925,7 @@ bool Foam::Time::run() const
} }
} }
if (running) if (isRunning)
{ {
if (!subCycling_) if (!subCycling_)
{ {
@ -957,25 +954,25 @@ bool Foam::Time::run() const
} }
} }
// Update the "running" status following the // Update the "is-running" status following the
// possible side-effects from functionObjects // possible side-effects from functionObjects
running = value() < (endTime_ - 0.5*deltaT_); isRunning = value() < (endTime_ - 0.5*deltaT_);
} }
return running; return isRunning;
} }
bool Foam::Time::loop() bool Foam::Time::loop()
{ {
bool running = run(); const bool isRunning = run();
if (running) if (isRunning)
{ {
operator++(); operator++();
} }
return running; return isRunning;
} }
@ -1066,19 +1063,19 @@ void Foam::Time::setEndTime(const scalar endTime)
void Foam::Time::setDeltaT void Foam::Time::setDeltaT
( (
const dimensionedScalar& deltaT, const dimensionedScalar& deltaT,
const bool bAdjustDeltaT const bool adjust
) )
{ {
setDeltaT(deltaT.value(), bAdjustDeltaT); setDeltaT(deltaT.value(), adjust);
} }
void Foam::Time::setDeltaT(const scalar deltaT, const bool bAdjustDeltaT) void Foam::Time::setDeltaT(const scalar deltaT, const bool adjust)
{ {
deltaT_ = deltaT; deltaT_ = deltaT;
deltaTchanged_ = true; deltaTchanged_ = true;
if (bAdjustDeltaT) if (adjust)
{ {
adjustDeltaT(); adjustDeltaT();
} }

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd. \\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -333,29 +333,33 @@ public:
void readModifiedObjects(); void readModifiedObjects();
//- Helper: add watches for list of files //- Helper: add watches for list of files
void addWatches(regIOobject&, const fileNameList&) const; void addWatches
(
regIOobject& rio,
const fileNameList& files
) const;
//- Find index (or -1) of file in list of handles //- Find index (or -1) of file in list of handles
label findWatch label findWatch
( (
const labelList& watchIndices, const labelList& watchIndices,
const fileName& const fileName& fName
) const; ) const;
//- Add watching of a file. Returns handle //- Add watching of a file. Returns handle
label addTimeWatch(const fileName&) const; label addTimeWatch(const fileName& fName) const;
//- Remove watch on a file (using handle) //- Remove watch on a file (using handle)
bool removeWatch(const label) const; bool removeWatch(const label watchIndex) const;
//- Get name of file being watched (using handle) //- Get name of file being watched (using handle)
const fileName& getFile(const label) const; const fileName& getFile(const label watchIndex) const;
//- Get current state of file (using handle) //- Get current state of file (using handle)
fileMonitor::fileState getState(const label) const; fileMonitor::fileState getState(const label watchIndex) const;
//- Set current state of file (using handle) to unmodified //- Set current state of file (using handle) to unmodified
void setUnmodified(const label) const; void setUnmodified(const label watchIndex) const;
//- Return the location of "dir" containing the file "name". //- Return the location of "dir" containing the file "name".
@ -375,20 +379,24 @@ public:
//- Search the case for the time directory path //- Search the case for the time directory path
// corresponding to the given instance // corresponding to the given instance
word findInstancePath(const fileName& path, const instant&) const; word findInstancePath
(
const fileName& directory,
const instant& t
) const;
//- Search the case for the time directory path //- Search the case for the time directory path
// corresponding to the given instance // corresponding to the given instance
word findInstancePath(const instant&) const; word findInstancePath(const instant& t) const;
//- Search the case for the time closest to the given time //- Search the case for the time closest to the given time
instant findClosestTime(const scalar) const; instant findClosestTime(const scalar t) const;
//- Search instantList for the time index closest to the given time //- Search instantList for the time index closest to the given time
static label findClosestTimeIndex static label findClosestTimeIndex
( (
const instantList&, const instantList& timeDirs,
const scalar, const scalar t,
const word& constantName = "constant" const word& constantName = "constant"
); );
@ -398,9 +406,9 @@ public:
//- Write using given format, version and compression //- Write using given format, version and compression
virtual bool writeObject virtual bool writeObject
( (
IOstream::streamFormat, IOstream::streamFormat fmt,
IOstream::versionNumber, IOstream::versionNumber ver,
IOstream::compressionType IOstream::compressionType cmp
) const; ) const;
//- Write the objects now (not at end of iteration) and continue //- Write the objects now (not at end of iteration) and continue
@ -420,7 +428,7 @@ public:
// formatted with given precision // formatted with given precision
static word timeName static word timeName
( (
const scalar, const scalar t,
const int precision = precision_ const int precision = precision_
); );
@ -430,7 +438,7 @@ public:
//- Search a given directory for valid time directories //- Search a given directory for valid time directories
static instantList findTimes static instantList findTimes
( (
const fileName&, const fileName& directory,
const word& constantName = "constant" const word& constantName = "constant"
); );
@ -521,42 +529,42 @@ public:
//- Adjust the current stopAtControl. Note that this value //- Adjust the current stopAtControl. Note that this value
// only persists until the next time the dictionary is read. // only persists until the next time the dictionary is read.
// Return true if the stopAtControl changed. // Return true if the stopAtControl changed.
virtual bool stopAt(const stopAtControls) const; virtual bool stopAt(const stopAtControls sa) const;
//- Reset the time and time-index to those of the given time //- Reset the time and time-index to those of the given time
virtual void setTime(const Time&); virtual void setTime(const Time& t);
//- Reset the time and time-index //- Reset the time and time-index
virtual void setTime(const instant&, const label newIndex); virtual void setTime(const instant& inst, const label newIndex);
//- Reset the time and time-index //- Reset the time and time-index
virtual void setTime virtual void setTime
( (
const dimensionedScalar&, const dimensionedScalar& newTime,
const label newIndex const label newIndex
); );
//- Reset the time and time-index //- Reset the time and time-index
virtual void setTime(const scalar, const label newIndex); virtual void setTime(const scalar newTime, const label newIndex);
//- Reset end time //- Reset end time
virtual void setEndTime(const dimensionedScalar&); virtual void setEndTime(const dimensionedScalar& endTime);
//- Reset end time //- Reset end time
virtual void setEndTime(const scalar); virtual void setEndTime(const scalar endTime);
//- Reset time step //- Reset time step, normally also calling adjustDeltaT()
virtual void setDeltaT virtual void setDeltaT
( (
const dimensionedScalar&, const dimensionedScalar& deltaT,
const bool adjustDeltaT = true const bool adjust = true
); );
//- Reset time step //- Reset time step, normally also calling adjustDeltaT()
virtual void setDeltaT virtual void setDeltaT
( (
const scalar, const scalar deltaT,
const bool adjustDeltaT = true const bool adjust = true
); );
//- Set time to sub-cycle for the given number of steps //- Set time to sub-cycle for the given number of steps
@ -575,10 +583,10 @@ public:
// Member operators // Member operators
//- Set deltaT to that specified and increment time via operator++() //- Set deltaT to that specified and increment time via operator++()
virtual Time& operator+=(const dimensionedScalar&); virtual Time& operator+=(const dimensionedScalar& deltaT);
//- Set deltaT to that specified and increment time via operator++() //- Set deltaT to that specified and increment time via operator++()
virtual Time& operator+=(const scalar); virtual Time& operator+=(const scalar deltaT);
//- Prefix increment, //- Prefix increment,
// also invokes the functionObjectList::start() or // also invokes the functionObjectList::start() or