Dynamically sized Field. More...
Public Member Functions | |
constexpr | DynamicField () noexcept |
Construct null. 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... | |
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... | |
void | setCapacity (const label nElem) |
Alter the size of the underlying storage. More... | |
void | setSize (const label nElem) |
Alter the addressed list size. More... | |
void | setSize (const label nElem, const T &val) |
Alter the addressed list size and fill new space with a constant. More... | |
void | resize (const label nElem) |
Alter the addressed list size. More... | |
void | resize (const label nElem, const T &val) |
Alter the addressed list size and fill new space with a. More... | |
void | reserve (const label nElem) |
Reserve allocation space for at least this size. More... | |
void | clear () |
Clear the addressed list, i.e. set the size to zero. More... | |
void | clearStorage () |
Clear the list and delete storage. More... | |
label | expandStorage () |
Expand the addressable size to fit the allocated capacity. More... | |
DynamicField< T, SizeMin > & | shrink () |
Shrink the allocated space to the number of elements used. More... | |
template<int AnySizeMin> | |
void | swap (DynamicField< T, AnySizeMin > &list) |
Swap content with any sized DynamicField. 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 (const UList< T > &list) |
Append a List at the end of this list. More... | |
T | remove () |
Remove and return the top element. More... | |
T & | operator() (const label i) |
Return non-const access to an element, resizing list if necessary. More... | |
void | operator= (const T &val) |
Assign addressed entries to the given value. 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... | |
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... | |
Dynamically sized Field.
Definition at line 51 of file DynamicField.H.
|
inlineconstexprnoexcept |
Construct null.
Definition at line 60 of file DynamicFieldI.H.
|
inlineexplicit |
Construct empty field with given reserve size.
Definition at line 68 of file DynamicFieldI.H.
|
inline |
Construct given size and initial value.
Definition at line 79 of file DynamicFieldI.H.
|
inline |
Construct given size and initial value of zero.
Definition at line 91 of file DynamicFieldI.H.
|
inline |
Copy construct.
Definition at line 103 of file DynamicFieldI.H.
|
inline |
Copy construct with different sizing parameters.
Definition at line 115 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 126 of file DynamicFieldI.H.
|
inlineexplicit |
Copy construct from IndirectList.
Definition at line 138 of file DynamicFieldI.H.
|
inlineexplicit |
Move construct from List contents.
Definition at line 149 of file DynamicFieldI.H.
|
inline |
Move construct from dynamic Field contents.
Definition at line 160 of file DynamicFieldI.H.
|
inline |
Move construct with different sizing parameters.
Definition at line 174 of file DynamicFieldI.H.
|
inline |
Construct by 1 to 1 mapping from the given field.
Definition at line 187 of file DynamicFieldI.H.
|
inline |
Construct by interpolative mapping from the given field.
Definition at line 199 of file DynamicFieldI.H.
|
inline |
Construct by mapping from the given field.
Definition at line 213 of file DynamicFieldI.H.
|
explicit |
Construct from Istream. Size set to size of list read.
Definition at line 34 of file DynamicField.C.
|
inlinestatic |
Return a null field.
Definition at line 96 of file DynamicField.H.
Foam::tmp< Foam::DynamicField< T, SizeMin > > clone | ( | ) | const |
Clone.
Definition at line 43 of file DynamicField.C.
|
inlinenoexcept |
Size of the underlying storage.
Definition at line 226 of file DynamicFieldI.H.
Referenced by extendedEdgeMesh::cut(), and DynamicField< Foam::Vector >::transfer().
|
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 234 of file DynamicFieldI.H.
Referenced by extendedEdgeMesh::cut(), and DynamicField< Foam::Vector >::swap().
|
inline |
Alter the addressed list size.
New space will be allocated if required. Use this to resize the list prior to using the operator[] for setting values (as per List usage).
Definition at line 284 of file DynamicFieldI.H.
Referenced by DynamicField< Foam::Vector >::swap().
|
inline |
Alter the addressed list size and fill new space with a constant.
Definition at line 312 of file DynamicFieldI.H.
|
inline |
Alter the addressed list size.
New space will be allocated if required. Use this to resize the list prior to using the operator[] for setting values (as per List usage).
Definition at line 330 of file DynamicFieldI.H.
|
inline |
Alter the addressed list size and fill new space with a.
constant.
Definition at line 340 of file DynamicFieldI.H.
|
inline |
Reserve allocation space for at least this size.
Never shrinks the allocated size, use setCapacity() for that.
Definition at line 256 of file DynamicFieldI.H.
|
inline |
Clear the addressed list, i.e. set the size to zero.
Allocated size does not change
Definition at line 350 of file DynamicFieldI.H.
Referenced by isoAlpha::reconstruct().
|
inline |
Clear the list and delete storage.
Definition at line 357 of file DynamicFieldI.H.
Referenced by zoneDistribute::getFields(), and DynamicField< Foam::Vector >::transfer().
|
inline |
Expand the addressable size to fit the allocated capacity.
Returns the previous addressable size.
Definition at line 365 of file DynamicFieldI.H.
Referenced by DynamicField< Foam::Vector >::swap().
|
inline |
Shrink the allocated space to the number of elements used.
Returns a reference to the DynamicField.
Definition at line 378 of file DynamicFieldI.H.
|
inline |
Swap content with any sized DynamicField.
Definition at line 398 of file DynamicFieldI.H.
Transfer the parameter contents into this.
Definition at line 428 of file DynamicFieldI.H.
|
inline |
Transfer the parameter contents into this.
Definition at line 439 of file DynamicFieldI.H.
|
inline |
Transfer the parameter contents into this.
Definition at line 461 of file DynamicFieldI.H.
|
inline |
Append an element at the end of the list.
Definition at line 483 of file DynamicFieldI.H.
Referenced by extendedEdgeMesh::add(), extendedEdgeMesh::cut(), zoneDistribute::getFields(), and isoAlpha::reconstruct().
|
inline |
Append a List at the end of this list.
Definition at line 498 of file DynamicFieldI.H.
|
inline |
Remove and return the top element.
Definition at line 520 of file DynamicFieldI.H.
|
inline |
Return non-const access to an element, resizing list if necessary.
Definition at line 543 of file DynamicFieldI.H.
|
inline |
Assign addressed entries to the given value.
Definition at line 558 of file DynamicFieldI.H.
Copy assignment.
Definition at line 568 of file DynamicFieldI.H.
|
inline |
Copy assignment.
Definition at line 578 of file DynamicFieldI.H.
Move assignment.
Definition at line 593 of file DynamicFieldI.H.
|
inline |
Move assignment.
Definition at line 603 of file DynamicFieldI.H.
|
inline |
Move assignment.
Definition at line 614 of file DynamicFieldI.H.