39#ifndef Foam_DynamicField_H
40#define Foam_DynamicField_H
53template<
class T,
int SizeMin>
56template<
class T,
int SizeMin>
63template<
class T,
int SizeMin=64>
68 static_assert(SizeMin > 0,
"Invalid min size parameter");
79 template<
class ListType>
80 inline void doAssignDynList(
const ListType& list);
84 inline void doCapacity_copy(label count,
const label len);
89 inline void doReserve_copy(label count,
const label len);
100 inline explicit DynamicField(
const label initialCapacity);
115 template<
int AnySizeMin>
133 template<
int AnySizeMin>
137 template<
int AnySizeMin>
141 template<
int AnySizeMin>
145 template<
int AnySizeMin>
220 inline void reserve(
const label len);
239 inline void resize(
const label len);
242 inline void resize(
const label len,
const T& val);
246 inline void resize_copy(label count,
const label len);
274 template<
int AnySizeMin>
278 template<
int AnySizeMin>
285 template<
int AnySizeMin>
289 template<
int AnySizeMin>
294 template<class... Args>
342 template<
int AnySizeMin>
349 template<
int AnySizeMin>
Dynamically sized Field. Similar to DynamicList, but inheriting from a Field instead of a List.
void clear() noexcept
Clear the addressed list, i.e. set the size to zero.
void transfer(List< Type > &list)
void setSize(const label n)
void resize_nocopy(const label len)
Alter addressable list size, allocating new space if required without necessarily recovering old cont...
void setCapacity_nocopy(const label len)
Type & emplace_back(Args &&... args)
void setCapacity_unsafe(label len) noexcept
void reserve_nocopy(const label len)
Reserve allocation space for at least this size, allocating new space if required without retaining o...
~DynamicField()
Destructor, sync allocated size before list destruction.
void reserve_exact(const label len)
Reserve allocation space for at least this size, allocating new space if required and retaining old c...
std::streamsize capacity_bytes() const noexcept
Number of contiguous bytes of the underlying storage.
void resize_copy(label count, const label len)
Alter addressable size, retaining the first count contents.
void append(const T &val)
Append an element at the end of the list.
void resize(const label len, const T &val)
Alter addressable size and fill new entries with constant value.
void swap(List< Type > &other)
void append(T &&val)
Move append an element.
void setSize(const label n, const T &val)
Alias for resize().
tmp< DynamicField< Type, 64 > > clone() const
void push_back(const Type &val)
constexpr DynamicField() noexcept
Default construct, an empty field without allocation.
static constexpr label min_size() noexcept
Normal lower capacity limit - the SizeMin template parameter.
label capacity() const noexcept
Size of the underlying storage.
DynamicField(const DynamicField< T, AnySizeMin > &list)
Copy construct with different sizing parameters.
void resize(const label len)
Alter addressable list size, allocating new space if required while recovering old content.
void reserve(const label len)
Reserve allocation space for at least this size, allocating new space if required and retaining old c...
DynamicField< T, SizeMin > & shrink()
Calls shrink_to_fit() and returns a reference to the DynamicField.
void resize_fill(const label len, const T &val)
Alter addressable size and set val for all addressed entries.
void setCapacity(const label len)
Istream & readList(Istream &is)
void append(const UList< T > &list)
Append a List at the end of this list.
friend Ostream & operator(Ostream &os, const DynamicField< Type, 64 > &rhs)
DynamicField(List< T > &&content) noexcept
Move construct from List contents.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Abstract base class to hold the Field mapping addressing and weights.
tmp< Field< Type > > T() const
Return the field transpose (only defined for second rank tensors).
constexpr Field() noexcept
void map(const UList< Type > &mapF, const labelUList &mapAddressing)
1 to 1 map from the given field
Base for lists with indirect addressing, templated on the list contents type and the addressing type....
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
void setAddressableSize(const label n) noexcept
Set addressed size to be inconsistent with allocated storage.
A class for managing temporary objects.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
OBJstream os(runTime.globalPath()/outputName)
List< scalarList > scalarListList
List of scalarList.
List< labelList > labelListList
List of labelList.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces).
Istream & operator>>(Istream &, directionInfo &)
void rhs(fvMatrix< typename Expr::value_type > &m, const Expr &expression)
UList< label > labelUList
A UList of labels.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Foam::argList args(argc, argv)
A non-counting (dummy) refCount.