Loading...
Searching...
No Matches
boundaryRegion Class Reference

The boundaryRegion persistent data saved as a Map<dictionary>. More...

#include <boundaryRegion.H>

Inheritance diagram for boundaryRegion:
Collaboration diagram for boundaryRegion:

Public Member Functions

 boundaryRegion (const boundaryRegion &)=delete
 No copy construct.
 boundaryRegion () noexcept=default
 Default construct.
 boundaryRegion (const objectRegistry &obr, const word &name="boundaryRegion", const fileName &instance="constant")
 Read construct from registry, name, instance.
 ~boundaryRegion ()=default
 Destructor.
label push_back (const dictionary &dict)
 Add to the end, return index.
label maxIndex () const
 The max table index, -1 if empty.
label findIndex (const word &name) const
 The index corresponding to entry with 'Label' of given name, or -1 if not found.
word name (const label id) const
 The 'Label' name corresponding to id, or boundaryRegion_ID if not otherwise defined.
Map< wordnames () const
 Return the extracted Map of (id => name).
Map< wordnames (const wordRes &patterns) const
 Return the extracted Map of (id => names) selected by patterns.
Map< wordboundaryTypes () const
 Return the extracted Map of (id => type).
word boundaryType (const word &name) const
 Return BoundaryType corresponding to patch 'name', "patch" if not found.
void readDict (const objectRegistry &obr, const word &name="boundaryRegion", const fileName &instance="constant")
 Read constant/boundaryRegion.
void writeDict (const objectRegistry &obr, const word &name="boundaryRegion", const fileName &instance="constant") const
 Write constant/boundaryRegion for later reuse.
void operator= (const boundaryRegion &)
 Copy assignment.
void operator= (const Map< dictionary > &)
 Assign from Map<dictionary>.
void rename (const dictionary &)
 Rename regions.
label append (const dictionary &dict)
 Add to the end, return index.
Public Member Functions inherited from Map< dictionary >
void operator= (const this_type &rhs)
 Copy assign.
void operator= (std::initializer_list< std::pair< label, dictionary > > rhs)
 Copy assign from an initializer list.
void operator= (this_type &&rhs)
 Move assign.
constexpr Map () noexcept=default
 Default construct: empty without allocation (capacity=0).
Public Member Functions inherited from HashTable< dictionary, label, Hash< label > >
Foam::List< label > sortedToc (const Compare &comp) const
Foam::List< label > tocKeys (const UnaryPredicate &pred, const bool invert) const
Foam::List< label > tocValues (const UnaryPredicate &pred, const bool invert) const
Foam::List< label > tocEntries (const BinaryPredicate &pred, const bool invert) const
Foam::label countKeys (const UnaryPredicate &pred, const bool invert) const
Foam::label countValues (const UnaryPredicate &pred, const bool invert) const
Foam::label countEntries (const BinaryPredicate &pred, const bool invert) const
Foam::label erase (InputIter first, InputIter last)
Foam::label erase (const FixedList< label, N > &keys)
Foam::label erase (const HashTable< AnyType, label, AnyHash > &other)
Foam::label retain (const HashTable< AnyType, label, AnyHash > &other)
Foam::label filterKeys (const UnaryPredicate &pred, const bool pruning)
Foam::label filterValues (const UnaryPredicate &pred, const bool pruning)
Foam::label filterEntries (const BinaryPredicate &pred, const bool pruning)
constexpr HashTable () noexcept
 Default construct: empty without allocation (capacity=0).
 ~HashTable ()
 Destructor.
bool empty () const noexcept
 True if the hash table is empty.
label size () const noexcept
 The number of elements in table.
label capacity () const noexcept
 The size of the underlying table (the number of buckets).
dictionaryat (const label &key)
 Find and return a hashed entry. FatalError if it does not exist.
bool contains (const label &key) const
 True if hashed key is contained (found) in table.
iterator find (const label &key)
 Find and return an iterator set at the hashed entry.
const_iterator cfind (const label &key) const
 Find and return an const_iterator set at the hashed entry.
const dictionarylookup (const label &key, const dictionary &deflt) const
 Return hashed entry if it exists, or return the given default.
List< label > toc () const
 The table of contents (the keys) in unsorted order.
UPtrList< const node_typecsorted () const
 Const access to the hash-table contents in sorted order (sorted by keys).
UPtrList< node_typesorted ()
 Non-const access to the hash-table contents in sorted order (sorted by keys).
bool emplace (const label &key, Args &&... args)
 Emplace insert a new entry, not overwriting existing entries.
bool emplace_set (const label &key, Args &&... args)
 Emplace set an entry, overwriting any existing entries.
bool insert (const label &key, const dictionary &obj)
 Copy insert a new entry, not overwriting existing entries.
bool set (const label &key, const dictionary &obj)
 Copy assign a new entry, overwriting existing entries.
void clear ()
 Remove all entries from table.
void clearStorage ()
 Remove all entries from table and the table itself.
