30template<
class T,
class Addr>
31template<
class ListType>
43 const label len = addr_.size();
45 if (len !=
rhs.size())
48 <<
"Addressing and list of addressed elements "
49 "have different sizes: " << len <<
" " <<
rhs.size()
54 for (label i = 0; i < len; ++i)
56 values_[addr_[i]] =
rhs[i];
63template<
class T,
class Addr>
66 const UList<T>& values,
70 values_(const_cast<UList<
T>&>(values)),
77template<
class T,
class Addr>
80 const label len = this->
size();
87 const T& val = (*this)[0];
89 for (label i = 1; i < len; ++i)
91 if (val != (*
this)[i])
101template<
class T,
class Addr>
109 return (this->
find(val,
pos, len) >= 0);
113template<
class T,
class Addr>
116 return (i == addr_.size()-1 ? 0 : i+1);
120template<
class T,
class Addr>
123 return (i ? i-1 : addr_.size()-1);
127template<
class T,
class Addr>
130 return values_[addr_.front()];
133template<
class T,
class Addr>
136 return values_[addr_.front()];
140template<
class T,
class Addr>
143 return values_[addr_.back()];
146template<
class T,
class Addr>
149 return values_[addr_.back()];
153template<
class T,
class Addr>
156 return values_[this->
fcIndex(i)];
160template<
class T,
class Addr>
163 return values_[this->
fcIndex(i)];
167template<
class T,
class Addr>
170 return values_[this->
rcIndex(i)];
174template<
class T,
class Addr>
177 return values_[this->
rcIndex(i)];
180template<
class T,
class Addr>
183 const label len = addr_.
size();
188 for (label i = 0; i < len; ++i)
190 result[i] = values_[addr_[i]];
199template<
class T,
class Addr>
202 return values_[addr_[i]];
206template<
class T,
class Addr>
210 return values_[addr_[i]];
214template<
class T,
class Addr>
218 for (
const label idx : addr_)
225template<
class T,
class Addr>
229 for (
const label idx : addr_)
236template<
class T,
class Addr>
246template<
class T,
class Addr>
256template<
class T,
class Addr>
257template<
class AnyAddr>
Base for lists with indirect addressing, templated on the list contents type and the addressing type....
bool contains(const T &val, label pos=0, label len=-1) const
Is the value contained in the list?
void copyList(const ListType &rhs)
Deep copy values from the list.
label rcIndex(const label i) const
The reverse circular index. The previous index in the list which returns to the last at the beginning...
const T & front() const
The first element of the list.
void operator=(const T &val)
Assign all addressed elements to the given value.
const T & rcValue(const label i) const
Return reverse circular value (ie, previous value in the list).
label fcIndex(const label i) const
The forward circular index. The next index in the list which returns to the first at the end of the l...
const T & fcValue(const label i) const
Return forward circular value (ie, next value in the list).
IndirectListBase()=delete
No default construct.
const T & back() const
The last element of the list.
bool uniform() const
True if all entries have identical values, and list is non-empty.
List< T > list() const
Return the addressed elements as a List.
const UList< T > & values() const noexcept
The list of values (without addressing).
label find(const T &val, label pos=0, label len=-1) const
Find index of the first occurrence of the value.
label size() const noexcept
The number of elements in the list.
T & operator[](const label i)
Non-const access to an element in the list.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
void size(const label n)
Older name for setAddressableSize.
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.
dimensionedScalar pos(const dimensionedScalar &ds)
errorManip< error > abort(error &err)
void rhs(fvMatrix< typename Expr::value_type > &m, const Expr &expression)
static constexpr const zero Zero
Global zero (0).
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)