65 return (!sizes_.x() || !sizes_.y() || !sizes_.z());
72 return (sizes_.x() * sizes_.y() * sizes_.z());
129 return (i + (sizes_.x() * (j + (sizes_.y() *
k))));
139 return (ijk.
x() + (sizes_.x() * (ijk.
y() + (sizes_.y() * ijk.
z()))));
151 idx / (sizes_.x() * sizes_.y())
161 const bool allowExtra
164 const label extra = (allowExtra ? 1 : 0);
166 if (i < 0 || i >= (sizes_.x() + extra))
169 <<
"The i-index " << i
170 <<
" is out of range [0," << (sizes_.x() + extra) <<
']' <<
nl
173 if (j < 0 || j >= (sizes_.y() + extra))
176 <<
"The j-index " << j
177 <<
" is out of range [0," << (sizes_.y() + extra) <<
']' <<
nl
183 <<
"The k-index " <<
k
184 <<
" is out of range [0," << (sizes_.z() + extra) <<
']' <<
nl
193 const bool allowExtra
196 checkIndex(ijk.x(), ijk.y(), ijk.z(), allowExtra);
205 <<
"The i-size is negative" <<
nl
211 <<
"The j-size is negative" <<
nl
217 <<
"The k-size is negative" <<
nl
228 <<
"The i-j-k sizes are different. "
229 << sizes_ <<
" vs. " << other <<
nl
237 if (size() != nTotal)
240 <<
"The total size is different. "
241 << size() <<
" vs. " << nTotal <<
nl
const Cmpt & x() const noexcept
Access to the vector x component.
const Cmpt & z() const noexcept
Access to the vector z component.
const Cmpt & y() const noexcept
Access to the vector y component.
void checkIndex(const label i, const label j, const label k, const bool allowExtra=false) const
Check indices are within ni,nj,nk range.
ijkAddressing()
Construct zero-size addressing.
label index(const label i, const label j, const label k) const
Linear addressing index (offset) for an (i,j,k) position.
bool empty() const noexcept
Addressing is considered empty if any component is zero.
label size() const noexcept
Return the total i*j*k size.
void checkSizes() const
Check that all components of sizes() are non-negative.
void reset(const label ni, const label nj, const label nk)
Change the sizing parameters.
void clear()
Reset to (0,0,0) sizing.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Vector< label > labelVector
Vector of labels.
errorManip< error > abort(error &err)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
constexpr char nl
The newline '\n' character (0x0a).