void setCapacity (label newCapacity)
 Change the hash table capacity (number of buckets).
void resize (label newCapacity)
 Rehash the hash table with new number of buckets. Currently identical to setCapacity().
void reserve (label numEntries)
 Reserve space for at least the specified number of elements (not the number of buckets) and regenerates the hash table.
void swap (HashTable< dictionary, label, Hash > &rhs) noexcept
 Swap contents into this table.
void transfer (HashTable< dictionary, label, Hash > &rhs)
 Transfer contents into this table.
void merge (HashTable< dictionary, label, Hash > &source)
 Attempts to extract entries from source parameter and insert them into this, does not overwrite existing entries. The source will contains any items that could not be merged.
dictionaryoperator[] (const label &key)
 Find and return a hashed entry. FatalError if it does not exist.
dictionaryoperator() (const label &key)
 Return existing entry or create a new entry.
void operator= (const this_type &rhs)
 Copy assign.
bool operator== (const this_type &rhs) const
 Equality. Tables are equal if all keys and values are equal, independent of order or underlying storage size.
bool operator!= (const this_type &rhs) const
 The opposite of the equality operation.
this_typeoperator+= (const this_type &rhs)
 Add entries into this HashTable.
const_iterator_pair< const_key_iterator, this_typekeys () const
 A const iterator begin/end pair for iterating over keys.
iterator begin ()
 iterator set to the beginning of the HashTable
const_iterator cbegin () const
 const_iterator set to the beginning of the HashTable
iterator end () noexcept
 iterator to signal the end (for any HashTable)
constexpr const_iterator cend () const noexcept
 const_iterator to signal the end (for any HashTable)
OstreamprintInfo (Ostream &os) const
 Print information.
OstreamwriteKeys (Ostream &os, const label shortLen=0) const
 Write unordered keys (list), with line-breaks when length exceeds shortLen.
bool found (const label &key) const
 Same as contains().
Public Member Functions inherited from HashTableCore
 ClassName ("HashTable")
 Declare type-name (with debug switch).
constexpr HashTableCore () noexcept=default
 Default construct.

Additional Inherited Members

Public Types inherited from Map< dictionary >
typedef Map< dictionarythis_type
 The template instance used for this Map.
typedef HashTable< dictionary, label, Hash< label > > parent_type
 The template instance used for the parent HashTable.
using iterator
using const_iterator
Public Types inherited from HashTable< dictionary, label, Hash< label > >
typedef HashTable< dictionary, label, Hashthis_type
 The template instance used for this HashTable.
using node_type
 A table entry (node) that encapsulates the key/val tuple with an additional linked-list entry for hash collisions.
typedef label key_type
 The second template parameter, type of keys used.
typedef dictionary mapped_type
 The first template parameter, type of objects contained.
typedef dictionary value_type
 Same as mapped_type for OpenFOAM HashTables.
typedef Hash hasher
 The third template parameter, the hash index method.
typedef dictionarypointer
 Pointer type for storing into value_type objects.
typedef dictionaryreference
 Reference to the stored value_type.
typedef const dictionaryconst_pointer
 Const pointer type for the stored value_type.
typedef const dictionaryconst_reference
 Const reference to the stored value_type.
typedef label difference_type
 The type to represent the difference between two iterators.
typedef label size_type
 The type that can represent the size of a HashTable.
using key_iterator
 Forward iterator returning the key.
using const_key_iterator
 Forward const iterator returning the key.
Static Public Member Functions inherited from HashTableCore
static label canonicalSize (const label size) noexcept
 Return a canonical (power-of-two) of the requested size.
Static Public Attributes inherited from HashTableCore
static constexpr int32_t maxTableSize = (1 << (32-3))
 Maximum allowable internal table size (must be a power of two!).

Detailed Description

The boundaryRegion persistent data saved as a Map<dictionary>.

The meshReader supports boundaryRegion information.

The constant/boundaryRegion file is an IOMap<dictionary> that is used to save the information persistently. It contains the boundaryRegion information of the following form:

    (
        INT
        {
            BoundaryType    WORD;
            Label           WORD;
        }
        ...
    )
Source files

Definition at line 70 of file boundaryRegion.H.

Constructor & Destructor Documentation

◆ boundaryRegion() [1/3]

boundaryRegion ( const boundaryRegion & )
delete

No copy construct.

References boundaryRegion().

Referenced by boundaryRegion(), boundaryRegion(), operator=(), and ~boundaryRegion().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ boundaryRegion() [2/3]

boundaryRegion ( )
defaultnoexcept

Default construct.

References boundaryRegion(), name(), and Foam::noexcept.

Here is the call graph for this function:

◆ boundaryRegion() [3/3]

boundaryRegion ( const objectRegistry & obr,
const word & name = "boundaryRegion",
const fileName & instance = "constant" )
explicit

Read construct from registry, name, instance.

Definition at line 64 of file boundaryRegion.C.

References name(), and readDict().

Here is the call graph for this function:

◆ ~boundaryRegion()

Member Function Documentation

