A multi-block mesh generator. More...
#include <blockMesh.H>


Public Types | |
| enum | mergeStrategy { DEFAULT_MERGE , MERGE_TOPOLOGY , MERGE_POINTS } |
| The block merging strategy. More... | |
| typedef PtrList< block > | blockList |
| The list of blocks is stored as a PtrList. | |
| Public Types inherited from UPtrList< T > | |
| typedef T | value_type |
| Type of values the list contains. | |
| typedef T & | reference |
| A non-const reference to the value_type. | |
| typedef const T & | const_reference |
| A const reference to the value_type. | |
Public Member Functions | |
| ClassName ("blockMesh") | |
| Runtime type information. | |
| blockMesh (const IOdictionary &dict, const word ®ionName=polyMesh::defaultRegion, mergeStrategy strategy=mergeStrategy::DEFAULT_MERGE, int verbosity=0) | |
| Construct from IOdictionary for given region. | |
| ~blockMesh ()=default | |
| Destructor. | |
| const dictionary & | meshDict () const noexcept |
| Access to input dictionary. | |
| const searchableSurfaces & | geometry () const noexcept |
| Optional searchable geometry to project face-points to. | |
| const blockEdgeList & | edges () const noexcept |
| The curved edges. | |
| const blockFaceList & | faces () const noexcept |
| The curved faces. | |
| bool | good () const noexcept |
| True if the blockMesh topology exists. | |
| bool | valid () const noexcept |
| Same as good(). | |
| wordList | patchNames () const |
| Return the patch names. | |
| label | numZonedBlocks () const |
| Number of blocks with specified zones. | |
| bool | hasPointTransforms () const noexcept |
| True if scaling and/or transformations are needed. | |
| bool | inplacePointTransforms (pointField &pts) const |
| Apply coordinate transforms and scaling. | |
| tmp< pointField > | globalPosition (const pointField &localPoints) const |
| Apply coordinate transforms and scaling. | |
| const pointField & | vertices () const noexcept |
| Reference to point field defining the blocks, these points are unscaled and non-transformed. | |
| tmp< pointField > | vertices (bool applyTransform) const |
| Point field defining the blocks, optionally transformed and scaled. | |
| const polyMesh & | topology () const |
| The blockMesh topology as a polyMesh unscaled and non-transformed. | |
| refPtr< polyMesh > | topology (bool applyTransform) const |
| The blockMesh topology as a polyMesh optionally transformed and scaled. | |
| const pointField & | points () const |
| The points for the entire mesh. These points are scaled and transformed. | |
| const cellShapeList & | cells () const |
| Return cell shapes list. | |
| const faceListList & | patches () const |
| Return the patch face lists. | |
| PtrList< dictionary > | patchDicts () const |
| Patch information from the topology mesh. | |
| int | verbose () const noexcept |
| Output verbosity level. | |
| int | verbose (const int level) noexcept |
| Change the output verbosity level. | |
| autoPtr< polyMesh > | mesh (const IOobject &io) const |
| Create polyMesh, with cell zones. | |
| scalar | scaleFactor () const |
| Old (v2106 and earlier) uniform scaling factor. | |
| Public Member Functions inherited from PtrList< block > | |
| constexpr | PtrList () noexcept |
| Default construct. | |
| PtrList (const label len) | |
| Construct with specified size, each element initialized to nullptr. | |
| PtrList (const PtrList< block > &list) | |
| Copy construct using 'clone()' method on each element. | |
| PtrList (PtrList< block > &&list) noexcept | |
| Move construct. | |
| PtrList (UList< block * > &list) | |
| Take ownership of pointers in the list, set old pointers to null. | |
| PtrList (const PtrList< block > &list, const CloneArg &cloneArgs) | |
| Copy construct using 'clone()' method on each element. | |
| PtrList (PtrList< block > &list, bool reuse) | |
| Construct as copy or re-use as specified. | |
| PtrList (const SLPtrList< block > &list) | |
| Copy construct using 'clone()' on each element of SLPtrList<T>. | |
| PtrList (Istream &is, const INew &inew) | |
| Construct from Istream using given Istream constructor class. | |
| PtrList (Istream &is) | |
| Construct from Istream using default Istream constructor class. | |
| ~PtrList () | |
| Destructor. Frees all pointers. | |
| PtrList< block > | clone (Args &&... args) const |
| Make a copy by cloning each of the list elements. | |
| const block * | 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. | |
| block & | 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 (block *ptr) |
| Append an element to the end of the list. | |
| void | push_back (std::unique_ptr< block > &&ptr) |
| Move append an element to the end of the list. | |
| void | push_back (autoPtr< block > &&ptr) |
| Move append an element to the end of the list. | |
| void | push_back (const refPtr< block > &ptr) |
| Move or clone append a refPtr to the end of the list. | |
| void | push_back (const tmp< block > &ptr) |
| Move or clone append a tmp to the end of the list. | |
| void | push_back (PtrList< block > &&other) |
| Move append another list to the end of this list. | |
| block & | emplace_set (const label i, Args &&... args) |
| Construct and set a new element at given position, (discard old element at that location). | |
| block & | emplace (const label i, Args &&... args) |
| Same as emplace_set(). | |
| block & | try_emplace (const label i, Args &&... args) |
| Like emplace_set() but will not overwrite an occupied (non-null) location. | |
| autoPtr< block > | set (const label i, block *ptr) |
| Set element to given pointer and return old element (can be null). | |
| autoPtr< block > | set (const label i, std::unique_ptr< block > &&ptr) |
| Set element to given unique_ptr and return old element. | |
| autoPtr< block > | set (const label i, autoPtr< block > &&ptr) |
| Set element to given autoPtr and return old element. | |
| autoPtr< block > | set (const label i, const refPtr< block > &ptr) |
| Set element to given refPtr and return old element. | |
| autoPtr< block > | set (const label i, const tmp< block > &ptr) |
| Set element to given tmp and return old element. | |
| autoPtr< block > | release (const label i) |
| Release ownership of the pointer at the given position. | |
| void | transfer (PtrList< block > &list) |
| Transfer into this list and annul the argument list. | |
| void | operator= (const UPtrList< block > &list) |
| Copy assignment. | |
| void | operator= (const PtrList< block > &list) |
| Copy assignment. | |
| void | operator= (PtrList< block > &&list) |
| Move assignment. | |
| void | push_back (autoPtr< block > &ptr)=delete |
| Disallow push_back with autoPtr without std::move. | |
| autoPtr< block > | set (const label i, autoPtr< block > &ptr) |
| Set element to given autoPtr and return old element. | |
| void | setSize (const label n) |
| Same as resize(). | |
| void | append (autoPtr< block > &ptr) |
| Move append an element to the end of the list. | |
| void | append (block *ptr) |
| Append an element to the end of the list. | |
| void | append (std::unique_ptr< block > &&ptr) |
| Move append an element to the end of the list. | |
| void | append (autoPtr< block > &&ptr) |
| Move append an element to the end of the list. | |
| void | append (const refPtr< block > &ptr) |
| Move or clone append a tmp to the end of the list. | |
| void | append (const tmp< block > &ptr) |
| Move or clone append a tmp to the end of the list. | |
| void | append (PtrList< block > &&other) |
| Move append another list to the end of this list. | |
| Foam::PtrList< block > | clone (Args &&... args) const |
| Public Member Functions inherited from UPtrList< T > | |
| constexpr | UPtrList () noexcept=default |
| Default construct. | |
| UPtrList (const label len) | |
Construct with specified size and set all entries to nullptr. | |
| UPtrList (const UPtrList< T > &list) | |
| Copy construct (shallow copies addresses). | |
| UPtrList (UPtrList< T > &&list) noexcept | |
| Move construct. | |
| UPtrList (UPtrList< T > &list, bool reuse) | |
| Construct as shallow copy or re-use as specified. | |
| UPtrList (PtrList< T > &list) | |
| Shallow copy from PtrList. | |
| UPtrList (const UList< T * > &list) | |
| Construct from UList of pointers (shallow copy). | |
| UPtrList (UList< T > &list) | |
| Construct from UList, taking the address of each list element. | |
| 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. | |
| T & | front () |
| Reference to the first element of the list. | |
| const T & | front () const |
| Reference to first element of the list. | |
| T & | back () |
| Reference to the last element of the list. | |
| const T & | back () const |
| Reference to the last element of the list. | |
| const T * | 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 T * | get (const label i) const |
| Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie, with bounds checking). | |
| T * | get (const label i) |
| Return pointer to element (can be nullptr), or nullptr for out-of-range access (ie, with bounds checking). | |
| const T * | 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 (T *ptr) |
| Append an element to the end of the list. | |
| void | push_back (UPtrList< T > &&other) |
| Move append another list to the end of this list. | |
| void | swap (UPtrList< T > &list) noexcept |
| Swap content. | |
| void | transfer (UPtrList< T > &list) |
| Transfer contents into this list and annul the argument. | |
| T * | set (const label i, T *ptr) |
| Set element to specified pointer and return the old list element, which can be a nullptr. | |
| 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 T & | at (const label i) const |
| Return const reference to the element at given position. FatalError for bounds problem or nullptr. | |
| T & | at (const label i) |
| Return reference to the element at given position. FatalError for bounds problem or nullptr. | |
| const T & | operator[] (const label i) const |
| Return const reference to the element at given position. FatalError for bounds problem or nullptr. Same as at(). | |
| T & | operator[] (const label i) |
| Return 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 T *operator()(const label i) const | |
| Deprecated(2022-09) - same as get(). | |
| void | operator= (const UPtrList< T > &list) |
| Copy assignment (shallow copies addresses). | |
| void | operator= (UPtrList< T > &&list) |
| Move assignment. | |
| 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. | |
| T ** | begin_ptr () noexcept |
| Iterator to begin of raw pointers traversal (use with caution). | |
| T ** | 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. | |
| const_iterator | begin () const |
| Return const_iterator to begin traversal of non-nullptr entries. | |
| const_iterator | end () const noexcept |
| Return const_iterator beyond end of UPtrList traversal. | |
| void | setSize (const label n) |
| Alias for resize(). | |
| T & | first () |
| Reference to the first element of the list. | |
| const T & | first () const |
| Return reference to first element of the list. | |
| T & | last () |
| Return reference to the last element of the list. | |
| const T & | last () const |
| Return reference to the last element of the list. | |
| void | append (T *ptr) |
| Append an element to the end of the list. | |
| void | append (UPtrList< T > &&other) |
| Move append another list to the end of this list. | |
| label | count () const noexcept |
| The number of non-nullptr entries in the list. | |
Static Public Attributes | |
| static bool | verboseOutput = true |
| The default verbosity (true). | |
Additional Inherited Members | |
| Protected Member Functions inherited from PtrList< block > | |
| void | readIstream (Istream &is, const INew &inew) |
| Read from Istream using Istream constructor class. | |
| Protected Member Functions inherited from UPtrList< T > | |
| 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< T > &&ptrs) noexcept | |
| Low-level move construct. | |
| Protected Attributes inherited from UPtrList< T > | |
| Detail::PtrListDetail< T > | ptrs_ |
| The list of pointers. | |
A multi-block mesh generator.
Dictionary controls
| Property | Description | Required | Default |
|---|---|---|---|
prescale | Point scaling before transform | no | 1.0 |
scale | Point scaling after transform | no | 1.0 |
transform | Point transform (origin, rotation) | no | |
vertices | yes | ||
blocks | yes | ||
edges | no | ||
faces | no | ||
boundary | Boundary definition | no | |
patches | Alternate version for "boundary" | no | |
namedBlocks | no | ||
namedVertices | no | ||
mergeType | Merging "points" or "topology" | no | topology |
checkFaceCorrespondence | no | true | |
verbose | no | true |
prescale and scale can be a single scalar or a vector of values.The vertices, cells and patches for filling the blocks are demand-driven.
Definition at line 161 of file blockMesh.H.
The list of blocks is stored as a PtrList.
Definition at line 172 of file blockMesh.H.
| enum mergeStrategy |
The block merging strategy.
| Enumerator | |
|---|---|
| DEFAULT_MERGE | Default (TOPOLOGY), not selectable. |
| MERGE_TOPOLOGY | "topology" merge by block topology (default) |
| MERGE_POINTS | "points" merge by point geometry |
Definition at line 180 of file blockMesh.H.
|
explicit |
Construct from IOdictionary for given region.
Default is topological merging.
Definition at line 221 of file blockMesh.C.
References DEFAULT_MERGE, dict, Foam::endl(), found, Foam::getVerbosity(), Foam::Info, MERGE_POINTS, Foam::nl, regionName, and vertices().

