A single block x-y-z rectilinear mesh addressable as i,j,k with simplified creation. Some of the input is similar to blockMeshDict, but since this specialization is for a single-block that is aligned with the x-y-z directions, it provides a different means of specifying the mesh. More...
#include <PDRblock.H>


Classes | |
| class | location |
| Grid locations in an axis direction. More... | |
| struct | gridControl |
| The begin/end nodes for each segment, with divisions and expansion for each segment. More... | |
Public Types | |
| enum | expansionType : uint8_t { EXPAND_UNIFORM , EXPAND_RATIO , EXPAND_RELATIVE } |
| The expansion type. More... | |
Public Member Functions | |
| PDRblock () | |
| Default construct, zero-size, inverted bounds etc. | |
| PDRblock (const UList< scalar > &xgrid, const UList< scalar > &ygrid, const UList< scalar > &zgrid) | |
| Construct from components. | |
| PDRblock (const boundBox &box, const labelVector &nCells) | |
| Construct from cube with specified griding. | |
| PDRblock (const dictionary &dict, bool verboseOutput=false) | |
| Construct from dictionary. | |
| bool | read (const dictionary &dict) |
| Read dictionary. | |
| void | reset (const UList< scalar > &xgrid, const UList< scalar > &ygrid, const UList< scalar > &zgrid) |
| Reset grid locations and mesh i-j-k sizing. | |
| void | reset (const boundBox &box, const labelVector &nCells) |
| Reset cube and mesh i-j-k sizing. | |
| const Vector< location > & | grid () const noexcept |
| The grid point locations in the i,j,k (x,y,z) directions. | |
| Vector< gradingDescriptors > | grading () const |
| Equivalent edge grading descriptors in (x,y,z) directions. | |
| gradingDescriptors | grading (const direction cmpt) const |
| Equivalent edge grading descriptors in specified (x,y,z) direction. | |
| const boundBox & | bounds () const noexcept |
| The mesh bounding box. | |
| const scalarMinMax & | edgeLimits () const noexcept |
| The min/max edge length. | |
| scalar | dx (const label i) const |
| Cell size in x-direction at i position. | |
| scalar | dx (const labelVector &ijk) const |
| Cell size in x-direction at i position. | |
| scalar | dy (const label j) const |
| Cell size in y-direction at j position. | |
| scalar | dy (const labelVector &ijk) const |
| Cell size in y-direction at j position. | |
| scalar | dz (const label k) const |
| Cell size in z-direction at k position. | |
| scalar | dz (const labelVector &ijk) const |
| Cell size in z-direction at k position. | |
| vector | span (const label i, const label j, const label k) const |
| Cell dimensions at i,j,k position. | |
| vector | span (const labelVector &ijk) const |
| Cell dimensions at i,j,k position. | |
| point | grid (const label i, const label j, const label k) const |
| Grid point at i,j,k position. | |
| point | grid (const labelVector &ijk) const |
| Grid point at i,j,k position. | |
| point | C (const label i, const label j, const label k) const |
| Cell centre at i,j,k position. | |
| point | C (const labelVector &ijk) const |
| Cell centre at i,j,k position. | |
| scalar | V (const label i, const label j, const label k) const |
| Cell volume at i,j,k position. | |
| scalar | V (const labelVector &ijk) const |
| Cell volume at i,j,k position. | |
| scalar | width (const label i, const label j, const label k) const |
| Characteristic cell size at i,j,k position. | |
| scalar | width (const labelVector &ijk) const |
| Characteristic cell size at i,j,k position. | |
| labelVector | findCell (const point &pt) const |
| Return i,j,k index for cell enclosing this location. | |
| labelVector | gridIndex (const point &pt, const scalar relTol=0.01) const |
| Obtain i,j,k grid index for point location within specified. | |
| Ostream & | blockMeshDict (Ostream &os, const bool withHeader=false) const |
| Output content for an equivalent blockMeshDict. | |
| dictionary | blockMeshDict () const |
| Content for an equivalent blockMeshDict. | |
| void | writeBlockMeshDict (const IOobject &io) const |
| Write an equivalent blockMeshDict. | |
| autoPtr< polyMesh > | mesh (const IOobject &io) const |
| Create polyMesh for grid definition and patch information. | |
| autoPtr< polyMesh > | innerMesh (const IOobject &io) const |
| Create polyMesh for inner-mesh only, ignore any outer block definitions. | |
| Public Member Functions inherited from ijkMesh | |
| ijkMesh () | |
| Construct zero-sized. | |
| ijkMesh (const labelVector &ijk) | |
| Construct with addressing. | |
| ijkMesh (const label nx, const label ny, const label nz) | |
| Construct with addressing. | |
| label | nPoints () const |
| The number of mesh points (nx+1)*(ny+1)*(nz+1) in the i-j-k mesh. | |
| label | nCells () const |
| The number of mesh cells (nx*ny*nz) in the i-j-k mesh. | |
| label | nFaces () const |
| The total number of mesh faces in the i-j-k mesh. | |
| label | nInternalFaces () const |
| The number of internal faces in the i-j-k mesh. | |
| label | nBoundaryFaces () const |
| The number of boundary faces in the i-j-k mesh. | |
| label | nBoundaryFaces (const direction shapeFacei) const |
| The number of boundary faces on the box face. | |
| label | cellLabel (const label i, const label j, const label k) const |
| The linear cell index for an i-j-k position - same as index(). | |
| label | cellLabel (const labelVector &ijk) const |
| The linear cell index for an i-j-k position - same as index(). | |
| label | pointLabel (const label i, const label j, const label k) const |
| The linear point index for an i-j-k position. | |
| label | pointLabel (const labelVector &ijk) const |
| The linear point index for an i-j-k position. | |
| hexCell | vertLabels (const label i, const label j, const label k) const |
| The hex cell vertices for an i-j-k position. | |
| hexCell | vertLabels (const labelVector &ijk) const |
| The hex cell vertices for an i-j-k position. | |
| Public Member Functions inherited from ijkAddressing | |
| ijkAddressing () | |
| Construct zero-size addressing. | |
| ijkAddressing (const labelVector &ijk) | |
| Construct with addressing. | |
| ijkAddressing (const label ni, const label nj, const label nk) | |
| Construct with addressing components. | |
| bool | empty () const noexcept |
| Addressing is considered empty if any component is zero. | |
| const labelVector & | sizes () const noexcept |
| The (i,j,k) addressing dimensions. | |
| labelVector & | sizes () noexcept |
| Return the (i,j,k) dimensions for modification. | |
| label | size () const noexcept |
| Return the total i*j*k size. | |
| label | size (const vector::components cmpt) const |
| The addressing dimension in the given direction. | |
| void | clear () |
| Reset to (0,0,0) sizing. | |
| void | reset (const label ni, const label nj, const label nk) |
| Change the sizing parameters. | |
| void | reset (const labelVector &newSizes) |
| Change the sizing parameters. | |
| label | index (const label i, const label j, const label k) const |
| Linear addressing index (offset) for an (i,j,k) position. | |
| label | index (const labelVector &ijk) const |
| Linear addressing index (offset) for an (i,j,k) position. | |
| labelVector | index (const label idx) const |
| The (i,j,k) indexing from linear addressing. | |
| void | checkIndex (const label i, const label j, const label k, const bool allowExtra=false) const |
| Check indices are within ni,nj,nk range. | |
| void | checkIndex (const labelVector &ijk, const bool allowExtra=false) const |
| Check indices are within ni,nj,nk range. | |
| void | checkSizes () const |
| Check that all components of sizes() are non-negative. | |
| void | checkSizes (const labelVector &other) const |
| Check that all components of sizes() match. | |
| void | checkSizes (const label nTotal) const |
| Check that the total size matches. | |
Static Public Member Functions | |
| static const PDRblock & | null () noexcept |
| Return a null PDRblock (reference to a nullObject). | |
Static Public Attributes | |
| static const Enum< expansionType > | expansionNames_ |
| Named enumerations for the expansion type. | |
A single block x-y-z rectilinear mesh addressable as i,j,k with simplified creation. Some of the input is similar to blockMeshDict, but since this specialization is for a single-block that is aligned with the x-y-z directions, it provides a different means of specifying the mesh.
Dictionary controls
| Property | Description | Required | Default |
|---|---|---|---|
x | X-direction grid specification | yes | |
y | Y-direction grid specification | yes | |
z | Z-direction grid specification | yes | |
scale | Point scaling | no | 1.0 |
expansion | Type of expansion (ratio/relative) | no | ratio |
boundary | Boundary patches | yes | |
defaultPatch | Default patch specification | no |
Grid coordinate controls
| Property | Description | Required | Default |
|---|---|---|---|
points | Locations defining the mesh segment | yes | |
nCells | Divisions per mesh segment | yes | |
ratios | Expansion values per segment | no |
A negative expansion value is trapped and treated as its reciprocal. by default, the expansion is as per blockMesh and represents the ratio of end-size / start-size for the section. Alternatively, the relative size can be given.
Definition at line 149 of file PDRblock.H.
| enum expansionType : uint8_t |
The expansion type.
| Enumerator | |
|---|---|
| EXPAND_UNIFORM | Uniform expansion (ie, no expansion). |
| EXPAND_RATIO | End/start ratio. |
| EXPAND_RELATIVE | Relative expansion ratio. |
Definition at line 160 of file PDRblock.H.
| PDRblock | ( | ) |
Default construct, zero-size, inverted bounds etc.
Definition at line 514 of file PDRblock.C.
References null(), and PDRblock().
Referenced by null(), PDRblock(), PDRblock(), and PDRblock().


| PDRblock | ( | const UList< scalar > & | xgrid, |
| const UList< scalar > & | ygrid, | ||
| const UList< scalar > & | zgrid ) |
Construct from components.
Definition at line 520 of file PDRblock.C.
References null(), PDRblock(), and reset().

| PDRblock | ( | const boundBox & | box, |
| const labelVector & | nCells ) |
Construct from cube with specified griding.
Definition at line 534 of file PDRblock.C.
References ijkMesh::nCells(), null(), PDRblock(), and reset().

|
explicit |
Construct from dictionary.
Definition at line 543 of file PDRblock.C.
References dict, and ijkMesh::ijkMesh().

|
inlinestaticnoexcept |
Return a null PDRblock (reference to a nullObject).
Definition at line 656 of file PDRblock.H.
References Foam::noexcept, Foam::NullObjectRef(), and PDRblock().
Referenced by PDRblock(), PDRblock(), and PDRblock().


| bool read | ( | const dictionary & | dict | ) |
Read dictionary.
Definition at line 563 of file PDRblock.C.
References dict, EXPAND_RATIO, expansionNames_, and Foam::Info.
| void reset | ( | const UList< scalar > & | xgrid, |
| const UList< scalar > & | ygrid, | ||
| const UList< scalar > & | zgrid ) |
Reset grid locations and mesh i-j-k sizing.
Definition at line 599 of file PDRblock.C.
References ijkMesh::nBoundaryFaces(), and VectorSpace< Form, Cmpt, Ncmpts >::nComponents.
Referenced by PDRblock(), and PDRblock().


| void reset | ( | const boundBox & | box, |
| const labelVector & | nCells ) |
Reset cube and mesh i-j-k sizing.
Definition at line 633 of file PDRblock.C.
References boundBox::max(), boundBox::min(), ijkMesh::nBoundaryFaces(), ijkMesh::nCells(), Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().

The grid point locations in the i,j,k (x,y,z) directions.
Definition at line 718 of file PDRblock.H.
References Foam::noexcept.
Referenced by PDRblock::location::reset().

| Foam::Vector< Foam::gradingDescriptors > grading | ( | ) | const |
Equivalent edge grading descriptors in (x,y,z) directions.
Definition at line 730 of file PDRblock.C.
Referenced by blockMeshDict().

| Foam::gradingDescriptors grading | ( | const direction | cmpt | ) | const |
Equivalent edge grading descriptors in specified (x,y,z) direction.
Definition at line 736 of file PDRblock.C.
References Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, Vector< scalar >::X, Vector< scalar >::Y, and Vector< scalar >::Z.

|
inlinenoexcept |
The mesh bounding box.
Definition at line 741 of file PDRblock.H.
References Foam::noexcept.
Referenced by blockMeshDict().

|
inlinenoexcept |
|
inline |
|
inline |
Cell size in x-direction at i position.
Definition at line 146 of file PDRblockI.H.
References Vector< Cmpt >::x().

|
inline |
|
inline |
Cell size in y-direction at j position.
Definition at line 158 of file PDRblockI.H.
References Vector< Cmpt >::y().

|
inline |
|
inline |
Cell size in z-direction at k position.
Definition at line 170 of file PDRblockI.H.
References Vector< Cmpt >::z().

|
inline |
Cell dimensions at i,j,k position.
Definition at line 176 of file PDRblockI.H.
References dx(), dy(), dz(), and k.
Referenced by PDRblock::location::reset().


|
inline |
Cell dimensions at i,j,k position.
Definition at line 187 of file PDRblockI.H.
References dx(), dy(), and dz().

|
inline |
|
inline |
Grid point at i,j,k position.
Definition at line 204 of file PDRblockI.H.
References Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().

|
inline |
|
inline |
Cell centre at i,j,k position.
Definition at line 227 of file PDRblockI.H.
References Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().

|
inline |
|
inline |
Cell volume at i,j,k position.
Definition at line 250 of file PDRblockI.H.
References dx(), dy(), dz(), Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().

|
inline |
Characteristic cell size at i,j,k position.
This is the cubic root of the volume
Definition at line 256 of file PDRblockI.H.
References Foam::cbrt(), k, and V().

|
inline |
Characteristic cell size at i,j,k position.
This is the cubic root of the volume
Definition at line 267 of file PDRblockI.H.
References Foam::cbrt(), and V().

| Foam::labelVector findCell | ( | const point & | pt | ) | const |
Return i,j,k index for cell enclosing this location.
The value (-1,-1,-1) is returned for out-of-bounds (not found).
Definition at line 700 of file PDRblock.C.
References Foam::pos().

| Foam::labelVector gridIndex | ( | const point & | pt, |
| const scalar | relTol = 0.01 ) const |
Obtain i,j,k grid index for point location within specified.
relative tolerance of the min edge length The value (-1,-1,-1) is returned for out-of-bounds (not found). and off-grid
Definition at line 713 of file PDRblock.C.
References Foam::pos().

| Foam::Ostream & blockMeshDict | ( | Ostream & | os, |
| const bool | withHeader = false ) const |
Output content for an equivalent blockMeshDict.
Optionally generate header/footer content
Definition at line 230 of file PDRblockBlockMesh.C.
References DynamicList< T, SizeMin >::append(), Foam::begIndentList(), bounds(), boundBox::centre(), e, Foam::endIndentList(), EXPAND_RATIO, grading(), cellModel::HEX, Foam::hex(), Foam::indent(), HashSet< Key, Hash >::insert(), io, boundBox::max(), Foam::max(), boundBox::min(), Foam::min(), Time::New(), Foam::nl, IOobjectOption::NO_READ, IOobjectOption::NO_REGISTER, IOobjectOption::NO_WRITE, os(), Foam::outputIndent(), boundBox::points(), Foam::projGeomName, cellModel::ref(), Foam::relativeToGeometricRatio(), Foam::serializeFace(), Foam::serializeHex(), Foam::serializeProjectEdge(), Foam::serializeProjectFace(), Foam::serializeProjectPoints(), UList< T >::size(), ijkAddressing::sizes(), HashTable< T, Key, Hash >::sortedToc(), boundBox::span(), IOobject::writeEndDivider(), IOobject::writeHeader(), Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().
Referenced by blockMeshDict(), and writeBlockMeshDict().


| Foam::dictionary blockMeshDict | ( | ) | const |
Content for an equivalent blockMeshDict.
Definition at line 778 of file PDRblockBlockMesh.C.
References blockMeshDict(), dictionary, os(), and List< T >::transfer().

| void writeBlockMeshDict | ( | const IOobject & | io | ) | const |
Write an equivalent blockMeshDict.
Definition at line 790 of file PDRblockBlockMesh.C.
References blockMeshDict(), IOobject::db(), IOstream::defaultPrecision(), Foam::endl(), Foam::Info, io, Foam::max(), Foam::nl, IOobjectOption::NO_READ, IOobjectOption::NO_REGISTER, IOobjectOption::NO_WRITE, IOobject::objectPath(), os(), TimePaths::relativePath(), objectRegistry::time(), IOobject::writeEndDivider(), and IOobject::writeHeader().

| Foam::autoPtr< Foam::polyMesh > mesh | ( | const IOobject & | io | ) | const |
Create polyMesh for grid definition and patch information.
Definition at line 374 of file PDRblockCreate.C.
References Foam::Info, innerMesh(), io, and Foam::nl.

| Foam::autoPtr< Foam::polyMesh > innerMesh | ( | const IOobject & | io | ) | const |
Create polyMesh for inner-mesh only, ignore any outer block definitions.
Definition at line 297 of file PDRblockCreate.C.
References polyMesh::addPatches(), IOobjectOption::AUTO_WRITE, UList< T >::begin(), polyMesh::boundaryMesh(), io, meshPtr, autoPtr< T >::New(), polyPatch::New(), ijkMesh::nFaces(), ijkMesh::nInternalFaces(), nPoints, patches, pts, and IOobjectOption::writeOpt().
Referenced by mesh().


|
static |
Named enumerations for the expansion type.
Definition at line 170 of file PDRblock.H.
Referenced by read().