A field of fields is a PtrList of fields with reference counting. More...
#include <FieldField.H>


Public Types | |
| typedef pTraits< Type >::cmptType | cmptType |
| Component type. | |
| Public Types inherited from UPtrList< Field< Type > > | |
| typedef Field< Type > | value_type |
| Type of values the list contains. | |
| typedef Field< Type > & | reference |
| A non-const reference to the value_type. | |
| typedef const Field< Type > & | const_reference |
| A const reference to the value_type. | |
Public Member Functions | |
| constexpr | FieldField () noexcept |
| Construct null. | |
| FieldField (const label size) | |
| Construct given size. | |
| FieldField (const word &type, const FieldField< Field, Type > &ff) | |
| Clone construct with new type. | |
| FieldField (const FieldField< Field, Type > &ff) | |
| Copy construct, cloning each element. | |
| FieldField (FieldField< Field, Type > &&ff) | |
| Move construct. | |
| FieldField (FieldField< Field, Type > &ff, bool reuse) | |
| Construct as copy or re-use as specified. | |
| FieldField (const PtrList< Field< Type > > &list) | |
| Copy construct from PtrList. | |
| FieldField (PtrList< Field< Type > > &&list) | |
| Move construct from PtrList. | |
| FieldField (const tmp< FieldField< Field, Type > > &tf) | |
| Move/copy construct from tmp<FieldField>. | |
| FieldField (Istream &is) | |
| Construct from Istream. | |
| tmp< FieldField< Field, Type > > | clone () const |
| Clone. | |
| void | negate () |
| Negate this field. See notes in Field. | |
| void | normalise () |
| Normalise this field. See notes in Field. | |
| tmp< FieldField< Field, cmptType > > | component (const direction) const |
| Return a component field of the field. | |
| void | replace (const direction, const FieldField< Field, cmptType > &) |
| Replace a component field of the field. | |
| void | replace (const direction, const cmptType &) |
| Replace a component field of the field. | |
| void | clamp_min (const Type &lower) |
| Impose lower (floor) clamp on the field values (in-place). | |
| void | clamp_min (const FieldField< Field, Type > &lower) |
| Impose lower (floor) clamp on the field values (in-place). | |
| void | clamp_max (const Type &upper) |
| Impose upper (ceiling) clamp on the field values (in-place). | |
| void | clamp_max (const FieldField< Field, Type > &upper) |
| Impose upper (ceiling) clamp on the field values (in-place). | |
| void | clamp_range (const Type &lower, const Type &upper) |
| Clamp field values (in-place) to the specified range. | |
| void | clamp_range (const MinMax< Type > &range) |
| Clamp field values (in-place) to the specified range. | |
| tmp< FieldField< Field, Type > > | T () const |
| Return the field transpose (only defined for second rank tensors). | |
| const Type & | operator[] (const labelPair &index) const |
| Const access to a single field element via (fieldi, elemi). | |
| Type & | operator[] (const labelPair &index) |
| Non-const access to a single field element via (fieldi, elemi). | |
| void | operator= (const FieldField< Field, Type > &) |
| Copy assignment. | |
| void | operator= (FieldField< Field, Type > &&) |
| Move assignment. | |
| void | operator= (const tmp< FieldField< Field, Type > > &) |
| Move or clone assignment. | |
| void | operator= (const Type &val) |
| Assign uniform value. | |
| void | operator= (Foam::zero) |
| Assign uniform zero. | |
| void | operator+= (const FieldField< Field, Type > &) |
| void | operator+= (const tmp< FieldField< Field, Type > > &) |
| void | operator-= (const FieldField< Field, Type > &) |
| void | operator-= (const tmp< FieldField< Field, Type > > &) |
| void | operator*= (const FieldField< Field, scalar > &) |
| void | operator*= (const tmp< FieldField< Field, scalar > > &) |
| void | operator/= (const FieldField< Field, scalar > &) |
| void | operator/= (const tmp< FieldField< Field, scalar > > &) |
| void | operator+= (const Type &) |
| void | operator-= (const Type &) |
| void | operator*= (const scalar &) |
| void | operator/= (const scalar &) |
| Public Member Functions inherited from refCount | |
| constexpr | refCount () noexcept |
| Default construct, initializing count to 0. | |
| int | use_count () const noexcept |
| Return the current reference count. | |
| bool | unique () const noexcept |
| Return true if the reference count is zero. | |
| void | operator++ () noexcept |
| Increment the reference count. | |
| void | operator++ (int) noexcept |
| Increment the reference count. | |
| void | operator-- () noexcept |
| Decrement the reference count. | |
| void | operator-- (int) noexcept |
| Decrement the reference count. | |
| Public Member Functions inherited from PtrList< Field< Type > > | |
| Foam::PtrList< Field< Type > > | clone (Args &&... args) const |
| constexpr | PtrList () noexcept |
| Default construct. | |
| ~PtrList () | |
| Destructor. Frees all pointers. | |
| const Field< Type > * | set (const label i) const |
| Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie, with bounds checking). | |
| void | clear () |
| Clear the PtrList. Delete allocated entries and set size to zero. | |
| void | free () |
| Free memory and nullify all entries. Does not change the list size. | |
| void | resize (const label newLen) |
| Adjust size of PtrList. | |
| void | resize_null (const label newLen) |
Set the addressed list to the given size, deleting all existing entries. Afterwards the list contains all nullptr entries. | |
| Field< Type > & | emplace_back (Args &&... args) |
| Construct and append an element to the end of the list, return reference to the new list element. | |
| void | push_back (Field< Type > *ptr) |
| Append an element to the end of the list. | |
| Field< Type > & | emplace_set (const label i, Args &&... args) |
| Construct and set a new element at given position, (discard old element at that location). | |
| Field< Type > & | emplace (const label i, Args &&... args) |
| Same as emplace_set(). | |
| Field< Type > & | try_emplace (const label i, Args &&... args) |
| Like emplace_set() but will not overwrite an occupied (non-null) location. | |
| autoPtr< Field< Type > > | release (const label i) |
| Release ownership of the pointer at the given position. | |
| void | transfer (PtrList< Field< Type > > &list) |
| Transfer into this list and annul the argument list. | |
| void | operator= (const UPtrList< Field< Type > > &list) |
| Copy assignment. | |
| void | setSize (const label n) |
| Same as resize(). | |
| void | append (autoPtr< Field< Type > > &ptr) |
| Move append an element to the end of the list. | |
| Public Member Functions inherited from UPtrList< Field< Type > > | |
| bool | empty () const noexcept |
| True if the list is empty (ie, size() is zero). | |
| label | size () const noexcept |
| The number of entries in the list. | |
| label | capacity () const noexcept |
| Size of the underlying storage. | |
| label | count_nonnull () const noexcept |
| The number of non-nullptr entries in the list. | |
| Field< Type > & | front () |
| Reference to the first element of the list. | |
| Field< Type > & | back () |
| Reference to the last element of the list. | |
| const Field< Type > * | test (const label i) const |
| Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie, with bounds checking). | |
| const Field< Type > * | get (const label i) const |
| Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie, with bounds checking). | |
| const Field< Type > * | set (const label i) const |
| Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie, with bounds checking). | |
| void | clear () |
| Set list size to zero. | |
| void | free () |
| Nullify all entries. Does not change the list size. | |
| void | resize (const label newLen) |
Change the size of the list. Any new entries are nullptr. | |
| void | resize_null (const label newLen) |
Set the list to the given size and set all entries to nullptr. | |
| label | squeezeNull () |
| Squeeze out nullptr entries in the list of pointers after which any null pointers will be at the end of the list. | |
| void | push_back (Field< Type > *ptr) |
| Append an element to the end of the list. | |
| void | swap (UPtrList< Field< Type > > &list) noexcept |
| Swap content. | |
| void | transfer (UPtrList< Field< Type > > &list) |
| Transfer contents into this list and annul the argument. | |
| void | reorder (const labelUList &oldToNew, const bool check=false) |
| Reorder elements. Reordering must be unique (ie, shuffle). | |
| void | sortOrder (const labelUList &order, const bool check=false) |
| Reorder elements according to new order mapping (newToOld). Reordering must be unique (ie, shuffle). | |
| void | checkNonNull () const |
| Check and raise FatalError if any nullptr exists in the list. | |
| const Field< Type > & | at (const label i) const |
| Return const reference to the element at given position. FatalError for bounds problem or nullptr. | |
| const Field< Type > & | operator[] (const label i) const |
| Return const reference to the element at given position. FatalError for bounds problem or nullptr. Same as at(). | |
| FOAM_DEPRECATED_FOR (2022-09, "get(), set() or test() methods") const Field< Type > *operator()(const label i) const | |
| Deprecated(2022-09) - same as get(). | |
| void | operator= (const UPtrList< Field< Type > > &list) |
| Copy assignment (shallow copies addresses). | |
| Ostream & | printAddresses (Ostream &os) const |
| Print pointer addresses to Ostream (debugging only). | |
| Ostream & | writeList (Ostream &os, const bool trimNull=false) const |
| Write UPtrList to Ostream, optionally ignoring null entries. | |
| Field< Type > ** | begin_ptr () noexcept |
| Iterator to begin of raw pointers traversal (use with caution). | |
| Field< Type > ** | end_ptr () noexcept |
| Iterator beyond end of raw pointers traversal (use with caution). | |
| iterator | begin () |
| Return iterator to begin traversal of non-nullptr entries. | |
| iterator | end () noexcept |
| Return iterator beyond end of UPtrList traversal. | |
| const_iterator | cbegin () const |
| Return const_iterator to begin traversal of non-nullptr entries. | |
| const_iterator | cend () const noexcept |
| Return const_iterator beyond end of UPtrList traversal. | |
| void | setSize (const label n) |
| Alias for resize(). | |
| Field< Type > & | first () |
| Reference to the first element of the list. | |
| Field< Type > & | last () |
| Return reference to the last element of the list. | |
| void | append (Field< Type > *ptr) |
| Append an element to the end of the list. | |
| label | count () const noexcept |
| The number of non-nullptr entries in the list. | |
Static Public Member Functions | |
| template<class Type2> | |
| static tmp< FieldField< Field, Type > > | NewCalculatedType (const FieldField< Field, Type2 > &ff) |
| Return a pointer to a new calculatedFvPatchFieldField created on. | |
Friends | |
| Ostream & | operator (Ostream &, const FieldField< Field, Type > &) |
| Ostream & | operator (Ostream &, const tmp< FieldField< Field, Type > > &) |
Additional Inherited Members | |
| Protected Member Functions inherited from PtrList< Field< Type > > | |
| void | readIstream (Istream &is, const INew &inew) |
| Read from Istream using Istream constructor class. | |
| Protected Member Functions inherited from UPtrList< Field< Type > > | |
| void | setAddressableSize (const label n) noexcept |
| Adjust addressable size. | |
| label | find_next (label pos) const |
| The next non-null entry after the specified position. | |
| UPtrList (Detail::PtrListDetail< Field< Type > > &&ptrs) noexcept | |
| Low-level move construct. | |
| Protected Attributes inherited from UPtrList< Field< Type > > | |
| Detail::PtrListDetail< Field< Type > > | ptrs_ |
| The list of pointers. | |
A field of fields is a PtrList of fields with reference counting.
Definition at line 73 of file FieldField.H.
Component type.
Definition at line 83 of file FieldField.H.
|
constexprnoexcept |
Construct null.
Used for temporary fields which are initialised after construction
Definition at line 101 of file FieldField.C.
References Foam::noexcept, and PtrList< Field< Type > >::PtrList().
Referenced by AveragingMethod< Type >::AveragingMethod(), AveragingMethod< Type >::AveragingMethod(), Basic< Type >::Basic(), Basic< Type >::Basic(), clamp_max(), clamp_min(), Dual< Type >::Dual(), Dual< Type >::Dual(), FieldField(), FieldField(), FieldField(), FieldField(), Moment< Type >::Moment(), Moment< Type >::Moment(), NewCalculatedType(), operator, operator, GeometricBoundaryField< Type, faPatchField, areaMesh >::operator!=(), TypeGrad< Type >::operator*=(), TypeGrad< Type >::operator+=(), TypeGrad< Type >::operator/=(), operator=(), operator=(), operator=(), GeometricBoundaryField< Type, faPatchField, areaMesh >::operator=(), TypeGrad< Type >::operator=(), GeometricBoundaryField< Type, faPatchField, areaMesh >::operator==(), and replace().


