Dynamically sized Field. More...
#include <OpenFOAM/DynamicField.H>
Dynamically sized Field.
Definition at line 70 of file DynamicField.H.
Public Member Functions | |
DynamicField () | |
Construct null. | |
DynamicField (const label) | |
Construct given size. | |
DynamicField (const UList< T > &) | |
Construct from UList. Size set to UList size. | |
DynamicField (const Xfer< List< T > > &) | |
Construct by transferring the parameter contents. | |
DynamicField (const UList< T > &mapF, const labelList &mapAddressing) | |
Construct by 1 to 1 mapping from the given field. | |
DynamicField (const UList< T > &mapF, const labelListList &mapAddressing, const scalarListList &weights) | |
Construct by interpolative mapping from the given field. | |
DynamicField (const UList< T > &mapF, const FieldMapper &map) | |
Construct by mapping from the given field. | |
DynamicField (const DynamicField< T, SizeInc, SizeMult, SizeDiv > &) | |
Construct copy. | |
DynamicField (const Xfer< DynamicField< T, SizeInc, SizeMult, SizeDiv > > &) | |
Construct by transferring the Field contents. | |
DynamicField (Istream &) | |
Construct from Istream. Size set to size of list read. | |
tmp< DynamicField< T, SizeInc, SizeMult, SizeDiv > > | clone () const |
Clone. | |
label | capacity () const |
Size of the underlying storage. | |
void | setCapacity (const label) |
Alter the size of the underlying storage. | |
void | setSize (const label) |
Alter the addressed list size. | |
void | setSize (const label, const T &) |
Alter the addressed list size and fill new space with a. | |
void | resize (const label) |
Alter the addressed list size. | |
void | resize (const label, const T &) |
Alter the addressed list size and fill new space with a. | |
void | reserve (const label) |
Reserve allocation space for at least this size. | |
void | clear () |
Clear the addressed list, i.e. set the size to zero. | |
void | clearStorage () |
Clear the list and delete storage. | |
DynamicField< T, SizeInc, SizeMult, SizeDiv > & | shrink () |
Shrink the allocated space to the number of elements used. | |
Xfer< List< T > > | xfer () |
Transfer contents to the Xfer container as a plain List. | |
DynamicField< T, SizeInc, SizeMult, SizeDiv > & | append (const T &) |
Append an element at the end of the list. | |
DynamicField< T, SizeInc, SizeMult, SizeDiv > & | append (const UList< T > &) |
Append a List at the end of this list. | |
T | remove () |
Remove and return the top element. | |
T & | operator() (const label) |
Return non-const access to an element, resizing list if. | |
void | operator= (const T &) |
Assignment of all addressed entries to the given value. | |
void | operator= (const DynamicField< T, SizeInc, SizeMult, SizeDiv > &) |
Assignment from DynamicField. | |
void | operator= (const UList< T > &) |
Assignment from UList. | |
![]() | |
Field () | |
Construct null. | |
Field (const label) | |
Construct given size. | |
Field (const label, const T &) | |
Construct given size and initial value. | |
Field (const UList< T > &) | |
Construct as copy of a UList<Type> | |
Field (const Xfer< List< T > > &) | |
Construct by transferring the List contents. | |
Field (const UList< T > &mapF, const unallocLabelList &mapAddressing) | |
Construct by 1 to 1 mapping from the given field. | |
Field (const tmp< Field< T > > &tmapF, const unallocLabelList &mapAddressing) | |
Construct by 1 to 1 mapping from the given tmp field. | |
Field (const UList< T > &mapF, const labelListList &mapAddressing, const scalarListList &weights) | |
Construct by interpolative mapping from the given field. | |
Field (const tmp< Field< T > > &tmapF, const labelListList &mapAddressing, const scalarListList &weights) | |
Construct by interpolative mapping from the given tmp field. | |
Field (const UList< T > &mapF, const FieldMapper &map) | |
Construct by mapping from the given field. | |
Field (const tmp< Field< T > > &tmapF, const FieldMapper &map) | |
Construct by mapping from the given tmp field. | |
Field (const Field< T > &) | |
Construct as copy. | |
Field (Field< T > &, bool reUse) | |
Construct as copy or re-use as specified. | |
Field (const Xfer< Field< T > > &) | |
Construct by transferring the Field contents. | |
Field (const typename Field< T >::subField &) | |
Construct as copy of subField. | |
Field (Istream &) | |
Construct as copy of tmp<Field> | |
Field (const word &keyword, const dictionary &dict, const label size) | |
Construct from a dictionary entry. | |
void | map (const UList< T > &mapF, const unallocLabelList &mapAddressing) |
1 to 1 map from the given field | |
void | map (const tmp< Field< T > > &tmapF, const unallocLabelList &mapAddressing) |
1 to 1 map from the given tmp field | |
void | map (const UList< T > &mapF, const labelListList &mapAddressing, const scalarListList &weights) |
Interpolative map from the given field. | |
void | map (const tmp< Field< T > > &tmapF, const labelListList &mapAddressing, const scalarListList &weights) |
Interpolative map from the given tmp field. | |
void | map (const UList< T > &mapF, const FieldMapper &map) |
Map from the given field. | |
void | map (const tmp< Field< T > > &tmapF, const FieldMapper &map) |
Map from the given tmp field. | |
void | autoMap (const FieldMapper &map) |
Map from self. | |
void | rmap (const UList< T > &mapF, const unallocLabelList &mapAddressing) |
1 to 1 reverse-map from the given field | |
void | rmap (const tmp< Field< T > > &tmapF, const unallocLabelList &mapAddressing) |
1 to 1 reverse-map from the given tmp field | |
void | rmap (const UList< T > &mapF, const unallocLabelList &mapAddressing, const scalarList &weights) |
Interpolative reverse map from the given field. | |
void | rmap (const tmp< Field< T > > &tmapF, const unallocLabelList &mapAddressing, const scalarList &weights) |
Interpolative reverse map from the given tmp field. | |
void | negate () |
Negate this field. | |
tmp< Field< cmptType > > | component (const direction) const |
Return a component field of the field. | |
void | replace (const direction, const UList< cmptType > &) |
Replace a component field of the field. | |
void | replace (const direction, const tmp< Field< cmptType > > &) |
Replace a component field of the field. | |
void | replace (const direction, const cmptType &) |
Replace a component field of the field. | |
tmp< Field< T > > | T () const |
Return the field transpose (only defined for second rank tensors) | |
void | writeEntry (const word &keyword, Ostream &os) const |
Write the field as a dictionary entry. | |
void | operator= (const Field< T > &) |
void | operator= (const SubField< T > &) |
void | operator= (const tmp< Field< T > > &) |
void | operator= (const VectorSpace< Form, Cmpt, nCmpt > &) |
void | operator+= (const UList< T > &) |
void | operator+= (const tmp< Field< T > > &) |
void | operator+= (const T &) |
void | operator-= (const UList< T > &) |
void | operator-= (const tmp< Field< T > > &) |
void | operator-= (const T &) |
void | operator*= (const UList< scalar > &) |
void | operator*= (const tmp< Field< scalar > > &) |
void | operator*= (const scalar &) |
void | operator/= (const UList< scalar > &) |
void | operator/= (const tmp< Field< scalar > > &) |
void | operator/= (const scalar &) |
![]() | |
refCount () | |
Construct null with zero count. | |
int | count () const |
Return the reference count. | |
bool | okToDelete () const |
Return true if the reference count is zero. | |
void | resetRefCount () |
Reset the reference count to zero. | |
void | operator++ () |
Increment the reference count. | |
void | operator++ (int) |
Increment the reference count. | |
void | operator-- () |
Decrement the reference count. | |
void | operator-- (int) |
Decrement the reference count. | |
![]() | |
List () | |
Null constructor. | |
List (const label) | |
Construct with given size. | |
List (const label, const T &) | |
Construct with given size and value for all elements. | |
List (const List< T > &) | |
Copy constructor. | |
List (const Xfer< List< T > > &) | |
Construct by transferring the parameter contents. | |
List (List< T > &, bool reUse) | |
Construct as copy or re-use as specified. | |
List (const UList< T > &, const unallocLabelList &mapAddressing) | |
Construct as subset. | |
template<class InputIterator > | |
List (InputIterator first, InputIterator last) | |
Construct given start and end iterators. | |
template<unsigned Size> | |
List (const FixedList< T, Size > &) | |
Construct as copy of FixedList<T, Size> | |
List (const PtrList< T > &) | |
Construct as copy of PtrList<T> | |
List (const SLList< T > &) | |
Construct as copy of SLList<T> | |
List (const IndirectList< T > &) | |
Construct as copy of IndirectList<T> | |
List (const UIndirectList< T > &) | |
Construct as copy of UIndirectList<T> | |
List (const BiIndirectList< T > &) | |
Construct as copy of BiIndirectList<T> | |
List (Istream &) | |
Construct from Istream. | |
~List () | |
label | size () const |
Return the number of elements in the UList. | |
void | append (const UIndirectList< T > &) |
Append a UIndirectList at the end of this list. | |
void | transfer (List< T > &) |
Transfer the contents of the argument List into this list. | |
template<unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv> | |
void | transfer (DynamicList< T, SizeInc, SizeMult, SizeDiv > &) |
Transfer the contents of the argument List into this list. | |
void | transfer (SortableList< T > &) |
Transfer the contents of the argument List into this list. | |
T & | newElmt (const label) |
Return subscript-checked element of UList. | |
void | operator= (const List< T > &) |
Assignment operator. Takes linear time. | |
void | operator= (const SLList< T > &) |
Assignment from SLList operator. Takes linear time. | |
void | operator= (const IndirectList< T > &) |
Assignment from IndirectList operator. Takes linear time. | |
void | operator= (const UIndirectList< T > &) |
Assignment from UIndirectList operator. Takes linear time. | |
void | operator= (const BiIndirectList< T > &) |
Assignment from BiIndirectList operator. Takes linear time. | |
![]() | |
UList () | |
Null constructor. | |
UList (T *__restrict__ v, label size) | |
Construct from components. | |
label | fcIndex (const label i) const |
Return the forward circular index, i.e. the next index. | |
label | rcIndex (const label i) const |
Return the reverse circular index, i.e. the previous index. | |
label | byteSize () const |
Return the binary size in number of characters of the UList. | |
const T * | cdata () const |
Return a const pointer to the first data element,. | |
T * | data () |
Return a pointer to the first data element,. | |
void | checkStart (const label start) const |
Check start is within valid range (0 ... size-1). | |
void | checkSize (const label size) const |
Check size is within valid range (0 ... size). | |
void | checkIndex (const label i) const |
Check index i is within valid range (0 ... size-1). | |
void | writeEntry (Ostream &) const |
Write the UList as a dictionary entry. | |
void | assign (const UList< T > &) |
Assign elements to those from UList. | |
T & | operator[] (const label) |
Return element of UList. | |
const T & | operator[] (const label) const |
Return element of constant UList. | |
operator const Foam::List< T > & () const | |
Allow cast to a const List<T>&. | |
iterator | begin () |
Return an iterator to begin traversing the UList. | |
iterator | end () |
Return an iterator to end traversing the UList. | |
const_iterator | cbegin () const |
Return const_iterator to begin traversing the constant UList. | |
const_iterator | cend () const |
Return const_iterator to end traversing the constant UList. | |
const_iterator | begin () const |
Return const_iterator to begin traversing the constant UList. | |
const_iterator | end () const |
Return const_iterator to end traversing the constant UList. | |
reverse_iterator | rbegin () |
Return reverse_iterator to begin reverse traversing the UList. | |
reverse_iterator | rend () |
Return reverse_iterator to end reverse traversing the UList. | |
const_reverse_iterator | crbegin () const |
Return const_reverse_iterator to begin reverse traversing the UList. | |
const_reverse_iterator | crend () const |
Return const_reverse_iterator to end reverse traversing the UList. | |
const_reverse_iterator | rbegin () const |
Return const_reverse_iterator to begin reverse traversing the UList. | |
const_reverse_iterator | rend () const |
Return const_reverse_iterator to end reverse traversing the UList. | |
label | max_size () const |
Return size of the largest possible UList. | |
bool | empty () const |
Return true if the UList is empty (ie, size() is zero). | |
void | swap (UList< T > &) |
Swap two ULists of the same type in constant time. | |
bool | operator== (const UList< T > &) const |
Equality operation on ULists of the same type. | |
bool | operator!= (const UList< T > &) const |
The opposite of the equality operation. Takes linear time. | |
bool | operator< (const UList< T > &) const |
Compare two ULists lexicographically. Takes linear time. | |
bool | operator> (const UList< T > &) const |
Compare two ULists lexicographically. Takes linear time. | |
bool | operator<= (const UList< T > &) const |
Return true if !(a > b). Takes linear time. | |
bool | operator>= (const UList< T > &) const |
Return true if !(a < b). Takes linear time. | |
template<> | |
const bool & | operator[] (const label i) const |
Static Public Member Functions | |
static const DynamicField< T, SizeInc, SizeMult, SizeDiv > & | null () |
Return a null field. | |
![]() | |
static tmp< Field< T > > | NewCalculatedType (const Field< Type2 > &f) |
Return a pointer to a new calculatedFvPatchFieldField created on. |
Friends | |
Ostream & | operator (Ostream &, const DynamicField< T, SizeInc, SizeMult, SizeDiv > &) |
Istream & | operator>> (Istream &, DynamicField< T, SizeInc, SizeMult, SizeDiv > &) |
Read from Istream, discarding contents of existing DynamicField. |
Additional Inherited Members | |
![]() | |
typedef pTraits< T >::cmptType | cmptType |
Component type. | |
typedef SubField< T > | subField |
Declare type of subField. | |
![]() | |
typedef SubList< T > | subList |
Declare type of subList. | |
![]() | |
typedef T | value_type |
Type of values the UList contains. | |
typedef T & | reference |
Type that can be used for storing into. | |
typedef const T & | const_reference |
Type that can be used for storing into. | |
typedef label | difference_type |
The type that can represent the difference between any two. | |
typedef label | size_type |
The type that can represent the size of a UList. | |
typedef T * | iterator |
Random access iterator for traversing UList. | |
typedef const T * | const_iterator |
Random access iterator for traversing UList. | |
typedef T * | reverse_iterator |
Reverse iterator for reverse traversal of UList. | |
typedef const T * | const_reverse_iterator |
Reverse iterator for reverse traversal of constant UList. | |
![]() | |
static const char *const | typeName |
|
inline |
Construct null.
Definition at line 29 of file DynamicFieldI.H.
|
inlineexplicit |
Construct given size.
Definition at line 38 of file DynamicFieldI.H.
References List< Type >::size().
|
inlineexplicit |
Construct from UList. Size set to UList size.
Also constructs from DynamicField with different sizing parameters.
Definition at line 52 of file DynamicFieldI.H.
|
inlineexplicit |
Construct by transferring the parameter contents.
Definition at line 63 of file DynamicFieldI.H.
|
inline |
Construct by 1 to 1 mapping from the given field.
Definition at line 74 of file DynamicFieldI.H.
|
inline |
Construct by interpolative mapping from the given field.
Definition at line 86 of file DynamicFieldI.H.
|
inline |
Construct by mapping from the given field.
Definition at line 100 of file DynamicFieldI.H.
|
inline |
Construct copy.
Definition at line 112 of file DynamicFieldI.H.
|
inline |
Construct by transferring the Field contents.
Definition at line 123 of file DynamicFieldI.H.
|
explicit |
Construct from Istream. Size set to size of list read.
Definition at line 31 of file DynamicField.C.
|
inlinestatic |
Return a null field.
Reimplemented from Field< T >.
Definition at line 85 of file DynamicField.H.
References reinterpret_cast().
Foam::tmp< Foam::DynamicField< T, SizeInc, SizeMult, SizeDiv > > clone | ( | ) | const |
|
inline |
Size of the underlying storage.
Definition at line 135 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 144 of file DynamicFieldI.H.
References List< Type >::setSize(), and List< Type >::size().
|
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).
Reimplemented from List< T >.
Definition at line 202 of file DynamicFieldI.H.
References Foam::max(), List< Type >::setSize(), and List< Type >::size().
|
inline |
Alter the addressed list size and fill new space with a.
constant.
Reimplemented from List< T >.
Definition at line 239 of file DynamicFieldI.H.
References setSize(), and List< Type >::size().
|
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).
Reimplemented from List< T >.
Definition at line 257 of file DynamicFieldI.H.
References setSize().
|
inline |
Alter the addressed list size and fill new space with a.
constant.
Reimplemented from List< T >.
Definition at line 267 of file DynamicFieldI.H.
References setSize().
|
inline |
Reserve allocation space for at least this size.
Never shrinks the allocated size, use setCapacity() for that.
Definition at line 165 of file DynamicFieldI.H.
References Foam::max(), List< Type >::setSize(), and List< Type >::size().
|
inline |
Clear the addressed list, i.e. set the size to zero.
Allocated size does not change
Reimplemented from List< T >.
Definition at line 277 of file DynamicFieldI.H.
References List< Type >::size().
|
inline |
Clear the list and delete storage.
Definition at line 284 of file DynamicFieldI.H.
References List< Type >::clear().
|
inline |
Shrink the allocated space to the number of elements used.
Returns a reference to the DynamicField.
Definition at line 293 of file DynamicFieldI.H.
References List< Type >::setSize(), and List< Type >::size().
|
inline |
Transfer contents to the Xfer container as a plain List.
Reimplemented from List< T >.
Definition at line 312 of file DynamicFieldI.H.
|
inline |
Append an element at the end of the list.
Definition at line 321 of file DynamicFieldI.H.
References setSize(), and List< T >::size().
|
inline |
Append a List at the end of this list.
Reimplemented from List< T >.
Definition at line 336 of file DynamicFieldI.H.
References Foam::abort(), Foam::FatalError, FatalErrorIn, forAll, setSize(), List< T >::size(), and UList< T >::size().
|
inline |
Remove and return the top element.
Definition at line 361 of file DynamicFieldI.H.
References Foam::abort(), Foam::FatalError, FatalErrorIn, UList< T >::operator[](), List< T >::size(), and Foam::T().
Return non-const access to an element, resizing list if.
necessary
Definition at line 385 of file DynamicFieldI.H.
References setSize().
Assignment of all addressed entries to the given value.
Reimplemented from Field< T >.
Definition at line 400 of file DynamicFieldI.H.
References UList< T >::operator=().
|
inline |
Assignment from DynamicField.
Definition at line 410 of file DynamicFieldI.H.
References Foam::abort(), Foam::FatalError, FatalErrorIn, Field< Type >::operator=(), List< Type >::size(), and UList< T >::size().
Assignment from UList.
Reimplemented from Field< T >.
Definition at line 442 of file DynamicFieldI.H.
References Field< Type >::operator=(), List< Type >::size(), and UList< T >::size().
|
friend |
|
friend |
Read from Istream, discarding contents of existing DynamicField.