21 template <VisitorEnum TVisitorType>
24 template <VisitorEnum TVisitorType>
33 template <
typename TValue,
typename TFunctor>
40 template <
typename TValue,
typename TFunctor>
53 template <
typename TValue,
typename TFunctor>
55 for (
auto& i : q.
getAll<TValue>()) {
59 template <
typename TValue,
typename TFunctor>
61 for (
const auto& i : q.
getAll<TValue>()) {
68 template <
typename TValue,
typename TFunctor>
70 auto values1 = q1.template getAll<TValue>();
71 auto values2 = q2.template getAll<TValue>();
73 for (
Size j = 0; j < values1.size(); ++j) {
74 functor(values1[j], values2[j]);
86 template <
typename TValue,
typename TFunctor>
93 template <
typename TValue,
typename TFunctor>
103 template <
typename TValue,
typename TFunctor>
112 template <
typename TValue,
typename TFunctor>
129 template <
typename TValue,
typename TFunctor>
136 template <
typename TValue,
typename TFunctor>
146 template <
typename TValue,
typename TFunctor>
155 template <
typename TValue,
typename TFunctor>
169 template <
typename TValue,
typename TFunctor>
176 template <
typename TValue,
typename TFunctor>
186 template <
typename TValue,
typename TFunctor>
201 template <
typename TValue,
typename TFunctor>
224 template <
typename TValue,
typename TFunctor>
228 functor(
id, q.
getDt<TValue>());
230 functor(
id, q.
getD2t<TValue>());
233 template <
typename TValue,
typename TFunctor>
237 functor(
id, q.
getDt<TValue>());
239 functor(
id, q.
getD2t<TValue>());
245 template <
typename TValue,
typename TFunctor>
250 functor(q1.
getDt<TValue>(), q2.
getDt<TValue>());
265 template <VisitorEnum Type,
typename TFunctor>
269 dispatch(q.quantity.
getValueEnum(), visitor, q.quantity, q.id, std::forward<TFunctor>(functor));
274 template <VisitorEnum Type,
typename TFunctor>
278 dispatch(q.quantity.
getValueEnum(), visitor, q.quantity, q.id, std::forward<TFunctor>(functor));
283 template <
typename TValue,
typename TFunctor>
287 auto buffers = q.
getAll<TValue>();
290 for (
Size i = 1; i < buffers.size(); ++i) {
291 functor(buffers[i], r);
294 for (
auto& i : q.
getAll<TValue>()) {
305 template <
typename TFunctor>
315 template <VisitorEnum Type,
typename TFunctor>
336 template <VisitorEnum Type,
typename TFunctor>
#define SPH_ASSERT(x,...)
uint32_t Size
Integral type used to index arrays (by default).
void iterateWithPositions(Storage &storage, TFunctor &&functor)
Iterate over all quantities and execute a functor, passing quantity buffers together with particle po...
void iteratePair(Storage &storage1, Storage &storage2, TFunctor &&functor)
Iterate over given type of quantities in two storage views and executes functor for each pair.
void iterate(Storage &storage, TFunctor &&functor)
Iterate over given type of quantities and executes functor for each.
Helper objects allowing to iterate in reverse, iterate over multiple containeres, etc.
#define NAMESPACE_SPH_END
decltype(auto) dispatch(const ValueEnum value, TVisitor &&visitor, TArgs &&... args)
Selects type based on run-time ValueEnum value and runs visit<Type>() method of the visitor.
QuantityId
Unique IDs of basic quantities of SPH particles.
@ POSITION
Positions (velocities, accelerations) of particles, always a vector quantity,.
Holder of quantity values and their temporal derivatives.
VisitorEnum
Types of iteration over storage.
@ 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.
@ ZERO
Quantity without derivatives, or "zero order" of quantity.
Container for storing particle quantities and materials.
Generic dynamically allocated resizable storage.
Generic container for storing scalar, vector or tensor quantity and its derivatives.
OrderEnum getOrderEnum() const
Returns the order of the quantity.
INLINE Array< TValue > & getD2t()
Returns a reference to array of second derivatives of quantity.
StaticArray< Array< TValue > &, 3 > getAll()
Returns all buffers of given type stored in this quantity.
INLINE Array< TValue > & getValue()
Returns a reference to array of quantity values.
INLINE Array< TValue > & getDt()
Returns a reference to array of first derivatives of quantity.
ValueEnum getValueEnum() const
Returns the value order of the quantity.
Container storing all quantities used within the simulations.
StorageSequence getQuantities()
Returns the sequence of quantities.
Size getQuantityCnt() const
Returns the number of stored quantities.
Array< TValue > & getValue(const QuantityId key)
Retrieves a quantity values from the storage, given its key and value type.
void visit(Quantity &q1, Quantity &q2, const QuantityId UNUSED(id), TFunctor &&functor)
void visit(Quantity &q1, Quantity &q2, TFunctor &&functor)
void visit(Quantity &q1, Quantity &q2, const QuantityId id, TFunctor &&functor)
void visit(const Quantity &q1, const Quantity &q2, const QuantityId id, TFunctor &&functor)
void visit(Quantity &q1, Quantity &q2, TFunctor &&functor)
void visit(Quantity &q1, Quantity &q2, const QuantityId id, TFunctor &&functor)
void visit(const Quantity &q1, const Quantity &q2, const QuantityId id, TFunctor &&functor)
void visit(Quantity &q1, Quantity &q2, const QuantityId id, TFunctor &&functor)
void visit(const Quantity &q1, const Quantity &q2, const QuantityId id, TFunctor &&functor)
void visit(Quantity &q, Array< Vector > &r, QuantityId key, TFunctor &&functor)
void visit(const Quantity &q, const QuantityId UNUSED(id), TFunctor &&functor)
void visit(Quantity &q, const QuantityId UNUSED(id), TFunctor &&functor)
void visit(Quantity &q, const QuantityId id, TFunctor &&functor)
void visit(Quantity &q, const QuantityId id, TFunctor &&functor)
void visit(const Quantity &q, const QuantityId id, TFunctor &&functor)
void visit(Quantity &q, const QuantityId id, TFunctor &&functor)
void visit(const Quantity &q, const QuantityId id, TFunctor &&functor)
void visit(Quantity &q, const QuantityId id, TFunctor &&functor)
void visit(const Quantity &q, const QuantityId id, TFunctor &&functor)
void visit(Quantity &q, const QuantityId id, TFunctor &&functor)
void visit(const Quantity &q, const QuantityId id, TFunctor &&functor)