|
default |
Destructor.
| ClassName | ( | "blockMesh" | ) |
Runtime type information.
References DEFAULT_MERGE, polyMesh::defaultRegion, dict, and regionName.
|
inlinenoexcept |
|
inlinenoexcept |
Optional searchable geometry to project face-points to.
Definition at line 442 of file blockMesh.H.
References Foam::noexcept.
|
inlinenoexcept |
|
inlinenoexcept |
|
noexcept |
True if the blockMesh topology exists.
Definition at line 300 of file blockMesh.C.
References Foam::noexcept.
Referenced by valid().

|
inlinenoexcept |
Same as good().
Definition at line 471 of file blockMesh.H.
References good(), Foam::noexcept, and valid().
Referenced by valid().


| Foam::wordList patchNames | ( | ) | const |
Return the patch names.
Definition at line 396 of file blockMesh.C.
References topology().
Referenced by mesh().


| Foam::label numZonedBlocks | ( | ) | const |
Number of blocks with specified zones.
Definition at line 414 of file blockMesh.C.
References UPtrList< T >::count().
Referenced by mesh().


|
noexcept |
True if scaling and/or transformations are needed.
Definition at line 432 of file blockMesh.C.
References Foam::noexcept.
Referenced by globalPosition(), topology(), and vertices().

| bool inplacePointTransforms | ( | pointField & | pts | ) | const |
Apply coordinate transforms and scaling.
Definition at line 438 of file blockMesh.C.
References Foam::cmptMultiply(), p, pts, and Foam::transform().
Referenced by globalPosition(), topology(), and vertices().


| Foam::tmp< Foam::pointField > globalPosition | ( | const pointField & | localPoints | ) | const |
Apply coordinate transforms and scaling.
Definition at line 511 of file blockMesh.C.
References hasPointTransforms(), inplacePointTransforms(), and tmp< T >::New().

|
noexcept |
Reference to point field defining the blocks, these points are unscaled and non-transformed.
Definition at line 320 of file blockMesh.C.
References Foam::noexcept.
Referenced by blockMesh().

| Foam::tmp< Foam::pointField > vertices | ( | bool | applyTransform | ) | const |
Point field defining the blocks, optionally transformed and scaled.
Definition at line 327 of file blockMesh.C.
References hasPointTransforms(), inplacePointTransforms(), and tmp< T >::New().

| const Foam::polyMesh & topology | ( | ) | const |
The blockMesh topology as a polyMesh unscaled and non-transformed.
Definition at line 287 of file blockMeshCreate.C.
References Foam::exit(), Foam::FatalError, and FatalErrorInFunction.
Referenced by patchDicts(), patchNames(), and topology().


