Loading...
Searching...
No Matches
ijkAddressing Class Reference

A simple i-j-k (row-major order) to linear addressing. More...

#include <ijkAddressing.H>

Inheritance diagram for ijkAddressing:

Public Member Functions

 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 labelVectorsizes () const noexcept
 The (i,j,k) addressing dimensions.
labelVectorsizes () 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.

Detailed Description

A simple i-j-k (row-major order) to linear addressing.

Source files

Definition at line 47 of file ijkAddressing.H.

Constructor & Destructor Documentation

◆ ijkAddressing() [1/3]

ijkAddressing ( )
inline

Construct zero-size addressing.

Definition at line 23 of file ijkAddressingI.H.

Referenced by ijkMesh::ijkMesh(), ijkMesh::ijkMesh(), and ijkMesh::ijkMesh().

Here is the caller graph for this function:

◆ ijkAddressing() [2/3]

ijkAddressing ( const labelVector & ijk)
inlineexplicit

Construct with addressing.

Definition at line 29 of file ijkAddressingI.H.

References checkSizes().

Here is the call graph for this function:

◆ ijkAddressing() [3/3]

ijkAddressing ( const label ni,
const label nj,
const label nk )
inline

Construct with addressing components.

Definition at line 39 of file ijkAddressingI.H.

References checkSizes().

Here is the call graph for this function:

Member Function Documentation

◆ empty()

bool empty ( ) const
inlinenoexcept

Addressing is considered empty if any component is zero.

Definition at line 56 of file ijkAddressingI.H.

References Foam::noexcept.

Referenced by ijkMesh::nBoundaryFaces(), ijkMesh::nBoundaryFaces(), ijkMesh::nFaces(), ijkMesh::nInternalFaces(), and ijkMesh::nPoints().

Here is the caller graph for this function:

◆ sizes() [1/2]

◆ sizes() [2/2]

labelVector & sizes ( )
inlinenoexcept

Return the (i,j,k) dimensions for modification.

Definition at line 94 of file ijkAddressing.H.

References Foam::noexcept.

◆ size() [1/2]

Foam::label size ( ) const
inlinenoexcept

Return the total i*j*k size.

Definition at line 62 of file ijkAddressingI.H.

References Foam::noexcept.

Referenced by checkSizes(), and ijkMesh::nCells().

Here is the caller graph for this function:

◆ size() [2/2]

Foam::label size ( const vector::components cmpt) const
inline

The addressing dimension in the given direction.

Definition at line 69 of file ijkAddressingI.H.

◆ clear()

void clear ( )
inline

Reset to (0,0,0) sizing.

Definition at line 78 of file ijkAddressingI.H.

◆ reset() [1/2]

void reset ( const label ni,
const label nj,
const label nk )
inline

Change the sizing parameters.

Definition at line 84 of file ijkAddressingI.H.

References checkSizes().

Here is the call graph for this function:

◆ reset() [2/2]

void reset ( const labelVector & newSizes)
inline

Change the sizing parameters.

Definition at line 101 of file ijkAddressingI.H.

References checkSizes().

Here is the call graph for this function:

◆ index() [1/3]

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

Linear addressing index (offset) for an (i,j,k) position.

Definition at line 111 of file ijkAddressingI.H.

References checkIndex(), and k.

Referenced by block::block(), ijkMesh::cellLabel(), ijkMesh::cellLabel(), block::declareRunTimeSelectionTable(), namedBlock::namedBlock(), block::New(), and namedBlock::TypeNameNoDebug().

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

◆ index() [2/3]

Foam::label index ( const labelVector & ijk) const
inline

Linear addressing index (offset) for an (i,j,k) position.

Definition at line 126 of file ijkAddressingI.H.

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

Here is the call graph for this function:

◆ index() [3/3]

Foam::labelVector index ( const label idx) const
inline

The (i,j,k) indexing from linear addressing.

Definition at line 136 of file ijkAddressingI.H.

◆ checkIndex() [1/2]

void checkIndex ( const label i,
const label j,
const label k,
const bool allowExtra = false ) const
inline

Check indices are within ni,nj,nk range.

Optionally allow an extra index for point addressing

Definition at line 149 of file ijkAddressingI.H.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, k, and Foam::nl.

Referenced by PDRblock::location::C(), checkIndex(), index(), index(), ijkMesh::pointLabel(), ijkMesh::pointLabel(), and PDRblock::location::width().

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

◆ checkIndex() [2/2]

void checkIndex ( const labelVector & ijk,
const bool allowExtra = false ) const
inline

Check indices are within ni,nj,nk range.

Optionally allow an extra index for point addressing

Definition at line 183 of file ijkAddressingI.H.

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

Here is the call graph for this function:

◆ checkSizes() [1/3]

void checkSizes ( ) const
inline

Check that all components of sizes() are non-negative.

Definition at line 193 of file ijkAddressingI.H.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, and Foam::nl.

Referenced by ijkAddressing(), ijkAddressing(), reset(), and reset().

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

◆ checkSizes() [2/3]

void checkSizes ( const labelVector & other) const
inline

Check that all components of sizes() match.

Definition at line 216 of file ijkAddressingI.H.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, and Foam::nl.

Here is the call graph for this function:

◆ checkSizes() [3/3]

void checkSizes ( const label nTotal) const
inline

Check that the total size matches.

Definition at line 228 of file ijkAddressingI.H.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, Foam::nl, and size().

Here is the call graph for this function:

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