24 enum Types { BOOL, INT, FLOAT, MEANS, VALUE, INTERVAL };
34 : entries(other.entries.clone()) {}
37 entries = other.entries.clone();
51 template <
typename TValue>
54 entries.
insert(idx, StoreType(std::forward<TValue>(value)));
63 entries[idx].template get<int>() += amount;
65 entries.
insert(idx,
int(amount));
76 entry->template get<MinMaxMean>().accumulate(value);
80 entries.
insert(idx, means);
87 template <
typename TValue>
92 const StoreType& value = entry->template get<StoreType>();
97 template <
typename TValue>
100 return this->get<TValue>(idx);
#define SPH_ASSERT(x,...)
Object holding a single values of various types.
Key-value associative container implemented as a sorted array.
uint32_t Size
Integral type used to index arrays (by default).
double Float
Precision used withing the code. Use Float instead of float or double where precision is important.
Object representing interval of real values.
Computing minimum, maximum and mean value of floats.
#define NAMESPACE_SPH_END
@ INDEX
Index of particle.
StatisticsId
List of values that are computed and displayed every timestep.
@ NEIGHBOUR_COUNT
Number of neighbours (min, max, mean)
@ LIMITING_PARTICLE_IDX
Index of particle that currently limits the timestep.
@ COLLISION_EVAL_TIME
Wallclock duration of collision evaluation.
@ WALLCLOCK_TIME
Current wallclock duration of the simulation.
@ SPH_EVAL_TIME
Wallclock duration of evaluation of SPH derivatives.
@ BREAKUP_COUNT
Number of fragmentation collisions.
@ GRAVITY_NODES_APPROX
Number of tree nodes evaluated using multipole approximation.
@ LIMITING_VALUE
Quantity value of particle that currently limits the timestep.
@ LIMITING_QUANTITY
Quantity that currently limits the timestep.
@ POSTPROCESS_EVAL_TIME
Wallclock spent on data dump, particle visualization, etc.
@ ETA
Estimated wallclock time to the end of the simulation.
@ GRAVITY_NODE_COUNT
Number of nodes in used gravity tree.
@ LIMITING_DERIVATIVE
Derivative value of particle that currently limits the timestep.
@ GRAVITY_NODES_EXACT
Number of tree nodes evaluated by pair-wise interacting.
@ FRAME_ANGLE
Current angular position of the non-inertial frame.
@ RUN_TIME
Current time of the simulation in code units. Does not necessarily have to be 0 when run starts.
@ TIMESTEP_VALUE
Current value of timestep.
@ AGGREGATE_COUNT
Number of aggregates in the simulation (single particles are not counted as aggregates).
@ SOLVER_SUMMATION_ITERATIONS
Number of iterations used to compute density and smoothing length in summation solver.
@ TIMESTEP_CRITERION
Criterion that currently limits the timestep.
@ TOTAL_COLLISION_COUNT
Number of collisions in the timestep.
@ OVERLAP_COUNT
Number of particle overlaps detected during collision evaluation.
@ TIMESTEP_ELAPSED
Wallclock time spend on computing last timestep.
@ GRAVITY_BUILD_TIME
Wallclock duration of gravity tree building.
@ MERGER_COUNT
Number of mergers in the timestep.
@ GRAVITY_EVAL_TIME
Wallclock duration of gravity evaluation.
@ BOUNCE_COUNT
Number of bounce collisions.
typename ConvertToSizeType< T >::Type ConvertToSize
Object capable of storing values of different types.
Container of key-value pairs.
INLINE bool contains(const TKey &key) const
Returns true if the map contains element of given key.
INLINE TValue & insert(const TKey &key, const TValue &value)
Adds a new element into the map or sets new value of element with the same key.
INLINE Optional< TValue & > tryGet(const TKey &key)
Returns a reference to the value matching the given key, or NOTHING if no such value exists.
Helper class for statistics, accumulating minimal, maximal and mean value of a set of numbers.
INLINE void accumulate(const Float value)
Wrapper of type value of which may or may not be present.
Object holding various statistics about current run.
TValue get(const StatisticsId idx) const
Returns value of a statistic.
void increment(const StatisticsId idx, const Size amount)
Increments an integer statistic by given amount.
void accumulate(const StatisticsId idx, const Float value)
Accumulate a value into means of given idx.
Statistics & operator=(const Statistics &other)
Statistics & set(const StatisticsId idx, TValue &&value)
Sets new values of a statistic.
Statistics(const Statistics &other)
TValue getOr(const StatisticsId idx, const TValue &other) const
Returns value of a statistic, or a given value if the statistic is not stored.
bool has(const StatisticsId idx) const
Checks if the object contains a statistic with given ID.
Variant, an implementation of type-safe union, similar to std::variant or boost::variant.