Go to the documentation of this file.
39 #ifndef DynamicField_H
40 #define DynamicField_H
43 #include <type_traits>
54 template<
class T,
int SizeMin>
61 template<
class T,
int SizeMin>
73 template<
class T,
int SizeMin=64>
78 static_assert(SizeMin > 0,
"Invalid min size parameter");
89 template<
class ListType>
90 inline void assignDynField(
const ListType& list);
99 return NullObjectRef<DynamicField<T, SizeMin>>();
121 template<
int AnySizeMin>
139 template<
int AnySizeMin>
176 inline label
capacity() const noexcept;
191 inline
void setSize(const label nElem);
194 inline
void setSize(const label nElem, const
T& val);
200 inline
void resize(const label nElem);
204 inline
void resize(const label nElem, const
T& val);
208 inline
void reserve(const label nElem);
226 template<
int AnySizeMin>
233 template<
int AnySizeMin>
237 template<
int AnySizeMin>
256 inline
T& operator()(const label i);
259 inline
void operator=(const
T& val);
262 inline
void operator=(const
UList<
T>& list);
268 inline
void operator=(
List<
T>&& list);
274 template<
int AnySizeMin>
286 #include "DynamicFieldI.H"
void clear()
Clear the addressed list, i.e. set the size to zero.
void transfer(List< T > &list)
Transfer the parameter contents into this.
void setSize(const label nElem)
Alter the addressed list size.
void clearStorage()
Clear the list and delete storage.
A class for managing temporary objects.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
label capacity() const noexcept
Size of the underlying storage.
Abstract base class to hold the Field mapping addressing and weights.
DynamicField< T, SizeMin > & shrink()
Shrink the allocated space to the number of elements used.
Generic templated field type.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< ' ';}gmvFile<< nl;for(const word &name :lagrangianScalarNames){ IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
constexpr DynamicField() noexcept
Construct null.
void swap(DynamicField< T, AnySizeMin > &list)
Swap content with any sized DynamicField.
tmp< DynamicField< T, SizeMin > > clone() const
Clone.
void reserve(const label nElem)
Reserve allocation space for at least this size.
T remove()
Remove and return the top element.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
label expandStorage()
Expand the addressable size to fit the allocated capacity.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
void setCapacity(const label nElem)
Alter the size of the underlying storage.
Base for lists with indirect addressing, templated on the list contents type and the addressing type....
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
DynamicField< T, SizeMin > & append(const T &val)
Append an element at the end of the list.
void resize(const label nElem)
Alter the addressed list size.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...