65 return (!sizes_.x() || !sizes_.y() || !sizes_.z());
84 return (sizes_.x() * sizes_.y() * sizes_.z());
141 return (i + (sizes_.x() * (j + (sizes_.y() *
k))));
151 return (ijk.
x() + (sizes_.x() * (ijk.
y() + (sizes_.y() * ijk.
z()))));
163 idx / (sizes_.x() * sizes_.y())
173 const bool allowExtra
176 const label extra = (allowExtra ? 1 : 0);
178 if (i < 0 || i >= (sizes_.x() + extra))
181 <<
"The i-index " << i
182 <<
" is out of range [0," << (sizes_.x() + extra) <<
']' <<
nl 185 if (j < 0 || j >= (sizes_.y() + extra))
188 <<
"The j-index " << j
189 <<
" is out of range [0," << (sizes_.y() + extra) <<
']' <<
nl 192 if (k < 0 || k >= (sizes_.z() + extra))
195 <<
"The k-index " <<
k 196 <<
" is out of range [0," << (sizes_.z() + extra) <<
']' <<
nl 205 const bool allowExtra
208 checkIndex(ijk.x(), ijk.y(), ijk.z(), allowExtra);
217 <<
"The i-size is negative" <<
nl 223 <<
"The j-size is negative" <<
nl 229 <<
"The k-size is negative" <<
nl 240 <<
"The i-j-k sizes are different. " 241 << sizes_ <<
" vs. " << other <<
nl 249 if (size() != nTotal)
252 <<
"The total size is different. " 253 << size() <<
" vs. " << nTotal <<
nl error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
constexpr char nl
The newline '\n' character (0x0a)
const Cmpt & y() const noexcept
Access to the vector y component.
label k
Boltzmann constant.
void reset(const label ni, const label nj, const label nk)
Change the sizing parameters.
void checkSizes() const
Check that all components of sizes() are non-negative.
const labelVector & sizes() const
The (i,j,k) addressing dimensions.
label index(const label i, const label j, const label k) const
Linear addressing index (offset) for an (i,j,k) position.
errorManip< error > abort(error &err)
void checkIndex(const label i, const label j, const label k, const bool allowExtra=false) const
Check indices are within ni,nj,nk range.
const Cmpt & x() const noexcept
Access to the vector x component.
ijkAddressing()
Construct zero-size addressing.
void clear()
Reset to (0,0,0) sizing.
const Cmpt & z() const noexcept
Access to the vector z component.
bool empty() const
Addressing is considered empty if any component is zero.
label size() const
Return the total i*j*k size.
components
Component labeling enumeration.
Vector< label > labelVector
Vector of labels.
static constexpr const zero Zero
Global zero (0)