Dynamically sized Field. More...
Public Member Functions | |
constexpr | DynamicField () noexcept |
Default construct, an empty field without allocation. More... | |
DynamicField (const label len) | |
Construct empty field with given reserve size. More... | |
DynamicField (const label len, const T &val) | |
Construct given size and initial value. More... | |
DynamicField (const label len, const Foam::zero) | |
Construct given size and initial value of zero. More... | |
DynamicField (const DynamicField< T, SizeMin > &list) | |
Copy construct. More... | |
template<int AnySizeMin> | |
DynamicField (const DynamicField< T, AnySizeMin > &list) | |
Copy construct with different sizing parameters. More... | |
DynamicField (const UList< T > &list) | |
Copy construct from UList. Size set to UList size. More... | |
template<class Addr > | |
DynamicField (const IndirectListBase< T, Addr > &list) | |
Copy construct from IndirectList. More... | |
DynamicField (List< T > &&content) | |
Move construct from List contents. More... | |
DynamicField (DynamicField< T, SizeMin > &&content) | |
Move construct from dynamic Field contents. More... | |
template<int AnySizeMin> | |
DynamicField (DynamicField< T, AnySizeMin > &&content) | |
Move construct with different sizing parameters. More... | |
template<int AnySizeMin> | |
DynamicField (DynamicList< T, AnySizeMin > &&list) | |
Move construct from DynamicList. More... | |
DynamicField (const UList< T > &mapF, const labelUList &mapAddressing) | |
Construct by 1 to 1 mapping from the given field. More... | |
DynamicField (const UList< T > &mapF, const labelListList &mapAddressing, const scalarListList &weights) | |
Construct by interpolative mapping from the given field. More... | |
DynamicField (const UList< T > &mapF, const FieldMapper &map) | |
Construct by mapping from the given field. More... | |
DynamicField (Istream &is) | |
Construct from Istream. Size set to size of list read. More... | |
tmp< DynamicField< T, SizeMin > > | clone () const |
Clone. More... | |
label | capacity () const noexcept |
Size of the underlying storage. More... | |
std::streamsize | capacity_bytes () const noexcept |
Number of contiguous bytes of the underlying storage. More... | |
void | setCapacity (const label len) |
Alter the size of the underlying storage. More... | |
void | setCapacity_nocopy (const label len) |
void | setCapacity_unsafe (const label len) noexcept |
void | reserve (const label len) |
void | reserve_nocopy (const label len) |
void | resize (const label len) |
void | resize (const label len, const T &val) |
Alter addressable size and fill new space with constant value. More... | |
void | resize_nocopy (const label len) |
void | setSize (const label n) |
Alias for resize() More... | |
void | setSize (const label n, const T &val) |
Alias for resize() More... | |
void | clear () noexcept |
Clear the addressed list, i.e. set the size to zero. More... | |
void | clearStorage () |
Clear the list and delete storage. More... | |
label | expandStorage () noexcept |
Expand the addressable size to fit the allocated capacity. More... | |
void | shrinkStorage () |
Shrink the allocated space to the number of elements used. More... | |
DynamicField< T, SizeMin > & | shrink () |
Shrink the allocated space to the number of elements used. More... | |
template<int AnySizeMin> | |
void | swap (DynamicField< T, AnySizeMin > &other) |
Swap content, independent of sizing parameter. More... | |
template<int AnySizeMin> | |
void | swap (DynamicList< T, AnySizeMin > &other) |
Swap content with DynamicList, independent of sizing parameter. More... | |
void | transfer (List< T > &list) |
Transfer the parameter contents into this. More... | |
template<int AnySizeMin> | |
void | transfer (DynamicList< T, AnySizeMin > &list) |
Transfer the parameter contents into this. More... | |
template<int AnySizeMin> | |
void | transfer (DynamicField< T, AnySizeMin > &list) |
Transfer the parameter contents into this. More... | |
DynamicField< T, SizeMin > & | append (const T &val) |
Append an element at the end of the list. More... | |
DynamicField< T, SizeMin > & | append (T &&val) |
Move append an element. More... | |
DynamicField< T, SizeMin > & | append (const UList< T > &list) |
Append a List at the end of this list. More... | |
T | remove () |
Remove and return the top element. More... | |
Istream & | readList (Istream &is) |
Read from Istream, discarding existing contents. More... | |
T & | operator() (const label i) |
Return non-const access to an element, resizing list if needed. More... | |
void | operator= (const T &val) |
Assign addressed entries to the given value. More... | |
void | operator= (const Foam::zero) |
Assign addressed entries to zero. More... | |
void | operator= (const UList< T > &list) |
Copy assignment. More... | |
void | operator= (const DynamicField< T, SizeMin > &list) |
Copy assignment. More... | |
void | operator= (List< T > &&list) |
Move assignment. More... | |
template<int AnySizeMin> | |
void | operator= (DynamicList< T, AnySizeMin > &&list) |
Move assignment. More... | |
void | operator= (DynamicField< T, SizeMin > &&list) |
Move assignment. More... | |
template<int AnySizeMin> | |
void | operator= (DynamicField< T, AnySizeMin > &&list) |
Move assignment. More... | |
Static Public Member Functions | |
static const DynamicField< T, SizeMin > & | null () |
Return a null field. More... | |
static constexpr label | min_size () noexcept |
Normal lower capacity limit - the SizeMin template parameter. More... | |
Friends | |
Istream & | operator>> (Istream &is, DynamicField< T, SizeMin > &rhs) |
Use the readList() method to read contents from Istream. More... | |
Ostream & | operator (Ostream &os, const DynamicField< T, SizeMin > &rhs) |
Write to Ostream. More... | |
Dynamically sized Field.
Definition at line 49 of file DynamicField.H.
|
inlineconstexprnoexcept |
Default construct, an empty field without allocation.
Definition at line 132 of file DynamicFieldI.H.
|
inlineexplicit |
Construct empty field with given reserve size.
Definition at line 140 of file DynamicFieldI.H.
|
inline |
Construct given size and initial value.
Definition at line 151 of file DynamicFieldI.H.
|
inline |
Construct given size and initial value of zero.
Definition at line 163 of file DynamicFieldI.H.
|
inline |
Copy construct.
Definition at line 175 of file DynamicFieldI.H.
|
inline |
Copy construct with different sizing parameters.
Definition at line 187 of file DynamicFieldI.H.
|
inlineexplicit |
Copy construct from UList. Size set to UList size.
Also constructs from DynamicField with different sizing parameters.
Definition at line 198 of file DynamicFieldI.H.
|
inlineexplicit |
Copy construct from IndirectList.
Definition at line 210 of file DynamicFieldI.H.
|
inlineexplicit |
Move construct from List contents.
Definition at line 221 of file DynamicFieldI.H.
|
inline |
Move construct from dynamic Field contents.
Definition at line 246 of file DynamicFieldI.H.
|
inline |
Move construct with different sizing parameters.
Definition at line 260 of file DynamicFieldI.H.
|
inline |
Move construct from DynamicList.
Definition at line 233 of file DynamicFieldI.H.
|
inline |
Construct by 1 to 1 mapping from the given field.
Definition at line 273 of file DynamicFieldI.H.
|
inline |
Construct by interpolative mapping from the given field.
Definition at line 285 of file DynamicFieldI.H.
|
inline |
Construct by mapping from the given field.
Definition at line 298 of file DynamicFieldI.H.
|
inlineexplicit |
Construct from Istream. Size set to size of list read.
Definition at line 309 of file DynamicFieldI.H.
|
inlinestatic |
Return a null field.
Definition at line 100 of file DynamicField.H.
|
inline |
Clone.
Definition at line 318 of file DynamicFieldI.H.
|
inlinestaticconstexprnoexcept |
Normal lower capacity limit - the SizeMin template parameter.
Definition at line 183 of file DynamicField.H.
|
inlinenoexcept |
Size of the underlying storage.
Definition at line 327 of file DynamicFieldI.H.
Referenced by extendedEdgeMesh::cut(), and DynamicField< Foam::Vector >::transfer().
|
inlinenoexcept |
Number of contiguous bytes of the underlying storage.
Definition at line 335 of file DynamicFieldI.H.
|
inline |
Alter the size of the underlying storage.
The addressed size will be truncated if needed to fit, but will remain otherwise untouched. Use this or reserve() in combination with append().
Definition at line 343 of file DynamicFieldI.H.
Referenced by extendedEdgeMesh::cut().
|
inline |
Alter the size of the underlying storage, without retaining old content.
The addressed size will be truncated if needed to fit, but will remain otherwise untouched.
Definition at line 353 of file DynamicFieldI.H.
|
inlinenoexcept |
Change the value for the list capacity directly (ADVANCED, UNSAFE) Does not perform any memory management or resizing.
Definition at line 363 of file DynamicFieldI.H.
|
inline |
Reserve allocation space for at least this size, allocating new space if required and retaining old content.
Never shrinks the allocated size, use setCapacity() for that.
Definition at line 373 of file DynamicFieldI.H.
|
inline |
Reserve allocation space for at least this size, allocating new space if required without retaining old content.
Never shrinks the allocated size, use setCapacity() for that.
Definition at line 383 of file DynamicFieldI.H.
|
inline |
Alter addressable list size, allocating new space if required while recovering old content.
If no reallocation is required, the contents remain untouched. Otherwise new entries will be uninitialized. Use this to resize the list prior to using the operator[] for setting values (as per List usage).
Definition at line 393 of file DynamicFieldI.H.
Referenced by DynamicField< Foam::Vector >::setSize().
|
inline |
Alter addressable size and fill new space with constant value.
Definition at line 413 of file DynamicFieldI.H.
|
inline |
Alter addressable list size, allocating new space if required without necessarily recovering old content.
If no reallocation is required, the contents remain untouched. Otherwise all entries will be uninitialized.
Definition at line 403 of file DynamicFieldI.H.
|
inline |
Alias for resize()
Definition at line 239 of file DynamicField.H.
|
inline |
Alias for resize()
Definition at line 242 of file DynamicField.H.
|
inlinenoexcept |
Clear the addressed list, i.e. set the size to zero.
Allocated size does not change
Definition at line 431 of file DynamicFieldI.H.
Referenced by isoAlpha::reconstruct().
|
inline |
Clear the list and delete storage.
Definition at line 438 of file DynamicFieldI.H.
Referenced by zoneDistribute::getFields(), and DynamicField< Foam::Vector >::transfer().
|
inlinenoexcept |
Expand the addressable size to fit the allocated capacity.
Returns the previous addressable size.
Definition at line 446 of file DynamicFieldI.H.
|
inline |
Shrink the allocated space to the number of elements used.
Definition at line 458 of file DynamicFieldI.H.
|
inline |
Shrink the allocated space to the number of elements used.
Returns a reference to the DynamicField.
Definition at line 475 of file DynamicFieldI.H.
|
inline |
Swap content, independent of sizing parameter.
Definition at line 485 of file DynamicFieldI.H.
|
inline |
Swap content with DynamicList, independent of sizing parameter.
Definition at line 506 of file DynamicFieldI.H.
Transfer the parameter contents into this.
Definition at line 532 of file DynamicFieldI.H.
|
inline |
Transfer the parameter contents into this.
Definition at line 543 of file DynamicFieldI.H.
|
inline |
Transfer the parameter contents into this.
Definition at line 565 of file DynamicFieldI.H.
|
inline |
Append an element at the end of the list.
Definition at line 587 of file DynamicFieldI.H.
Referenced by extendedEdgeMesh::add(), extendedEdgeMesh::cut(), zoneDistribute::getFields(), and isoAlpha::reconstruct().
|
inline |
Move append an element.
Definition at line 602 of file DynamicFieldI.H.
|
inline |
Append a List at the end of this list.
Definition at line 617 of file DynamicFieldI.H.
|
inline |
Remove and return the top element.
Definition at line 640 of file DynamicFieldI.H.
|
inline |
Read from Istream, discarding existing contents.
Uses a DynamicList::readList internally
Definition at line 767 of file DynamicFieldI.H.
Return non-const access to an element, resizing list if needed.
Definition at line 663 of file DynamicFieldI.H.
Assign addressed entries to the given value.
Definition at line 678 of file DynamicFieldI.H.
|
inline |
Assign addressed entries to zero.
Definition at line 688 of file DynamicFieldI.H.
Copy assignment.
Definition at line 698 of file DynamicFieldI.H.
|
inline |
Copy assignment.
Definition at line 708 of file DynamicFieldI.H.
Move assignment.
Definition at line 723 of file DynamicFieldI.H.
|
inline |
Move assignment.
Definition at line 755 of file DynamicFieldI.H.
|
inline |
Move assignment.
Definition at line 733 of file DynamicFieldI.H.
|
inline |
Move assignment.
Definition at line 744 of file DynamicFieldI.H.
|
friend |
Use the readList() method to read contents from Istream.
|
friend |
Write to Ostream.