walberla::cell::Cell Class Reference

Detailed Description

A representation of a Cell's coordinates (in 3D)

#include <Cell.h>

Public Member Functions

Constructors
 Cell ()=default
 
 Cell (const cell_idx_t _x, const cell_idx_t _y, const cell_idx_t _z)
 
 Cell (const Vector3< cell_idx_t > _vec)
 
 Cell (const uint_t _x, const uint_t _y, const uint_t _z)
 
 Cell (const Vector3< uint_t > _vec)
 
Arithmetic operators
Cell operator+ (const Cell &rhs) const
 Operator for component-wise addition of two cells. More...
 
Cell operator- (const Cell &rhs) const
 Operator for component-wise subtraction of two cells. More...
 
Celloperator+= (const Cell &rhs)
 Additive compound assignment operator. More...
 
Celloperator-= (const Cell &rhs)
 Subtractive compound assignment operator. More...
 
Cell operator+ () const
 Unary plus operator. More...
 
Cell operator- () const
 Unary negation operator. More...
 
Comparison operators
bool operator< (const Cell &rhs) const
 Less-than comparison operator for Cells. More...
 
bool operator== (const Cell &rhs) const
 Equal comparison operator for Cells. More...
 
bool operator!= (const Cell &rhs) const
 

Access operators

cell_idx_t cell [3]
 Array of the cells coordinates. cell == {x, y, z}. More...
 
cell_idx_t operator[] (std::size_t idx) const
 Operator providing read-only element access of a const Cell. More...
 
cell_idx_toperator[] (std::size_t idx)
 Operator providing element access of a Cell. More...
 
cell_idx_t x () const
 
cell_idx_tx ()
 
cell_idx_t y () const
 
cell_idx_ty ()
 
cell_idx_t z () const
 
cell_idx_tz ()
 
bool positiveIndicesOnly () const
 

Constructor & Destructor Documentation

◆ Cell() [1/5]

walberla::cell::Cell::Cell ( )
default

◆ Cell() [2/5]

walberla::cell::Cell::Cell ( const cell_idx_t  _x,
const cell_idx_t  _y,
const cell_idx_t  _z 
)
inline

◆ Cell() [3/5]

walberla::cell::Cell::Cell ( const Vector3< cell_idx_t _vec)
inline

◆ Cell() [4/5]

walberla::cell::Cell::Cell ( const uint_t  _x,
const uint_t  _y,
const uint_t  _z 
)
inline

◆ Cell() [5/5]

walberla::cell::Cell::Cell ( const Vector3< uint_t _vec)
inline

Member Function Documentation

◆ operator!=()

bool walberla::cell::Cell::operator!= ( const Cell rhs) const
inline

◆ operator+() [1/2]

Cell walberla::cell::Cell::operator+ ( ) const
inline

Unary plus operator.

Returns
*this unmodified.

◆ operator+() [2/2]

Cell walberla::cell::Cell::operator+ ( const Cell rhs) const
inline

Operator for component-wise addition of two cells.

Parameters
[in]rhsThe cell added to this.
Returns
a Cell which components are the sum of this and rhs components

◆ operator+=()

Cell & walberla::cell::Cell::operator+= ( const Cell rhs)
inline

Additive compound assignment operator.

Parameters
[in]rhsThe cell added to this.
Returns
Reference to this.

◆ operator-() [1/2]

Cell walberla::cell::Cell::operator- ( ) const
inline

Unary negation operator.

Returns
Cell with negated components.

◆ operator-() [2/2]

Cell walberla::cell::Cell::operator- ( const Cell rhs) const
inline

Operator for component-wise subtraction of two cells.

Parameters
[in]rhsThe cell subtracted from this.
Returns
a Cell which components are the difference of this and rhs components

◆ operator-=()

Cell & walberla::cell::Cell::operator-= ( const Cell rhs)
inline

Subtractive compound assignment operator.

Parameters
[in]rhsThe cell subtracted from this.
Returns
Reference to this.

◆ operator<()

bool walberla::cell::Cell::operator< ( const Cell rhs) const
inline

Less-than comparison operator for Cells.

Compares a cell's coordinates lexicographically (first x, then eventually y and (if necessary) finally z).

Parameters
[in]rhsthe cell compared to *this.
Returns
std::lexicographical_compare(this->cell, this->cell + 3, rhs.cell, rhs.cell + 3).

◆ operator==()

bool walberla::cell::Cell::operator== ( const Cell rhs) const
inline

Equal comparison operator for Cells.

Compares a cell's coordinates for equality (first x, then eventually y and (if necessary) finally z).

Parameters
[in]rhsThe cell compared to *this.
Returns
(this->x == rhs.x) && (this->y == rhs.y) && (this->z == rhs.z)

◆ operator[]() [1/2]

cell_idx_t & walberla::cell::Cell::operator[] ( std::size_t  idx)
inline

Operator providing element access of a Cell.

Parameters
[in]idxZero-based index of the cell's coordinate component.
Returns
The idx-th coordinate component. This is equal to this->cell[i].

◆ operator[]() [2/2]

cell_idx_t walberla::cell::Cell::operator[] ( std::size_t  idx) const
inline

Operator providing read-only element access of a const Cell.

Parameters
[in]idxZero-based index of the cell's coordinate component.
Returns
The idx-th coordinate component. This is equal to this->cell[i].

◆ positiveIndicesOnly()

bool walberla::cell::Cell::positiveIndicesOnly ( ) const
inline

◆ x() [1/2]

cell_idx_t& walberla::cell::Cell::x ( )
inline

◆ x() [2/2]

cell_idx_t walberla::cell::Cell::x ( ) const
inline

◆ y() [1/2]

cell_idx_t& walberla::cell::Cell::y ( )
inline

◆ y() [2/2]

cell_idx_t walberla::cell::Cell::y ( ) const
inline

◆ z() [1/2]

cell_idx_t& walberla::cell::Cell::z ( )
inline

◆ z() [2/2]

cell_idx_t walberla::cell::Cell::z ( ) const
inline

Member Data Documentation

◆ cell

cell_idx_t walberla::cell::Cell::cell[3]
private

Array of the cells coordinates. cell == {x, y, z}.


The documentation for this class was generated from the following file:
cell_idx_t cell[3]
Array of the cells coordinates. cell == {x, y, z}.
Definition: Cell.h:95
cell_idx_t y() const
Definition: Cell.h:85
cell_idx_t z() const
Definition: Cell.h:87
cell_idx_t x() const
Definition: Cell.h:83