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 
97 {
98  return constant_;
99 }
100 
101 
102 inline const Foam::word& Foam::TimePaths::system() const
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 
129 
131 {
132  return path()/constant();
133 }
134 
135 
137 {
138  return path()/system();
139 }
140 
141 
142 // ************************************************************************* //
Foam::TimePaths::rootPath
const fileName & rootPath() const
Return root path.
Definition: TimePathsI.H:50
Foam::TimePaths::globalCaseName
const fileName & globalCaseName() const
Return global case name.
Definition: TimePathsI.H:56
Foam::TimePaths::path
fileName path() const
Return path for the case.
Definition: TimePathsI.H:74
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::TimePaths::systemPath
fileName systemPath() const
Return system path.
Definition: TimePathsI.H:136
Foam::fileName
A class for handling file names.
Definition: fileName.H:73
Foam::TimePaths::processorCase
bool processorCase() const noexcept
Return true if this is a processor case.
Definition: TimePathsI.H:36
Foam::system
int system(const std::string &command, const bool bg=false)
Execute the specified command via the shell.
Definition: MSwindows.C:1150
Foam::TimePaths::caseSystem
fileName caseSystem() const
Definition: TimePathsI.H:119
Foam::TimePaths::caseName
const fileName & caseName() const
Return case name.
Definition: TimePathsI.H:62
Foam::TimePaths::constantPath
fileName constantPath() const
Return constant path.
Definition: TimePathsI.H:130
Foam::TimePaths::distributed
bool distributed() const noexcept
Definition: TimePathsI.H:30
Foam::TimePaths::relativePath
fileName relativePath(const fileName &input, const bool caseTag=false) const
Definition: TimePathsI.H:87
Foam::TimePaths::system
const word & system() const
Return system name.
Definition: TimePathsI.H:102
Foam::TimePaths::caseConstant
fileName caseConstant() const
Definition: TimePathsI.H:108
path
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
Foam::input
static Istream & input(Istream &is, IntRange< T > &range)
Definition: IntRanges.C:55
Foam::TimePaths::globalPath
fileName globalPath() const
Return global path for the case.
Definition: TimePathsI.H:80
Foam::TimePaths::constant
const word & constant() const
Return constant name.
Definition: TimePathsI.H:96
constant
constant condensation/saturation model.