List container for porosity models. More...
#include <porosityModelList.H>


Public Member Functions | |
| porosityModelList (const fvMesh &mesh, const dictionary &dict) | |
| Constructor. | |
| ~porosityModelList ()=default | |
| Destructor. | |
| bool | active (const bool warn=false) const |
| Return active status. | |
| void | reset (const dictionary &dict) |
| Reset the source list. | |
| void | addResistance (fvVectorMatrix &UEqn) |
| Add resistance. | |
| void | addResistance (fvVectorMatrix &UEqn, const volScalarField &rho, const volScalarField &mu) |
| Add resistance. | |
| void | addResistance (const fvVectorMatrix &UEqn, volTensorField &AU, bool correctAUprocBC=true) |
| Add resistance. | |
| bool | read (const dictionary &dict) |
| Read dictionary. | |
| bool | writeData (Ostream &os) const |
| Write data to Ostream. | |
| Public Member Functions inherited from PtrList< porosityModel > | |
| Foam::PtrList< porosityModel > | clone (Args &&... args) const |
| constexpr | PtrList () noexcept |
| Default construct. | |
| ~PtrList () | |
| Destructor. Frees all pointers. | |
| const porosityModel * | 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. | |
| porosityModel & | 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 (porosityModel *ptr) |
| Append an element to the end of the list. | |
| porosityModel & | emplace_set (const label i, Args &&... args) |
| Construct and set a new element at given position, (discard old element at that location). | |
| porosityModel & | emplace (const label i, Args &&... args) |
| Same as emplace_set(). | |
| porosityModel & | try_emplace (const label i, Args &&... args) |
| Like emplace_set() but will not overwrite an occupied (non-null) location. | |
| autoPtr< porosityModel > | release (const label i) |
| Release ownership of the pointer at the given position. | |
| void | transfer (PtrList< porosityModel > &list) |
| Transfer into this list and annul the argument list. | |
| void | operator= (const UPtrList< porosityModel > &list) |
| Copy assignment. | |
| void | setSize (const label n) |
| Same as resize(). | |
| void | append (autoPtr< porosityModel > &ptr) |
| Move append an element to the end of the list. | |
| Public Member Functions inherited from UPtrList< porosityModel > | |
| 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. | |
| porosityModel & | front () |
| Reference to the first element of the list. | |
| porosityModel & | back () |
| Reference to the last element of the list. | |
| const porosityModel * | 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 porosityModel * | 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 porosityModel * | 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 (porosityModel *ptr) |
| Append an element to the end of the list. | |
| void | swap (UPtrList< porosityModel > &list) noexcept |
| Swap content. | |
| void | transfer (UPtrList< porosityModel > &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 porosityModel & | at (const label i) const |
| Return const reference to the element at given position. FatalError for bounds problem or nullptr. | |
| const porosityModel & | 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 porosityModel *operator()(const label i) const | |
| Deprecated(2022-09) - same as get(). | |
| void | operator= (const UPtrList< porosityModel > &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. | |
| porosityModel ** | begin_ptr () noexcept |
| Iterator to begin of raw pointers traversal (use with caution). | |
| porosityModel ** | 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(). | |
| porosityModel & | first () |
| Reference to the first element of the list. | |
| porosityModel & | last () |
| Return reference to the last element of the list. | |
| void | append (porosityModel *ptr) |
| Append an element to the end of the list. | |
| label | count () const noexcept |
| The number of non-nullptr entries in the list. | |
Protected Attributes | |
| const fvMesh & | mesh_ |
| Reference to the mesh database. | |
| Protected Attributes inherited from UPtrList< porosityModel > | |
| Detail::PtrListDetail< porosityModel > | ptrs_ |
| The list of pointers. | |
Friends | |
| Ostream & | operator<< (Ostream &os, const porosityModelList &models) |
| Ostream operator. | |
Additional Inherited Members | |
| Public Types inherited from UPtrList< porosityModel > | |
| typedef porosityModel | value_type |
| Type of values the list contains. | |
| typedef porosityModel & | reference |
| A non-const reference to the value_type. | |
| typedef const porosityModel & | const_reference |
| A const reference to the value_type. | |
| Protected Member Functions inherited from PtrList< porosityModel > | |
| void | readIstream (Istream &is, const INew &inew) |
| Read from Istream using Istream constructor class. | |
| Protected Member Functions inherited from UPtrList< porosityModel > | |
| 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< porosityModel > &&ptrs) noexcept | |
| Low-level move construct. | |
| porosityModelList | ( | const fvMesh & | mesh, |
| const dictionary & | dict ) |
Constructor.
Definition at line 26 of file porosityModelList.C.
References active(), dict, mesh, mesh_, PtrList< porosityModel >::PtrList(), and reset().

|
default |
| bool active | ( | const bool | warn = false | ) | const |
Return active status.
Definition at line 42 of file porosityModelList.C.
References Foam::endl(), forAll, Foam::Info, UPtrList< porosityModel >::operator[](), and UPtrList< porosityModel >::size().
Referenced by porosityModelList().


| void reset | ( | const dictionary & | dict | ) |
Reset the source list.
Definition at line 59 of file porosityModelList.C.
References UPtrList< porosityModel >::count(), dict, mesh_, Foam::name(), porosityModel::New(), resize(), and PtrList< porosityModel >::set().
Referenced by porosityModelList().


| void addResistance | ( | fvVectorMatrix & | UEqn | ) |
Add resistance.
Definition at line 115 of file porosityModelList.C.
References forAll, UPtrList< porosityModel >::operator[](), and UEqn.

| void addResistance | ( | fvVectorMatrix & | UEqn, |
| const volScalarField & | rho, | ||
| const volScalarField & | mu ) |
Add resistance.
Definition at line 127 of file porosityModelList.C.
References forAll, mu, UPtrList< porosityModel >::operator[](), rho, and UEqn.

| void addResistance | ( | const fvVectorMatrix & | UEqn, |
| volTensorField & | AU, | ||
| bool | correctAUprocBC = true ) |
Add resistance.
Definition at line 141 of file porosityModelList.C.
References forAll, UPtrList< porosityModel >::operator[](), and UEqn.

| bool read | ( | const dictionary & | dict | ) |
Read dictionary.
Definition at line 90 of file porosityModelList.C.
References dict, forAll, porosityModel::name(), UPtrList< porosityModel >::operator[](), and porosityModel::read().
Referenced by IOporosityModelList::read().


| bool writeData | ( | Ostream & | os | ) | const |
Write data to Ostream.
Definition at line 103 of file porosityModelList.C.
References forAll, Foam::nl, UPtrList< porosityModel >::operator[](), and os().

|
protected |
Reference to the mesh database.
Definition at line 79 of file porosityModelList.H.
Referenced by porosityModelList(), and reset().