|
explicit |
Construct given size.
Used for temporary fields which are initialised after construction
Definition at line 108 of file FieldField.C.
References PtrList< Field< Type > >::PtrList(), and UPtrList< Field< Type > >::size().

| FieldField | ( | const word & | type, |
| const FieldField< Field, Type > & | ff ) |
Clone construct with new type.
Definition at line 115 of file FieldField.C.
References FieldField(), forAll, Field< Type >::New(), PtrList< Field< Type > >::PtrList(), PtrList< Field< Type > >::set(), and UPtrList< Field< Type > >::size().

| FieldField | ( | const FieldField< Field, Type > & | ff | ) |
Copy construct, cloning each element.
Definition at line 131 of file FieldField.C.
References FieldField(), and PtrList< Field< Type > >::PtrList().

| FieldField | ( | FieldField< Field, Type > && | ff | ) |
Move construct.
Definition at line 138 of file FieldField.C.
References FieldField(), and PtrList< Field< Type > >::PtrList().

| FieldField | ( | FieldField< Field, Type > & | ff, |
| bool | reuse ) |
Construct as copy or re-use as specified.
Definition at line 145 of file FieldField.C.
| FieldField | ( | const PtrList< Field< Type > > & | list | ) |
Copy construct from PtrList.
Definition at line 152 of file FieldField.C.
References PtrList< Field< Type > >::PtrList().

Move construct from PtrList.
Definition at line 159 of file FieldField.C.
References PtrList< Field< Type > >::PtrList().

| FieldField | ( | const tmp< FieldField< Field, Type > > & | tf | ) |
Move/copy construct from tmp<FieldField>.
Definition at line 166 of file FieldField.C.
References FieldField(), and PtrList< Field< Type > >::PtrList().

| FieldField | ( | Istream & | is | ) |
Construct from Istream.
Definition at line 175 of file FieldField.C.
References PtrList< Field< Type > >::PtrList().

| tmp< FieldField< Field, Type > > clone | ( | ) | const |
Clone.
Definition at line 182 of file FieldField.C.
References Foam::New().

|
static |
Return a pointer to a new calculatedFvPatchFieldField created on.
freestore without setting patchField values
Definition at line 190 of file FieldField.C.
References FieldField(), and Foam::New().
Referenced by Foam::cmptAv(), Foam::cmptMag(), Foam::cmptMax(), Foam::cmptMin(), Foam::mag(), Foam::magSqr(), reuseTmpFieldField< Field, TypeR, Type1 >::New(), reuseTmpFieldField< Field, TypeR, Type1 >::New(), reuseTmpFieldField< Field, TypeR, TypeR >::New(), reuseTmpTmpFieldField< Field, TypeR, Type1, Type12, Type2 >::New(), reuseTmpTmpFieldField< Field, TypeR, Type1, Type12, TypeR >::New(), reuseTmpTmpFieldField< Field, TypeR, TypeR, TypeR, Type2 >::New(), reuseTmpTmpFieldField< Field, TypeR, TypeR, TypeR, TypeR >::New(), Foam::pow(), Foam::sqr(), Foam::stabilise(), and T().


| void negate | ( | ) |
Negate this field. See notes in Field.
Definition at line 212 of file FieldField.C.
References forAll, and operator[]().

| void normalise | ( | ) |
Normalise this field. See notes in Field.
Definition at line 222 of file FieldField.C.
| tmp< FieldField< Field, typename FieldField< Field, Type >::cmptType > > component | ( | const direction | d | ) | const |
Return a component field of the field.
Definition at line 233 of file FieldField.C.
| void replace | ( | const direction | d, |
| const FieldField< Field, cmptType > & | sf ) |
Replace a component field of the field.
Definition at line 251 of file FieldField.C.
References FieldField(), forAll, and operator[]().

| void replace | ( | const direction | d, |
| const cmptType & | s ) |
Replace a component field of the field.
Definition at line 265 of file FieldField.C.
| void clamp_min | ( | const Type & | lower | ) |
Impose lower (floor) clamp on the field values (in-place).
Definition at line 279 of file FieldField.C.
| void clamp_min | ( | const FieldField< Field, Type > & | lower | ) |
Impose lower (floor) clamp on the field values (in-place).
Definition at line 305 of file FieldField.C.
References FieldField(), and UPtrList< Field< Type > >::size().

| void clamp_max | ( | const Type & | upper | ) |
Impose upper (ceiling) clamp on the field values (in-place).
Definition at line 292 of file FieldField.C.
| void clamp_max | ( | const FieldField< Field, Type > & | upper | ) |
Impose upper (ceiling) clamp on the field values (in-place).
Definition at line 320 of file FieldField.C.
References FieldField(), and UPtrList< Field< Type > >::size().

