ijkAddressing Class Reference

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

Inheritance diagram for ijkAddressing:
[legend]

Public Member Functions

 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.

Source files

Definition at line 51 of file ijkAddressing.H.

Constructor & Destructor Documentation

◆ ijkAddressing() [1/3]

ijkAddressing ( )
inline

Construct zero-size addressing.

Definition at line 30 of file ijkAddressingI.H.

◆ ijkAddressing() [2/3]

ijkAddressing ( const labelVector ijk)
inlineexplicit

Construct with addressing.

Definition at line 36 of file ijkAddressingI.H.

References ijkAddressing::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 47 of file ijkAddressingI.H.

Member Function Documentation

◆ empty()

bool empty ( ) const
inline

Addressing is considered empty if any component is zero.

Definition at line 63 of file ijkAddressingI.H.

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

Here is the caller graph for this function:

◆ sizes() [1/2]

const Foam::labelVector & sizes ( ) const
inline

The (i,j,k) addressing dimensions.

Definition at line 69 of file ijkAddressingI.H.

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

Here is the caller graph for this function:

◆ sizes() [2/2]

Foam::labelVector & sizes ( )
inline

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

Definition at line 75 of file ijkAddressingI.H.

◆ size() [1/2]

Foam::label size ( ) const
inline

Return the total i*j*k size.

Definition at line 81 of file ijkAddressingI.H.

Referenced by ijkMesh::nCells().

Here is the caller graph for this function:

◆ size() [2/2]

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

The addressing dimension in the given direction.

Definition at line 89 of file ijkAddressingI.H.

◆ clear()

void clear ( )
inline

Reset to (0,0,0) sizing.

Definition at line 97 of file ijkAddressingI.H.

References Foam::Zero.

◆ reset() [1/2]

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

Change the sizing parameters.

Definition at line 104 of file ijkAddressingI.H.

◆ reset() [2/2]

void reset ( const labelVector newSizes)
inline

Change the sizing parameters.

Definition at line 120 of file ijkAddressingI.H.

◆ 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 131 of file ijkAddressingI.H.

References k.

Referenced by ijkMesh::cellLabel().

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 145 of file ijkAddressingI.H.

References 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 155 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 169 of file ijkAddressingI.H.

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

Referenced by PDRblock::location::C(), 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 203 of file ijkAddressingI.H.

References 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 212 of file ijkAddressingI.H.

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

Referenced by ijkAddressing::ijkAddressing().

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 235 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 247 of file ijkAddressingI.H.

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

Here is the call graph for this function:

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