◆ push_back()

Foam::label push_back ( const dictionary & dict)

Add to the end, return index.

Definition at line 92 of file boundaryRegion.C.

References dict, insert(), and maxIndex().

Referenced by append(), and ~boundaryRegion().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ maxIndex()

Foam::label maxIndex ( ) const

The max table index, -1 if empty.

Definition at line 77 of file boundaryRegion.C.

References forAllConstIters.

Referenced by push_back(), and ~boundaryRegion().

Here is the caller graph for this function:

◆ findIndex()

Foam::label findIndex ( const word & name) const

The index corresponding to entry with 'Label' of given name, or -1 if not found.

Definition at line 152 of file boundaryRegion.C.

References dict, forAllConstIters, and name().

Referenced by ~boundaryRegion().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ name()

Foam::word name ( const label id) const

The 'Label' name corresponding to id, or boundaryRegion_ID if not otherwise defined.

Definition at line 133 of file boundaryRegion.C.

References HashTable< dictionary, label, Hash< label > >::cfind(), and Foam::name().

Referenced by boundaryRegion(), boundaryRegion(), boundaryType(), findIndex(), readDict(), writeDict(), and ~boundaryRegion().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ names() [1/2]

Foam::Map< Foam::word > names ( ) const

Return the extracted Map of (id => name).

Definition at line 101 of file boundaryRegion.C.

References Foam::names_impl().

Referenced by ~boundaryRegion().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ names() [2/2]

Foam::Map< Foam::word > names ( const wordRes & patterns) const

Return the extracted Map of (id => names) selected by patterns.

Definition at line 107 of file boundaryRegion.C.

References Foam::names_impl().

Here is the call graph for this function:

◆ boundaryTypes()

Foam::Map< Foam::word > boundaryTypes ( ) const

Return the extracted Map of (id => type).

Definition at line 113 of file boundaryRegion.C.

References HashTable< T, Key, Hash >::emplace(), forAllConstIters, Map< dictionary >::Map(), readIfPresent(), HashTable< T, Key, Hash >::reserve(), and HashTable< dictionary, label, Hash< label > >::size().

Referenced by ~boundaryRegion().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ boundaryType()

Foam::word boundaryType ( const word & name) const

Return BoundaryType corresponding to patch 'name', "patch" if not found.

Definition at line 174 of file boundaryRegion.C.

References Foam::findIndex(), name(), and HashTable< dictionary, label, Hash< label > >::operator[]().

Referenced by ~boundaryRegion().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readDict()

void readDict ( const objectRegistry & obr,
const word & name = "boundaryRegion",
const fileName & instance = "constant" )

Read constant/boundaryRegion.

Definition at line 188 of file boundaryRegion.C.

References HashTable< T, label, Hash< label > >::clear(), Foam::endl(), regIOobject::headerOk(), Foam::Info, name(), IOobjectOption::NO_REGISTER, IOobjectOption::NO_WRITE, and IOobjectOption::READ_IF_PRESENT.

Referenced by boundaryRegion(), and ~boundaryRegion().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeDict()

void writeDict ( const objectRegistry & obr,
const word & name = "boundaryRegion",
const fileName & instance = "constant" ) const

Write constant/boundaryRegion for later reuse.

Definition at line 222 of file boundaryRegion.C.

References Foam::endl(), Foam::Info, name(), IOobject::name(), IOobjectOption::NO_READ, IOobjectOption::NO_REGISTER, IOobjectOption::NO_WRITE, IOobject::note(), IOobject::objectPath(), IOobject::objectRelPath(), os(), IOobject::writeEndDivider(), and IOobject::writeHeader().

Referenced by ~boundaryRegion().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=() [1/2]

void operator= ( const boundaryRegion & rhs)

Copy assignment.

Definition at line 259 of file boundaryRegion.C.

References boundaryRegion(), Map< T >::operator=(), and Foam::rhs().

Here is the call graph for this function:

◆ operator=() [2/2]

void operator= ( const Map< dictionary > & rhs)

Assign from Map<dictionary>.

Definition at line 265 of file boundaryRegion.C.

References Map< dictionary >::Map(), Map< T >::operator=(), and Foam::rhs().

Here is the call graph for this function:

◆ rename()

void rename ( const dictionary & mapDict)

Rename regions.

each dictionary entry is a single word:

*     newPatchName    originalName;
* 

Definition at line 273 of file boundaryRegion.C.

References dict, DLListBase::empty(), Foam::findIndex(), forAllConstIters, Foam::Info, HashTable< T, Key, Hash >::insert(), Map< dictionary >::Map(), Foam::name(), Foam::nl, HashTable< dictionary, label, Hash< label > >::operator[](), HashTable< T, Key, Hash >::reserve(), and DLListBase::size().

Referenced by ~boundaryRegion().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ append()

label append ( const dictionary & dict)
inline

Add to the end, return index.

Definition at line 204 of file boundaryRegion.H.

References append(), dict, and push_back().

Referenced by append().

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following files: