TimePathsI.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2018-2021 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 \*---------------------------------------------------------------------------*/
27 
28 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
29 
30 inline bool Foam::TimePaths::distributed() const noexcept
31 {
32  return distributed_;
33 }
34 
35 
36 inline bool Foam::TimePaths::processorCase() const noexcept
37 {
38  return processorCase_;
39 }
40 
41 
42 inline bool Foam::TimePaths::processorCase(bool isProcessorCase) noexcept
43 {
44  bool old(processorCase_);
45  processorCase_ = isProcessorCase;
46  return old;
47 }
48 
49 
51 {
52  return rootPath_;
53 }
54 
55 
57 {
58  return globalCaseName_;
59 }
60 
61 
63 {
64  return case_;
65 }
66 
67 
69 {
70  return case_;
71 }
72 
73 
75 {
76  return rootPath()/caseName();
77 }
78 
79 
81 {
82  return rootPath()/globalCaseName();
83 }
84 
85 
87 (
88  const fileName& input,
89  const bool caseTag
90 ) const
91 {
92  return input.relative(globalPath(), caseTag);
93 }
94 
95 
96 inline const Foam::word& Foam::TimePaths::constant() const noexcept
97 {
98  return constant_;
99 }
100 
102 inline const Foam::word& Foam::TimePaths::system() const noexcept
103 {
104  return system_;
105 }
106 
107 
109 {
110  if (processorCase_)
111  {
112  return ".."/constant();
113  }
114 
115  return constant();
116 }
117 
118 
120 {
121  if (processorCase_)
122  {
123  return ".."/system();
124  }
125 
126  return system();
127 }
128 
131 {
132  return path()/constant();
133 }
134 
135 
137 {
138  return path()/system();
139 }
140 
141 
142 // ************************************************************************* //
fileName constantPath() const
Return constant path.
Definition: TimePathsI.H:123
A class for handling file names.
Definition: fileName.H:71
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...
Definition: TimePathsI.H:80
fileName systemPath() const
Return system path.
Definition: TimePathsI.H:129
bool processorCase() const noexcept
Return true if this is a processor case.
Definition: TimePathsI.H:29
fileName caseSystem() const
Return the system name for the case, which is ../system() for parallel runs.
Definition: TimePathsI.H:112
A class for handling words, derived from Foam::string.
Definition: word.H:63
static Istream & input(Istream &is, IntRange< T > &range)
Definition: IntRanges.C:48
const word & system() const noexcept
Return system name.
Definition: TimePathsI.H:95
const direction noexcept
Definition: Scalar.H:258
fileName caseConstant() const
Return the constant name for the case, which is ../constant() for parallel runs.
Definition: TimePathsI.H:101
bool distributed() const noexcept
True if case running with parallel distributed directories (ie. not NFS mounted)
Definition: TimePathsI.H:23
const word & constant() const noexcept
Return constant name.
Definition: TimePathsI.H:89
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
const fileName & rootPath() const noexcept
Return root path.
Definition: TimePathsI.H:43
const fileName & globalCaseName() const noexcept
Return global case name.
Definition: TimePathsI.H:49
fileName path() const
Return path for the case.
Definition: TimePathsI.H:67
int system(const std::string &command, const bool bg=false)
Execute the specified command via the shell.
Definition: POSIX.C:1655
const fileName & caseName() const noexcept
Return case name.
Definition: TimePathsI.H:55
fileName globalPath() const
Return global path for the case.
Definition: TimePathsI.H:73