7 template <
typename TValue>
11 clonedArray = array.
clone();
16 template <
typename TValue>
18 return Holder(order, TValue(0._f), particleCnt);
21 template <
typename TValue>
26 template <
typename TValue>
30 d2v_dt2.resize(v.size());
31 d2v_dt2.fill(TValue(0._f));
33 dv_dt.resize(v.size());
34 dv_dt.fill(TValue(0._f));
39 template <
typename TValue>
44 d2v_dt2.fill(TValue(0._f));
46 dv_dt.fill(TValue(0._f));
51 dv_dt.fill(TValue(0._f));
58 template <
typename TValue>
59 template <
typename TFunctor>
60 void Holder<TValue>::visitMutable(Holder& other,
const Flags<VisitorEnum> flags, TFunctor&& functor) {
71 functor(dv_dt, other.dv_dt);
76 functor(dv_dt, other.dv_dt);
80 functor(d2v_dt2, other.d2v_dt2);
88 template <
typename TValue>
89 template <
typename TFunctor>
90 void Holder<TValue>::visitConst(Holder& other,
const Flags<VisitorEnum> flags, TFunctor&& functor)
const {
91 const_cast<Holder*
>(
this)->visitMutable(other, flags, std::forward<TFunctor>(functor));
94 template class Holder<Size>;
95 template class Holder<Float>;
96 template class Holder<Vector>;
97 template class Holder<SymmetricTensor>;
98 template class Holder<TracelessTensor>;
99 template class Holder<Tensor>;
#define SPH_ASSERT(x,...)
uint32_t Size
Integral type used to index arrays (by default).
#define NAMESPACE_SPH_END
Holder of quantity values and their temporal derivatives.
@ FIRST_ORDER
Iterates only over first-order quantities. Passes values and derivatives as arguments of functor.
@ SECOND
Quantity with 1st and 2nd derivative.
@ FIRST
Quantity with 1st derivative.
void swap(Array &other)
Swaps content of two arrays.
Array clone() const
Performs a deep copy of all elements of the array.
void swap(Holder &other, Flags< VisitorEnum > flags)
Holder createZeros(const Size particleCnt) const
void setOrder(const OrderEnum newOrder)
Holder clone(const Flags< VisitorEnum > flags) const
Wrapper of an integral value providing functions for reading and modifying individual bits.
constexpr INLINE bool hasAny(const TEnum flag, const TArgs... others) const
Checks if the object has any of given flags.