51 [](
const scalar a,
const scalar
b)
72 dictName_(cacheFileName)
109 return dictptr->
remove(fieldName);
126Foam::label Foam::ensightOutput::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());
189 return max(0, times_.size()-1);
194 return max(0, geoms_.find_last());
202 if (geoms_.count() <= 1)
207 if (geoms_.size() == times_.size() && geoms_.all())
223 const scalar timeValue,
224 const bool geomChanged,
225 const word& fieldName,
226 const word& fieldType,
230 const fileName dictFile(baseDir/dictName_);
232 bool stateChanged =
false;
237 ? readPreviousTimes(dictFile, timeValue)
268 cache_.set(
"times", times_);
269 cache_.set(
"geometry", geoms_.sortedToc());
285 dict.set(
"type", fieldType);
286 if (!varName.empty() && varName != fieldName)
289 dict.set(
"name", varName);
296 os <<
"// State file for writer output" <<
nl <<
nl;
297 cache_.write(
os,
false);
299 os <<
nl <<
"// End" <<
nl;
Various functions to operate on Lists.
Input from file stream, using an ISstream.
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.
Output to file stream, using an OSstream.
unsigned int remove()
Remove and return the last element.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
dictionary * findDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX)
Find and return a sub-dictionary pointer if present.
dictionary & subDictOrAdd(const word &keyword, enum keyType::option matchOpt=keyType::REGEX)
Find and return a sub-dictionary for manipulation.
bool remove(const word &keyword)
Remove an entry specified by keyword.
static const dictionary null
An empty dictionary, which is also the parent for all dictionaries.
State information for writers with collated times.
label latestTimeIndex() const
The most current time index.
label latestGeomIndex() const
The most current geometry index.
void clear()
Clear all values.
int geometryTimeset() const
Expected timeset for the geometry.
const dictionary & fieldsDict() const
Get or create the 'fields' information dictionary.
A class for handling file names.
virtual bool update()
Update the mesh for both mesh motion and topology change.
A class for handling words, derived from Foam::string.
OBJstream os(runTime.globalPath()/outputName)
#define WarningInFunction
Report a warning using Foam::Warning.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
static const equalOp< scalar > equalTimes(ROOTSMALL)
static label findTimeIndex(const UList< scalar > &list, const scalar val)
label findLower(const ListType &input, const T &val, const label start, const ComparePredicate &comp)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
constexpr char nl
The newline '\n' character (0x0a)