| void clamp_range | ( | const Type & | lower, |
| const Type & | upper ) |
Clamp field values (in-place) to the specified range.
Does not check if range is valid or not.
Definition at line 335 of file FieldField.C.
| void clamp_range | ( | const MinMax< Type > & | range | ) |
Clamp field values (in-place) to the specified range.
Does not check if range is valid or not.
Definition at line 351 of file FieldField.C.
References range.
| tmp< FieldField< Field, Type > > T | ( | ) | const |
Return the field transpose (only defined for second rank tensors).
Definition at line 366 of file FieldField.C.
References NewCalculatedType(), and Foam::T().
Referenced by Dual< Type >::interpolateGrad(), and Moment< Type >::Moment().


|
inline |
Const access to a single field element via (fieldi, elemi).
Definition at line 381 of file FieldField.C.
References Pair< T >::first(), operator[](), and Pair< T >::second().
Referenced by negate(), operator=(), operator[](), operator[](), and replace().


|
inline |
Non-const access to a single field element via (fieldi, elemi).
Definition at line 388 of file FieldField.C.
References Pair< T >::first(), operator[](), and Pair< T >::second().

| void operator= | ( | const FieldField< Field, Type > & | ff | ) |
Copy assignment.
Definition at line 395 of file FieldField.C.
References FieldField(), forAll, and operator[]().
Referenced by AveragingMethod< Type >::operator=(), AveragingMethod< Type >::operator=(), AveragingMethod< Type >::operator=(), GeometricBoundaryField< Type, PatchField, GeoMesh >::operator=(), GeometricBoundaryField< Type, PatchField, GeoMesh >::operator=(), and GeometricBoundaryField< Type, PatchField, GeoMesh >::operator=().


| void operator= | ( | FieldField< Field, Type > && | ff | ) |
Move assignment.
Definition at line 412 of file FieldField.C.
References FieldField(), PtrList< Field< Type > >::PtrList(), and PtrList< Field< Type > >::transfer().

| void operator= | ( | const tmp< FieldField< Field, Type > > & | ) |
Move or clone assignment.
References FieldField(), and operator.

| void operator= | ( | const Type & | val | ) |
Assign uniform value.
Definition at line 444 of file FieldField.C.
| void operator= | ( | Foam::zero | ) |
Assign uniform zero.
Definition at line 454 of file FieldField.C.
| void operator+= | ( | const FieldField< Field, Type > & | f | ) |
Definition at line 493 of file FieldField.C.
Referenced by AveragingMethod< Type >::operator+=().

| void operator+= | ( | const tmp< FieldField< Field, Type > > & | tf | ) |
Definition at line 493 of file FieldField.C.
| void operator-= | ( | const FieldField< Field, Type > & | f | ) |
Definition at line 494 of file FieldField.C.
References COMPUTED_ASSIGNMENT.
| void operator-= | ( | const tmp< FieldField< Field, Type > > & | tf | ) |
Definition at line 494 of file FieldField.C.
| void operator*= | ( | const FieldField< Field, scalar > & | f | ) |
Definition at line 495 of file FieldField.C.
References COMPUTED_ASSIGNMENT.
Referenced by AveragingMethod< Type >::operator*=().

| void operator*= | ( | const tmp< FieldField< Field, scalar > > & | tf | ) |
Definition at line 495 of file FieldField.C.
| void operator/= | ( | const FieldField< Field, scalar > & | f | ) |
Definition at line 496 of file FieldField.C.
References COMPUTED_ASSIGNMENT.
Referenced by AveragingMethod< Type >::operator/=().

| void operator/= | ( | const tmp< FieldField< Field, scalar > > & | tf | ) |
Definition at line 496 of file FieldField.C.
| void operator+= | ( | const Type & | val | ) |
Definition at line 493 of file FieldField.C.
| void operator-= | ( | const Type & | val | ) |
Definition at line 494 of file FieldField.C.
| void operator*= | ( | const scalar & | val | ) |
Definition at line 495 of file FieldField.C.
| void operator/= | ( | const scalar & | val | ) |
Definition at line 496 of file FieldField.C.
|
friend |
References FieldField(), and operator.
Referenced by Basic< Type >::Basic(), Basic< Type >::Basic(), Dual< Type >::Dual(), Dual< Type >::Dual(), Moment< Type >::Moment(), Moment< Type >::Moment(), operator, operator, AveragingMethod< Type >::operator*=(), AveragingMethod< Type >::operator+=(), AveragingMethod< Type >::operator/=(), AveragingMethod< Type >::operator=(), AveragingMethod< Type >::operator=(), AveragingMethod< Type >::operator=(), and operator=().
|
friend |
References FieldField(), and operator.