36 #ifndef OldTimeField_H
37 #define OldTimeField_H
49 template<
class FieldType>
57 template<
class FieldType>
62 template<
class,
class,
template<
class>
class>
class GeoField,
65 template<class> class PrimitiveField
69 typedef GeoField<Type, GeoMesh, PrimitiveField>
type;
77 template<
class,
class,
template<
class>
class>
class GeoField,
83 typedef GeoField<Type, GeoMesh, Field>
type;
91 template<
class FieldType>
96 template<
class,
class,
template<
class>
class>
class GeoField,
99 template<class> class PrimitiveField
103 template<
template<
class>
class OtherPrimitiveField>
104 using type = GeoField<Type, GeoMesh, OtherPrimitiveField>;
112 template<
class FieldType>
123 template<
template<
class>
class OtherPrimitiveField>
124 using OtherFieldType =
126 template type<OtherPrimitiveField>;
132 template<
template<
class>
class OtherPrimitiveField>
140 mutable label timeIndex_;
149 const FieldType& field()
const;
152 FieldType& fieldRef();
155 void storeOldTimesInner()
const;
158 void nullOldestTimeInner();
162 void setBase(
const nil&)
const;
166 template<
class OldTimeBaseField>
167 void setBase(
const OldTimeBaseField& otbf)
const;
170 void setBase()
const;
181 template<
template<
class>
class OtherPrimitiveField>
189 template<
template<
class>
class OtherPrimitiveField>
200 template<
class OtherFieldType>
204 template<
class OtherFieldType,
typename>
253 const Field0Type&
oldTime()
const;
276 template<
class FieldType,
typename =
void>
285 template<
class FieldType>
288 typedef typename FieldType::Base::OldTime
type;
292 return static_cast<const type&
>(otf.field());
301 template<
class FieldType>
312 template<
class Type,
class GeoMesh,
template<
class>
class PrimitiveField>
319 typedef typename FieldType::Patch::Calculated
Calculated;
334 #define USING_OLD_TIME_FIELD(FieldType) \
335 using OldTimeField<FieldType>::readOldTimeIfPresent; \
336 using OldTimeField<FieldType>::copyOldTimes; \
337 using OldTimeField<FieldType>::timeIndex; \
338 using OldTimeField<FieldType>::isOldTime; \
339 using OldTimeField<FieldType>::hasStoredOldTimes; \
340 using OldTimeField<FieldType>::storeOldTimes; \
341 using OldTimeField<FieldType>::clearOldTimes; \
342 using OldTimeField<FieldType>::nullOldestTime; \
343 using OldTimeField<FieldType>::nOldTimes; \
344 using OldTimeField<FieldType>::oldTime; \
345 using OldTimeField<FieldType>::oldTimeRef;
Generic mesh wrapper used by volMesh, surfaceMesh, pointMesh etc.
Generic GeometricField class.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Class to add into field types to provide old-time storage and retrieval.
label timeIndex() const
Return the time index of the field.
bool readOldTimeIfPresent()
Read old-time field from file if it is present.
friend class OldTimeField
Declare friendship with other old-time fields.
void copyOldTimes(const IOobject &io, const OtherOldTime< OtherPrimitiveField > &)
Copy the old-times from the given field.
label nOldTimes(const bool includeNull=true) const
Return the number of old-time fields stored.
const Field0Type & oldTime() const
Return the old-time field.
Field0Type & oldTimeRef()
Return a non-const reference to the old-time field.
bool hasStoredOldTimes() const
Return whether old-time fields have been stored yet.
bool isOldTime() const
Return whether or not this is an old-time field.
void storeOldTimes() const
Store the old-time fields.
~OldTimeField()
Destructor.
void nullOldestTime()
Set the oldest field pointer to nullObjectPtr. This removes the.
void operator=(const OldTimeField< FieldType > &)=delete
Disallow default bitwise assignment.
void clearOldTimes()
Clear old-time fields.
Pre-declare related SubField type.
A zero-sized class without any storage. Used, for example, in HashSet.
A class for handling words, derived from string.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
FieldType::Base::OldTime type
nil operator()(const OldTimeField< FieldType > &otf) const
FieldType::Patch::Calculated Calculated
tmp< Field0Type > operator()(const IOobject &io, const FieldType &field)
OldTimeField0Type< FieldType >::type Field0Type
GeoField< Type, GeoMesh, OtherPrimitiveField > type