waLBerla 7.3
Loading...
Searching...
No Matches
walberla::Cell Class Reference

Detailed Description

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

#include <Cell.h>

Public Member Functions

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

Access operators

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

Constructor & Destructor Documentation

◆ Cell() [1/5]

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

◆ Cell() [2/5]

WALBERLA_HOST_DEVICE 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_HOST_DEVICE 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!=()

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

◆ operator+() [1/2]

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

Unary plus operator.

Returns
*this unmodified.

◆ operator+() [2/2]

WALBERLA_HOST_DEVICE 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+=()

WALBERLA_HOST_DEVICE 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]

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

Unary negation operator.

Returns
Cell with negated components.

◆ operator-() [2/2]

WALBERLA_HOST_DEVICE 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-=()

WALBERLA_HOST_DEVICE 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<()

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

Less-than comparison operator for Cells.

Compares a cell's coordinates lexicographically (first z, then y, then x).

Parameters
[in]rhsthe cell compared to *this.
Returns
true if this cell is lexicographically smaller than rhs when comparing coordinates in the order z, then y, then x.

◆ operator==()

WALBERLA_HOST_DEVICE 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)
WALBERLA_HOST_DEVICE cell_idx_t z() const
Definition Cell.h:89
WALBERLA_HOST_DEVICE cell_idx_t y() const
Definition Cell.h:87
WALBERLA_HOST_DEVICE cell_idx_t x() const
Definition Cell.h:85

◆ operator[]() [1/2]

WALBERLA_HOST_DEVICE 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]

WALBERLA_HOST_DEVICE 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()

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

◆ x() [1/2]

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

◆ x() [2/2]

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

◆ y() [1/2]

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

◆ y() [2/2]

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

◆ z() [1/2]

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

◆ z() [2/2]

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

Member Data Documentation

◆ cell

stdlib::array< cell_idx_t, 3 > walberla::cell::Cell::cell
private

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


The documentation for this class was generated from the following file:
  • /builds/administration/walberla-website/walberla/src/core/cell/Cell.h