39#ifndef Foam_ListExpression_H
40#define Foam_ListExpression_H
43#define Foam_Expression_execution
48#if defined(_WIN32) || (defined(FOAM_REAL_GNUC) && (FOAM_REAL_GNUC < 10))
51#elif __has_include(<execution>) && defined(Foam_Expression_execution)
83 return static_cast<E const&
>(*this)[i];
85 auto size() const
noexcept {
return static_cast<E const&
>(*this).size(); }
88 template<
class Container>
89 Container&
fill(Container& lst)
const
92 int loopLen = this->
size();
93 _Pragma(
"omp target teams distribute parallel for if(loopLen > 1000)")
94 for(
int i = 0; i < loopLen; ++i)
96 auto src =
static_cast<E const&
>(*this).cbegin() + i;
102 #
if (defined(__APPLE__) && defined(__clang__)) || defined(_WIN32)
105 #elif (__cpp_lib_execution >= 201902L)
106 std::execution::par_unseq,
110 static_cast<E const&
>(*this).cbegin(),
111 static_cast<E const&
>(*this).cend(),
118 template<
class Container>
119 Container&
evaluate(Container& lst)
const
121 lst.resize_nocopy(this->
size());
136 public ListExpression<ListWrap<T>>
141 static constexpr bool is_leaf =
true;
154 elems_(std::move(elems.
data()))
158 ListWrap(std::initializer_list<T> elems)
174 expr.evaluate(elems_);
178 const auto&
data()
const
201 return elems_.size();
207 return elems_.cbegin();
211 return elems_.cend();
217 return elems_.begin();
239 static constexpr bool is_leaf =
false;
262 elems_.resize_nocopy(
size);
275 expr.evaluate(elems_);
282 expr.evaluate(elems_);
286 const auto&
data()
const
309 return elems_.size();
315 return elems_.cbegin();
319 return elems_.cend();
325 return elems_.begin();
349 static constexpr bool is_leaf =
false;
360 const auto&
data()
const
372 return elems_.size();
376 struct const_iterator
383 using pointer =
typename ConstIterTraits::pointer;
384 using reference =
typename ConstIterTraits::reference;
552 expr.evaluate(elems_.ref());
568 return elems_().size();
574 return elems_().cbegin();
578 return elems_().cend();
583 return elems_().begin();
587 return elems_().end();
607 static constexpr bool is_leaf =
false;
618 const T&
data()
const
630 return elems_().size();
642 using value_type =
typename ConstIterTraits::value_type;
643 using pointer =
typename ConstIterTraits::pointer;
751 IndirectConstWrap<E1>
755 typename std::conditional
784 return values_[addr_[i]];
799 typedef typename E1::const_iterator
ConstIter;
801 using value_type =
typename ConstIter::value_type;
802 using pointer =
typename ConstIter::pointer;
803 using reference =
typename ConstIter::reference;
882 return (
iter_ >= it.iter_);
911#undef EXPRESSION_FUNCTION1
912#define EXPRESSION_FUNCTION1(Func, BaseFunc, OpFunc) \
914template<typename E1> \
917 public ListExpression< \
921 typename std::conditional<E1::is_leaf, const E1&, const E1>::type u_; \
924 static constexpr bool is_leaf = false; \
926 typedef decltype(BaseFunc(std::declval<typename E1::value_type>())) \
929 OpFunc(const E1& u) \
934 auto operator[](const label i) const \
936 return BaseFunc(u_[i]); \
939 auto size() const noexcept { return u_.size(); } \
941 struct const_iterator \
943 typedef typename E1::const_iterator ConstIter; \
944 using difference_type = typename ConstIter::difference_type; \
945 using value_type = typename ConstIter::value_type; \
946 using pointer = typename ConstIter::pointer; \
947 using reference = typename ConstIter::reference; \
948 using iterator_category = typename ConstIter::iterator_category; \
952 const_iterator(ConstIter it) : base_(it) {} \
953 auto operator*() const \
955 return BaseFunc(*base_); \
957 auto operator[](const difference_type i) const \
959 return BaseFunc(base_[i]); \
961 const_iterator& operator++() \
966 const_iterator operator++(int) \
968 const_iterator old(*this); \
972 const_iterator& operator--() \
977 const_iterator operator--(int) \
979 const_iterator old(*this); \
983 const_iterator operator+(const difference_type i) const \
985 return const_iterator(base_+i); \
987 const_iterator operator-(const difference_type i) const \
989 return const_iterator(base_-i); \
991 difference_type operator-(const const_iterator& it) const \
993 return (base_ - it.base_); \
995 bool operator==(const const_iterator& it) const \
997 return base_ == it.base_; \
999 bool operator!=(const const_iterator& it) const \
1001 return base_ != it.base_; \
1003 bool operator<(const const_iterator& it) const \
1005 return (base_ < it.base_); \
1007 bool operator<=(const const_iterator& it) const \
1009 return (base_ <= it.base_); \
1011 bool operator>(const const_iterator& it) const \
1013 return (base_ > it.base_); \
1015 bool operator>=(const const_iterator& it) const \
1017 return (base_ >= it.base_); \
1019 const_iterator& operator+=(const difference_type n) \
1024 const_iterator& operator-=(const difference_type n) \
1030 const_iterator cbegin() const \
1032 return const_iterator(u_.cbegin()); \
1034 const_iterator cend() const \
1036 return const_iterator(u_.cend()); \
1039template<typename E1> \
1042 const ListExpression<E1>& u \
1045 return OpFunc<E1>(static_cast<const E1&>(u)); \
1047template<class Type> \
1048auto Func(UList<Type> const& u) \
1050 typedef typename Expression::ListConstRefWrap<Type> E2; \
1051 return Func(E2(u)); \
1057template<
typename E1>
1060 public ListExpression<List_negate<E1>>
1062 typename std::conditional<E1::is_leaf, const E1&, const E1>::type u_;
1065 static constexpr bool is_leaf =
false;
1079 auto size()
const noexcept {
return u_.size(); }
1081 struct const_iterator
1085 typedef typename E1::const_iterator
ConstIter;
1087 using value_type =
typename ConstIter::value_type;
1088 using pointer =
typename ConstIter::pointer;
1089 using reference =
typename ConstIter::reference;
1121 const_iterator old(*
this);
1143 return base_ != it.base_;
1147 return (
base_ < it.base_);
1151 return (
base_ <= it.base_);
1159 return (
base_ >= it.base_);
1181template<
typename E1>
1193#undef EXPRESSION_FUNCTION2
1194#define EXPRESSION_FUNCTION2(Func, BaseFunc, OpFunc) \
1196template<typename E1, typename E2> \
1199 public ListExpression \
1205 typename std::conditional<E1::is_leaf, const E1&, const E1>::type u_; \
1206 typename std::conditional<E2::is_leaf, const E2&, const E2>::type v_; \
1209 static constexpr bool is_leaf = false; \
1212 typedef typename E1::value_type value_type; \
1214 OpFunc(const E1& u, const E2& v) \
1218 assert(u_.size() == -1 || v_.size() == -1 || u_.size() == v_.size()); \
1220 auto operator[](const label i) const \
1222 return BaseFunc(u_[i], v_[i]); \
1224 auto size() const noexcept { return Foam::max(u_.size(), v_.size()); } \
1226 struct const_iterator \
1228 typedef typename E1::const_iterator E1Iter; \
1229 typedef typename E2::const_iterator E2Iter; \
1230 using difference_type = typename E1Iter::difference_type; \
1231 using value_type = typename E1Iter::value_type; \
1232 using pointer = typename E1Iter::pointer; \
1233 using reference = typename E1Iter::reference; \
1234 using iterator_category = typename E1Iter::iterator_category; \
1239 const_iterator(E1Iter uIter, E2Iter vIter) \
1244 auto operator*() const \
1246 return BaseFunc(*uIter_, *vIter_); \
1248 const_iterator& operator++() \
1254 difference_type operator-(const const_iterator& it) const \
1256 return (uIter_ - it.uIter_); \
1258 const_iterator operator+(const label i) const \
1260 return const_iterator(uIter_+i, vIter_+i); \
1262 bool operator==(const const_iterator& it) const \
1264 return uIter_ == it.uIter_ && vIter_ == it.vIter_; \
1266 bool operator!=(const const_iterator& it) const \
1268 return !operator==(it); \
1270 bool operator<(const const_iterator& it) const \
1272 return (uIter_ < it.uIter_); \
1275 const_iterator cbegin() const \
1277 return const_iterator(u_.cbegin(), v_.cbegin()); \
1279 const_iterator cend() const \
1281 return const_iterator(u_.cend(), v_.cend()); \
1284template<typename E1, typename E2> \
1297 return OpFunc<E1, E2> \
1299 static_cast<const E1&>(u), \
1300 static_cast<const E2&>(v) \
1303template<typename E1, class Type> \
1310 UList<Type> const& v \
1313 typedef typename Expression::ListConstRefWrap<Type> E2; \
1314 return Func(u, E2(v)); \
1316template<typename E1, class Type> \
1319 UList<Type> const& u, \
1326 typedef typename Expression::ListConstRefWrap<Type> E2; \
1327 return Func(E2(u), v); \
1329template<class Type1, class Type2> \
1330auto Func(UList<Type1> const& u, UList<Type2> const& v) \
1332 typedef typename Expression::ListConstRefWrap<Type1> E1; \
1333 typedef typename Expression::ListConstRefWrap<Type2> E2; \
1334 return Func(E1(u), E2(v)); \
1340 class = std::enable_if_t \
1342 (std::is_arithmetic_v<Type> || Foam::is_vectorspace_v<Type>) \
1354 typedef typename Expression::UniformListWrap<Type> E2; \
1355 return Func(u, E2(u.size(), v)); \
1361 class = std::enable_if_t \
1363 (std::is_arithmetic_v<Type> || Foam::is_vectorspace_v<Type>) \
1375 typedef typename Expression::UniformListWrap<Type> E2; \
1376 return Func(E2(v.size(), u), v); \
1381 class TypeT = Type, \
1382 class = std::enable_if_t \
1384 (std::is_arithmetic_v<TypeT> || Foam::is_vectorspace_v<TypeT>) \
1389 UList<Type> const& u, \
1393 typedef typename Expression::ListConstRefWrap<Type> E1; \
1394 typedef typename Expression::UniformListWrap<TypeT> E2; \
1395 return Func(E1(u), E2(u.size(), v)); \
1400 class TypeT = Type, \
1401 class = std::enable_if_t \
1403 (std::is_arithmetic_v<TypeT> || Foam::is_vectorspace_v<TypeT>) \
1409 UList<Type> const& v \
1412 typedef typename Expression::ListConstRefWrap<Type> E1; \
1413 typedef typename Expression::UniformListWrap<TypeT> E2; \
1414 return Func(E2(v.size(), u), E1(v)); \
1418#undef EXPRESSION_OPERATOR
1419#define EXPRESSION_OPERATOR(Op, OpFunc) \
1420template<typename E1, typename E2> \
1423 public ListExpression \
1429 typename std::conditional<E1::is_leaf, const E1&, const E1>::type u_; \
1430 typename std::conditional<E2::is_leaf, const E2&, const E2>::type v_; \
1433 static constexpr bool is_leaf = false; \
1436 typedef typename E1::value_type value_type; \
1438 OpFunc(const E1& u, const E2& v) \
1442 assert(u_.size() == -1 || v_.size() == -1 || u_.size() == v_.size()); \
1444 auto operator[](const label i) const \
1446 return u_[i] Op v_[i]; \
1448 auto size() const noexcept { return Foam::max(u_.size(), v_.size()); } \
1450 struct const_iterator \
1452 typedef typename E1::const_iterator E1Iter; \
1453 typedef typename E2::const_iterator E2Iter; \
1454 using difference_type = typename E1Iter::difference_type; \
1455 using value_type = typename E1Iter::value_type; \
1456 using pointer = typename E1Iter::pointer; \
1457 using reference = typename E1Iter::reference; \
1458 using iterator_category = typename E1Iter::iterator_category; \
1463 const_iterator(E1Iter uIter, E2Iter vIter) \
1468 auto operator*() const \
1470 return *uIter_ Op *vIter_; \
1472 auto operator[](const difference_type i) const \
1474 return uIter_[i] Op vIter_[i]; \
1476 const_iterator& operator++() \
1482 const_iterator operator++(int) \
1484 const_iterator old(*this); \
1489 const_iterator& operator--() \
1495 const_iterator operator--(int) \
1497 const_iterator old(*this); \
1502 const_iterator operator+(const difference_type i) const \
1504 return const_iterator(uIter_+i, vIter_+i); \
1506 const_iterator operator-(const difference_type i) const \
1508 return const_iterator(uIter_-i, vIter_-i); \
1510 difference_type operator-(const const_iterator& it) const \
1512 return (uIter_ - it.uIter_); \
1514 bool operator==(const const_iterator& it) const \
1516 return uIter_ == it.uIter_ && vIter_ == it.vIter_; \
1518 bool operator!=(const const_iterator& it) const \
1520 return !operator==(it); \
1522 bool operator<(const const_iterator& it) const \
1524 return (uIter_ < it.uIter_); \
1526 bool operator<=(const const_iterator& it) const \
1528 return (uIter_ <= it.uIter_); \
1530 bool operator>(const const_iterator& it) const \
1532 return (uIter_ > it.uIter_); \
1534 bool operator>=(const const_iterator& it) const \
1536 return (uIter_ >= it.uIter_); \
1538 const_iterator& operator+=(const difference_type n) \
1544 const_iterator& operator-=(const difference_type n) \
1551 const_iterator cbegin() const \
1553 return const_iterator(u_.cbegin(), v_.cbegin()); \
1555 const_iterator cend() const \
1557 return const_iterator(u_.cend(), v_.cend()); \
1560template<typename E1, typename E2> \
1573 return OpFunc<E1, E2> \
1575 static_cast<const E1&>(u), \
1576 static_cast<const E2&>(v) \
1579template<typename E1, class Type> \
1586 UList<Type> const& v \
1589 typedef typename Expression::ListConstRefWrap<Type> E2; \
1590 return operator Op(u, E2(v)); \
1592template<typename E1, class Type> \
1595 UList<Type> const& u, \
1602 typedef typename Expression::ListConstRefWrap<Type> E2; \
1603 return operator Op(E2(u), v); \
1605template<class Type1, class Type2> \
1606auto operator Op(UList<Type1> const& u, UList<Type2> const& v) \
1608 typedef typename Expression::ListConstRefWrap<Type1> E1; \
1609 typedef typename Expression::ListConstRefWrap<Type2> E2; \
1610 return operator Op(E1(u), E2(v)); \
1616 class = std::enable_if_t \
1618 (std::is_arithmetic_v<Type> || Foam::is_vectorspace_v<Type>) \
1630 typedef typename Expression::UniformListWrap<Type> E2; \
1631 return operator Op(u, E2(u.size(), v)); \
1637 class = std::enable_if_t \
1639 (std::is_arithmetic_v<Type> || Foam::is_vectorspace_v<Type>) \
1651 typedef typename Expression::UniformListWrap<Type> E2; \
1652 return operator Op(E2(v.size(), u), v); \
1657 class TypeT = Type, \
1658 class = std::enable_if_t \
1660 (std::is_arithmetic_v<TypeT> || Foam::is_vectorspace_v<TypeT>) \
1665 UList<Type> const& u, \
1669 typedef typename Expression::ListConstRefWrap<Type> E1; \
1670 typedef typename Expression::UniformListWrap<TypeT> E2; \
1671 return operator Op(E1(u), E2(u.size(), v)); \
1676 class TypeT = Type, \
1677 class = std::enable_if_t \
1679 (std::is_arithmetic_v<TypeT> || Foam::is_vectorspace_v<TypeT>) \
1685 UList<Type> const& v \
1688 typedef typename Expression::ListConstRefWrap<Type> E1; \
1689 typedef typename Expression::UniformListWrap<TypeT> E2; \
1690 return operator Op(E2(v.size(), u), E1(v)); \
1717#undef EXPRESSION_FUNCTION1
1722#undef EXPRESSION_FUNCTION2
1731#undef EXPRESSION_OPERATOR
1746template<
typename E1,
typename E2,
typename E3>
1747class List_interpolate
1751 List_interpolate<E1, E2, E3>
1755 typename std::conditional<E1::is_leaf, const E1&, const E1>::type u_;
1758 typename std::conditional<E2::is_leaf, const E2&, const E2>::type v_;
1761 typename std::conditional<E3::is_leaf, const E3&, const E3>::type weight_;
1781 const auto ownVal = u_[i];
1782 const auto neiVal = v_[i];
1783 return weight_[i]*(ownVal-neiVal) + neiVal;
1792 typedef typename E1::const_iterator
E1Iter;
1793 typedef typename E2::const_iterator
E2Iter;
1794 typedef typename E3::const_iterator
E3Iter;
1796 using value_type =
typename E1Iter::value_type;
1797 using pointer =
typename E1Iter::pointer;
1798 using reference =
typename E1Iter::reference;
1812 const auto ownVal = *
uIter_;
1813 const auto neiVal = *
vIter_;
1818 const auto ownVal =
uIter_[i];
1819 const auto neiVal =
vIter_[i];
1831 const_iterator old(*
this);
1877 return (
uIter_ < it.uIter_);
1881 return (
uIter_ <= it.uIter_);
1885 return (
uIter_ > it.uIter_);
1889 return (
uIter_ >= it.uIter_);
1908 return const_iterator(u_.cbegin(), v_.cbegin(), weight_.cbegin());
1935 static constexpr bool is_leaf =
false;
1995 const_iterator old(*
this);
2020 return (
count_ - it.count_);
2024 return val_ == it.val_ &&
count_ == it.count_;
2032 return (
count_ < it.count_);
2036 return (
count_ <= it.count_);
2080 static constexpr bool is_leaf =
false;
2162 return val_ == it.val_;
2212 size_t total_size_ = 0;
2218 for (label i = 0; i < data_.
size(); ++i)
2220 offsets_[i] = total_size_;
2221 total_size_ += data_[i]->
size();
2245 template<
class Container>
2251 const V& vals =
static_cast<const V&
>(ds[i]);
2256 template<
class Container>
2262 const V& vals =
static_cast<const V&
>(ds[elems[i]]);
2270 data_.push_back(vec);
2271 offsets_.push_back(total_size_);
2272 total_size_ += vec->size();
2277 const label vec_index =
2284 - offsets_.
begin() - 1;
2285 const label elem_index = i - offsets_[vec_index];
2286 return (*data_[vec_index])[elem_index];
2288 label
size()
const {
return total_size_; }
2373 return (
index_ - it.index_);
2380 return (
index_ == it.index_);
2384 return (
index_ != it.index_);
2388 return (
index_ < it.index_);
2392 return (
index_ <= it.index_);
2396 return (
index_ > it.index_);
2400 return (
index_ >= it.index_);
2435 size_t total_size_ = 0;
2441 for (label i = 0; i < data_.size(); ++i)
2443 offsets_[i] = total_size_;
2444 total_size_ += data_[i]->size();
2447 labelPair whichVecElem(
const label i)
const
2449 const label vec_index =
2456 - offsets_.begin() - 1;
2457 const label elem_index = i - offsets_[vec_index];
2481 template<
class Container>
2484 data_.resize_nocopy(ds.size());
2485 const label
n = ds.size();
2486 for (label i = 0; i <
n; ++i)
2488 V& vals =
static_cast<V&
>(ds[i]);
2495 template<
class Container,
class ElemOp>
2498 data_.resize_nocopy(ds.size());
2499 const label
n = ds.size();
2500 label dataIndex = 0;
2501 for (label i = 0; i <
n; ++i)
2503 insertOp(data_, dataIndex, ds[i]);
2505 data_.setSize(dataIndex);
2525 total_size_ += vec->size();
2533 template<
typename E,
class Container >
2536 const label loop_len = this->
size();
2538 _Pragma(
"omp target teams distribute parallel for if(loop_len > 1000)")
2540 for (label i = 0; i < loop_len; ++i)
2542 auto src = (*this).cbegin() + i;
2543 const auto ve(whichVecElem(i));
2544 exprWarp(ds[ve.first()],ve.second()) = *src;
2548 template<
typename E>
2551 expr.evaluate(*
this);
2556 const auto ve(whichVecElem(i));
2557 return (*data_[ve.first()])[ve.second()];
2561 const auto ve(whichVecElem(i));
2562 auto& elems = *data_[ve.first()];
2563 return elems[ve.second()];
2568 auto& elems = *data_[i];
2572 label
size()
const {
return total_size_; }
2581 struct const_iterator
2669 return (
index_ == it.index_);
2673 return (
index_ != it.index_);
2681 return (
index_ <= it.index_);
2685 return (
index_ > it.index_);
2689 return (
index_ >= it.index_);
2848 auto& this_vals = *
this;
2853 auto& this_vals = *
this;
#define EXPRESSION_OPERATOR(BaseClass, Op, BaseOp, OpFunc)
#define EXPRESSION_FUNCTION2(BaseClass, Func, BaseFunc, OpFunc)
#define EXPRESSION_FUNCTION1(BaseClass, Func, BaseFunc, OpFunc)
Expression wrap of indirection.
IndirectConstWrap(const E1 &values, const labelUList &addr)
static constexpr bool is_leaf
E1::value_type value_type
value_type operator[](const label i) const
Expression wrap of const reference to UList.
const auto & data() const
static constexpr bool is_leaf
auto size() const noexcept
value_type operator[](const label i) const
ListConstRefWrap(const UList< T > &elems)
Expression wrap of const tmp to List.
ListConstTmpWrap(const tmp< T > &elems)
static constexpr bool is_leaf
auto size() const noexcept
value_type operator[](const label i) const
Field< value_type >::value_type value_type
Expression templates for List.
auto operator[](const label i) const
Container & evaluate(Container &lst) const
Helper: assign to passed in list.
static constexpr bool is_leaf
auto size() const noexcept
Container & fill(Container &lst) const
Helper: assign to passed in list.
Expression wrap of non-const reference to List.
ListRefWrap(const label size, List< T > &elems)
Construct from List and expected size. This is to enforce that our size() member function returns the...
const auto & data() const
static constexpr bool is_leaf
auto size() const noexcept
ListRefWrap(ListRefWrap< T > &&elems)
Move construct.
void operator=(const ListExpression< E > &expr)
Assignment.
value_type & operator[](const label i)
value_type operator[](const label i) const
List< value_type >::const_iterator const_iterator
List< value_type >::iterator iterator
ListRefWrap(ListRefWrap< T > &w)
Copy construct.
ListRefWrap(List< T > &elems, const ListExpression< E > &expr)
Expression wrap of tmp to List.
static constexpr bool is_leaf
Field< value_type >::const_iterator const_iterator
auto size() const noexcept
ListTmpWrap(tmp< T > &elems, const ListExpression< E > &expr)
void operator=(const ListExpression< E > &expr)
Assignment.
value_type operator[](const label i) const
ListTmpWrap(const tmp< T > &elems)
Field< value_type >::value_type value_type
ListTmpWrap(tmp< T > &elems)
List< Field< value_type > >::iterator iterator
const auto & data() const
static constexpr bool is_leaf
auto size() const noexcept
ListWrap(const ListExpression< E > &expr)
ListWrap(const ListWrap< T > &elems)
Copy construct.
ListWrap(const UList< T > &elems)
value_type & operator[](const label i)
value_type operator[](const label i) const
List< T >::const_iterator const_iterator
List< T >::iterator iterator
ListWrap(ListWrap< T > &&elems)
Move construct.
ListWrap(std::initializer_list< T > elems)
Construct from initializer list.
List_add(const E1 &u, const E2 &v)
List_divide(const E1 &u, const E2 &v)
List_dot(const E1 &u, const E2 &v)
List_interpolate(const E1 &u, const E2 &v, const E3 &weight)
static constexpr bool is_leaf
const_iterator cbegin() const
E1::value_type value_type
const_iterator cend() const
value_type operator[](const label i) const
static constexpr bool is_leaf
List_max(const E1 &u, const E2 &v)
List_min(const E1 &u, const E2 &v)
List_multiply(const E1 &u, const E2 &v)
auto operator[](const label i) const
static constexpr bool is_leaf
const_iterator cbegin() const
auto size() const noexcept
E1::value_type value_type
const_iterator cend() const
List_subtract(const E1 &u, const E2 &v)
Expression wrap of multiple lists (e.g. FieldField).
ListsConstRefWrap< V > this_type
const value_type * const_pointer
ListsConstRefWrap(const Container &ds, const labelUList &elems)
typename V::value_type value_type
static constexpr bool is_leaf
void push_back(const V *vec)
ListsConstRefWrap(List< const V * > &&d)
value_type operator[](label i) const
ListsConstRefWrap(const Container &ds)
ListsConstRefWrap(const UList< const V * > &d)
ListsConstRefWrap()=delete
const value_type & const_reference
Expression wrap of multiple lists.
ListsRefWrap(Container &ds, const ElemOp &insertOp)
const value_type * const_pointer
void evaluate(ListsRefWrap< E > &exprWarp, const Container &ds)
Assignment.
typename V::value_type value_type
static constexpr bool is_leaf
ListsRefWrap< V > this_type
ListsRefWrap(UList< V * > &d)
void resize_nocopy(const label)
Dummy resizing so we can pass *this to ListExpression::evaluate. Maybe do resizing externally?
ListsRefWrap(List< V * > &&d)
void operator=(const ListExpression< E > &expr)
value_type & operator()(const label i, const label j)
value_type & operator[](const label i)
value_type operator[](const label i) const
const value_type & const_reference
ListsRefWrap(Container &ds)
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void resize_nocopy(const label len)
Adjust allocated size of list without necessarily.
void push_back(const T &val)
Append an element at the end of the list.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
iterator begin() noexcept
Return an iterator to begin traversing the UList.
const T * const_iterator
Random access iterator for traversing a UList.
T * iterator
Random access iterator for traversing a UList.
iterator end() noexcept
Return an iterator to end traversing the UList.
void size(const label n)
Older name for setAddressableSize.
Generic dimensioned Type class.
A class for managing temporary objects.
auto tanh(GeometricFieldExpression< E1, typename E1::IntExpr, typename E1::UncoupledPatchExpr, typename E1::CoupledPatchExpr, typename E1::value_type > const &u)
auto cos(GeometricFieldExpression< E1, typename E1::IntExpr, typename E1::UncoupledPatchExpr, typename E1::CoupledPatchExpr, typename E1::value_type > const &u)
auto sin(GeometricFieldExpression< E1, typename E1::IntExpr, typename E1::UncoupledPatchExpr, typename E1::CoupledPatchExpr, typename E1::value_type > const &u)
g_pow2< E1 > pow2(const GenericExpression< E1 > &u)
fvm_subtract< E1, E2 > operator-(fvMatrixExpression< E1, typename E1::DiagExpr, typename E1::UpperExpr, typename E1::LowerExpr, typename E1::FaceFluxExpr, typename E1::SourceExpr > const &u, fvMatrixExpression< E2, typename E2::DiagExpr, typename E2::UpperExpr, typename E2::LowerExpr, typename E2::FaceFluxExpr, typename E2::SourceExpr > const &v)
auto cosh(GeometricFieldExpression< E1, typename E1::IntExpr, typename E1::UncoupledPatchExpr, typename E1::CoupledPatchExpr, typename E1::value_type > const &u)
g_sqrt< E1 > sqrt(const GenericExpression< E1 > &u)
g_sqr< E1 > sqr(const GenericExpression< E1 > &u)
g_pow4< E1 > pow4(const GenericExpression< E1 > &u)
ListConstRefWrap< typename Expr::value_type > expr
Fully self-contained constant field wrapper. Not needed?
auto max(GeometricFieldExpression< E1, typename E1::IntExpr, typename E1::UncoupledPatchExpr, typename E1::CoupledPatchExpr, typename E1::value_type > const &u, GeometricFieldExpression< E2, typename E2::IntExpr, typename E2::UncoupledPatchExpr, typename E2::CoupledPatchExpr, typename E2::value_type > const &v)
g_symm< E1 > symm(const GenericExpression< E1 > &u)
auto sinh(GeometricFieldExpression< E1, typename E1::IntExpr, typename E1::UncoupledPatchExpr, typename E1::CoupledPatchExpr, typename E1::value_type > const &u)
auto tan(GeometricFieldExpression< E1, typename E1::IntExpr, typename E1::UncoupledPatchExpr, typename E1::CoupledPatchExpr, typename E1::value_type > const &u)
const expr V(m.psi().mesh().V())
g_pow3< E1 > pow3(const GenericExpression< E1 > &u)
auto min(GeometricFieldExpression< E1, typename E1::IntExpr, typename E1::UncoupledPatchExpr, typename E1::CoupledPatchExpr, typename E1::value_type > const &u, GeometricFieldExpression< E2, typename E2::IntExpr, typename E2::UncoupledPatchExpr, typename E2::CoupledPatchExpr, typename E2::value_type > const &v)
auto mag(GeometricFieldExpression< E1, typename E1::IntExpr, typename E1::UncoupledPatchExpr, typename E1::CoupledPatchExpr, typename E1::value_type > const &u)
g_magSqr< E1 > magSqr(const GenericExpression< E1 > &u)
Pair< label > labelPair
A pair of labels.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
dimensionedSymmTensor symm(const dimensionedSymmTensor &dt)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
dimensionedScalar pow3(const dimensionedScalar &ds)
dimensionedScalar sqrt(const dimensionedScalar &ds)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
dimensionedScalar pow4(const dimensionedScalar &ds)
UList< label > labelUList
A UList of labels.
dimensionSet pow2(const dimensionSet &ds)
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
#define forAll(list, i)
Loop across all elements in list.
label difference_type
Step type for addressing.
E1::const_iterator ConstIter
Iterator definition for E1.
bool operator==(const const_iterator &it) const
typename ConstIter::value_type value_type
bool operator<(const const_iterator &it) const
const_iterator operator++(int)
const_iterator & operator-=(const difference_type n)
const_iterator operator--(int)
bool operator>=(const const_iterator &it) const
bool operator<=(const const_iterator &it) const
std::random_access_iterator_tag iterator_category
const_iterator & operator+=(const difference_type n)
const_iterator operator+(const difference_type i) const
const_iterator & operator++()
const_iterator(ConstIter begin, typename labelUList::const_iterator addrIter)
typename ConstIter::reference reference
value_type operator[](const difference_type i) const
const_iterator operator-(const difference_type i) const
typename ConstIter::pointer pointer
difference_type operator-(const const_iterator &it) const
labelUList::const_iterator iter_
const_iterator & operator--()
bool operator>(const const_iterator &it) const
bool operator!=(const const_iterator &it) const
typename ConstIterTraits::pointer pointer
typename ConstIterTraits::value_type value_type
bool operator==(const const_iterator &it) const
typename ConstIterTraits::reference reference
const_iterator(ConstIter it)
bool operator<(const const_iterator &it) const
const_iterator operator++(int)
const_iterator & operator-=(const difference_type n)
const_iterator operator--(int)
bool operator>=(const const_iterator &it) const
bool operator<=(const const_iterator &it) const
ConstIter & operator=(ConstIter it)
std::random_access_iterator_tag iterator_category
const_iterator & operator+=(const difference_type n)
const_iterator operator+(const difference_type i) const
const_iterator & operator++()
value_type operator[](const difference_type i) const
const_iterator operator-(const difference_type i) const
difference_type operator-(const const_iterator &it) const
value_type operator*() const
typename ConstIterTraits::difference_type difference_type
const_iterator & operator--()
bool operator>(const const_iterator &it) const
UList< T >::const_iterator ConstIter
bool operator!=(const const_iterator &it) const
std::iterator_traits< ConstIter > ConstIterTraits
Define our own iterator so we can refer to it. 'normal', e.g. double*.
typename ConstIterTraits::pointer pointer
typename ConstIterTraits::value_type value_type
bool operator==(const const_iterator &it) const
typename ConstIterTraits::reference reference
const_iterator(ConstIter it)
bool operator<(const const_iterator &it) const
const_iterator operator++(int)
T::const_iterator ConstIter
typename ConstIterTraits::iterator_category iterator_category
const_iterator & operator-=(const difference_type n)
const_iterator operator--(int)
bool operator>=(const const_iterator &it) const
bool operator<=(const const_iterator &it) const
const_iterator & operator+=(const difference_type n)
const_iterator operator+(const difference_type i) const
const_iterator & operator++()
value_type operator[](const difference_type i) const
const_iterator operator-(const difference_type i) const
difference_type operator-(const const_iterator &it) const
value_type operator*() const
typename ConstIterTraits::difference_type difference_type
const_iterator & operator--()
bool operator>(const const_iterator &it) const
bool operator!=(const const_iterator &it) const
std::iterator_traits< ConstIter > ConstIterTraits
typename E1Iter::value_type value_type
typename E3Iter::iterator_category iterator_category
const_iterator operator+(const label i) const
E1::const_iterator E1Iter
bool operator==(const const_iterator &it) const
const_iterator(E1Iter uIter, E2Iter vIter, E3Iter weightIter)
bool operator<(const const_iterator &it) const
const_iterator operator++(int)
typename E1Iter::reference reference
const_iterator & operator-=(const difference_type n)
const_iterator operator--(int)
typename E3Iter::difference_type difference_type
bool operator>=(const const_iterator &it) const
bool operator<=(const const_iterator &it) const
E3::const_iterator E3Iter
E2::const_iterator E2Iter
const_iterator & operator+=(const difference_type n)
typename E1Iter::pointer pointer
const_iterator & operator++()
value_type operator[](const difference_type i) const
const_iterator operator-(const label i) const
difference_type operator-(const const_iterator &it) const
value_type operator*() const
typename E1Iter::value_type value_type
const_iterator & operator--()
bool operator>(const const_iterator &it) const
bool operator!=(const const_iterator &it) const
typename E1Iter::value_type value_type
E1::const_iterator ConstIter
bool operator==(const const_iterator &it) const
typename ConstIter::value_type value_type
const_iterator(ConstIter it)
bool operator<(const const_iterator &it) const
const_iterator operator++(int)
const_iterator & operator-=(const difference_type n)
typename ConstIter::difference_type difference_type
const_iterator operator--(int)
bool operator>=(const const_iterator &it) const
bool operator<=(const const_iterator &it) const
const_iterator & operator+=(const difference_type n)
const_iterator operator+(const difference_type i) const
const_iterator & operator++()
typename ConstIter::reference reference
value_type operator[](const difference_type i) const
const_iterator operator-(const difference_type i) const
typename ConstIter::pointer pointer
difference_type operator-(const const_iterator &it) const
value_type operator*() const
typename ConstIter::iterator_category iterator_category
const_iterator & operator--()
bool operator>(const const_iterator &it) const
bool operator!=(const const_iterator &it) const
this_type::value_type value_type
bool operator==(const const_iterator &it) const
const_iterator(const const_iterator &it)
bool operator<(const const_iterator &it) const
const_iterator operator++(int)
const_iterator & operator-=(const difference_type n)
const_iterator & operator=(const_iterator &it)=default
const_iterator operator--(int)
bool operator>=(const const_iterator &it) const
bool operator<=(const const_iterator &it) const
this_type::const_pointer pointer
const_iterator(const this_type &base, const label index)
std::random_access_iterator_tag iterator_category
this_type::difference_type difference_type
const_iterator & operator+=(const difference_type n)
const_iterator operator+(const difference_type i) const
const_iterator & operator++()
value_type operator[](const difference_type i) const
this_type::const_reference reference
const_iterator operator-(const difference_type i) const
difference_type operator-(const const_iterator &it) const
value_type operator*() const
const_iterator & operator--()
bool operator>(const const_iterator &it) const
bool operator!=(const const_iterator &it) const
const_iterator(const_iterator &it)
this_type::value_type value_type
bool operator==(const const_iterator &it) const
const_iterator(const const_iterator &it)
bool operator<(const const_iterator &it) const
const_iterator operator++(int)
const_iterator & operator-=(const difference_type n)
const_iterator & operator=(const_iterator &it)=default
const_iterator operator--(int)
bool operator>=(const const_iterator &it) const
bool operator<=(const const_iterator &it) const
this_type::const_pointer pointer
const_iterator(const this_type &base, const label index)
std::random_access_iterator_tag iterator_category
this_type::difference_type difference_type
const_iterator & operator+=(const difference_type n)
const_iterator operator+(const difference_type i) const
const_iterator & operator++()
value_type operator[](const difference_type i) const
this_type::const_reference reference
const_iterator operator-(const difference_type i) const
difference_type operator-(const const_iterator &it) const
value_type operator*() const
const_iterator & operator--()
bool operator>(const const_iterator &it) const
bool operator!=(const const_iterator &it) const
value_type & operator->()
iterator operator-(const difference_type i) const
bool operator>(const iterator &it) const
iterator & operator-=(const difference_type n)
this_type::value_type value_type
value_type operator->() const
iterator & operator+=(const difference_type n)
difference_type operator-(const iterator &it) const
this_type::reference reference
bool operator==(const iterator &it) const
std::random_access_iterator_tag iterator_category
iterator operator+(const difference_type i) const
this_type::difference_type difference_type
iterator(const iterator &it)=default
bool operator<=(const iterator &it) const
value_type & operator[](const difference_type i)
value_type operator[](const difference_type i) const
bool operator!=(const iterator &it) const
iterator & operator=(const iterator &it)
bool operator<(const iterator &it) const
value_type operator*() const
this_type::pointer pointer
bool operator>=(const iterator &it) const
iterator(this_type &base, const label index)