Loading...
Searching...
No Matches
TimePaths Class Reference

Address the time paths without using the Time class. More...

#include <TimePaths.H>

Inheritance diagram for TimePaths:

Public Member Functions

 TimePaths (const bool processorCase, const fileName &rootPath, const bool distributed, const fileName &globalCaseName, const fileName &caseName, const word &systemDirName="system", const word &constantDirName="constant")
 Construct from all components.
 TimePaths (const argList &args, const word &systemDirName="system", const word &constantDirName="constant")
 Construct using characteristics given by the argList.
 TimePaths (const fileName &rootPath, const fileName &caseName, const word &systemDirName="system", const word &constantDirName="constant")
 Construct from rootPath and casePath.
bool distributed () const noexcept
 True if case running with parallel distributed directories (ie. not NFS mounted).
bool processorCase () const noexcept
 True if this is a processor case.
bool processorCase (bool on) noexcept
 Set processor case status. Return old status.
const fileNamerootPath () const noexcept
 Return root path.
const fileNameglobalCaseName () const noexcept
 Return global case name.
const fileNamecaseName () const noexcept
 Return case name.
fileNamecaseName () noexcept
 The case name for modification (use with caution).
const fileNamecaseName (IOobjectOption::Layout) const noexcept
 Return caseName() or globalCaseName().
fileName path () const
 Return path for the case = rootPath/caseName.
fileName globalPath () const
 Return global path for the case = rootPath/globalCaseName.
fileName path (IOobjectOption::Layout) const
 Return path() or globalPath().
fileName relativePath (const fileName &input, const bool caseTag=false) const
 Return the input relative to the globalPath by stripping off a leading value of the globalPath.
const wordconstant () const noexcept
 Return constant name.
const wordsystem () const noexcept
 Return system name.
fileName caseConstant () const
 Return the constant name for the case, which is ../constant() for parallel runs.
fileName caseSystem () const
 Return the system name for the case, which is ../system() for parallel runs.
fileName constantPath () const
 Return constant path.
fileName systemPath () const
 Return system path.
instantList times () const
 Search the case for valid time directories.
instantList times (IOobjectOption::Layout) const
 Search local or global locations for valid time directories.
instant findClosestTime (const scalar t) const
 Search the case for the time closest to the given time.
instant findClosestTime (IOobjectOption::Layout, const scalar t) const
 Search local or global locations for the time closest to the given time.
word findInstancePath (const instant &t) const
 Search the case for the time directory path corresponding to the given instance.
word findInstancePath (IOobjectOption::Layout, const instant &t) const
 Search local or global locations for the time directory path corresponding to the given instance.

Static Public Member Functions

static instantList findTimes (const fileName &directory, const word &constantDirName="constant")
 Search a given directory for valid time directories.
static label findClosestTimeIndex (const UList< instant > &timeDirs, const scalar t, const word &constantDirName="constant")
 Search instant list for the time index closest to the specified time.
static instant findClosestTime (const UList< instant > &timeDirs, const scalar t, const word &constantDirName="constant")
 Search instant list for the instant closest to the specified time.
static word findInstancePath (const UList< instant > &timeDirs, const instant &t)
 Search instantList for matching time value, return the instance name or word::null if nothing is equal.
static word findInstancePath (const fileName &directory, const instant &t, const word &constantDirName="constant")
 Search the given directory for matching time value, return the instance name or word::null if nothing is equal.

Detailed Description

Address the time paths without using the Time class.

Source files

Definition at line 52 of file TimePaths.H.

Constructor & Destructor Documentation

◆ TimePaths() [1/3]

TimePaths ( const bool processorCase,
const fileName & rootPath,
const bool distributed,
const fileName & globalCaseName,
const fileName & caseName,
const word & systemDirName = "system",
const word & constantDirName = "constant" )

Construct from all components.

Definition at line 61 of file TimePaths.C.

References caseName(), distributed(), globalCaseName(), processorCase(), and rootPath().

Referenced by Time::Time(), Time::Time(), Time::Time(), Time::Time(), TimePaths(), and TimePaths().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TimePaths() [2/3]

TimePaths ( const argList & args,
const word & systemDirName = "system",
const word & constantDirName = "constant" )
explicit

Construct using characteristics given by the argList.

Definition at line 86 of file TimePaths.C.

References args, caseName(), distributed(), globalCaseName(), rootPath(), and TimePaths().

Here is the call graph for this function:

◆ TimePaths() [3/3]

