28 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
32 capacity_(
Field<
T>::size())
36 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
43 capacity_(
Field<
T>::size())
50 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
58 capacity_(
Field<
T>::size())
62 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
70 capacity_(
Field<
T>::size())
74 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
81 capacity_(
Field<
T>::size())
85 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
92 capacity_(
Field<
T>::size())
96 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
103 Field<
T>(mapF, mapAddressing),
104 capacity_(
Field<
T>::size())
108 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
116 Field<
T>(mapF, mapAddressing, weights),
117 capacity_(
Field<
T>::size())
121 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
128 capacity_(lst.capacity_)
132 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
140 capacity_(lst.capacity_)
146 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
153 capacity_(lst.capacity_)
161 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
169 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
178 if (nextFree > capacity_)
181 nextFree = capacity_;
190 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
197 if (nElem > capacity_)
215 label(SizeInc + capacity_ * SizeMult / SizeDiv)
227 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
234 if (nElem > capacity_)
252 label(SizeInc + capacity_ * SizeMult / SizeDiv)
264 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
275 while (nextFree < nElem)
277 this->operator[](nextFree++) = t;
282 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
292 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
303 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
310 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
318 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
323 if (capacity_ > nextFree)
329 capacity_ = nextFree;
337 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
347 this->operator[](elemI) = t;
352 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
370 this->operator[](nextFree++) = lst[elemI];
376 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
397 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
408 return this->operator[](elemI);
412 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
422 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
434 if (capacity_ >= lst.size())
451 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
464 capacity_ = lst.capacity_;
469 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
475 if (capacity_ >= lst.size())
492 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
#define forAll(list, i)
Loop across all elements in list.
T remove()
Remove and return the top element.
DynamicField< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
void setCapacity(const label)
Alter the size of the underlying storage.
void resize(const label)
Alter the addressed list size.
label capacity() const
Size of the underlying storage.
DynamicField()
Construct null.
DynamicField< T, SizeInc, SizeMult, SizeDiv > & shrink()
Shrink the allocated space to the number of elements used.
void reserve(const label)
Reserve allocation space for at least this size.
void clearStorage()
Clear the list and delete storage.
void clear()
Clear the addressed list, i.e. set the size to zero.
void setSize(const label)
Alter the addressed list size.
friend Ostream & operator(Ostream &, const DynamicField< T, SizeInc, SizeMult, SizeDiv > &)
Pre-declare SubField and related Field type.
void operator=(const Field< Type > &)
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
label size() const
Return the number of elements in the UList.
void clear()
Clear the list, i.e. set size to zero.
void setSize(const label)
Reset size of List.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
label size() const
Return the number of elements in the UList.
T & operator[](const label)
Return element of UList.
A class representing the concept of 0 used to avoid unnecessary manipulations for objects that are kn...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
errorManip< error > abort(error &err)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
points setSize(newPointi)