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...
Classes | |
class | location |
Grid locations in an axis direction. More... | |
Public Types | |
enum | expansionType { EXPAND_UNIFORM, EXPAND_RATIO, EXPAND_RELATIVE } |
The expansion type. More... | |
Public Member Functions | |
PDRblock () | |
Construct zero-size. More... | |
PDRblock (const UList< scalar > &xgrid, const UList< scalar > &ygrid, const UList< scalar > &zgrid) | |
Construct from components. More... | |
PDRblock (const dictionary &dict, bool verbose=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... | |
const Vector< location > & | grid () const |
The grid point locations in the i,j,k (x,y,z) directions. More... | |
const boundBox & | bounds () const |
The mesh bounding box. More... | |
const scalar & | minEdgeLen () const |
The min 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... | |
autoPtr< polyMesh > | mesh (const IOobject &io) const |
Create polyMesh for grid definition and patch information. 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... | |
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 labelVector & | sizes () const |
The (i,j,k) addressing dimensions. More... | |
labelVector & | sizes () |
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 PDRblock & | null () |
Return a PDRblock reference to a nullObject. More... | |
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 |
The expansion type.
Enumerator | |
---|---|
EXPAND_UNIFORM | Uniform expansion (ie, no expansion) |
EXPAND_RATIO | End/start ratio. |
EXPAND_RELATIVE | Relative expansion ratio. |
Definition at line 158 of file PDRblock.H.
|
inline |
Construct zero-size.
Definition at line 30 of file PDRblockI.H.
PDRblock | ( | const UList< scalar > & | xgrid, |
const UList< scalar > & | ygrid, | ||
const UList< scalar > & | zgrid | ||
) |
Construct from components.
Definition at line 518 of file PDRblock.C.
References Foam::name().
|
explicit |
Construct from dictionary.
Definition at line 544 of file PDRblock.C.
References dict, and PDRblock::read().
|
static |
Return a PDRblock reference to a nullObject.
Definition at line 107 of file PDRblock.C.
bool read | ( | const dictionary & | dict | ) |
Read dictionary.
Definition at line 556 of file PDRblock.C.
References dict, dictionary::getOrDefault(), and dictionary::subDict().
Referenced by PDRblock::PDRblock().
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 583 of file PDRblock.C.
References VectorSpace< Vector< scalar >, scalar, 3 >::nComponents.
|
inline |
The grid point locations in the i,j,k (x,y,z) directions.
Definition at line 152 of file PDRblockI.H.
|
inline |
The mesh bounding box.
Definition at line 164 of file PDRblockI.H.
|
inline |
The min edge length.
Definition at line 158 of file PDRblockI.H.
|
inline |
Cell size in x-direction at i position.
Definition at line 170 of file PDRblockI.H.
|
inline |
Cell size in x-direction at i position.
Definition at line 176 of file PDRblockI.H.
References Vector< Cmpt >::x().
|
inline |
Cell size in y-direction at j position.
Definition at line 182 of file PDRblockI.H.
|
inline |
Cell size in y-direction at j position.
Definition at line 188 of file PDRblockI.H.
References Vector< Cmpt >::y().
|
inline |
|
inline |
Cell size in z-direction at k position.
Definition at line 200 of file PDRblockI.H.
References Vector< Cmpt >::z().
|
inline |
|
inline |
Cell dimensions at i,j,k position.
Definition at line 217 of file PDRblockI.H.
|
inline |
|
inline |
Grid point at i,j,k position.
Definition at line 234 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 257 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 280 of file PDRblockI.H.
References 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 287 of file PDRblockI.H.
References Foam::cbrt(), and k.
|
inline |
Characteristic cell size at i,j,k position.
This is the cubic root of the volume
Definition at line 297 of file PDRblockI.H.
References Foam::cbrt().
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 661 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 minEdgeLen. The value (-1,-1,-1) is returned for out-of-bounds (not found). and off-grid
Definition at line 675 of file PDRblock.C.
References Foam::pos().
Foam::autoPtr< Foam::polyMesh > mesh | ( | const IOobject & | io | ) | const |
Create polyMesh for grid definition and patch information.
Definition at line 303 of file PDRblockCreate.C.
References polyMesh::addPatches(), polyMesh::boundaryMesh(), meshPtr, autoPtr< T >::New(), polyPatch::New(), nPoints, patches, and PtrList< T >::set().