TimePaths Class Reference

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

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. More...
 
 TimePaths (const argList &args, const word &systemDirName="system", const word &constantDirName="constant")
 Construct using characteristics given by the argList. More...
 
 TimePaths (const fileName &rootPath, const fileName &caseName, const word &systemDirName="system", const word &constantDirName="constant")
 Construct from rootPath and casePath. More...
 
bool distributed () const noexcept
 True if case running with parallel distributed directories (ie. not NFS mounted) More...
 
bool processorCase () const noexcept
 True if this is a processor case. More...
 
bool processorCase (bool on) noexcept
 Set processor case status. Return old status. More...
 
const fileNamerootPath () const noexcept
 Return root path. More...
 
const fileNameglobalCaseName () const noexcept
 Return global case name. More...
 
const fileNamecaseName () const noexcept
 Return case name. More...
 
fileNamecaseName () noexcept
 The case name for modification (use with caution) More...
 
fileName path () const
 Return path for the case = rootPath/caseName. More...
 
fileName globalPath () const
 Return global path for the case = rootPath/globalCaseName. More...
 
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. More...
 
const wordconstant () const noexcept
 Return constant name. More...
 
const wordsystem () const noexcept
 Return system name. More...
 
fileName caseConstant () const
 Return the constant name for the case, which is ../constant() for parallel runs. More...
 
fileName caseSystem () const
 Return the system name for the case, which is ../system() for parallel runs. More...
 
fileName constantPath () const
 Return constant path. More...
 
fileName systemPath () const
 Return system path. More...
 
instantList times () const
 Search the case for valid time directories. More...
 
instant findClosestTime (const scalar t) const
 Search the case for the time closest to the given time. More...
 

Static Public Member Functions

static instantList findTimes (const fileName &directory, const word &constantDirName="constant")
 Search a given directory for valid time directories. More...
 
static label findClosestTimeIndex (const instantList &timeDirs, const scalar t, const word &constantDirName="constant")
 Search instantList for the time index closest to the specified time. More...
 

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 62 of file TimePaths.C.

◆ 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 87 of file TimePaths.C.

◆ 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 24 of file TimePathsI.H.

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.

Referenced by Time::readDict().

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.

Referenced by cyclicAMIPolyPatch::canResetAMI(), cyclicAMIFvPatch::coupled(), 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.

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

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.

Referenced by Time::globalPath().

Here is the caller graph for this function:

◆ caseName() [1/2]

const Foam::fileName & caseName ( ) const
inlinenoexcept

Return case name.

Definition at line 78 of file TimePathsI.H.

Referenced by Time::path().

Here is the caller graph for this function:

◆ caseName() [2/2]

Foam::fileName & caseName ( )
inlinenoexcept

The case name for modification (use with caution)

Definition at line 84 of file TimePathsI.H.

◆ path()

Foam::fileName path ( ) const
inline

Return path for the case = rootPath/caseName.

Definition at line 90 of file TimePathsI.H.

Referenced by Time::timePath().

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 96 of file TimePathsI.H.

Referenced by Time::globalTimePath().

Here is the caller 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 103 of file TimePathsI.H.

References Foam::input().

Referenced by surfaceNoise::initialise(), and 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 118 of file TimePathsI.H.

Referenced by codedBase::codeDict(), fvMeshTools::createDummyFvMeshFiles(), optimisationManager::New(), PDRblock::writeBlockMeshDict(), and triSurfaceMesh::writeObject().

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 124 of file TimePathsI.H.

Referenced by triSurfaceMesh::writeObject().

Here is the caller 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 135 of file TimePathsI.H.

References Foam::system().

Referenced by lumpedPointIOMovement::New(), sensitivitySurface::smoothSensitivities(), and triSurfaceMesh::writeObject().

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 146 of file TimePathsI.H.

References path().

Here is the call graph for this function:

◆ systemPath()

Foam::fileName systemPath ( ) const
inline

Return system path.

Definition at line 152 of file TimePathsI.H.

References path(), and Foam::system().

Here is the call graph for this function:

◆ findTimes()

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

Search a given directory for valid time directories.

Forwards to the current fileHandler

Definition at line 109 of file TimePaths.C.

References Foam::fileHandler.

Referenced by uniformInterpolatedDisplacementPointPatchVectorField::updateCoeffs().

Here is the caller graph for this function:

◆ findClosestTimeIndex()

Foam::label findClosestTimeIndex ( const instantList timeDirs,
const scalar  t,
const word constantDirName = "constant" 
)
static

Search instantList for the time index closest to the specified time.

Definition at line 125 of file TimePaths.C.

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

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

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

◆ times()

Foam::instantList times ( ) const

Search the case for valid time directories.

Definition at line 118 of file TimePaths.C.

References path().

Referenced by masterUncollatedFileOperation::findInstance(), fileOperation::findInstance(), timeSelector::select0(), and triSurface::triSurfInstance().

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

◆ findClosestTime()

Foam::instant findClosestTime ( const scalar  t) const

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

Definition at line 152 of file TimePaths.C.

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

Here is the call graph for this function:

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