36bool Foam::TimePaths::detectProcessorCase()
40 return processorCase_;
44 const auto sep = globalCaseName_.rfind(
'/');
45 const auto pos = globalCaseName_.find
53 globalCaseName_ =
".";
54 processorCase_ =
true;
58 globalCaseName_.resize(sep);
59 processorCase_ =
true;
62 return processorCase_;
71 const word& systemName,
72 const word& constantName
75 processorCase_(
args.runControl().parRun()),
76 distributed_(
args.runControl().distributed()),
77 rootPath_(
args.rootPath()),
78 globalCaseName_(
args.globalCaseName()),
79 case_(
args.caseName()),
81 constant_(constantName)
86 detectProcessorCase();
94 const word& systemName,
95 const word& constantName
98 processorCase_(false),
101 globalCaseName_(caseName),
104 constant_(constantName)
107 detectProcessorCase();
113 const bool processorCase,
115 const bool distributed,
118 const word& systemName,
119 const word& constantName
122 processorCase_(processorCase),
123 distributed_(distributed),
125 globalCaseName_(globalCaseName),
128 constant_(constantName)
133 detectProcessorCase();
142 const word& constantName
159 const word& constantName
162 const label nTimes = timeDirs.
size();
164 label nearestIndex = -1;
165 scalar deltaT = GREAT;
167 for (label timei=0; timei < nTimes; ++timei)
169 if (timeDirs[timei].
name() == constantName)
continue;
171 const scalar
diff =
mag(timeDirs[timei].value() - t);
175 nearestIndex = timei;
187 const label nTimes = timeDirs.
size();
192 return timeDirs.
first();
195 if (t < timeDirs[1].value())
199 else if (t > timeDirs.
last().value())
201 return timeDirs.
last();
204 label nearestIndex = -1;
205 scalar deltaT = GREAT;
207 for (label timei=1; timei < nTimes; ++timei)
209 const scalar
diff =
mag(timeDirs[timei].value() - t);
213 nearestIndex = timei;
217 return timeDirs[nearestIndex];
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
Address the time paths without using the Time class.
instantList times() const
Search the case for valid time directories.
static instantList findTimes(const fileName &directory, const word &constantName="constant")
Search a given directory for valid time directories.
static label findClosestTimeIndex(const instantList &timeDirs, const scalar t, const word &constantName="constant")
Search instantList for the time index closest to the specified time.
instant findClosestTime(const scalar t) const
Search the case for the time closest to the given time.
T & first()
Return the first element of the list.
void size(const label n)
Older name for setAddressableSize.
T & last()
Return the last element of the list.
Extract command arguments and options from the supplied argc and argv parameters.
A class for handling file names.
virtual instantList findTimes(const fileName &, const word &) const
Get sorted list of times.
An instant of time. Contains the time value and name. Uses Foam::Time when formatting the name.
constant condensation/saturation model.
A class for handling words, derived from Foam::string.
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
const fileOperation & fileHandler()
Get current file handler.
dimensionedScalar pos(const dimensionedScalar &ds)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
scalar diff(const triad &A, const triad &B)
Return a quantity of the difference between two triads.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Foam::argList args(argc, argv)