| Foam::refPtr< Foam::polyMesh > topology | ( | bool | applyTransform | ) | const |
The blockMesh topology as a polyMesh optionally transformed and scaled.
Definition at line 301 of file blockMeshCreate.C.
References polyMesh::boundaryMesh(), PtrList< block >::clone(), polyMesh::faceNeighbour(), polyMesh::faceOwner(), polyMesh::faces(), forAll, hasPointTransforms(), inplacePointTransforms(), refPtr< T >::New(), IOobjectOption::NO_READ, IOobjectOption::NO_WRITE, polyMesh::points(), IOobjectOption::registerObject(), PtrList< T >::set(), UPtrList< T >::size(), topology(), and topoMesh.

| const Foam::pointField & points | ( | ) | const |
The points for the entire mesh. These points are scaled and transformed.
Definition at line 363 of file blockMesh.C.
Referenced by mesh().

| const Foam::cellShapeList & cells | ( | ) | const |
Return cell shapes list.
Definition at line 374 of file blockMesh.C.
Referenced by mesh().

| const Foam::faceListList & patches | ( | ) | const |
Return the patch face lists.
Definition at line 385 of file blockMesh.C.
Referenced by mesh().

| Foam::PtrList< Foam::dictionary > patchDicts | ( | ) | const |
Patch information from the topology mesh.
Definition at line 342 of file blockMesh.C.
References forAll, os(), patchDicts(), patchDicts, PtrList< block >::PtrList(), ISpanStream::reset(), UPtrList< T >::size(), and topology().
Referenced by mesh(), and patchDicts().


|
noexcept |
|
noexcept |
| Foam::autoPtr< Foam::polyMesh > mesh | ( | const IOobject & | io | ) | const |
Create polyMesh, with cell zones.
Definition at line 348 of file blockMeshCreate.C.
References polyMesh::addZones(), List< T >::append(), b, cells(), polyMesh::cellZones(), HashTable< T, Key, Hash >::cfind(), ZoneMesh< ZoneType, MeshType >::clear(), Foam::endl(), polyMesh::faceZones(), forAllConstIters, Foam::Info, HashTable< T, Key, Hash >::insert(), io, meshPtr, autoPtr< T >::New(), Foam::nl, numZonedBlocks(), patchDicts(), patches(), patchNames(), points(), polyMesh::pointZones(), HashTable< T, Key, Hash >::size(), and UPtrList< T >::size().

|
inline |
Old (v2106 and earlier) uniform scaling factor.
Definition at line 583 of file blockMesh.H.
References scaleFactor().
Referenced by scaleFactor().


|
static |
The default verbosity (true).
Definition at line 396 of file blockMesh.H.
Referenced by Foam::getVerbosity().