TimePaths ( const fileName & rootPath,
const fileName & caseName,
const word & systemDirName = "system",
const word & constantDirName = "constant" )
inline

Construct from rootPath and casePath.

Definition at line 23 of file TimePathsI.H.

References caseName(), rootPath(), and TimePaths().

Here is the call graph for this function:

Member Function Documentation

◆ distributed()

bool distributed ( ) const
inlinenoexcept

True if case running with parallel distributed directories (ie. not NFS mounted).

Definition at line 46 of file TimePathsI.H.

References Foam::noexcept.

Referenced by Time::readDict(), TimePaths(), and TimePaths().

Here is the caller graph for this function:

◆ processorCase() [1/2]

bool processorCase ( ) const
inlinenoexcept

True if this is a processor case.

Definition at line 52 of file TimePathsI.H.

References Foam::noexcept.

Referenced by cyclicAMIPolyPatch::canResetAMI(), cyclicAMIFvPatch::coupled(), TimePaths(), and collatedFileOperation::writeObject().

Here is the caller graph for this function:

◆ processorCase() [2/2]

bool processorCase ( bool on)
inlinenoexcept

Set processor case status. Return old status.

Definition at line 58 of file TimePathsI.H.

◆ rootPath()

const Foam::fileName & rootPath ( ) const
inlinenoexcept

Return root path.

Definition at line 66 of file TimePathsI.H.

References Foam::noexcept.

Referenced by globalPath(), path(), path(), TimePaths(), TimePaths(), TimePaths(), and Time::TypeName().

Here is the caller graph for this function:

◆ globalCaseName()

const Foam::fileName & globalCaseName ( ) const
inlinenoexcept

Return global case name.

Definition at line 72 of file TimePathsI.H.

References Foam::noexcept.

Referenced by globalPath(), TimePaths(), TimePaths(), and Time::TypeName().

Here is the caller graph for this function:

◆ caseName() [1/3]

const Foam::fileName & caseName ( ) const
inlinenoexcept

Return case name.

Definition at line 78 of file TimePathsI.H.

References Foam::noexcept.

Referenced by path(), path(), TimePaths(), TimePaths(), TimePaths(), and Time::TypeName().

Here is the caller graph for this function:

◆ caseName() [2/3]

Foam::fileName & caseName ( )
inlinenoexcept

The case name for modification (use with caution).

Definition at line 84 of file TimePathsI.H.

References Foam::noexcept.

◆ caseName() [3/3]

const Foam::fileName & caseName ( IOobjectOption::Layout layout) const
inlinenoexcept

Return caseName() or globalCaseName().

Definition at line 91 of file TimePathsI.H.

References IOobjectOption::global.

◆ path() [1/2]

Foam::fileName path ( ) const
inline

Return path for the case = rootPath/caseName.

Definition at line 102 of file TimePathsI.H.

References caseName(), and rootPath().

Referenced by Time::timePath(), Time::timePath(), and Time::TypeName().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ globalPath()

Foam::fileName globalPath ( ) const
inline

Return global path for the case = rootPath/globalCaseName.

Definition at line 108 of file TimePathsI.H.

References globalCaseName(), and rootPath().

Referenced by Time::globalTimePath(), relativePath(), and Time::TypeName().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ path() [2/2]

Foam::fileName path ( IOobjectOption::Layout layout) const
inline

Return path() or globalPath().

Definition at line 115 of file TimePathsI.H.

References caseName(), and rootPath().

Here is the call graph for this function:

◆ relativePath()

Foam::fileName relativePath ( const fileName & input,
const bool caseTag = false ) const
inline

Return the input relative to the globalPath by stripping off a leading value of the globalPath.

Parameters
inputthe directory or filename to make case-relative
caseTagreplace globalPath with <case> for later use with expand(), or prefix <case> if the file name was not an absolute location

Definition at line 121 of file TimePathsI.H.

References globalPath(), and fileName::relative().

Referenced by PDRblock::writeBlockMeshDict().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ constant()

◆ system()

const Foam::word & system ( ) const
inlinenoexcept

Return system name.

Definition at line 137 of file TimePathsI.H.

References Foam::noexcept.

Referenced by codedBase::codeDict(), Time::Time(), Time::Time(), Time::Time(), and Time::Time().

Here is the caller graph for this function:

◆ caseConstant()

Foam::fileName caseConstant ( ) const
inline

Return the constant name for the case, which is ../constant() for parallel runs.

Definition at line 143 of file TimePathsI.H.

References constant().

Here is the call graph for this function:

◆ caseSystem()

Foam::fileName caseSystem ( ) const
inline

Return the system name for the case, which is ../system() for parallel runs.

Definition at line 154 of file TimePathsI.H.

References Foam::system().

Referenced by lumpedPointIOMovement::New().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ constantPath()

Foam::fileName constantPath ( ) const
inline

Return constant path.

Definition at line 165 of file TimePathsI.H.

◆ systemPath()

Foam::fileName systemPath ( ) const
inline

Return system path.

Definition at line 171 of file TimePathsI.H.

◆ findTimes()

Foam::instantList findTimes ( const fileName & directory,
const word & constantDirName = "constant" )
static

Search a given directory for valid time directories.

Note
forwards to the current fileHandler

Definition at line 108 of file TimePaths.C.

References Foam::fileHandler.

Referenced by findClosestTime(), findClosestTime(), findInstancePath(), Time::setControls(), times(), times(), and uniformInterpolatedDisplacementPointPatchVectorField::updateCoeffs().

Here is the caller graph for this function:

◆ findClosestTimeIndex()

Foam::label findClosestTimeIndex ( const UList< instant > & timeDirs,
const scalar t,
const word & constantDirName = "constant" )
static

Search instant list for the time index closest to the specified time.

Returns
-1 if nothing close is found

Definition at line 118 of file TimePaths.C.

References Foam::diff(), Foam::mag(), name, and UList< T >::size().

Referenced by if(), timeSelector::selected(), and timeSelector::setTimeIfPresent().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ findClosestTime() [1/3]

Foam::instant findClosestTime ( const UList< instant > & timeDirs,
const scalar t,
const word & constantDirName = "constant" )
static

Search instant list for the instant closest to the specified time.

Definition at line 146 of file TimePaths.C.

References Foam::diff(), Foam::mag(), and UList< T >::size().

Referenced by findClosestTime(), and findClosestTime().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ findInstancePath() [1/4]

Foam::word findInstancePath ( const UList< instant > & timeDirs,
const instant & t )
static

Search instantList for matching time value, return the instance name or word::null if nothing is equal.

Definition at line 191 of file TimePaths.C.

References Instant< T >::equal(), and forAllReverse.

Referenced by masterUncollatedFileOperation::filePathInfo(), findInstancePath(), findInstancePath(), findInstancePath(), masterUncollatedFileOperation::readObjects(), and uncollatedFileOperation::readObjects().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ findInstancePath() [2/4]

Foam::word findInstancePath ( const fileName & directory,
const instant & t,
const word & constantDirName = "constant" )
static

Search the given directory for matching time value, return the instance name or word::null if nothing is equal.

Definition at line 215 of file TimePaths.C.

References findInstancePath(), and findTimes().

Here is the call graph for this function:

◆ times() [1/2]

Foam::instantList times ( ) const

Search the case for valid time directories.

Note
forwards to the current fileHandler

Definition at line 230 of file TimePaths.C.

References constant(), findTimes(), and path().

Referenced by triSurface::triSurfInstance().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ times() [2/2]

Search local or global locations for valid time directories.

Note
forwards to the current fileHandler

Definition at line 237 of file TimePaths.C.

References constant(), findTimes(), and path().

Here is the call graph for this function:

◆ findClosestTime() [2/3]

Foam::instant findClosestTime ( const scalar t) const

Search the case for the time closest to the given time.

Note
forwards to the current fileHandler

Definition at line 244 of file TimePaths.C.

References constant(), findClosestTime(), findTimes(), and path().

Here is the call graph for this function:

◆ findClosestTime() [3/3]

Foam::instant findClosestTime ( IOobjectOption::Layout layout,
const scalar t ) const

Search local or global locations for the time closest to the given time.

Note
forwards to the current fileHandler

Definition at line 256 of file TimePaths.C.

References constant(), findClosestTime(), findTimes(), and path().

Here is the call graph for this function:

◆ findInstancePath() [3/4]

Foam::word findInstancePath ( const instant & t) const

Search the case for the time directory path corresponding to the given instance.

Note
forwards to the current fileHandler

Definition at line 272 of file TimePaths.C.

References findInstancePath(), and path().

Here is the call graph for this function:

◆ findInstancePath() [4/4]

Foam::word findInstancePath ( IOobjectOption::Layout layout,
const instant & t ) const

Search local or global locations for the time directory path corresponding to the given instance.

Note
forwards to the current fileHandler

Definition at line 278 of file TimePaths.C.

References findInstancePath(), and path().

Here is the call graph for this function:

The documentation for this class was generated from the following files: