ijkMesh Class Reference

A simple i-j-k (row-major order) to linear addressing for a rectilinear mesh. Since the underlying mesh is rectilinear, some mesh-related sizing information can be derived directly from the addressing information. More...

Inheritance diagram for ijkMesh:
[legend]
Collaboration diagram for ijkMesh:
[legend]

Public Member Functions

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

Detailed Description

A simple i-j-k (row-major order) to linear addressing for a rectilinear mesh. Since the underlying mesh is rectilinear, some mesh-related sizing information can be derived directly from the addressing information.

Source files

Definition at line 57 of file ijkMesh.H.

Constructor & Destructor Documentation

◆ ijkMesh() [1/3]

ijkMesh ( )
inline

Construct zero-sized.

Definition at line 30 of file ijkMeshI.H.

◆ ijkMesh() [2/3]

ijkMesh ( const labelVector ijk)
inlineexplicit

Construct with addressing.

Definition at line 36 of file ijkMeshI.H.

◆ ijkMesh() [3/3]

ijkMesh ( const label  nx,
const label  ny,
const label  nz 
)
inline

Construct with addressing.

Definition at line 43 of file ijkMeshI.H.

Member Function Documentation

◆ nPoints()

Foam::label nPoints ( ) const
inline

The number of mesh points (nx+1)*(ny+1)*(nz+1) in the i-j-k mesh.

Definition at line 55 of file ijkMeshI.H.

References ijkAddressing::empty(), n, and ijkAddressing::sizes().

Referenced by Foam::operator<<().

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

◆ nCells()

Foam::label nCells ( ) const
inline

The number of mesh cells (nx*ny*nz) in the i-j-k mesh.

This is the same as the ijkAddressing::size()

Definition at line 68 of file ijkMeshI.H.

References ijkAddressing::size().

Referenced by PDRblock::location::checkIndex(), and Foam::operator<<().

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

◆ nFaces()

Foam::label nFaces ( ) const
inline

The total number of mesh faces in the i-j-k mesh.

Definition at line 74 of file ijkMeshI.H.

References ijkAddressing::empty(), n, and ijkAddressing::sizes().

Referenced by Foam::operator<<().

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

◆ nInternalFaces()

Foam::label nInternalFaces ( ) const
inline

The number of internal faces in the i-j-k mesh.

Definition at line 92 of file ijkMeshI.H.

References ijkAddressing::empty(), n, and ijkAddressing::sizes().

Referenced by Foam::operator<<().

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

◆ nBoundaryFaces() [1/2]

Foam::label nBoundaryFaces ( ) const
inline

The number of boundary faces in the i-j-k mesh.

Definition at line 110 of file ijkMeshI.H.

References ijkAddressing::empty(), n, and ijkAddressing::sizes().

Here is the call graph for this function:

◆ nBoundaryFaces() [2/2]

Foam::label nBoundaryFaces ( const direction  shapeFacei) const
inline

The number of boundary faces on the box face.

Face: 0=x-min, 1=x-max, 2=y-min, 3=y-max, 4=z-min, 5=z-max

Definition at line 129 of file ijkMeshI.H.

References ijkAddressing::empty(), n, and ijkAddressing::sizes().

Here is the call graph for this function:

◆ cellLabel() [1/2]

Foam::label cellLabel ( const label  i,
const label  j,
const label  k 
) const
inline

The linear cell index for an i-j-k position - same as index()

Definition at line 166 of file ijkMeshI.H.

References ijkAddressing::index(), and k.

Here is the call graph for this function:

◆ cellLabel() [2/2]

Foam::label cellLabel ( const labelVector ijk) const
inline

The linear cell index for an i-j-k position - same as index()

Definition at line 176 of file ijkMeshI.H.

References ijkAddressing::index().

Here is the call graph for this function:

◆ pointLabel() [1/2]

Foam::label pointLabel ( const label  i,
const label  j,
const label  k 
) const
inline

The linear point index for an i-j-k position.

Addressable in the range (ni+1, nj+1, nk+1).

Definition at line 183 of file ijkMeshI.H.

References k, and n.

Referenced by Foam::facePoint(), Foam::facePointN(), and ijkMesh::vertLabels().

Here is the caller graph for this function:

◆ pointLabel() [2/2]

Foam::label pointLabel ( const labelVector ijk) const
inline

The linear point index for an i-j-k position.

Addressable in the range (ni+1, nj+1, nk+1).

Definition at line 199 of file ijkMeshI.H.

References n, Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().

Here is the call graph for this function:

◆ vertLabels() [1/2]

Foam::hexCell vertLabels ( const label  i,
const label  j,
const label  k 
) const

The hex cell vertices for an i-j-k position.

Definition at line 33 of file ijkMesh.C.

References k, and ijkMesh::pointLabel().

Here is the call graph for this function:

◆ vertLabels() [2/2]

Foam::hexCell vertLabels ( const labelVector ijk) const

The hex cell vertices for an i-j-k position.

Definition at line 50 of file ijkMesh.C.

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

Here is the call graph for this function:

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