Go to the documentation of this file.
51 [](
const scalar a,
const scalar
b)
72 dictName_(cacheFileName)
103 bool Foam::surfaceWriters::writerCaching::remove(
const word& fieldName)
126 Foam::label Foam::surfaceWriters::writerCaching::readPreviousTimes
128 const fileName& dictFile,
129 const scalar timeValue
144 IFstream is(dictFile);
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());
248 dictionary&
dict = fieldDict(fieldName);
254 dict.set(
"type", fieldType);
255 if (!varName.empty() && varName != fieldName)
258 dict.set(
"name", varName);
264 OFstream
os(dictFile);
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)
List< label > labelList
A List of labels.
List< scalar > scalarList
A List of scalars.
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
dictionary & subDictOrAdd(const word &keyword, enum keyType::option matchOpt=keyType::REGEX)
static const dictionary null
const dimensionedScalar b
label findLower(const ListType &input, const T &val, const label start, const ComparePredicate &comp)
static const equalOp< scalar > equalTimes(ROOTSMALL)
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)
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
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)
Various functions to operate on Lists.
#define WarningInFunction
writerCaching(const word &cacheFileName)