PDRblock Class Reference

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...

Inheritance diagram for PDRblock:
Collaboration diagram for PDRblock:

Classes

struct  gridControl
 The begin/end nodes for each segment, with divisions and expansion for each segment. More...
 
class  location
 Grid locations in an axis direction. 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. More...
 
 PDRblock (const UList< scalar > &xgrid, const UList< scalar > &ygrid, const UList< scalar > &zgrid)
 Construct from components. More...
 
 PDRblock (const boundBox &box, const labelVector &nCells)
 Construct from cube with specified griding. More...
 
 PDRblock (const dictionary &dict, bool verboseOutput=false)
 Construct from dictionary. More...
 
bool read (const dictionary &dict)
 Read dictionary. More...
 
void reset (const UList< scalar > &xgrid, const UList< scalar > &ygrid, const UList< scalar > &zgrid)
 Reset grid locations and mesh i-j-k sizing. More...
 
void reset (const boundBox &box, const labelVector &nCells)
 Reset cube and mesh i-j-k sizing. More...
 
const Vector< location > & grid () const noexcept
 The grid point locations in the i,j,k (x,y,z) directions. More...
 
Vector< gradingDescriptorsgrading () const
 Equivalent edge grading descriptors in (x,y,z) directions. More...
 
gradingDescriptors grading (const direction cmpt) const
 Equivalent edge grading descriptors in specified (x,y,z) direction. More...
 
const boundBoxbounds () const noexcept
 The mesh bounding box. More...
 
const scalarMinMaxedgeLimits () const noexcept
 The min/max edge length. More...
 
scalar dx (const label i) const
 Cell size in x-direction at i position. More...
 
scalar dx (const labelVector &ijk) const
 Cell size in x-direction at i position. More...
 
scalar dy (const label j) const
 Cell size in y-direction at j position. More...
 
scalar dy (const labelVector &ijk) const
 Cell size in y-direction at j position. More...
 
scalar dz (const label k) const
 Cell size in z-direction at k position. More...
 
scalar dz (const labelVector &ijk) const
 Cell size in z-direction at k position. More...
 
vector span (const label i, const label j, const label k) const
 Cell dimensions at i,j,k position. More...
 
vector span (const labelVector &ijk) const
 Cell dimensions at i,j,k position. More...
 
point grid (const label i, const label j, const label k) const
 Grid point at i,j,k position. More...
 
point grid (const labelVector &ijk) const
 Grid point at i,j,k position. More...
 
point C (const label i, const label j, const label k) const
 Cell centre at i,j,k position. More...
 
point C (const labelVector &ijk) const
 Cell centre at i,j,k position. More...
 
scalar V (const label i, const label j, const label k) const
 Cell volume at i,j,k position. More...
 
scalar V (const labelVector &ijk) const
 Cell volume at i,j,k position. More...
 
scalar width (const label i, const label j, const label k) const
 Characteristic cell size at i,j,k position. More...
 
scalar width (const labelVector &ijk) const
 Characteristic cell size at i,j,k position. More...
 
labelVector findCell (const point &pt) const
 Return i,j,k index for cell enclosing this location. More...
 
labelVector gridIndex (const point &pt, const scalar relTol=0.01) const
 Obtain i,j,k grid index for point location within specified. More...
 
OstreamblockMeshDict (Ostream &os, const bool withHeader=false) const
 Output content for an equivalent blockMeshDict. More...
 
dictionary blockMeshDict () const
 Content for an equivalent blockMeshDict. More...
 
void writeBlockMeshDict (const IOobject &io) const
 Write an equivalent blockMeshDict. More...
 
autoPtr< polyMeshmesh (const IOobject &io) const
 Create polyMesh for grid definition and patch information. More...
 
autoPtr< polyMeshinnerMesh (const IOobject &io) const
 Create polyMesh for inner-mesh only, ignore any outer block definitions. More...
 
- Public Member Functions inherited from ijkMesh
 ijkMesh ()
 Construct zero-sized. More...
 
 ijkMesh (const labelVector &ijk)
 Construct with addressing. More...
 
 ijkMesh (const label nx, const label ny, const label nz)
 Construct with addressing. More...
 
label nPoints () const
 The number of mesh points (nx+1)*(ny+1)*(nz+1) in the i-j-k mesh. More...
 
label nCells () const
 The number of mesh cells (nx*ny*nz) in the i-j-k mesh. More...
 
label nFaces () const
 The total number of mesh faces in the i-j-k mesh. More...
 
label nInternalFaces () const
 The number of internal faces in the i-j-k mesh. More...
 
label nBoundaryFaces () const
 The number of boundary faces in the i-j-k mesh. More...
 
label nBoundaryFaces (const direction shapeFacei) const
 The number of boundary faces on the box face. More...
 
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() More...
 
label cellLabel (const labelVector &ijk) const
 The linear cell index for an i-j-k position - same as index() More...
 
label pointLabel (const label i, const label j, const label k) const
 The linear point index for an i-j-k position. More...
 
label pointLabel (const labelVector &ijk) const
 The linear point index for an i-j-k position. More...
 
hexCell vertLabels (const label i, const label j, const label k) const
 The hex cell vertices for an i-j-k position. More...
 
hexCell vertLabels (const labelVector &ijk) const
 The hex cell vertices for an i-j-k position. More...
 
- Public Member Functions inherited from ijkAddressing
 ijkAddressing ()
 Construct zero-size addressing. More...
 
 ijkAddressing (const labelVector &ijk)
 Construct with addressing. More...
 
 ijkAddressing (const label ni, const label nj, const label nk)
 Construct with addressing components. More...
 
bool empty () const
 Addressing is considered empty if any component is zero. More...
 
const labelVectorsizes () const
 The (i,j,k) addressing dimensions. More...
 
labelVectorsizes ()
 Return the (i,j,k) dimensions for modification. More...
 
label size () const
 Return the total i*j*k size. More...
 
const label & size (const vector::components cmpt) const
 The addressing dimension in the given direction. More...
 
void clear ()
 Reset to (0,0,0) sizing. More...
 
void reset (const label ni, const label nj, const label nk)
 Change the sizing parameters. More...
 
void reset (const labelVector &newSizes)
 Change the sizing parameters. More...
 
label index (const label i, const label j, const label k) const
 Linear addressing index (offset) for an (i,j,k) position. More...
 
label index (const labelVector &ijk) const
 Linear addressing index (offset) for an (i,j,k) position. More...
 
labelVector index (const label idx) const
 The (i,j,k) indexing from linear addressing. More...
 
void checkIndex (const label i, const label j, const label k, const bool allowExtra=false) const
 Check indices are within ni,nj,nk range. More...
 
void checkIndex (const labelVector &ijk, const bool allowExtra=false) const
 Check indices are within ni,nj,nk range. More...
 
void checkSizes () const
 Check that all components of sizes() are non-negative. More...
 
void checkSizes (const labelVector &other) const
 Check that all components of sizes() match. More...
 
void checkSizes (const label nTotal) const
 Check that the total size matches. More...
 

Static Public Member Functions

static const PDRblocknull ()
 Return a PDRblock reference to a nullObject. More...
 

Static Public Attributes

static const Enum< expansionTypeexpansionNames_
 Named enumerations for the expansion type. More...
 

Detailed Description

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.

Source files

Definition at line 149 of file PDRblock.H.

Member Enumeration Documentation

◆ expansionType

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.

Constructor & Destructor Documentation

◆ PDRblock() [1/4]

PDRblock ( )

Default construct, zero-size, inverted bounds etc.

Definition at line 520 of file PDRblock.C.

◆ PDRblock() [2/4]

PDRblock ( const UList< scalar > &  xgrid,
const UList< scalar > &  ygrid,
const UList< scalar > &  zgrid 
)

Construct from components.

Definition at line 527 of file PDRblock.C.

◆ PDRblock() [3/4]

PDRblock ( const boundBox box,
const labelVector nCells 
)

Construct from cube with specified griding.

Definition at line 540 of file PDRblock.C.

References ijkMesh::nCells(), and PDRblock::reset().

Here is the call graph for this function:

◆ PDRblock() [4/4]

PDRblock ( const dictionary dict,
bool  verboseOutput = false 
)
explicit

Construct from dictionary.

Definition at line 549 of file PDRblock.C.

References dict, and PDRblock::read().

Here is the call graph for this function:

Member Function Documentation

◆ null()

const Foam::PDRblock & null ( )
static

Return a PDRblock reference to a nullObject.

Definition at line 106 of file PDRblock.C.

◆ read()

bool read ( const dictionary dict)

Read dictionary.

Definition at line 569 of file PDRblock.C.

References dict, dictionary::findDict(), dictionary::getOrDefault(), Foam::Info, dictionary::read(), and dictionary::subDict().

Referenced by PDRblock::PDRblock().

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

◆ reset() [1/2]

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 606 of file PDRblock.C.

References Foam::expressions::Detail::nComponents().

Referenced by PDRblock::PDRblock().

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

◆ reset() [2/2]

void reset ( const boundBox box,
const labelVector nCells 
)

Reset cube and mesh i-j-k sizing.

Definition at line 639 of file PDRblock.C.

References boundBox::max(), boundBox::min(), Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().

Here is the call graph for this function:

◆ grid() [1/3]

const Vector<location>& grid ( ) const
inlinenoexcept

The grid point locations in the i,j,k (x,y,z) directions.

Definition at line 711 of file PDRblock.H.

◆ grading() [1/2]

Foam::Vector< Foam::gradingDescriptors > grading ( ) const

Equivalent edge grading descriptors in (x,y,z) directions.

Definition at line 736 of file PDRblock.C.

◆ grading() [2/2]

Foam::gradingDescriptors grading ( const direction  cmpt) const

Equivalent edge grading descriptors in specified (x,y,z) direction.

Definition at line 742 of file PDRblock.C.

References Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, and Y.

Here is the call graph for this function:

◆ bounds()

const boundBox& bounds ( ) const
inlinenoexcept

The mesh bounding box.

Definition at line 734 of file PDRblock.H.

◆ edgeLimits()

const scalarMinMax& edgeLimits ( ) const
inlinenoexcept

The min/max edge length.

Definition at line 739 of file PDRblock.H.

◆ dx() [1/2]

Foam::scalar dx ( const label  i) const
inline

Cell size in x-direction at i position.

Definition at line 140 of file PDRblockI.H.

Referenced by PDRblock::span(), and PDRblock::V().

Here is the caller graph for this function:

◆ dx() [2/2]

Foam::scalar dx ( const labelVector ijk) const
inline

Cell size in x-direction at i position.

Definition at line 146 of file PDRblockI.H.

References Vector< Cmpt >::x().

Here is the call graph for this function:

◆ dy() [1/2]

Foam::scalar dy ( const label  j) const
inline

Cell size in y-direction at j position.

Definition at line 152 of file PDRblockI.H.

Referenced by PDRblock::span(), and PDRblock::V().

Here is the caller graph for this function:

◆ dy() [2/2]

Foam::scalar dy ( const labelVector ijk) const
inline

Cell size in y-direction at j position.

Definition at line 158 of file PDRblockI.H.

References Vector< Cmpt >::y().

Here is the call graph for this function:

◆ dz() [1/2]

Foam::scalar dz ( const label  k) const
inline

Cell size in z-direction at k position.

Definition at line 164 of file PDRblockI.H.

References k.

Referenced by PDRblock::span(), and PDRblock::V().

Here is the caller graph for this function:

◆ dz() [2/2]

Foam::scalar dz ( const labelVector ijk) const
inline

Cell size in z-direction at k position.

Definition at line 170 of file PDRblockI.H.

References Vector< Cmpt >::z().

Here is the call graph for this function:

◆ span() [1/2]

Foam::vector span ( const label  i,
const label  j,
const label  k 
) const
inline

Cell dimensions at i,j,k position.

Definition at line 177 of file PDRblockI.H.

References PDRblock::dx(), PDRblock::dy(), PDRblock::dz(), and k.

Here is the call graph for this function:

◆ span() [2/2]

Foam::vector span ( const labelVector ijk) const
inline

Cell dimensions at i,j,k position.

Definition at line 187 of file PDRblockI.H.

References PDRblock::dx(), PDRblock::dy(), and PDRblock::dz().

Here is the call graph for this function:

◆ grid() [2/3]

Foam::point grid ( const label  i,
const label  j,
const label  k 
) const
inline

Grid point at i,j,k position.

Definition at line 194 of file PDRblockI.H.

References k.

◆ grid() [3/3]

Foam::point grid ( const labelVector ijk) const
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().

Here is the call graph for this function:

◆ C() [1/2]

Foam::point C ( const label  i,
const label  j,
const label  k 
) const
inline

Cell centre at i,j,k position.

Definition at line 217 of file PDRblockI.H.

References k.

◆ C() [2/2]

Foam::point C ( const labelVector ijk) const
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().

Here is the call graph for this function:

◆ V() [1/2]

Foam::scalar V ( const label  i,
const label  j,
const label  k 
) const
inline

Cell volume at i,j,k position.

Definition at line 240 of file PDRblockI.H.

References PDRblock::dx(), PDRblock::dy(), PDRblock::dz(), and k.

Referenced by PDRblock::width().

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

◆ V() [2/2]

Foam::scalar V ( const labelVector ijk) const
inline

Cell volume at i,j,k position.

Definition at line 250 of file PDRblockI.H.

References PDRblock::dx(), PDRblock::dy(), PDRblock::dz(), Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().

Here is the call graph for this function:

◆ width() [1/2]

Foam::scalar width ( const label  i,
const label  j,
const label  k 
) const
inline

Characteristic cell size at i,j,k position.

This is the cubic root of the volume

Definition at line 257 of file PDRblockI.H.

References Foam::cbrt(), k, and PDRblock::V().

Here is the call graph for this function:

◆ width() [2/2]

Foam::scalar width ( const labelVector ijk) const
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 PDRblock::V().

Here is the call graph for this function:

◆ findCell()

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 706 of file PDRblock.C.

References Foam::pos().

Here is the call graph for this function:

◆ gridIndex()

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 720 of file PDRblock.C.

References Foam::pos().

Here is the call graph for this function:

◆ blockMeshDict() [1/2]

◆ blockMeshDict() [2/2]

Foam::dictionary blockMeshDict ( ) const

Content for an equivalent blockMeshDict.

Definition at line 778 of file PDRblockBlockMesh.C.

References os(), and List< T >::transfer().

Here is the call graph for this function:

◆ writeBlockMeshDict()

◆ mesh()

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, io(), and Foam::nl.

Here is the call graph for this function:

◆ innerMesh()

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(), nPoints, patches, pts, PtrList< T >::set(), and IOobjectOption::writeOpt().

Here is the call graph for this function:

Member Data Documentation

◆ expansionNames_

const Foam::Enum< Foam::PDRblock::expansionType > expansionNames_
static

Named enumerations for the expansion type.

Definition at line 170 of file PDRblock.H.


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