Go to the documentation of this file.
38 static const equalOp<scalar>
equalTimes(ROOTSMALL);
51 [](
const scalar a,
const scalar
b)
72 dictName_(cacheFileName)
103 bool Foam::surfaceWriters::writerCaching::remove(
const word& fieldName)
109 return dictptr->
remove(fieldName);
126 Foam::label Foam::surfaceWriters::writerCaching::readPreviousTimes
129 const scalar timeValue
146 if (is.good() && cache_.read(is))
150 cache_.readIfPresent(
"times", times_);
156 if (cache_.readIfPresent(
"geometry", geomIndices))
159 geoms_.
set(geomIndices);
161 else if (cache_.readIfPresent(
"meshes", meshTimes))
165 <<
"Setting geometry timeset information from time values"
166 <<
" (cache from an older OpenFOAM version)." <<
nl
167 <<
"This may not be fully reliable." <<
nl
170 for (
const scalar meshTime : meshTimes)
173 geoms_.set(geomIndex);
180 geoms_.resize(times_.size());
192 const scalar timeValue,
193 const bool geomChanged,
194 const word& fieldName,
195 const word& fieldType,
199 const fileName dictFile(baseDir/dictName_);
201 bool stateChanged =
false;
206 ? readPreviousTimes(dictFile, timeValue)
237 cache_.set(
"times", times_);
238 cache_.set(
"geometry", geoms_.sortedToc());
254 dict.set(
"type", fieldType);
255 if (!varName.empty() && varName != fieldName)
258 dict.set(
"name", varName);
265 os <<
"// State file for surface writer output" <<
nl <<
nl;
266 cache_.write(
os,
false);
268 os <<
nl <<
"// End" <<
nl;
dictionary * findDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX)
Find and return a sub-dictionary pointer if present.
A class for handling words, derived from Foam::string.
A class for handling file names.
Input from file stream, using an ISstream.
const dictionary & fieldsDict() const
Get or create the 'fields' information dictionary.
dictionary & subDictOrAdd(const word &keyword, enum keyType::option matchOpt=keyType::REGEX)
Find and return a sub-dictionary for manipulation.
static const dictionary null
An empty dictionary, which is also the parent for all dictionaries.
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
label findLower(const ListType &input, const T &val, const label start, const ComparePredicate &comp)
static const equalOp< scalar > equalTimes(ROOTSMALL)
void clear()
Clear all values.
bool update(const fileName &baseDir, const scalar timeValue, const bool geomChanged, const word &fieldName, const word &fieldType, const word &varName=word::null)
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
OBJstream os(runTime.globalPath()/outputName)
Output to file stream, using an OSstream.
static label findTimeIndex(const UList< scalar > &list, const scalar val)
bool remove(const word &keyword)
Remove an entry specified by keyword.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
std::enable_if< std::is_same< bool, TypeT >::value, bool >::type set(const label i, bool val=true)
A bitSet::set() method for a list of bool.
Various functions to operate on Lists.
#define WarningInFunction
Report a warning using Foam::Warning.
writerCaching(const word &cacheFileName)
Construct with specified cache name.